aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2017-11-10 01:44:31 +0300
committerWohlstand <admin@wohlnet.ru>2017-11-10 01:44:31 +0300
commit48188458bcc624b13f9c242c0fddfba29a91286d (patch)
tree5eb6f6cefcbff3f05e7e542be98dc47ca5babd62 /src/adlmidi.cpp
parent0be25a41ca793c3c03814f529890492adfac8ad5 (diff)
downloadlibADLMIDI-48188458bcc624b13f9c242c0fddfba29a91286d.tar.gz
libADLMIDI-48188458bcc624b13f9c242c0fddfba29a91286d.tar.bz2
libADLMIDI-48188458bcc624b13f9c242c0fddfba29a91286d.zip
Added adl_atEnd() function
It is needed to detect the end of song while manually iterating a MIDI ticks
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r--src/adlmidi.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 5e252db..7c08287 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -686,3 +686,13 @@ ADLMIDI_EXPORT double adl_tickEvents(ADL_MIDIPlayer *device, double seconds, dou
return -1.0;
return player->Tick(seconds, granuality);
}
+
+ADLMIDI_EXPORT int adl_atEnd(ADL_MIDIPlayer *device)
+{
+ if(!device)
+ return 1;
+ MIDIplay *player = reinterpret_cast<MIDIplay *>(device->adl_midiPlayer);
+ if(!player)
+ return 1;
+ return (int)player->atEnd;
+}