Explorar el Código

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

master
kevin hace 7 años
padre
commit
19b90719aa
Se han modificado 2 ficheros con 8 adiciones y 14 borrados
  1. 5
    11
      cmMidiFile.c
  2. 3
    3
      cmMidiFile.h

+ 5
- 11
cmMidiFile.c Ver fichero

1368
 
1368
 
1369
 }
1369
 }
1370
 
1370
 
1371
-cmMfRC_t  cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg, unsigned* uidRef )
1371
+cmMfRC_t  cmMidiFileInsertTrackMsg( cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg )
1372
 {
1372
 {
1373
   _cmMidiFile_t* p = _cmMidiFileHandleToPtr(h);
1373
   _cmMidiFile_t* p = _cmMidiFileHandleToPtr(h);
1374
 
1374
 
1375
-  if( uidRef != NULL )
1376
-    *uidRef = cmInvalidId;
1377
-
1378
   // validate the track index
1375
   // validate the track index
1379
   if( trkIdx >= p->trkN )
1376
   if( trkIdx >= p->trkN )
1380
     return cmErrMsg(&p->err,kInvalidTrkIndexMfRC,"The track index (%i) is invalid.",trkIdx);
1377
     return cmErrMsg(&p->err,kInvalidTrkIndexMfRC,"The track index (%i) is invalid.",trkIdx);
1398
     memcpy((void*)m->u.voidPtr,msg->u.voidPtr,msg->byteCnt);
1395
     memcpy((void*)m->u.voidPtr,msg->u.voidPtr,msg->byteCnt);
1399
   }
1396
   }
1400
 
1397
 
1401
-  if( uidRef != NULL )
1402
-    *uidRef = m->uid;
1403
-  
1404
   cmMidiTrackMsg_t* m0 = NULL;                  // msg before insertion
1398
   cmMidiTrackMsg_t* m0 = NULL;                  // msg before insertion
1405
   cmMidiTrackMsg_t* m1 = p->trkV[trkIdx].base;  // msg after insertion
1399
   cmMidiTrackMsg_t* m1 = p->trkV[trkIdx].base;  // msg after insertion
1406
 
1400
 
1461
    
1455
    
1462
 }
1456
 }
1463
 
1457
 
1464
-cmMfRC_t  cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1, unsigned* uidRef )
1458
+cmMfRC_t  cmMidiFileInsertTrackChMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1 )
1465
 {
1459
 {
1466
   cmMidiTrackMsg_t m;
1460
   cmMidiTrackMsg_t m;
1467
   cmMidiChMsg_t   cm;
1461
   cmMidiChMsg_t   cm;
1480
 
1474
 
1481
   assert( m.status >= kNoteOffMdId && m.status <= kPbendMdId );
1475
   assert( m.status >= kNoteOffMdId && m.status <= kPbendMdId );
1482
   
1476
   
1483
-  return cmMidiFileInsertTrackMsg(h,trkIdx,&m,uidRef);
1477
+  return cmMidiFileInsertTrackMsg(h,trkIdx,&m);
1484
 }
1478
 }
1485
 
1479
 
1486
-cmMfRC_t  cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm, unsigned* uidRef )
1480
+cmMfRC_t  cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm )
1487
 {
1481
 {
1488
   cmMidiTrackMsg_t m;
1482
   cmMidiTrackMsg_t m;
1489
 
1483
 
1494
   m.metaId     = kTempoMdId;
1488
   m.metaId     = kTempoMdId;
1495
   m.u.iVal     = 60000000/bpm;  // convert BPM to microsPerQN
1489
   m.u.iVal     = 60000000/bpm;  // convert BPM to microsPerQN
1496
   
1490
   
1497
-  return cmMidiFileInsertTrackMsg(h,trkIdx,&m,uidRef);
1491
+  return cmMidiFileInsertTrackMsg(h,trkIdx,&m);
1498
 }
1492
 }
1499
 
1493
 
1500
 
1494
 

+ 3
- 3
cmMidiFile.h Ver fichero

185
   //   byteCnt  - used to allocate storage for the data element in 'cmMidiTrackMsg_t.u'
185
   //   byteCnt  - used to allocate storage for the data element in 'cmMidiTrackMsg_t.u'
186
   //   u        - the message data
186
   //   u        - the message data
187
   //
187
   //
188
-  cmMfRC_t             cmMidiFileInsertTrackMsg(     cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg, unsigned* uidRef );
189
-  cmMfRC_t             cmMidiFileInsertTrackChMsg(   cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1, unsigned* uidRef );
190
-  cmMfRC_t             cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm, unsigned* uidRef );
188
+  cmMfRC_t             cmMidiFileInsertTrackMsg(     cmMidiFileH_t h, unsigned trkIdx, const cmMidiTrackMsg_t* msg );
189
+  cmMfRC_t             cmMidiFileInsertTrackChMsg(   cmMidiFileH_t h, unsigned trkIdx, unsigned atick, cmMidiByte_t status, cmMidiByte_t d0, cmMidiByte_t d1 );
190
+  cmMfRC_t             cmMidFileInsertTrackTempoMsg( cmMidiFileH_t h, unsigned trkIdx, unsigned atick, unsigned bpm );
191
   
191
   
192
   // Return a pointer to the first msg at or after 'usecsOffs' or kInvalidIdx if no
192
   // Return a pointer to the first msg at or after 'usecsOffs' or kInvalidIdx if no
193
   // msg exists after 'usecsOffs'.  Note that 'usecOffs' is an offset from the beginning
193
   // msg exists after 'usecsOffs'.  Note that 'usecOffs' is an offset from the beginning

Loading…
Cancelar
Guardar