From 19b90719aa85f1849720448db4fe1cf58e39fb56 Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 14 Sep 2016 15:15:48 -0400 Subject: [PATCH] cmMidiFile.c : Removed UID return value from cmMidiFileInsertTrackMsg(). --- cmMidiFile.c | 16 +++++----------- cmMidiFile.h | 6 +++--- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/cmMidiFile.c b/cmMidiFile.c index a7aaf36..fb26f63 100644 --- a/cmMidiFile.c +++ b/cmMidiFile.c @@ -1368,13 +1368,10 @@ cmMfRC_t cmMidiFileInsertMsg( cmMidiFileH_t h, unsigned uid, int dtick, cmMidiBy } -cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg, unsigned* uidRef ) +cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg ) { _cmMidiFile_t* p = _cmMidiFileHandleToPtr(h); - if( uidRef != NULL ) - *uidRef = cmInvalidId; - // validate the track index if( trkIdx >= p->trkN ) return cmErrMsg(&p->err,kInvalidTrkIndexMfRC,"The track index (%i) is invalid.",trkIdx); @@ -1398,9 +1395,6 @@ cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMi memcpy((void*)m->u.voidPtr,msg->u.voidPtr,msg->byteCnt); } - if( uidRef != NULL ) - *uidRef = m->uid; - cmMidiTrackMsg_t* m0 = NULL; // msg before insertion cmMidiTrackMsg_t* m1 = p->trkV[trkIdx].base; // msg after insertion @@ -1461,7 +1455,7 @@ cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMi } -cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1, unsigned* uidRef ) +cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1 ) { cmMidiTrackMsg_t m; cmMidiChMsg_t cm; @@ -1480,10 +1474,10 @@ cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned assert( m.status >= kNoteOffMdId && m.status <= kPbendMdId ); - return cmMidiFileInsertTrackMsg(h,trkIdx,&m,uidRef); + return cmMidiFileInsertTrackMsg(h,trkIdx,&m); } -cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm, unsigned* uidRef ) +cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm ) { cmMidiTrackMsg_t m; @@ -1494,7 +1488,7 @@ cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsign m.metaId = kTempoMdId; m.u.iVal = 60000000/bpm; // convert BPM to microsPerQN - return cmMidiFileInsertTrackMsg(h,trkIdx,&m,uidRef); + return cmMidiFileInsertTrackMsg(h,trkIdx,&m); } diff --git a/cmMidiFile.h b/cmMidiFile.h index efc5976..55b8ef7 100644 --- a/cmMidiFile.h +++ b/cmMidiFile.h @@ -185,9 +185,9 @@ extern "C" { // byteCnt - used to allocate storage for the data element in 'cmMidiTrackMsg_t.u' // u - the message data // - cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg, unsigned* uidRef ); - cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1, unsigned* uidRef ); - cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm, unsigned* uidRef ); + cmMfRC_t cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg ); + cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1 ); + cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm ); // Return a pointer to the first msg at or after 'usecsOffs' or kInvalidIdx if no // msg exists after 'usecsOffs'. Note that 'usecOffs' is an offset from the beginning