Skip to content

Commit

Permalink
Fix toggling UI for non-embedded VST effects
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark committed Apr 12, 2018
1 parent f6bb54a commit 4ba0861
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 5 additions & 2 deletions plugins/VstEffect/VstEffectControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
if (embed_vst) {
btn->setCheckable( true );
btn->setChecked( true );
}
connect( btn, SIGNAL( toggled( bool ) ),
connect( btn, SIGNAL( toggled( bool ) ),
SLOT( togglePluginUI( bool ) ) );
} else {
connect( btn, SIGNAL( clicked() ),
m_plugin.data(), SLOT( toggleUI() ) );
}

btn->setMinimumWidth( 78 );
btn->setMaximumWidth( 78 );
Expand Down
10 changes: 4 additions & 6 deletions plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1885,8 +1885,6 @@ bool RemoteVstPlugin::setupMessageWindow()
__MessageHwnd = CreateWindowEx( 0, "LVSL", "dummy",
0, 0, 0, 0, 0, NULL, NULL,
hInst, NULL );
SetWindowLongPtr( __MessageHwnd, GWLP_WNDPROC,
reinterpret_cast<LONG_PTR>( RemoteVstPlugin::messageWndProc ) );
// install GUI update timer
SetTimer( __MessageHwnd, 1000, 50, NULL );

Expand All @@ -1911,7 +1909,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() )
Expand Down Expand Up @@ -2005,7 +2003,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;
Expand Down

0 comments on commit 4ba0861

Please sign in to comment.