From 56b07e29c29478fc1727d864233aed7e8a1c714e Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 26 Nov 2012 19:18:20 +0100 Subject: [PATCH] RemoteVstPlugin: send updates of current program name if changed Send current program name back to host if current program has changed. --- plugins/vst_base/RemoteVstPlugin.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 975d86a65..17405d655 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -291,6 +291,7 @@ private: bpm_t m_bpm; double m_currentSamplePos; + int m_currentProgram; } ; @@ -312,7 +313,8 @@ RemoteVstPlugin::RemoteVstPlugin( key_t _shm_in, key_t _shm_out ) : m_outputs( NULL ), m_midiEvents(), m_bpm( 0 ), - m_currentSamplePos( 0 ) + m_currentSamplePos( 0 ), + m_currentProgram( -1 ) { pthread_mutex_init( &m_pluginLock, NULL ); @@ -701,6 +703,13 @@ void RemoteVstPlugin::process( const sampleFrame * _in, sampleFrame * _out ) #endif m_currentSamplePos += bufferSize(); + + int newCurrentProgram = pluginDispatch( effGetProgram ); + if( newCurrentProgram != m_currentProgram ) + { + m_currentProgram = newCurrentProgram; + sendCurrentProgramName(); + } }