diff --git a/cwIoMidiRecordPlay.cpp b/cwIoMidiRecordPlay.cpp index bb742f0..dcb37ea 100644 --- a/cwIoMidiRecordPlay.cpp +++ b/cwIoMidiRecordPlay.cpp @@ -150,7 +150,7 @@ namespace cw event_callback_t cb; void* cb_arg; - + } midi_record_play_t; enum @@ -1599,6 +1599,15 @@ cw::rc_t cw::midi_record_play::seek( handle_t h, time::spec_t seek_timestamp ) return rc; } +unsigned cw::midi_record_play::elapsed_micros( handle_t h ) +{ + midi_record_play_t* p = _handleToPtr(h); + time::spec_t t; + time::get(t); + + return time::elapsedMicros( p->start_time, t ); +} + unsigned cw::midi_record_play::event_count( handle_t h ) { midi_record_play_t* p = _handleToPtr(h); diff --git a/cwIoMidiRecordPlay.h b/cwIoMidiRecordPlay.h index c8a9de1..3fd525f 100644 --- a/cwIoMidiRecordPlay.h +++ b/cwIoMidiRecordPlay.h @@ -56,6 +56,8 @@ namespace cw rc_t load( handle_t h, const midi_msg_t* msg, unsigned msg_count ); rc_t seek( handle_t h, time::spec_t timestamp ); + + unsigned elapsed_micros( handle_t h ); unsigned event_count( handle_t h ); // Current count of stored messages. unsigned event_index( handle_t h ); // record mode: index of next event to store play mode:index of next event to play