Преглед на файлове

cmDspKr.c:Added 'rewind' command to _cmDspActiveMeas.

master
kevin преди 11 години
родител
ревизия
fbf2b570a9
променени са 1 файла, в които са добавени 9 реда и са изтрити 4 реда
  1. 9
    4
      dsp/cmDspKr.c

+ 9
- 4
dsp/cmDspKr.c Целия файл

@@ -903,7 +903,7 @@ cmDspInst_t*  _cmDspScFolAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned
903 903
     { "d1",    kD1SfId,       0, 0, kInDsvFl | kUIntDsvFl,                    "MIDI data byte 1"},
904 904
     { "smpidx",kSmpIdxSfId,   0, 0, kInDsvFl | kUIntDsvFl,                    "MIDI time tag as a sample index"},
905 905
     { "cmd",   kCmdSfId,      0, 0, kInDsvFl | kSymDsvFl,                     "Command input: print | quiet"},
906
-    { "out",   kOutSfId,      0, 0, kOutDsvFl| kUIntDsvFl,                    "Current score index."},
906
+    { "out",   kOutSfId,      0, 0, kOutDsvFl| kUIntDsvFl,                    "Current score location index."},
907 907
     { "dyn",   kDynSfId,      0, 0, kOutDsvFl| kDoubleDsvFl,                  "Dynamic value."},
908 908
     { "even",  kEvenSfId,     0, 0, kOutDsvFl| kDoubleDsvFl,                  "Evenness value."},
909 909
     { "tempo", kTempoSfId,    0, 0, kOutDsvFl| kDoubleDsvFl,                  "Tempo value."},
@@ -1660,7 +1660,8 @@ typedef struct
1660 1660
   cmDspInst_t            inst;
1661 1661
   unsigned               addSymId;
1662 1662
   unsigned               clearSymId;
1663
-  unsigned               printSymId;    
1663
+  unsigned               printSymId;
1664
+  unsigned               rewindSymId;
1664 1665
   cmDspActiveMeasRecd_t* array; // array[cnt]
1665 1666
   unsigned               cnt;   
1666 1667
   unsigned               nextEmptyIdx;
@@ -1678,7 +1679,7 @@ cmDspInst_t*  _cmDspActiveMeasAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, uns
1678 1679
     { "type",     kTypeAmId,     0,0, kInDsvFl  | kUIntDsvFl,    "Meas. Type." },
1679 1680
     { "val",      kValueAmId,    0,0, kInDsvFl  | kDoubleDsvFl,  "Meas. Value."},
1680 1681
     { "cst",      kCstAmId,      0,0, kInDsvFl  | kDoubleDsvFl,  "Meas. Cost."},
1681
-    { "cmd",      kCmdAmId,      0,0, kInDsvFl  | kSymDsvFl,     "Commands:add | clear | print"}, 
1682
+    { "cmd",      kCmdAmId,      0,0, kInDsvFl  | kSymDsvFl,     "Commands:add | clear | dump | rewind"}, 
1682 1683
     { "even",     kEvenAmId,     0,0, kOutDsvFl | kDoubleDsvFl,  "Even out"},
1683 1684
     { "dyn",      kDynAmId,      0,0, kOutDsvFl | kDoubleDsvFl,  "Dyn out"},
1684 1685
     { "tempo",    kTempoAmId,    0,0, kOutDsvFl | kDoubleDsvFl,  "Tempo out"},
@@ -1692,7 +1693,8 @@ cmDspInst_t*  _cmDspActiveMeasAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, uns
1692 1693
 
1693 1694
   p->addSymId   = cmSymTblRegisterStaticSymbol(ctx->stH,"add");
1694 1695
   p->clearSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"clear");
1695
-  p->printSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"print");
1696
+  p->printSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"dump");
1697
+  p->rewindSymId= cmSymTblRegisterStaticSymbol(ctx->stH,"rewind");
1696 1698
 
1697 1699
   cmDspSetDefaultUInt(  ctx,&p->inst,kCntAmId,  0,100);
1698 1700
   cmDspSetDefaultDouble(ctx,&p->inst,kEvenAmId, 0,0);
@@ -1821,6 +1823,9 @@ cmDspRC_t _cmDspActiveMeasRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
1821 1823
         else
1822 1824
           if( cmdSymId == p->printSymId )
1823 1825
             rc = _cmDspActiveMeasPrint(ctx,p);
1826
+          else
1827
+            if(cmdSymId == p->rewindSymId )
1828
+              p->nextFullIdx = 0;
1824 1829
       }
1825 1830
       break;
1826 1831
 

Loading…
Отказ
Запис