Browse Source

cmTakeSeqBldr.c : Added 'muid' to cmScTrkMidiTsb_t.

Fixed bug in _cmTsbScoreTrkFree().
master
Kevin Larke 9 years ago
parent
commit
9b86614e57
1 changed files with 9 additions and 4 deletions
  1. 9
    4
      app/cmTakeSeqBldr.c

+ 9
- 4
app/cmTakeSeqBldr.c View File

21
 // Score track record: Map a score event to a MIDI event. 
21
 // Score track record: Map a score event to a MIDI event. 
22
 typedef struct cmScTrkMidiTsb_str
22
 typedef struct cmScTrkMidiTsb_str
23
 {
23
 {
24
-  unsigned mni;      // midi note index as an offset from the take marker
24
+  unsigned mni;      // MIDI note index as an offset from the take marker
25
+  unsigned muid;     // MIDI file msg  unique id
25
   unsigned scEvtIdx; // score event index this not is assoc'd with or -1 if it did not match
26
   unsigned scEvtIdx; // score event index this not is assoc'd with or -1 if it did not match
26
   unsigned flags;    // flags from cmScMatcherResult_t 
27
   unsigned flags;    // flags from cmScMatcherResult_t 
27
 } cmScTrkMidiTsb_t;
28
 } cmScTrkMidiTsb_t;
114
     goto errLabel;
115
     goto errLabel;
115
   }
116
   }
116
   
117
   
117
-  for(i=0; i<p->scTrkTakeN; ++i)
118
-    cmMemPtrFree(&p->scTrkTakeV[i].midiV);
118
+  if( p->scTrkTakeV != NULL )
119
+  {
120
+    for(i=0; i<p->scTrkTakeN; ++i)
121
+      cmMemPtrFree(&p->scTrkTakeV[i].midiV);
119
 
122
 
120
-  cmMemPtrFree(&p->scTrkTakeV);
123
+    cmMemPtrFree(&p->scTrkTakeV);
124
+  }
121
 
125
 
122
   if( cmTimeLineFinalize(&p->tlH) != kOkTlRC )
126
   if( cmTimeLineFinalize(&p->tlH) != kOkTlRC )
123
     rc = cmErrMsg(&p->err,kTimeLineFailTsbRC,"Time line object finalize failed.");
127
     rc = cmErrMsg(&p->err,kTimeLineFailTsbRC,"Time line object finalize failed.");
231
       // parse the note record
235
       // parse the note record
232
       if((jsRC = cmJsonMemberValues( noteObj, &errMsg,
236
       if((jsRC = cmJsonMemberValues( noteObj, &errMsg,
233
             "mni",      kIntTId, &p->scTrkTakeV[i].midiV[j].mni,
237
             "mni",      kIntTId, &p->scTrkTakeV[i].midiV[j].mni,
238
+            "muid",     kIntTId, &p->scTrkTakeV[i].midiV[j].muid,
234
             "scEvtIdx", kIntTId, &p->scTrkTakeV[i].midiV[j].scEvtIdx,
239
             "scEvtIdx", kIntTId, &p->scTrkTakeV[i].midiV[j].scEvtIdx,
235
             "flags",    kIntTId, &p->scTrkTakeV[i].midiV[j].flags,
240
             "flags",    kIntTId, &p->scTrkTakeV[i].midiV[j].flags,
236
             NULL)) != kOkJsRC )
241
             NULL)) != kOkJsRC )

Loading…
Cancel
Save