diff --git a/cwIoMidiRecordPlay.cpp b/cwIoMidiRecordPlay.cpp index 387962f..f11557d 100644 --- a/cwIoMidiRecordPlay.cpp +++ b/cwIoMidiRecordPlay.cpp @@ -341,7 +341,7 @@ namespace cw } if( !after_stop_time_fl and p->cb ) - p->cb( p->cb_arg, id, timestamp, loc, ch, status, d0, d1 ); + p->cb( p->cb_arg, kMidiEventActionId, id, timestamp, loc, ch, status, d0, d1 ); if( log_fl && p->logOutFl ) { @@ -739,6 +739,9 @@ namespace cw } + if( p->cb != nullptr ) + p->cb( p->cb_arg, kPlayerStoppedActionId, kInvalidId, t1, kInvalidId, 0, 0, 0, 0 ); + return rc; } diff --git a/cwIoMidiRecordPlay.h b/cwIoMidiRecordPlay.h index 2bdabc1..85a1f87 100644 --- a/cwIoMidiRecordPlay.h +++ b/cwIoMidiRecordPlay.h @@ -19,8 +19,13 @@ namespace cw uint8_t d1; } midi_msg_t; + enum { + kMidiEventActionId, + kPlayerStoppedActionId + }; - typedef void (*event_callback_t)( void* arg, unsigned id, const time::spec_t timestamp, unsigned loc, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1 ); + + typedef void (*event_callback_t)( void* arg, unsigned actionId, unsigned id, const time::spec_t timestamp, unsigned loc, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1 ); rc_t create( handle_t& hRef, io::handle_t ioH, const object_t& cfg, event_callback_t cb=nullptr, void* cb_arg=nullptr );