From f44c36856ada538d32d7eda3128c8942a194f2d9 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sun, 24 Dec 2017 01:59:23 +0300 Subject: Fixed an inability to use adlmidi.h in pure C programs --- include/adlmidi.h | 2 +- src/adlmidi.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/adlmidi.h b/include/adlmidi.h index 49dcbc0..29e2fab 100644 --- a/include/adlmidi.h +++ b/include/adlmidi.h @@ -222,7 +222,7 @@ extern void adl_panic(struct ADL_MIDIPlayer *device); extern void adl_rt_resetState(struct ADL_MIDIPlayer *device); /*Turn specific MIDI note ON*/ -extern bool adl_rt_noteOn(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note, ADL_UInt8 velocity); +extern int adl_rt_noteOn(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note, ADL_UInt8 velocity); /*Turn specific MIDI note OFF*/ extern void adl_rt_noteOff(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note); diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 3ad4508..7394424 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -749,14 +749,14 @@ ADLMIDI_EXPORT void adl_rt_resetState(struct ADL_MIDIPlayer *device) player->realTime_ResetState(); } -ADLMIDI_EXPORT bool adl_rt_noteOn(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note, ADL_UInt8 velocity) +ADLMIDI_EXPORT int adl_rt_noteOn(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note, ADL_UInt8 velocity) { if(!device) - return false; + return 0; MIDIplay *player = reinterpret_cast(device->adl_midiPlayer); if(!player) - return false; - return player->realTime_NoteOn(channel, note, velocity); + return 0; + return (int)player->realTime_NoteOn(channel, note, velocity); } ADLMIDI_EXPORT void adl_rt_noteOff(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 note) -- cgit v1.2.3