cmMidiFile.c : Removed UID return value from cmMidiFileInsertTrackMsg().

This commit is contained in:
kevin 2016-09-14 15:15:48 -04:00
parent d14744ed4d
commit 19b90719aa
2 changed files with 8 additions and 14 deletions

View File

@ -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); _cmMidiFile_t* p = _cmMidiFileHandleToPtr(h);
if( uidRef != NULL )
*uidRef = cmInvalidId;
// validate the track index // validate the track index
if( trkIdx >= p->trkN ) if( trkIdx >= p->trkN )
return cmErrMsg(&p->err,kInvalidTrkIndexMfRC,"The track index (%i) is invalid.",trkIdx); 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); 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* m0 = NULL; // msg before insertion
cmMidiTrackMsg_t* m1 = p->trkV[trkIdx].base; // msg after 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; cmMidiTrackMsg_t m;
cmMidiChMsg_t cm; cmMidiChMsg_t cm;
@ -1480,10 +1474,10 @@ cmMfRC_t cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned
assert( m.status >= kNoteOffMdId && m.status <= kPbendMdId ); 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; cmMidiTrackMsg_t m;
@ -1494,7 +1488,7 @@ cmMfRC_t cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsign
m.metaId = kTempoMdId; m.metaId = kTempoMdId;
m.u.iVal = 60000000/bpm; // convert BPM to microsPerQN m.u.iVal = 60000000/bpm; // convert BPM to microsPerQN
return cmMidiFileInsertTrackMsg(h,trkIdx,&m,uidRef); return cmMidiFileInsertTrackMsg(h,trkIdx,&m);
} }

View File

@ -185,9 +185,9 @@ extern "C" {
// byteCnt - used to allocate storage for the data element in 'cmMidiTrackMsg_t.u' // byteCnt - used to allocate storage for the data element in 'cmMidiTrackMsg_t.u'
// u - the message data // u - the message data
// //
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 );
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 );
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 );
// Return a pointer to the first msg at or after 'usecsOffs' or kInvalidIdx if no // 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 // msg exists after 'usecsOffs'. Note that 'usecOffs' is an offset from the beginning