Переглянути джерело

cmDspKr.c : Added 'cmd' input to cmDspScore object to print score location report upon reception of 'dump' symbol.

 f
master
kevin 11 роки тому
джерело
коміт
0a71501780
1 змінених файлів з 10 додано та 0 видалено
  1. 10
    0
      dsp/cmDspKr.c

+ 10
- 0
dsp/cmDspKr.c Переглянути файл

@@ -473,6 +473,7 @@ enum
473 473
   kD1ScId,
474 474
   kSmpIdxScId,
475 475
   kLocIdxScId,
476
+  kCmdScId,
476 477
   kEvtIdxScId,
477 478
   kDynScId,
478 479
   kValTypeScId,
@@ -486,6 +487,7 @@ typedef struct
486 487
   cmDspInst_t inst;
487 488
   cmScH_t     scH;
488 489
   cmDspCtx_t* ctx;   // temporary ctx ptr used during cmScore callback in _cmDspScoreRecv()
490
+  unsigned printSymId;
489 491
 } cmDspScore_t;
490 492
 
491 493
 cmDspInst_t*  _cmDspScoreAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
@@ -500,6 +502,7 @@ cmDspInst_t*  _cmDspScoreAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned
500 502
     { "d1",      kD1ScId,     0, 0, kInDsvFl  | kUIntDsvFl,                "Performed MIDI msg data byte 1" },
501 503
     { "smpidx",  kSmpIdxScId, 0, 0, kInDsvFl  | kUIntDsvFl,                "Performed MIDi msg time tag as a sample index." }, 
502 504
     { "loc",     kLocIdxScId, 0, 0, kInDsvFl  | kUIntDsvFl,                "Performance score location."},
505
+    { "cmd",     kCmdScId,    0, 0, kInDsvFl  | kSymDsvFl,                 "cmd: dump "},
503 506
     { "evtidx",  kEvtIdxScId, 0, 0, kOutDsvFl | kUIntDsvFl,                "Performed event index of following dynamcis level."},
504 507
     { "dyn",     kDynScId,    0, 0, kOutDsvFl | kUIntDsvFl,                "Dynamic level of previous event index."},
505 508
     { "type",    kValTypeScId,0, 0, kOutDsvFl | kUIntDsvFl,                "Output variable type."},
@@ -511,6 +514,8 @@ cmDspInst_t*  _cmDspScoreAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned
511 514
   
512 515
   cmDspSetDefaultUInt( ctx, &p->inst,  kSelScId,           0, cmInvalidId);
513 516
 
517
+  p->printSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"dump");
518
+
514 519
   // create the UI control
515 520
   cmDspUiScoreCreate(ctx,&p->inst,kFnScId,kSelScId,kSmpIdxScId,kD0ScId,kD1ScId,kLocIdxScId,kEvtIdxScId,kDynScId,kValTypeScId,kValueScId);
516 521
 
@@ -621,6 +626,11 @@ cmDspRC_t _cmDspScoreRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
621 626
       }
622 627
       break;
623 628
 
629
+    case kCmdScId:
630
+      if( cmDspSymbol(inst,kCmdScId) == p->printSymId )
631
+        cmScorePrintLoc(p->scH);
632
+      break;
633
+
624 634
   }
625 635
 
626 636
   return kOkDspRC;

Завантаження…
Відмінити
Зберегти