SF2 Player, OpulenZ: addPlayHandle moved to end of constructor.
Should mean smaller risk of race conditions and less need for mutexes.
This commit is contained in:
@@ -141,9 +141,6 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
vib_depth_mdl(false, this, tr( "Vibrato Depth" ) ),
|
||||
trem_depth_mdl(false, this, tr( "Tremolo Depth" ) )
|
||||
{
|
||||
// Connect the plugin to the mixer...
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
|
||||
Engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
// Create an emulator - samplerate, 16 bit, mono
|
||||
emulatorMutex.lock();
|
||||
@@ -220,6 +217,10 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
MOD_CON( fm_mdl );
|
||||
MOD_CON( vib_depth_mdl );
|
||||
MOD_CON( trem_depth_mdl );
|
||||
|
||||
// Connect the plugin to the mixer...
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
|
||||
Engine::mixer()->addPlayHandle( iph );
|
||||
}
|
||||
|
||||
opl2instrument::~opl2instrument() {
|
||||
|
||||
@@ -118,9 +118,6 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
// everytime we load a new soundfont.
|
||||
m_synth = new_fluid_synth( m_settings );
|
||||
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
|
||||
Engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
loadFile( ConfigManager::inst()->defaultSoundfont() );
|
||||
|
||||
updateSampleRate();
|
||||
@@ -152,6 +149,8 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
connect( &m_chorusSpeed, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) );
|
||||
connect( &m_chorusDepth, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) );
|
||||
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
|
||||
Engine::mixer()->addPlayHandle( iph );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user