InstrumentPlayHandle: do not process if InstrumentTrack is muted
While regular instruments were excluded from processing when muted
this did not happen for InstrumentPlayHandle-based instruments. Muting
for exampling tracks with VSTi's inside did not decrease CPU usage.
Checking whether related InstrumentTrack is muted before calling
Instrument::play() fixes this issue.
Closes #2857426.
(cherry picked from commit 6940d19969)
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "lb302.h"
|
||||
#include "automatable_button.h"
|
||||
#include "engine.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "knob.h"
|
||||
#include "note_play_handle.h"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "lb303.h"
|
||||
#include "engine.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "knob.h"
|
||||
#include "note_play_handle.h"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "sf2_player.h"
|
||||
#include "engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "knob.h"
|
||||
#include "song.h"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "VstPlugin.h"
|
||||
#include "pixmap_button.h"
|
||||
@@ -202,12 +202,15 @@ void vestigeInstrument::play( sampleFrame * _buf )
|
||||
bool vestigeInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
if( !isMuted() )
|
||||
{
|
||||
m_plugin->processMidiEvent( _me, _time );
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->processMidiEvent( _me, _time );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "ZynAddSubFx.h"
|
||||
#include "engine.h"
|
||||
#include "mmp.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "gui_templates.h"
|
||||
#include "string_pair_drag.h"
|
||||
@@ -232,16 +232,19 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
|
||||
bool ZynAddSubFxInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_remotePlugin )
|
||||
if( !isMuted() )
|
||||
{
|
||||
m_remotePlugin->processMidiEvent( _me, 0 );
|
||||
m_pluginMutex.lock();
|
||||
if( m_remotePlugin )
|
||||
{
|
||||
m_remotePlugin->processMidiEvent( _me, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin->processMidiEvent( _me );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin->processMidiEvent( _me );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user