+/*
+ * Copyright (C) 2006-2010 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2010-2011 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2014-2016 John Emmas <john@creativepost.co.uk>
+ * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#include <stdio.h>
#include <string.h>
#include <windows.h>
case WM_KEYDOWN:
break;
+ case WM_SIZE:
+#ifdef PLATFORM_WINDOWS
+ {
+ LRESULT rv = DefWindowProcA (w, msg, wp, lp);
+ RECT rect;
+ GetClientRect(w, &rect);
+#ifndef NDEBUG
+ printf("VST WM_SIZE.. %ld %ld %ld %ld\n", rect.top, rect.left, (rect.right - rect.left), (rect.bottom - rect.top));
+#endif
+ VSTState* fst = (VSTState*) GetProp (w, "fst_ptr");
+ if (fst) {
+ int32_t width = (rect.right - rect.left);
+ int32_t height = (rect.bottom - rect.top);
+ if (width > 0 && height > 0) {
+ fst->amc (fst->plugin, 15 /*audioMasterSizeWindow */, width, height, NULL, 0);
+ }
+ }
+ return rv;
+ }
+#endif
+ break;
case WM_CLOSE:
/* we don't care about windows closing ...
* WM_CLOSE is used for minimizing the window.
break;
}
- return DefWindowProcA (w, msg, wp, lp );
+ return DefWindowProcA (w, msg, wp, lp);
}
vststate_init (fst);
#ifdef PLATFORM_WINDOWS
- fst->voffset = 50;
+ fst->voffset = 45;
fst->hoffset = 0;
#else /* linux + wine */
fst->voffset = 24;
{
if (fst->windows_window) {
#ifdef PLATFORM_WINDOWS
- SetWindowPos ((HWND)(fst->windows_window), 0, fst->hoffset, fst->voffset, fst->width + fst->hoffset, fst->height + fst->voffset, 0);
+ SetWindowPos ((HWND)(fst->windows_window),
+ HWND_TOP /*0*/,
+ fst->hoffset, fst->voffset,
+ fst->width, fst->height,
+ SWP_NOACTIVATE|SWP_NOOWNERZORDER);
#else /* linux + wine */
SetWindowPos ((HWND)(fst->windows_window), 0, 0, 0, fst->width + fst->hoffset, fst->height + fst->voffset, 0);
#endif
ShowWindow ((HWND)(fst->windows_window), SW_SHOWNA);
+ UpdateWindow ((HWND)(fst->windows_window));
}
}
}
fst = fst_new ();
+ fst->amc = amc;
if ((fst->plugin = fhandle->main_entry (amc)) == NULL) {
fst_error ("fst_instantiate: %s could not be instantiated\n", fhandle->name);
}
fst->handle = fhandle;
- fst->plugin->user = userptr;
+ fst->plugin->ptr1 = userptr;
if (fst->plugin->magic != kEffectMagic) {
fst_error ("fst_instantiate: %s is not a vst plugin\n", fhandle->name);