Browse Source

cmScore.h/c:Added score file line number to cmScoreEvt_t.

master
kpl 11 years ago
parent
commit
e54b4da348
2 changed files with 16 additions and 6 deletions
  1. 15
    4
      app/cmScore.c
  2. 1
    2
      app/cmScore.h

+ 15
- 4
app/cmScore.c View File

980
       break;
980
       break;
981
     }
981
     }
982
 
982
 
983
+    // set the score file line number
984
+    p->array[j].line = i + 1;
985
+
983
     secs = DBL_MAX;
986
     secs = DBL_MAX;
984
 
987
 
985
     switch(tid)
988
     switch(tid)
1236
   cmSc_t* p = _cmScHandleToPtr(h);
1239
   cmSc_t* p = _cmScHandleToPtr(h);
1237
   unsigned i = 0;
1240
   unsigned i = 0;
1238
   for(; i<p->cnt; ++i)
1241
   for(; i<p->cnt; ++i)
1239
-    if( p->array[i].typeId==kBarEvtScId && p->array[i].barNumb==barNumb )
1242
+    if( p->array[i].type==kBarEvtScId && p->array[i].barNumb==barNumb )
1240
       return p->array + i;
1243
       return p->array + i;
1241
 
1244
 
1242
   return NULL;
1245
   return NULL;
1905
 {
1908
 {
1906
   cmSc_t* p = _cmScHandleToPtr(h);
1909
   cmSc_t* p = _cmScHandleToPtr(h);
1907
   unsigned i;
1910
   unsigned i;
1908
-  for(i=0; i<20 /*p->cnt*/; ++i)
1911
+  for(i=0; i<p->cnt; ++i)
1909
   {
1912
   {
1910
     cmScoreEvt_t* r = p->array + i;
1913
     cmScoreEvt_t* r = p->array + i;
1911
     switch(r->type)
1914
     switch(r->type)
1912
     {
1915
     {
1916
+      case kBarEvtScId:
1917
+        cmRptPrintf(rpt,"%5i %5i %3i bar\n",
1918
+          i,
1919
+          r->line,
1920
+          r->barNumb );
1921
+        break;
1922
+
1913
       case kNonEvtScId:
1923
       case kNonEvtScId:
1914
-        cmRptPrintf(rpt,"%5i %3i %3i %s 0x%2x %c%c%c %s\n",
1924
+        cmRptPrintf(rpt,"%5i %5i %3i %3i %s %5s %c%c%c %s\n",
1915
           i,
1925
           i,
1926
+          r->line,
1916
           r->barNumb,
1927
           r->barNumb,
1917
           r->barNoteIdx,
1928
           r->barNoteIdx,
1918
           cmScEvtTypeIdToLabel(r->type),
1929
           cmScEvtTypeIdToLabel(r->type),
1919
-          r->pitch,
1930
+          cmMidiToSciPitch(r->pitch,NULL,0),
1920
           cmIsFlag(r->flags,kEvenScFl)  ? 'e' : ' ',
1931
           cmIsFlag(r->flags,kEvenScFl)  ? 'e' : ' ',
1921
           cmIsFlag(r->flags,kTempoScFl) ? 't' : ' ',
1932
           cmIsFlag(r->flags,kTempoScFl) ? 't' : ' ',
1922
           cmIsFlag(r->flags,kDynScFl)   ? 'd' : ' ',
1933
           cmIsFlag(r->flags,kDynScFl)   ? 'd' : ' ',

+ 1
- 2
app/cmScore.h View File

87
     unsigned     perfSmpIdx;   // Time this event was performed or cmInvalidIdx if the event was not performed.
87
     unsigned     perfSmpIdx;   // Time this event was performed or cmInvalidIdx if the event was not performed.
88
     unsigned     perfVel;      // Velocity of the performed note or 0 if the note was not performed.
88
     unsigned     perfVel;      // Velocity of the performed note or 0 if the note was not performed.
89
     unsigned     perfDynLvl;   // Index into dynamic level ref. array assoc'd with perfVel  
89
     unsigned     perfDynLvl;   // Index into dynamic level ref. array assoc'd with perfVel  
90
+    unsigned     line;         // Line number of this event in the score file.
90
   } cmScoreEvt_t;
91
   } cmScoreEvt_t;
91
 
92
 
92
   typedef struct cmScoreSet_str
93
   typedef struct cmScoreSet_str
175
   // cmScMsg_t record.
176
   // cmScMsg_t record.
176
   cmScRC_t      cmScoreSeqNotify( cmScH_t h );
177
   cmScRC_t      cmScoreSeqNotify( cmScH_t h );
177
 
178
 
178
-  /*
179
   void          cmScoreClearPerfInfo( cmScH_t h );
179
   void          cmScoreClearPerfInfo( cmScH_t h );
180
 
180
 
181
   // Assign 'smpIdx' and 'vel'  to the event matching 'pitch' at 'locIdx'
181
   // Assign 'smpIdx' and 'vel'  to the event matching 'pitch' at 'locIdx'
193
   
193
   
194
   // Set the performed dynamic level of a score event.
194
   // Set the performed dynamic level of a score event.
195
   void          cmScoreSetPerfDynLevel( cmScH_t h, unsigned evtIdx, unsigned dynLvl );
195
   void          cmScoreSetPerfDynLevel( cmScH_t h, unsigned evtIdx, unsigned dynLvl );
196
-  */
197
   
196
   
198
   typedef enum
197
   typedef enum
199
   {
198
   {

Loading…
Cancel
Save