From 7c567ff1c8ad4a1342bfa1ab3d0b5b68a5e704eb Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 21 May 2022 09:26:23 -0400 Subject: [PATCH] cwIoMidiRecordPlay.h/cpp: Added 'actionId' to callback function. --- cwIoMidiRecordPlay.cpp | 5 ++++- cwIoMidiRecordPlay.h | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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 );