diff options
author | Wohlstand <admin@wohlnet.ru> | 2022-06-29 18:27:00 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2022-06-29 18:27:00 +0300 |
commit | 48ec16f3d2a04295767b6bac38aed7bef5180881 (patch) | |
tree | 2812d6d55fc8547ef349a0f60cf07a2401b202e9 /src/adlmidi.cpp | |
parent | 219d03678d35cc8667490e2eae38b58e354347d3 (diff) | |
download | libADLMIDI-48ec16f3d2a04295767b6bac38aed7bef5180881.tar.gz libADLMIDI-48ec16f3d2a04295767b6bac38aed7bef5180881.tar.bz2 libADLMIDI-48ec16f3d2a04295767b6bac38aed7bef5180881.zip |
Added the chip channels allocation mode option
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r-- | src/adlmidi.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 54d839b..a9ec918 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -651,6 +651,29 @@ ADLMIDI_EXPORT int adl_getVolumeRangeModel(struct ADL_MIDIPlayer *device) return play->m_synth->getVolumeScaleModel(); } +ADLMIDI_EXPORT void adl_setChannelAllocMode(struct ADL_MIDIPlayer *device, int chanalloc) +{ + if(!device) + return; + MidiPlayer *play = GET_MIDI_PLAYER(device); + assert(play); + Synth &synth = *play->m_synth; + + if(chanalloc < -1 || chanalloc >= ADLMIDI_ChanAlloc_Count) + chanalloc = ADLMIDI_ChanAlloc_AUTO; + + synth.m_channelAlloc = static_cast<ADLMIDI_ChannelAlloc>(chanalloc); +} + +ADLMIDI_EXPORT int adl_getChannelAllocMode(struct ADL_MIDIPlayer *device) +{ + if(!device) + return -1; + MidiPlayer *play = GET_MIDI_PLAYER(device); + assert(play); + return static_cast<int>(play->m_synth->m_channelAlloc); +} + ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, const char *filePath) { if(device) |