From d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 26 Oct 2017 03:17:15 +0300 Subject: Continue works on loop points and some clean-up - Added more detailed error information while parsing MIDI file - Added abiltiy to retrieve loop points time positions - Added ability to change playing tempo by giving multiplier - Removed old commented code TODO: - implement meta-information store and a way to retreive it - implement hook-ability for every MIDI event - implement ability to mute/solo every channel --- src/adlmidi.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/adlmidi.cpp') diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index bbd80e4..a7bab22 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -303,6 +303,20 @@ ADLMIDI_EXPORT double adl_totalTimeLength(ADL_MIDIPlayer *device) return reinterpret_cast(device->adl_midiPlayer)->timeLength(); } +ADLMIDI_EXPORT double adl_loopStartTime(struct ADL_MIDIPlayer *device) +{ + if(!device) + return -1.0; + return reinterpret_cast(device->adl_midiPlayer)->getLoopStart(); +} + +ADLMIDI_EXPORT double adl_loopEndTime(struct ADL_MIDIPlayer *device) +{ + if(!device) + return -1.0; + return reinterpret_cast(device->adl_midiPlayer)->getLoopEnd(); +} + ADLMIDI_EXPORT double adl_positionTell(struct ADL_MIDIPlayer *device) { if(!device) @@ -324,6 +338,12 @@ ADLMIDI_EXPORT void adl_positionRewind(struct ADL_MIDIPlayer *device) reinterpret_cast(device->adl_midiPlayer)->rewind(); } +ADLMIDI_EXPORT void adl_setTempo(struct ADL_MIDIPlayer *device, double tempo) +{ + if(!device || (tempo <= 0.0)) + return; + reinterpret_cast(device->adl_midiPlayer)->setTempo(tempo); +} #ifdef ADLMIDI_USE_DOSBOX_OPL -- cgit v1.2.3