Bläddra i källkod

cmDspKr.c : Added ability to preload a cmRecdPlay segment from an audio file.

master
kevin 10 år sedan
förälder
incheckning
a19d93b265
1 ändrade filer med 15 tillägg och 0 borttagningar
  1. 15
    0
      dsp/cmDspKr.c

+ 15
- 0
dsp/cmDspKr.c Visa fil

@@ -2485,6 +2485,8 @@ enum
2485 2485
   kMaxLaSecsPrId,
2486 2486
   kCurLaSecsPrId,
2487 2487
   kFadeRatePrId,
2488
+  kSegFnPrId,
2489
+  kSegLblPrId,
2488 2490
   kScLocIdxPrId,
2489 2491
   kCmdPrId,
2490 2492
   kInAudioBasePrId
@@ -2537,6 +2539,15 @@ cmDspRC_t _cmDspRecdPlayOpenScore( cmDspCtx_t* ctx, cmDspInst_t* inst )
2537 2539
     for(i=0; i<markerCnt; ++i)
2538 2540
       cmRecdPlayRegisterFrag(p->rcdply,i, cmScoreMarkerLabelSymbolId(p->scH,i ));
2539 2541
 
2542
+    const cmChar_t* segFn = cmDspStrcz(inst,kSegFnPrId);
2543
+    const cmChar_t* segLbl= cmDspStrcz(inst,kSegLblPrId);
2544
+    
2545
+    if( cmTextLength(segFn)>0 && cmTextLength(segLbl)>0 )
2546
+    {
2547
+      unsigned segSymId = cmSymTblRegisterSymbol(ctx->stH,segLbl);
2548
+      cmRecdPlayInsertRecord(p->rcdply,segSymId,segFn);
2549
+    }
2550
+
2540 2551
   }
2541 2552
 
2542 2553
   return rc;
@@ -2565,6 +2576,8 @@ cmDspInst_t*  _cmDspRecdPlayAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsig
2565 2576
     1,         "maxla",  kMaxLaSecsPrId,  0,0, kInDsvFl   | kDoubleDsvFl | kReqArgDsvFl, "Maximum look-ahead buffer in seconds.",
2566 2577
     1,         "curla",  kCurLaSecsPrId,  0,0, kInDsvFl   | kDoubleDsvFl | kOptArgDsvFl, "Current look-head buffer in seconds.",
2567 2578
     1,         "frate",  kFadeRatePrId,   0,0, kInDsvFl   | kDoubleDsvFl | kOptArgDsvFl, "Fade rate in dB per second.",
2579
+    1,         "segFn",  kSegFnPrId,      0,0, kInDsvFl   | kStrzDsvFl   | kOptArgDsvFl, "Preload an audio segment.",
2580
+    1,         "segLbl", kSegLblPrId,     0,0, kInDsvFl   | kStrzDsvFl   | kOptArgDsvFl, "Score symbol of preloaded audio segment.",
2568 2581
     1,         "index",  kScLocIdxPrId,   0,0, kInDsvFl   | kUIntDsvFl,                "Score follower location index.",
2569 2582
     1,         "cmd",    kCmdPrId,        0,0, kInDsvFl   | kSymDsvFl,                 "on=reset off=stop.",
2570 2583
     chCnt,     "in",     kInAudioBasePrId,0,1, kInDsvFl   | kAudioBufDsvFl,            "Audio input",
@@ -2589,6 +2602,8 @@ cmDspInst_t*  _cmDspRecdPlayAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsig
2589 2602
   printf("1 max la secs:%f\n",cmDspDouble(&p->inst,kMaxLaSecsPrId));
2590 2603
 
2591 2604
 
2605
+
2606
+
2592 2607
   return &p->inst;
2593 2608
 }
2594 2609
 

Laddar…
Avbryt
Spara