瀏覽代碼

Added cmDspUi2 two-dimensional drag UI control.

master
Kevin Larke 9 年之前
父節點
當前提交
2c1be3cf84
共有 3 個檔案被更改,包括 23 行新增0 行删除
  1. 1
    0
      cmMsgProtocol.h
  2. 1
    0
      dsp/cmDspClass.h
  3. 21
    0
      dsp/cmDspUi.c

+ 1
- 0
cmMsgProtocol.h 查看文件

@@ -23,6 +23,7 @@ extern "C" {
23 23
     kScoreDuiId,       // ui<--eng create a score control
24 24
     kTakeSeqBldrDuiId, // ui<--eng create a take sequence builder
25 25
     kTakeSeqRendDuiId, // ui<--eng create a take sequence renderer
26
+    kTwodDuiId,        // ui<--eng create a 2d control
26 27
     kNumberDuiId,      // ui<--eng create a number box
27 28
     kTextDuiId,        // ui<--eng create a text entry control
28 29
     kFnameDuiId,       // ui<--eng create a file/directory picker control

+ 1
- 0
dsp/cmDspClass.h 查看文件

@@ -405,6 +405,7 @@ extern "C" {
405 405
   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 406
   cmDspRC_t  cmDspUiTakeSeqBldrCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned fileNameVarId, unsigned ptrVarId, unsigned selVarId, unsigned refreshVarId );
407 407
   cmDspRC_t  cmDspUiTakeSeqRendCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned ptrVarId,      unsigned refreshVarId, unsigned selVarId  );
408
+  cmDspRC_t  cmDspUi2dCreate(          cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned xVarId,        unsigned yVarId,       unsigned radiusVarId, unsigned angleVarId);
408 409
 
409 410
   cmDspRC_t  cmDspUiNewColumn(        cmDspCtx_t* ctx, unsigned colW );
410 411
   cmDspRC_t  cmDspUiInsertHorzBorder( cmDspCtx_t* ctx );

+ 21
- 0
dsp/cmDspUi.c 查看文件

@@ -457,6 +457,27 @@ cmDspRC_t  cmDspUiTakeSeqRendCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigne
457 457
   return rc;
458 458
 }
459 459
 
460
+cmDspRC_t  cmDspUi2dCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned xVarId, unsigned yVarId, unsigned radiusVarId, unsigned angleVarId)
461
+{
462
+  cmDspRC_t    rc;
463
+  unsigned     arr[] = { xVarId, yVarId, radiusVarId, angleVarId  };
464
+  cmDspValue_t v;
465
+  unsigned     vn    = sizeof(arr)/sizeof(arr[0]);
466
+  cmDsvSetUIntMtx(&v,arr,vn,1);
467
+
468
+  // tell the UI to create a sequence render  control
469
+  if((rc = _cmDspUiMsg( ctx, kUiSelAsId, kTwodDuiId, 0, inst, cmInvalidId, &v )) != kOkDspRC )
470
+    return cmDspInstErr(ctx,inst,kUiEleCreateFailDspRC,"2-d UI element create failed.");
471
+
472
+  // Setting kUiDsvFl will cause variable values to be sent to the UI whenever they change.
473
+  cmDspInstVarSetFlags( ctx, inst, xVarId,      kUiDsvFl );
474
+  cmDspInstVarSetFlags( ctx, inst, yVarId,      kUiDsvFl );
475
+  cmDspInstVarSetFlags( ctx, inst, radiusVarId, kUiDsvFl );
476
+  cmDspInstVarSetFlags( ctx, inst, angleVarId,  kUiDsvFl );
477
+
478
+  return rc;
479
+}
480
+
460 481
 
461 482
 cmDspRC_t  cmDspUiNewColumn(    cmDspCtx_t* ctx, unsigned colW )
462 483
 {

Loading…
取消
儲存