Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wait for reply when updating sample rate
  • Loading branch information
DomClark authored and PhysSong committed Jan 17, 2018
commit d0b3be7f00e732dd1c5dbb43cb7030d42ff6a346
7 changes: 7 additions & 0 deletions include/RemotePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ enum RemoteMessageIDs
IdQuit,
IdSampleRateInformation,
IdBufferSizeInformation,
IdInformationUpdated,
IdMidiEvent,
IdStartProcessing,
IdProcessingDone,
Expand Down Expand Up @@ -807,6 +808,7 @@ class EXPORT RemotePlugin : public QObject, public RemotePluginBase
{
lock();
sendMessage( message( IdSampleRateInformation ).addInt( _sr ) );
waitForMessage( IdInformationUpdated, true );
unlock();
}

Expand Down Expand Up @@ -1318,9 +1320,14 @@ bool RemotePluginClient::processMessage( const message & _m )
case IdSampleRateInformation:
m_sampleRate = _m.getInt();
updateSampleRate();
reply_message.id = IdInformationUpdated;
reply = true;
break;

case IdBufferSizeInformation:
// Should LMMS gain the ability to change buffer size
// without a restart, it must wait for this message to
// complete processing or else risk VST crashes
m_bufferSize = _m.getInt();
updateBufferSize();
break;
Expand Down
7 changes: 1 addition & 6 deletions plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,7 @@ void RemoteVstPlugin::init( const std::string & _plugin_file )

updateInOutCount();
updateBufferSize();

// some plugins have to set samplerate during init
if( m_vstSyncData->hasSHM )
{
updateSampleRate();
}
updateSampleRate();

/* set program to zero */
/* i comment this out because it breaks dfx Geometer
Expand Down
1 change: 1 addition & 0 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ void VstPlugin::updateSampleRate()
lock();
sendMessage( message( IdSampleRateInformation ).
addInt( Engine::mixer()->processingSampleRate() ) );
waitForMessage( IdInformationUpdated, true );
unlock();
}

Expand Down