diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-09-30 04:57:56 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-09-30 04:57:56 +0300 |
commit | c971992278519b29768be349dd3962bbd93dbb22 (patch) | |
tree | ee1ece6c4c28a7784c02cc2d9a8aaecc4808fd29 /src/adlmidi_midiplay.cpp | |
parent | 4cf3a53ed36e56985753a9d0ec5ba564d6043460 (diff) | |
download | libADLMIDI-c971992278519b29768be349dd3962bbd93dbb22.tar.gz libADLMIDI-c971992278519b29768be349dd3962bbd93dbb22.tar.bz2 libADLMIDI-c971992278519b29768be349dd3962bbd93dbb22.zip |
Lock settings for CMF and IMF playing to don't destroy them
For now, all settings are in safe, except of custom bank that getting be dropped away by CMF file that does passing of own custom instruments.
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 276a33d..585e855 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -141,7 +141,7 @@ MIDIplay::MIDIplay(unsigned long sampleRate): m_setup.maxdelay = 512.0 / (double)m_setup.PCM_RATE; m_setup.bankId = 0; - m_setup.numFourOps = 7; + m_setup.numFourOps = -1; m_setup.numChips = 2; m_setup.deepTremoloMode = -1; m_setup.deepVibratoMode = -1; @@ -198,9 +198,13 @@ void MIDIplay::applySetup() m_synth.m_volumeScale = (OPL3::VolumesScale)m_synth.m_insBankSetup.volumeModel; m_synth.m_numChips = m_setup.numChips; - m_synth.m_numFourOps = m_setup.numFourOps; m_cmfPercussionMode = false; + if(m_setup.numFourOps >= 0) + m_synth.m_numFourOps = m_setup.numFourOps; + else + adlCalculateFourOpChannels(this, true); + m_synth.reset(m_setup.emulator, m_setup.PCM_RATE, this); m_chipChannels.clear(); m_chipChannels.resize(m_synth.m_numChannels); |