From 6349bc624436cd0226d1145b084236185e912f81 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 1 Nov 2021 10:16:36 -0400 Subject: [PATCH] cwMidiAlsa.cpp : Event handler now loops in _cmMpPoll() to advance ts.tv_nsec/sec time. To handle case where tv_nsec is greater than 1 second. --- cwMidiAlsa.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cwMidiAlsa.cpp b/cwMidiAlsa.cpp index e9be04f..3645964 100644 --- a/cwMidiAlsa.cpp +++ b/cwMidiAlsa.cpp @@ -240,6 +240,11 @@ namespace cw case SND_SEQ_EVENT_SENSING: status = kSysRtSenseMdId; break; case SND_SEQ_EVENT_RESET: status = kSysRtResetMdId; break; + case SND_SEQ_EVENT_SYSEX: + //printf("Sysex: %i\n",ev->data.ext.len); + break; + + } if( status != 0 ) @@ -248,7 +253,7 @@ namespace cw time::spec_t ts; ts.tv_sec = p->baseTimeStamp.tv_sec + ev->time.time.tv_sec; ts.tv_nsec = p->baseTimeStamp.tv_nsec + ev->time.time.tv_nsec; - if( ts.tv_nsec > 1000000000 ) + while( ts.tv_nsec > 1000000000 ) { ts.tv_nsec -= 1000000000; ts.tv_sec += 1;