Merge pull request #162 from wongcc966422/opulenzInitializeVoices

Fixed OpulenZ segfault bug when it is dropped on another instrument.
This commit is contained in:
Tobias Doerffel
2014-01-26 00:49:17 -08:00

View File

@@ -152,6 +152,14 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
theEmulator->write(0x01,0x20);
emulatorMutex.unlock();
//Initialize voice values
voiceNote[0] = 0;
voiceLRU[0] = 0;
for(int i=1; i<9; ++i) {
voiceNote[i] = OPL2_VOICE_FREE;
voiceLRU[i] = i;
}
updatePatch();
// Can the buffer size change suddenly? I bet that would break lots of stuff
@@ -162,11 +170,6 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
pitchbend = 0;
tuneEqual(69, 440);
for(int i=1; i<9; ++i) {
voiceNote[i] = OPL2_VOICE_FREE;
voiceLRU[i] = i;
}
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( reloadEmulator() ) );
// Connect knobs