aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2017-10-26 03:17:15 +0300
committerWohlstand <admin@wohlnet.ru>2017-10-26 03:17:15 +0300
commitd9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9 (patch)
tree7fc7899b2a68250666b939bc151ae797814e5f8f /src/adlmidi.cpp
parent650d6b913504f37ed84c5f855a85aa00d9dc34d8 (diff)
downloadlibADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.tar.gz
libADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.tar.bz2
libADLMIDI-d9a000cc0a6a8aae37f34c4cc6e23797a1ceb8c9.zip
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
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r--src/adlmidi.cpp20
1 files changed, 20 insertions, 0 deletions
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<MIDIplay *>(device->adl_midiPlayer)->timeLength();
}
+ADLMIDI_EXPORT double adl_loopStartTime(struct ADL_MIDIPlayer *device)
+{
+ if(!device)
+ return -1.0;
+ return reinterpret_cast<MIDIplay *>(device->adl_midiPlayer)->getLoopStart();
+}
+
+ADLMIDI_EXPORT double adl_loopEndTime(struct ADL_MIDIPlayer *device)
+{
+ if(!device)
+ return -1.0;
+ return reinterpret_cast<MIDIplay *>(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<MIDIplay *>(device->adl_midiPlayer)->rewind();
}
+ADLMIDI_EXPORT void adl_setTempo(struct ADL_MIDIPlayer *device, double tempo)
+{
+ if(!device || (tempo <= 0.0))
+ return;
+ reinterpret_cast<MIDIplay *>(device->adl_midiPlayer)->setTempo(tempo);
+}
#ifdef ADLMIDI_USE_DOSBOX_OPL