|
@@ -655,7 +655,6 @@ cmTlRC_t _cmTlProcMidiFile( _cmTl_t* p, _cmTlObj_t* op, cmMidiFileH_t mfH )
|
655
|
655
|
fl = mp->dtick == 0;
|
656
|
656
|
}
|
657
|
657
|
|
658
|
|
-
|
659
|
658
|
accum += dtick * p->srate / 1000000;
|
660
|
659
|
|
661
|
660
|
//int begSmpIdx = floor(accum_micros * p->srate / 1000000);
|
|
@@ -958,6 +957,35 @@ double cmTimeLineSampleRate( cmTlH_t h )
|
958
|
957
|
return p->srate;
|
959
|
958
|
}
|
960
|
959
|
|
|
960
|
+cmTlObj_t* _cmTimeLineIdToObj( _cmTl_t* p, unsigned seqId, unsigned id )
|
|
961
|
+{
|
|
962
|
+ assert( seqId < p->seqCnt );
|
|
963
|
+
|
|
964
|
+ _cmTlObj_t* op = p->seq[seqId].first;
|
|
965
|
+ for(; op != NULL; op=op->next )
|
|
966
|
+ if( op->obj->uid == id )
|
|
967
|
+ return op->obj;
|
|
968
|
+ return NULL;
|
|
969
|
+}
|
|
970
|
+
|
|
971
|
+cmTlObj_t* cmTimeLineIdToObj( cmTlH_t h, unsigned seqId, unsigned id )
|
|
972
|
+{
|
|
973
|
+ _cmTl_t* p = _cmTlHandleToPtr(h);
|
|
974
|
+ cmTlObj_t* op = NULL;
|
|
975
|
+
|
|
976
|
+ if( seqId != cmInvalidId )
|
|
977
|
+ op = _cmTimeLineIdToObj(p,seqId,id);
|
|
978
|
+ else
|
|
979
|
+ {
|
|
980
|
+ for(seqId=0; seqId<p->seqCnt; ++seqId)
|
|
981
|
+ if((op = _cmTimeLineIdToObj(p,seqId,id) ) != NULL )
|
|
982
|
+ break;
|
|
983
|
+ }
|
|
984
|
+
|
|
985
|
+ return op;
|
|
986
|
+}
|
|
987
|
+
|
|
988
|
+
|
961
|
989
|
cmTlObj_t* cmTimeLineNextObj( cmTlH_t h, cmTlObj_t* tp, unsigned seqId )
|
962
|
990
|
{
|
963
|
991
|
_cmTl_t* p = _cmTlHandleToPtr(h);
|
|
@@ -1036,6 +1064,22 @@ cmTlMarker_t* cmTlNextMarkerObjPtr( cmTlH_t h, cmTlObj_t* op, unsigned seq
|
1036
|
1064
|
return cmTimeLineMarkerObjPtr(h,op);
|
1037
|
1065
|
}
|
1038
|
1066
|
|
|
1067
|
+cmTlObj_t* cmTlIdToObjPtr( cmTlH_t h, unsigned uid )
|
|
1068
|
+{
|
|
1069
|
+ _cmTl_t* p = _cmTlHandleToPtr(h);
|
|
1070
|
+ unsigned i;
|
|
1071
|
+ for(i=0; i<p->seqCnt; ++i)
|
|
1072
|
+ //if( p->seq[i].first->obj->uid <= uid && uid <= p->seq[i].last->obj->uid )
|
|
1073
|
+ {
|
|
1074
|
+ _cmTlObj_t* op = p->seq[i].first;
|
|
1075
|
+ for(; op != NULL; op=op->next )
|
|
1076
|
+ if( op->obj->uid == uid )
|
|
1077
|
+ return op->obj;
|
|
1078
|
+ }
|
|
1079
|
+
|
|
1080
|
+ return NULL;
|
|
1081
|
+}
|
|
1082
|
+
|
1039
|
1083
|
|
1040
|
1084
|
cmTlMidiFile_t* cmTimeLineMidiFileObjPtr( cmTlH_t h, cmTlObj_t* op )
|
1041
|
1085
|
{
|
|
@@ -1474,16 +1518,16 @@ cmTlRC_t _cmTimeLineDecodeObj( const void* msg, unsigned msgByteCnt, cmTlUiMsg_
|
1474
|
1518
|
|
1475
|
1519
|
r->msgId = kInsertMsgTlId;
|
1476
|
1520
|
r->objId = tp->uid;
|
1477
|
|
- r->parentObjId = *parentIdPtr;
|
|
1521
|
+ //r->parentObjId = *parentIdPtr;
|
1478
|
1522
|
r->seqId = tp->seqId;
|
1479
|
|
- r->typeId = tp->typeId;
|
1480
|
|
- r->begSmpIdx = tp->begSmpIdx;
|
1481
|
|
- r->durSmpCnt = tp->durSmpCnt;
|
1482
|
|
- r->label = strlen(text)==0 ? NULL : text;
|
|
1523
|
+ //r->typeId = tp->typeId;
|
|
1524
|
+ //r->begSmpIdx = tp->begSmpIdx;
|
|
1525
|
+ //r->durSmpCnt = tp->durSmpCnt;
|
|
1526
|
+ //r->label = strlen(text)==0 ? NULL : text;
|
1483
|
1527
|
r->srate = 0;
|
1484
|
|
- r->midiTrkMsg = NULL;
|
1485
|
|
- r->textStr = NULL;
|
1486
|
|
-
|
|
1528
|
+ //r->midiTrkMsg = NULL;
|
|
1529
|
+ //r->textStr = NULL;
|
|
1530
|
+ /*
|
1487
|
1531
|
switch( tp->typeId )
|
1488
|
1532
|
{
|
1489
|
1533
|
case kMidiFileTlId:
|
|
@@ -1515,7 +1559,7 @@ cmTlRC_t _cmTimeLineDecodeObj( const void* msg, unsigned msgByteCnt, cmTlUiMsg_
|
1515
|
1559
|
default:
|
1516
|
1560
|
{ assert(0); }
|
1517
|
1561
|
}
|
1518
|
|
-
|
|
1562
|
+ */
|
1519
|
1563
|
return rc;
|
1520
|
1564
|
}
|
1521
|
1565
|
|