Browse Source

cmTimeLine.h/c Added cmTimeLineMarkerFind().

master
kevin 12 years ago
parent
commit
03811e0a6a
2 changed files with 24 additions and 0 deletions
  1. 22
    0
      app/cmTimeLine.c
  2. 2
    0
      app/cmTimeLine.h

+ 22
- 0
app/cmTimeLine.c View File

@@ -1282,6 +1282,28 @@ cmTlMarker_t*    cmTimeLineMarkerAtTime(    cmTlH_t h, unsigned seqId, unsigned
1282 1282
   return _cmTlMarkerObjPtr(p,op->obj,false);  
1283 1283
 }
1284 1284
 
1285
+cmTlMarker_t*    cmTimeLineMarkerFind( cmTlH_t h, const cmChar_t* markText )
1286
+{
1287
+  unsigned      i;
1288
+  unsigned      n   = cmTimeLineSeqCount(h);
1289
+  cmTlMarker_t* mop = NULL;
1290
+  
1291
+  for(i=0; i<n && mop==NULL; ++i)
1292
+  {
1293
+    cmTlObj_t* op = NULL;
1294
+    mop = NULL;
1295
+    while((mop = cmTlNextMarkerObjPtr(h,op,i)) != NULL )
1296
+    {
1297
+      if( mop->obj.name!=NULL && strcmp(mop->obj.name,markText)==0 )
1298
+        break;
1299
+
1300
+      op = &mop->obj;
1301
+    }
1302
+  }
1303
+    
1304
+  return mop;
1305
+
1306
+}
1285 1307
 
1286 1308
 cmTlRC_t _cmTlParseErr( cmErr_t* err, const cmChar_t* errLabelPtr, unsigned idx, const cmChar_t* fn )
1287 1309
 {

+ 2
- 0
app/cmTimeLine.h View File

@@ -166,6 +166,8 @@ extern "C" {
166 166
   cmTlMidiEvt_t*   cmTimeLineMidiEvtAtTime(   cmTlH_t h, unsigned seqId, unsigned seqSmpIdx );
167 167
   cmTlMarker_t*    cmTimeLineMarkerAtTime(    cmTlH_t h, unsigned seqId, unsigned seqSmpIdx );
168 168
 
169
+  cmTlMarker_t*    cmTimeLineMarkerFind( cmTlH_t h, const cmChar_t* markText );
170
+
169 171
   // 'typeId' = kAudioFileTlId, kMidiFileTId, kMarkerTlId.
170 172
   // 'nameStr' and 'refObjNameStr' may be NULL.
171 173
   cmTlRC_t cmTimeLineInsert( 

Loading…
Cancel
Save