Browse Source

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

file parser code in cmTakeSeqBldr.c.
master
Kevin Larke 9 years ago
parent
commit
15a0c7beeb
1 changed files with 14 additions and 5 deletions
  1. 14
    5
      app/cmScoreProc.c

+ 14
- 5
app/cmScoreProc.c View File

596
   unsigned       mni;
596
   unsigned       mni;
597
   bool           failFl;
597
   bool           failFl;
598
   cmJsonH_t      jsH;
598
   cmJsonH_t      jsH;
599
+  cmJsonNode_t*  takeArray;
599
   cmJsonNode_t*  takeObj;
600
   cmJsonNode_t*  takeObj;
600
   cmJsonNode_t*  array;
601
   cmJsonNode_t*  array;
601
-
602
+  
602
   cmSpAssoc_t*   bap;  
603
   cmSpAssoc_t*   bap;  
603
   cmSpAssoc_t*   eap;
604
   cmSpAssoc_t*   eap;
604
   cmSpNoteMap_t* bmp;
605
   cmSpNoteMap_t* bmp;
641
         m->mni    = 0;
642
         m->mni    = 0;
642
         m->failFl = false;
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
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Take insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
648
           rc = cmErrMsg(&m->ctx->err,kJsonFailSpRC,"Take insert failed on seq:%i '%s' : '%s'.", tlObjPtr->seqId, cmStringNullGuard(tlObjPtr->text),cmStringNullGuard(markPtr->text));
648
           goto errLabel; 
649
           goto errLabel; 
755
 
756
 
756
   // store the time-line and score file name
757
   // store the time-line and score file name
757
   if( cmJsonInsertPairs(m->jsH, cmJsonRoot(m->jsH), 
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
       NULL ) != kOkJsRC )
762
       NULL ) != kOkJsRC )
761
   {
763
   {
762
     cmErrMsg(&m->ctx->err,kJsonFailSpRC,"File name JSON field insertion failed.");
764
     cmErrMsg(&m->ctx->err,kJsonFailSpRC,"File name JSON field insertion failed.");
763
     goto errLabel;
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
   // run the score processor
775
   // run the score processor
767
   _cmScoreProcProcess(ctx,sp);
776
   _cmScoreProcProcess(ctx,sp);
768
 
777
 

Loading…
Cancel
Save