Browse Source

cmScoreProc.c : Changed kBegin/EndSectionSpId to kBegin/EndTakeSpId to better

reflect the meaning of the score markers.
master
Kevin Larke 9 years ago
parent
commit
c89117af6a
1 changed files with 20 additions and 20 deletions
  1. 20
    20
      app/cmScoreProc.c

+ 20
- 20
app/cmScoreProc.c View File

@@ -22,10 +22,10 @@
22 22
 
23 23
 typedef enum
24 24
 {
25
-  kBeginSectionSpId,  // tlObjPtr points to a cmTlMarker_t object.
26
-  kEndSectionSpId,    // tlObjPtr is NULL.
27
-  kNoteOnSpId,        // tlObjPtr points to a cmTlMidiEvt_t note-on object.
28
-  kFailSpId           // tlObjPtr points to a cmTlMarker_t object (This section score tracking failed.)
25
+  kBeginTakeSpId,  // tlObjPtr points to a cmTlMarker_t object.
26
+  kEndTakeSpId,    // tlObjPtr is NULL.
27
+  kNoteOnSpId,     // tlObjPtr points to a cmTlMidiEvt_t note-on object.
28
+  kFailSpId        // tlObjPtr points to a cmTlMarker_t object (This takes score tracking failed.)
29 29
 } cmScoreProcSelId_t;
30 30
 
31 31
 struct cmSp_str;
@@ -44,7 +44,7 @@ typedef struct cmSp_str
44 44
   double          srate;        // 
45 45
   cmScMatcher*    match;        // score follower
46 46
 
47
-  cmScoreProcCb_t  procCb;      // score processor callback - called whenever a new 'marker' section or note-on is about to be processed
47
+  cmScoreProcCb_t  procCb;      // score processor callback - called whenever a new 'marker' take or note-on is about to be processed
48 48
   cmScMatcherCb_t  matchCb;     // score follower callback  - called whenever the score follower detects a matched event
49 49
   void*            cbArg;       // callback arg. for both matchCb and procCb.
50 50
 
@@ -204,8 +204,8 @@ cmSpRC_t _cmScoreProcProcess(cmCtx_t* ctx, cmSp_t* sp)
204 204
         continue;
205 205
       }
206 206
 
207
-      // inform the score processor that we are about to start a new section
208
-      if( sp->procCb( sp->cbArg, sp, kBeginSectionSpId, o0p ) != kOkSpRC )
207
+      // inform the score processor that we are about to start a new take
208
+      if( sp->procCb( sp->cbArg, sp, kBeginTakeSpId, o0p ) != kOkSpRC )
209 209
       {
210 210
         cmErrMsg(&sp->err,kProcFailSpRC,"The score process object failed on reset.");
211 211
         continue;
@@ -259,11 +259,11 @@ cmSpRC_t _cmScoreProcProcess(cmCtx_t* ctx, cmSp_t* sp)
259 259
         }
260 260
       }
261 261
 
262
-      // inform the score processor that we done processing a section
263
-      if( sp->procCb( sp->cbArg, sp, kEndSectionSpId, NULL ) != kOkSpRC )
262
+      // inform the score processor that we done processing a take
263
+      if( sp->procCb( sp->cbArg, sp, kEndTakeSpId, NULL ) != kOkSpRC )
264 264
         cmErrMsg(&sp->err,kProcFailSpRC,"The score process object failed on reset.");
265 265
 
266
-      // error flag is used to break out of the loop after the 'end-section' is called
266
+      // error flag is used to break out of the loop after the 'end-take' is called
267 267
       // so that the user defined processes has a chance to clean-up 
268 268
       if( errFl )
269 269
         goto errLabel;
@@ -493,7 +493,7 @@ cmSpRC_t  _cmSpProcMeasCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlObj
493 493
 
494 494
   switch( id )
495 495
   {
496
-    case kBeginSectionSpId:
496
+    case kBeginTakeSpId:
497 497
 
498 498
       // reset the performance evaluation object
499 499
       if( cmScMeasReset(m->meas) != cmOkRC )
@@ -505,7 +505,7 @@ cmSpRC_t  _cmSpProcMeasCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlObj
505 505
     case kNoteOnSpId:
506 506
       break;
507 507
 
508
-    case kEndSectionSpId:
508
+    case kEndTakeSpId:
509 509
       break;
510 510
 
511 511
     case kFailSpId:
@@ -595,7 +595,7 @@ typedef struct
595 595
   unsigned       mni;
596 596
   bool           failFl;
597 597
   cmJsonH_t      jsH;
598
-  cmJsonNode_t*  sectObj;
598
+  cmJsonNode_t*  takeObj;
599 599
   cmJsonNode_t*  array;
600 600
 
601 601
   cmSpAssoc_t*   bap;  
@@ -632,7 +632,7 @@ cmSpRC_t  _cmSpProcAssocCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlOb
632 632
 
633 633
   switch( id )
634 634
   {
635
-    case kBeginSectionSpId:
635
+    case kBeginTakeSpId:
636 636
       {
637 637
         cmTlMarker_t* markPtr = cmTimeLineMarkerObjPtr( sp->tlH, tlObjPtr );
638 638
         assert( markPtr != NULL );
@@ -640,21 +640,21 @@ cmSpRC_t  _cmSpProcAssocCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlOb
640 640
         m->failFl = false;
641 641
 
642 642
         // insert a section object
643
-        if((m->sectObj = cmJsonInsertPairObject(m->jsH, cmJsonRoot(m->jsH), "section" )) == NULL )
643
+        if((m->takeObj = cmJsonInsertPairObject(m->jsH, cmJsonRoot(m->jsH), "take" )) == NULL )
644 644
         {
645
-          rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Section insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
645
+          rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Take insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
646 646
           goto errLabel; 
647 647
         }
648 648
 
649 649
         // set the section time-line UID
650
-        if( cmJsonInsertPairInt(m->jsH, m->sectObj,"markerUid", tlObjPtr->uid ) != kOkJsRC )
650
+        if( cmJsonInsertPairInt(m->jsH, m->takeObj,"markerUid", tlObjPtr->uid ) != kOkJsRC )
651 651
         {
652 652
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Marker uid field insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
653 653
           goto errLabel;           
654 654
         }
655 655
 
656 656
         // create an array to hold the assoc results
657
-        if(( m->array = cmJsonInsertPairArray(m->jsH, m->sectObj, "array")) == NULL )
657
+        if(( m->array = cmJsonInsertPairArray(m->jsH, m->takeObj, "array")) == NULL )
658 658
         {
659 659
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Marker array field insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
660 660
           goto errLabel;           
@@ -662,7 +662,7 @@ cmSpRC_t  _cmSpProcAssocCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlOb
662 662
       }
663 663
       break;
664 664
 
665
-    case kEndSectionSpId:
665
+    case kEndTakeSpId:
666 666
       {
667 667
         while( m->bmp != NULL )
668 668
         {
@@ -674,7 +674,7 @@ cmSpRC_t  _cmSpProcAssocCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlOb
674 674
         m->bmp = NULL;
675 675
         m->emp = NULL;
676 676
 
677
-        if( cmJsonInsertPairInt( m->jsH, m->sectObj, "failFl", m->failFl ) != kOkJsRC )
677
+        if( cmJsonInsertPairInt( m->jsH, m->takeObj, "failFl", m->failFl ) != kOkJsRC )
678 678
         {
679 679
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"JSON fail flag insert failed.");
680 680
           goto errLabel;

Loading…
Cancel
Save