Browse Source

cmDspClass.h,cmDspUi.c,cmDspKr.c : Added 'meas' inputs to cmDspScore and cmDspTimeline to allow the current score and timeline location to be set programattically.

master
kevin 8 years ago
parent
commit
068cff567b
3 changed files with 24 additions and 11 deletions
  1. 2
    2
      dsp/cmDspClass.h
  2. 16
    5
      dsp/cmDspKr.c
  3. 6
    4
      dsp/cmDspUi.c

+ 2
- 2
dsp/cmDspClass.h View File

403
   cmDspRC_t  cmDspUiMeterCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned minVarId,  unsigned maxVarId,  unsigned valVarId,  unsigned lblVarId );
403
   cmDspRC_t  cmDspUiMeterCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned minVarId,  unsigned maxVarId,  unsigned valVarId,  unsigned lblVarId );
404
   cmDspRC_t  cmDspUiButtonCreate(      cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned typeDuiId, unsigned outVarId, unsigned lblVarId );
404
   cmDspRC_t  cmDspUiButtonCreate(      cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned typeDuiId, unsigned outVarId, unsigned lblVarId );
405
   cmDspRC_t  cmDspUiLabelCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned lblVarId,  unsigned alignVarId );
405
   cmDspRC_t  cmDspUiLabelCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned lblVarId,  unsigned alignVarId );
406
-  cmDspRC_t  cmDspUiTimeLineCreate(    cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned tlFileVarId,  unsigned audPathVarId, unsigned selVarId, unsigned cursVarId );
407
-  cmDspRC_t  cmDspUiScoreCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned scFileVarId,  unsigned selVarId, unsigned smpIdxVarId, unsigned pitchVarId, unsigned velVarId, unsigned locIdxVarIdx, unsigned evtIdxVarIdx, unsigned dynLvlVarIdx, unsigned valTypeVarIdx, unsigned valueVarIdx );
406
+  cmDspRC_t  cmDspUiTimeLineCreate(    cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned tlFileVarId,  unsigned audPathVarId, unsigned selVarId, unsigned measVarId, unsigned cursVarId );
407
+  cmDspRC_t  cmDspUiScoreCreate(       cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned scFileVarId,  unsigned selVarId, unsigned smpIdxVarId, unsigned pitchVarId, unsigned velVarId, unsigned locIdxVarIdx, unsigned evtIdxVarIdx, unsigned dynLvlVarIdx, unsigned valTypeVarIdx, unsigned valueVarIdx, unsigned kMeasScId );
408
   cmDspRC_t  cmDspUiTakeSeqBldrCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned fileNameVarId, unsigned ptrVarId, unsigned selVarId, unsigned refreshVarId );
408
   cmDspRC_t  cmDspUiTakeSeqBldrCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned fileNameVarId, unsigned ptrVarId, unsigned selVarId, unsigned refreshVarId );
409
   cmDspRC_t  cmDspUiTakeSeqRendCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned ptrVarId,      unsigned refreshVarId, unsigned selVarId  );
409
   cmDspRC_t  cmDspUiTakeSeqRendCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned ptrVarId,      unsigned refreshVarId, unsigned selVarId  );
410
   cmDspRC_t  cmDspUi2dCreate(          cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned xVarId,        unsigned yVarId,       unsigned radiusVarId, unsigned angleVarId);
410
   cmDspRC_t  cmDspUi2dCreate(          cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned xVarId,        unsigned yVarId,       unsigned radiusVarId, unsigned angleVarId);

+ 16
- 5
dsp/cmDspKr.c View File

290
   kTlFileTlId,
290
   kTlFileTlId,
291
   kPrefixPathTlId,
291
   kPrefixPathTlId,
292
   kSelTlId,
292
   kSelTlId,
293
+  kMeasTlId,
293
   kCursTlId,
294
   kCursTlId,
294
   kResetTlId,
295
   kResetTlId,
295
   kAudFnTlId,
296
   kAudFnTlId,
299
   kBegAudSmpIdxTlId,
300
   kBegAudSmpIdxTlId,
300
   kEndAudSmpIdxTlId,
301
   kEndAudSmpIdxTlId,
301
   kBegMidiSmpIdxTlId,
302
   kBegMidiSmpIdxTlId,
302
-  kEndMidiSmpIdxTlId
303
+  kEndMidiSmpIdxTlId,
303
 };
304
 };
304
 
305
 
305
 cmDspClass_t _cmTimeLineDC;
306
 cmDspClass_t _cmTimeLineDC;
318
     { "tlfile",  kTlFileTlId,         0, 0, kInDsvFl   | kStrzDsvFl | kReqArgDsvFl, "Time line file." },
319
     { "tlfile",  kTlFileTlId,         0, 0, kInDsvFl   | kStrzDsvFl | kReqArgDsvFl, "Time line file." },
319
     { "path",    kPrefixPathTlId,     0, 0, kInDsvFl   | kStrzDsvFl | kReqArgDsvFl, "Time line data file prefix path"    },
320
     { "path",    kPrefixPathTlId,     0, 0, kInDsvFl   | kStrzDsvFl | kReqArgDsvFl, "Time line data file prefix path"    },
320
     { "sel",     kSelTlId,            0, 0, kInDsvFl   | kOutDsvFl  | kUIntDsvFl,   "Selected marker id."},
321
     { "sel",     kSelTlId,            0, 0, kInDsvFl   | kOutDsvFl  | kUIntDsvFl,   "Selected marker id."},
322
+    { "meas",    kMeasTlId,           0, 0, kInDsvFl   | kUIntDsvFl,  "Select a bar marker and generate a 'sel' output."},
321
     { "curs",    kCursTlId,           0, 0, kInDsvFl   | kUIntDsvFl,  "Current audio file index."},
323
     { "curs",    kCursTlId,           0, 0, kInDsvFl   | kUIntDsvFl,  "Current audio file index."},
322
     { "reset",   kResetTlId,          0, 0, kInDsvFl   | kSymDsvFl,   "Resend all outputs." },
324
     { "reset",   kResetTlId,          0, 0, kInDsvFl   | kSymDsvFl,   "Resend all outputs." },
323
     { "afn",     kAudFnTlId,          0, 0, kOutDsvFl  | kStrzDsvFl,  "Selected Audio file." },
325
     { "afn",     kAudFnTlId,          0, 0, kOutDsvFl  | kStrzDsvFl,  "Selected Audio file." },
345
   cmDspSetDefaultInt(  ctx, &p->inst,  kEndMidiSmpIdxTlId, 0, cmInvalidIdx);
347
   cmDspSetDefaultInt(  ctx, &p->inst,  kEndMidiSmpIdxTlId, 0, cmInvalidIdx);
346
 
348
 
347
   // create the UI control
349
   // create the UI control
348
-  cmDspUiTimeLineCreate(ctx,&p->inst,kTlFileTlId,kPrefixPathTlId,kSelTlId,kCursTlId);
350
+  cmDspUiTimeLineCreate(ctx,&p->inst,kTlFileTlId,kPrefixPathTlId,kSelTlId,kMeasTlId,kCursTlId);
349
 
351
 
350
   p->tlH = cmTimeLineNullHandle;
352
   p->tlH = cmTimeLineNullHandle;
351
 
353
 
442
       }
444
       }
443
       
445
       
444
       break;
446
       break;
445
-
447
+      
448
+    case kMeasTlId:
449
+      cmDspSetEvent(ctx,inst,evt);
450
+      break;
451
+      
446
     default:
452
     default:
447
       {assert(0);}
453
       {assert(0);}
448
   }
454
   }
483
   kEvtIdxScId,
489
   kEvtIdxScId,
484
   kDynScId,
490
   kDynScId,
485
   kValTypeScId,
491
   kValTypeScId,
486
-  kValueScId
492
+  kValueScId,
493
+  kMeasScId,
487
 };
494
 };
488
 
495
 
489
 cmDspClass_t _cmScoreDC;
496
 cmDspClass_t _cmScoreDC;
513
     { "dyn",     kDynScId,    0, 0, kOutDsvFl | kUIntDsvFl,                "Dynamic level of previous event index."},
520
     { "dyn",     kDynScId,    0, 0, kOutDsvFl | kUIntDsvFl,                "Dynamic level of previous event index."},
514
     { "type",    kValTypeScId,0, 0, kOutDsvFl | kUIntDsvFl,                "Output variable type."},
521
     { "type",    kValTypeScId,0, 0, kOutDsvFl | kUIntDsvFl,                "Output variable type."},
515
     { "value",   kValueScId,  0, 0, kOutDsvFl | kDoubleDsvFl,              "Output variable value."},
522
     { "value",   kValueScId,  0, 0, kOutDsvFl | kDoubleDsvFl,              "Output variable value."},
523
+    { "meas",    kMeasScId,   0, 0, kInDsvFl  | kUIntDsvFl,                "Trigger this measures location to emit from 'sel'."},
516
     { NULL, 0, 0, 0, 0 }
524
     { NULL, 0, 0, 0, 0 }
517
   };
525
   };
518
 
526
 
523
   p->printSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"dump");
531
   p->printSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"dump");
524
 
532
 
525
   // create the UI control
533
   // create the UI control
526
-  cmDspUiScoreCreate(ctx,&p->inst,kFnScId,kSelScId,kSmpIdxScId,kD0ScId,kD1ScId,kLocIdxScId,kEvtIdxScId,kDynScId,kValTypeScId,kValueScId);
534
+  cmDspUiScoreCreate(ctx,&p->inst,kFnScId,kSelScId,kSmpIdxScId,kD0ScId,kD1ScId,kLocIdxScId,kEvtIdxScId,kDynScId,kValTypeScId,kValueScId,kMeasScId);
527
 
535
 
528
   p->scH = cmScNullHandle;
536
   p->scH = cmScNullHandle;
529
 
537
 
637
         cmScorePrintLoc(p->scH);
645
         cmScorePrintLoc(p->scH);
638
       break;
646
       break;
639
 
647
 
648
+    case kMeasScId:
649
+      break;
650
+
640
   }
651
   }
641
 
652
 
642
   return kOkDspRC;
653
   return kOkDspRC;

+ 6
- 4
dsp/cmDspUi.c View File

362
   return rc;
362
   return rc;
363
 }
363
 }
364
 
364
 
365
-cmDspRC_t  cmDspUiTimeLineCreate(   cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned tlFileVarId, unsigned audPathVarId, unsigned selVarId, unsigned cursVarId )
365
+cmDspRC_t  cmDspUiTimeLineCreate(   cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned tlFileVarId, unsigned audPathVarId, unsigned selVarId, unsigned measVarId, unsigned cursVarId )
366
 {
366
 {
367
   cmDspRC_t    rc;
367
   cmDspRC_t    rc;
368
-  unsigned     arr[] = { tlFileVarId, audPathVarId, selVarId, cursVarId  };
368
+  unsigned     arr[] = { tlFileVarId, audPathVarId, selVarId, measVarId, cursVarId  };
369
   cmDspValue_t v;
369
   cmDspValue_t v;
370
   unsigned     vn    = sizeof(arr)/sizeof(arr[0]);
370
   unsigned     vn    = sizeof(arr)/sizeof(arr[0]);
371
   cmDsvSetUIntMtx(&v,arr,vn,1);
371
   cmDsvSetUIntMtx(&v,arr,vn,1);
383
   cmDspInstVarSetFlags( ctx, inst, tlFileVarId,  kUiDsvFl );
383
   cmDspInstVarSetFlags( ctx, inst, tlFileVarId,  kUiDsvFl );
384
   cmDspInstVarSetFlags( ctx, inst, audPathVarId, kUiDsvFl );
384
   cmDspInstVarSetFlags( ctx, inst, audPathVarId, kUiDsvFl );
385
   cmDspInstVarSetFlags( ctx, inst, selVarId,     kUiDsvFl );
385
   cmDspInstVarSetFlags( ctx, inst, selVarId,     kUiDsvFl );
386
+  cmDspInstVarSetFlags( ctx, inst, measVarId,     kUiDsvFl );
386
   cmDspInstVarSetFlags( ctx, inst, cursVarId,     kUiDsvFl );
387
   cmDspInstVarSetFlags( ctx, inst, cursVarId,     kUiDsvFl );
387
   return rc;
388
   return rc;
388
 }
389
 }
389
 
390
 
390
-cmDspRC_t  cmDspUiScoreCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned scFileVarId, unsigned selVarId, unsigned smpIdxVarId, unsigned pitchVarId, unsigned velVarId, unsigned locIdxVarId, unsigned evtIdxVarId, unsigned dynVarId, unsigned valTypeVarId, unsigned valueVarId )
391
+cmDspRC_t  cmDspUiScoreCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned scFileVarId, unsigned selVarId, unsigned smpIdxVarId, unsigned pitchVarId, unsigned velVarId, unsigned locIdxVarId, unsigned evtIdxVarId, unsigned dynVarId, unsigned valTypeVarId, unsigned valueVarId, unsigned measVarId )
391
 {
392
 {
392
   cmDspRC_t    rc;
393
   cmDspRC_t    rc;
393
-  unsigned     arr[] = { scFileVarId, selVarId, smpIdxVarId, pitchVarId, velVarId, locIdxVarId, evtIdxVarId, dynVarId, valTypeVarId, valueVarId };
394
+  unsigned     arr[] = { scFileVarId, selVarId, smpIdxVarId, pitchVarId, velVarId, locIdxVarId, evtIdxVarId, dynVarId, valTypeVarId, valueVarId, measVarId };
394
   cmDspValue_t v;
395
   cmDspValue_t v;
395
   unsigned     vn    = sizeof(arr)/sizeof(arr[0]);
396
   unsigned     vn    = sizeof(arr)/sizeof(arr[0]);
396
   cmDsvSetUIntMtx(&v,arr,vn,1);
397
   cmDsvSetUIntMtx(&v,arr,vn,1);
411
   cmDspInstVarSetFlags( ctx, inst, dynVarId,     kUiDsvFl );
412
   cmDspInstVarSetFlags( ctx, inst, dynVarId,     kUiDsvFl );
412
   cmDspInstVarSetFlags( ctx, inst, valTypeVarId, kUiDsvFl );
413
   cmDspInstVarSetFlags( ctx, inst, valTypeVarId, kUiDsvFl );
413
   cmDspInstVarSetFlags( ctx, inst, valueVarId,   kUiDsvFl );
414
   cmDspInstVarSetFlags( ctx, inst, valueVarId,   kUiDsvFl );
415
+  cmDspInstVarSetFlags( ctx, inst, measVarId,    kUiDsvFl );
414
 
416
 
415
   return rc;
417
   return rc;
416
 }
418
 }

Loading…
Cancel
Save