From ee18011dc73cc93504aa461937e81e3fa72c7968 Mon Sep 17 00:00:00 2001 From: DomClark Date: Fri, 13 Apr 2018 00:33:08 +0100 Subject: [PATCH] Fix toggling UI for non-embedded VST effects --- plugins/VstEffect/VstEffectControlDialog.cpp | 4 ++-- plugins/vst_base/RemoteVstPlugin.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/VstEffect/VstEffectControlDialog.cpp b/plugins/VstEffect/VstEffectControlDialog.cpp index ea258134958..ef033ddb156 100644 --- a/plugins/VstEffect/VstEffectControlDialog.cpp +++ b/plugins/VstEffect/VstEffectControlDialog.cpp @@ -82,8 +82,8 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : connect( btn, SIGNAL( toggled( bool ) ), SLOT( togglePluginUI( bool ) ) ); } else { - connect( btn, SIGNAL( clicked( bool ) ), - SLOT( togglePluginUI( bool ) ) ); + connect( btn, SIGNAL( clicked() ), + m_plugin.data(), SLOT( toggleUI() ) ); } btn->setMinimumWidth( 78 ); diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 71ebf74c05e..bca09b1a2a6 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -293,8 +293,8 @@ class RemoteVstPlugin : public RemotePluginClient static DWORD WINAPI processingThread( LPVOID _param ); static bool setupMessageWindow(); static DWORD WINAPI guiEventLoop(); - static LRESULT CALLBACK messageWndProc( HWND hwnd, UINT uMsg, - WPARAM wParam, LPARAM lParam ); + static LRESULT CALLBACK wndProc( HWND hwnd, UINT uMsg, + WPARAM wParam, LPARAM lParam ); private: @@ -1884,8 +1884,6 @@ bool RemoteVstPlugin::setupMessageWindow() __MessageHwnd = CreateWindowEx( 0, "LVSL", "dummy", 0, 0, 0, 0, 0, NULL, NULL, hInst, NULL ); - SetWindowLongPtr( __MessageHwnd, GWLP_WNDPROC, - reinterpret_cast( RemoteVstPlugin::messageWndProc ) ); // install GUI update timer SetTimer( __MessageHwnd, 1000, 50, NULL ); @@ -1910,7 +1908,7 @@ DWORD WINAPI RemoteVstPlugin::guiEventLoop() -LRESULT CALLBACK RemoteVstPlugin::messageWndProc( HWND hwnd, UINT uMsg, +LRESULT CALLBACK RemoteVstPlugin::wndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { if( uMsg == WM_TIMER && __plugin->isInitialized() ) @@ -2004,7 +2002,7 @@ int main( int _argc, char * * _argv ) WNDCLASS wc; wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = DefWindowProc; + wc.lpfnWndProc = RemoteVstPlugin::wndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInst;