diff options
-rw-r--r-- | include/adlmidi.h | 7 | ||||
-rw-r--r-- | src/adlmidi.cpp | 9 | ||||
-rw-r--r-- | src/adlmidi_midiplay.cpp | 2 | ||||
-rw-r--r-- | utils/midiplay/adlmidiplay.cpp | 10 |
4 files changed, 23 insertions, 5 deletions
diff --git a/include/adlmidi.h b/include/adlmidi.h index af1102a..71a67c7 100644 --- a/include/adlmidi.h +++ b/include/adlmidi.h @@ -557,6 +557,13 @@ extern ADLMIDI_DECLSPEC void adl_setFullRangeBrightness(struct ADL_MIDIPlayer *d extern ADLMIDI_DECLSPEC void adl_setAutoArpeggio(struct ADL_MIDIPlayer *device, int aaEn); /** + * @brief Get the state of the automatical arpeggio system enable state + * @param device Instalce of the library + * @return 0 - disabled, 1 - enabled + */ +extern ADLMIDI_DECLSPEC int adl_getAutoArpeggio(struct ADL_MIDIPlayer *device); + +/** * @brief Enable or disable built-in loop (built-in loop supports 'loopStart' and 'loopEnd' tags to loop specific part) * @param device Instance of the library * @param loopEn 0 - disabled, 1 - enabled diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 21cfbc9..54d839b 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -560,6 +560,15 @@ ADLMIDI_EXPORT void adl_setAutoArpeggio(ADL_MIDIPlayer *device, int aaEn) play->m_setup.enableAutoArpeggio = (aaEn != 0); } +ADLMIDI_EXPORT int adl_getAutoArpeggio(ADL_MIDIPlayer *device) +{ + if(!device) + return 0; + MidiPlayer *play = GET_MIDI_PLAYER(device); + assert(play); + return play->m_setup.enableAutoArpeggio ? 1 : 0; +} + ADLMIDI_EXPORT void adl_setLoopEnabled(ADL_MIDIPlayer *device, int loopEn) { #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index a0e31bd..3f4adc9 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -91,7 +91,7 @@ MIDIplay::MIDIplay(unsigned long sampleRate): //m_setup.SkipForward = 0; m_setup.scaleModulators = -1; m_setup.fullRangeBrightnessCC74 = false; - m_setup.enableAutoArpeggio = true; + m_setup.enableAutoArpeggio = false; m_setup.delay = 0.0; m_setup.carry = 0.0; m_setup.tick_skip_samples_delay = 0; diff --git a/utils/midiplay/adlmidiplay.cpp b/utils/midiplay/adlmidiplay.cpp index a087953..ae90187 100644 --- a/utils/midiplay/adlmidiplay.cpp +++ b/utils/midiplay/adlmidiplay.cpp @@ -403,7 +403,7 @@ int main(int argc, char **argv) " will be combined into one\n" " --solo <track> Selects a solo track to play\n" " --only <track1,...,trackN> Selects a subset of tracks to play\n" - " -na Disable the auto-arpeggio\n" + " -ea Enable the auto-arpeggio\n" #ifndef HARDWARE_OPL3 " -fp Enables full-panning stereo support\n" " --emu-nuked Uses Nuked OPL3 v 1.8 emulator\n" @@ -484,7 +484,7 @@ int main(int argc, char **argv) bool recordWave = false; int loopEnabled = 1; #endif - int autoArpeggioEnabled = 1; + int autoArpeggioEnabled = 0; #ifndef HARDWARE_OPL3 int emulator = ADLMIDI_EMU_NUKED; @@ -542,8 +542,10 @@ int main(int argc, char **argv) else if(!std::strcmp("-nl", argv[2])) loopEnabled = 0; //Enable loop #endif - else if(!std::strcmp("-na", argv[2])) + else if(!std::strcmp("-na", argv[2])) // Deprecated autoArpeggioEnabled = 0; //Enable auto-arpeggio + else if(!std::strcmp("-ea", argv[2])) + autoArpeggioEnabled = 1; //Enable auto-arpeggio #ifndef HARDWARE_OPL3 else if(!std::strcmp("--emu-nuked", argv[2])) @@ -848,7 +850,7 @@ int main(int argc, char **argv) std::fprintf(stdout, "\n"); } - std::fprintf(stdout, " - Automatic arpeggio is turned %s\n", autoArpeggioEnabled ? "ON" : "OFF"); + std::fprintf(stdout, " - Automatic arpeggio is turned %s\n", adl_getAutoArpeggio(myDevice) ? "ON" : "OFF"); std::fprintf(stdout, " - File [%s] opened!\n", musPath.c_str()); flushout(stdout); |