diff options
author | Vitaly Novichkov <Wohlstand@users.noreply.github.com> | 2018-10-06 03:24:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-06 03:24:05 +0300 |
commit | 3d70e34b258b1042aeea9dca13480cbb61610999 (patch) | |
tree | 7972745dc36ca6c0fdfe2c05ba1173bb4d6bdca6 /src/adlmidi_private.cpp | |
parent | 5e9be04e14cca96551cd19f5ee7597a11ad98a8a (diff) | |
parent | c542a7576de33ecc9c9744cf5a4df7d094af5c47 (diff) | |
download | libADLMIDI-3d70e34b258b1042aeea9dca13480cbb61610999.tar.gz libADLMIDI-3d70e34b258b1042aeea9dca13480cbb61610999.tar.bz2 libADLMIDI-3d70e34b258b1042aeea9dca13480cbb61610999.zip |
Merge pull request #184 from jpcima/reorganize
reorganize the OPL3 chip manager code
Diffstat (limited to 'src/adlmidi_private.cpp')
-rw-r--r-- | src/adlmidi_private.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/adlmidi_private.cpp b/src/adlmidi_private.cpp index 4e8e488..b2c9b8d 100644 --- a/src/adlmidi_private.cpp +++ b/src/adlmidi_private.cpp @@ -21,6 +21,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "adlmidi_midiplay.hpp" +#include "adlmidi_opl3.hpp" #include "adlmidi_private.hpp" std::string ADLMIDI_ErrorString; @@ -36,20 +38,21 @@ void adl_audioTickHandler(void *instance, uint32_t chipId, uint32_t rate) int adlCalculateFourOpChannels(MIDIplay *play, bool silent) { + Synth &synth = *play->m_synth; size_t n_fourop[2] = {0, 0}, n_total[2] = {0, 0}; //Automatically calculate how much 4-operator channels is necessary #ifndef DISABLE_EMBEDDED_BANKS - if(play->m_synth.m_embeddedBank == OPL3::CustomBankTag) + if(synth.m_embeddedBank == Synth::CustomBankTag) #endif { //For custom bank - OPL3::BankMap::iterator it = play->m_synth.m_insBanks.begin(); - OPL3::BankMap::iterator end = play->m_synth.m_insBanks.end(); + Synth::BankMap::iterator it = synth.m_insBanks.begin(); + Synth::BankMap::iterator end = synth.m_insBanks.end(); for(; it != end; ++it) { size_t bank = it->first; - size_t div = (bank & OPL3::PercussionTag) ? 1 : 0; + size_t div = (bank & Synth::PercussionTag) ? 1 : 0; for(size_t i = 0; i < 128; ++i) { adlinsdata2 &ins = it->second.ins[i]; @@ -99,10 +102,10 @@ int adlCalculateFourOpChannels(MIDIplay *play, bool silent) : (play->m_setup.NumCards == 1 ? 1 : play->m_setup.NumCards * 4); */ - play->m_synth.m_numFourOps = static_cast<unsigned>(numFourOps * play->m_synth.m_numChips); + synth.m_numFourOps = static_cast<unsigned>(numFourOps * synth.m_numChips); // Update channel categories and set up four-operator channels if(!silent) - play->m_synth.updateChannelCategories(); + synth.updateChannelCategories(); return 0; } |