ソースを参照

cmScoreProc.c : Updated the TakeSeqBldr JSON file generation code to match the

file parser code in cmTakeSeqBldr.c.
master
Kevin Larke 9年前
コミット
15a0c7beeb
1個のファイルの変更14行の追加5行の削除
  1. 14
    5
      app/cmScoreProc.c

+ 14
- 5
app/cmScoreProc.c ファイルの表示

@@ -596,9 +596,10 @@ typedef struct
596 596
   unsigned       mni;
597 597
   bool           failFl;
598 598
   cmJsonH_t      jsH;
599
+  cmJsonNode_t*  takeArray;
599 600
   cmJsonNode_t*  takeObj;
600 601
   cmJsonNode_t*  array;
601
-
602
+  
602 603
   cmSpAssoc_t*   bap;  
603 604
   cmSpAssoc_t*   eap;
604 605
   cmSpNoteMap_t* bmp;
@@ -641,8 +642,8 @@ cmSpRC_t  _cmSpProcAssocCb( void* arg, cmSp_t* sp, cmScoreProcSelId_t id, cmTlOb
641 642
         m->mni    = 0;
642 643
         m->failFl = false;
643 644
 
644
-        // insert a section object
645
-        if((m->takeObj = cmJsonInsertPairObject(m->jsH, cmJsonRoot(m->jsH), "take" )) == NULL )
645
+        // insert a take object
646
+        if((m->takeObj = cmJsonCreateObject(m->jsH, m->takeArray )) == NULL )
646 647
         {
647 648
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Take insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
648 649
           goto errLabel; 
@@ -755,14 +756,22 @@ cmSpRC_t _cmScoreProcGenAssocMain(cmCtx_t* ctx)
755 756
 
756 757
   // store the time-line and score file name
757 758
   if( cmJsonInsertPairs(m->jsH, cmJsonRoot(m->jsH), 
758
-      "tlFn",    kStringTId, cmTimeLineFileName( sp->tlH),
759
-      "scoreFn", kStringTId, cmScoreFileName( sp->scH ),
759
+      "timeLineFn",    kStringTId, cmTimeLineFileName(   sp->tlH),
760
+      "scoreFn",       kStringTId, cmScoreFileName(      sp->scH ),
761
+      "tlPrefixPath",  kStringTId, cmTimeLinePrefixPath( sp->tlH ),
760 762
       NULL ) != kOkJsRC )
761 763
   {
762 764
     cmErrMsg(&m->ctx->err,kJsonFailSpRC,"File name JSON field insertion failed.");
763 765
     goto errLabel;
764 766
   }
765 767
 
768
+  // create an array to hold each take
769
+  if((m->takeArray = cmJsonInsertPairArray(m->jsH, cmJsonRoot(m->jsH), "takeArray" )) == NULL )
770
+  {
771
+    cmErrMsg(&m->ctx->err,kJsonFailSpRC,"JSON take-array create failed.");
772
+    goto errLabel;
773
+  }
774
+
766 775
   // run the score processor
767 776
   _cmScoreProcProcess(ctx,sp);
768 777
 

読み込み中…
キャンセル
保存