diff options
author | Wohlstand <admin@wohlnet.ru> | 2021-10-25 05:39:00 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2021-10-25 05:39:00 +0300 |
commit | 72321e12764a57364a12199938eb757af4d4f4ff (patch) | |
tree | 6c506796c273d376d55e5a03aef0d8265d867254 /src/adlmidi.cpp | |
parent | 50a8396eb61c665b07426c70a11c0b73ed950434 (diff) | |
download | libADLMIDI-72321e12764a57364a12199938eb757af4d4f4ff.tar.gz libADLMIDI-72321e12764a57364a12199938eb757af4d4f4ff.tar.bz2 libADLMIDI-72321e12764a57364a12199938eb757af4d4f4ff.zip |
Added an ability to disable/enable the MIDI channel
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r-- | src/adlmidi.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 621c385..99109eb 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -1569,6 +1569,27 @@ ADLMIDI_EXPORT int adl_setTrackOptions(struct ADL_MIDIPlayer *device, size_t tra #endif } +ADLMIDI_EXPORT int adl_setChannelEnabled(struct ADL_MIDIPlayer *device, size_t channelNumber, int enabled) +{ +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER + if(!device) + return -1; + + MidiPlayer *play = GET_MIDI_PLAYER(device); + assert(play); + MidiSequencer &seq = *play->m_sequencer; + + if(!seq.setChannelEnabled(channelNumber, (bool)enabled)) + return -1; + return 0; +#else + ADL_UNUSED(device); + ADL_UNUSED(channelNumber); + ADL_UNUSED(enabled); + return -1; +#endif +} + ADLMIDI_EXPORT int adl_setTriggerHandler(struct ADL_MIDIPlayer *device, ADL_TriggerHandler handler, void *userData) { #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER |