From 48ec16f3d2a04295767b6bac38aed7bef5180881 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 29 Jun 2022 18:27:00 +0300 Subject: Added the chip channels allocation mode option --- src/adlmidi.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/adlmidi.cpp') 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(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(play->m_synth->m_channelAlloc); +} + ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, const char *filePath) { if(device) -- cgit v1.2.3