|
@@ -48,6 +48,7 @@
|
48
|
48
|
#include "cmMidiFile.h"
|
49
|
49
|
#include "cmTimeLine.h"
|
50
|
50
|
#include "cmScore.h"
|
|
51
|
+#include "cmTakeSeqBldr.h"
|
51
|
52
|
#include "cmdIf.h"
|
52
|
53
|
#include "tlCtl.h"
|
53
|
54
|
#include "kcApp.h"
|
|
@@ -58,6 +59,9 @@
|
58
|
59
|
#include "cmGrPlot.h"
|
59
|
60
|
#include "cmGrPage.h"
|
60
|
61
|
#include "cmGrFltk.h"
|
|
62
|
+#include "cmGrFltk.h"
|
|
63
|
+#include "gvHashFunc.h"
|
|
64
|
+#include "cmGrTksbFltk.h"
|
61
|
65
|
|
62
|
66
|
|
63
|
67
|
#define TIMER_PERIOD (1.0/20.0) // 50ms
|
|
@@ -648,8 +652,6 @@ void kcApp::_setTextValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
|
648
|
652
|
}
|
649
|
653
|
}
|
650
|
654
|
|
651
|
|
-
|
652
|
|
-
|
653
|
655
|
void kcApp::_createFnameCtl( const cmDspUiHdr_t* m )
|
654
|
656
|
{
|
655
|
657
|
int x,y,w=0,h=0;
|
|
@@ -1275,6 +1277,125 @@ void kcApp::_setScorValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
|
1275
|
1277
|
}
|
1276
|
1278
|
}
|
1277
|
1279
|
|
|
1280
|
+void kcApp::_createTksb( const cmDspUiHdr_t* m )
|
|
1281
|
+{
|
|
1282
|
+ int x,y,w=0,h=0;
|
|
1283
|
+
|
|
1284
|
+ page_t* pg = _createPage("Bldr");
|
|
1285
|
+
|
|
1286
|
+ ctl_t* cp = _createCtl(m, kTksbTypeId, x,y,w,h, true );
|
|
1287
|
+
|
|
1288
|
+ w = pg->grp->w();
|
|
1289
|
+ h = pg->grp->h();
|
|
1290
|
+
|
|
1291
|
+ // currently we only support one Take sequence builder control because
|
|
1292
|
+ // we have not yet implmenented a method of providing
|
|
1293
|
+ // timer callbacks to a list of UI controls
|
|
1294
|
+ if( _tlCtl != NULL )
|
|
1295
|
+ cp->u.tksb.tlctl = _tlCtl;
|
|
1296
|
+ else
|
|
1297
|
+ {
|
|
1298
|
+ _tlCtl = new tlCtl(_ctx,this,_menu,this);
|
|
1299
|
+
|
|
1300
|
+ cp->u.tksb.tlctl = _tlCtl;
|
|
1301
|
+ }
|
|
1302
|
+
|
|
1303
|
+ Fl_Widget* wdgt = cp->u.tksb.tlctl->initTakeSeqBldrCtlr(x,y,w,h);
|
|
1304
|
+
|
|
1305
|
+ _insertNewCtl(cp,m,wdgt,cp->u.tksb.varIdArray,kTksbVarCnt);
|
|
1306
|
+
|
|
1307
|
+}
|
|
1308
|
+
|
|
1309
|
+void kcApp::_setTksbValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp )
|
|
1310
|
+{
|
|
1311
|
+ unsigned i;
|
|
1312
|
+
|
|
1313
|
+ for(i=0; i<kTksbVarCnt; ++i)
|
|
1314
|
+ if( cp->u.tksb.varIdArray[i] == instVarId )
|
|
1315
|
+ {
|
|
1316
|
+ switch(i)
|
|
1317
|
+ {
|
|
1318
|
+ case kTksbFileArgIdx:
|
|
1319
|
+ break;
|
|
1320
|
+
|
|
1321
|
+ case kTksbPtrArgIdx:
|
|
1322
|
+ if( _tlCtl != NULL )
|
|
1323
|
+ _tlCtl->openTakeSeqBldr(cmDsvPtr(vp));
|
|
1324
|
+ break;
|
|
1325
|
+
|
|
1326
|
+ case kTksbSelArgIdx:
|
|
1327
|
+ // TODO: call cmGrTksbFltk from here to to animate the time cursor
|
|
1328
|
+ // with a new location
|
|
1329
|
+ break;
|
|
1330
|
+
|
|
1331
|
+ case kTksbRefreshArgIdx:
|
|
1332
|
+ break;
|
|
1333
|
+
|
|
1334
|
+ default:
|
|
1335
|
+ { assert(0); }
|
|
1336
|
+ }
|
|
1337
|
+ }
|
|
1338
|
+}
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+void kcApp::_createTksr( const cmDspUiHdr_t* m )
|
|
1342
|
+{
|
|
1343
|
+ int x,y,w=0,h=0;
|
|
1344
|
+
|
|
1345
|
+ page_t* pg = _createPage("Rndr");
|
|
1346
|
+
|
|
1347
|
+ ctl_t* cp = _createCtl(m, kTksrTypeId, x,y,w,h, true );
|
|
1348
|
+
|
|
1349
|
+ w = pg->grp->w();
|
|
1350
|
+ h = pg->grp->h();
|
|
1351
|
+
|
|
1352
|
+ // currently we only support one Take sequence builder control because
|
|
1353
|
+ // we have not yet implmenented a method of providing
|
|
1354
|
+ // timer callbacks to a list of UI controls
|
|
1355
|
+ if( _tlCtl != NULL )
|
|
1356
|
+ cp->u.tksr.tlctl = _tlCtl;
|
|
1357
|
+ else
|
|
1358
|
+ {
|
|
1359
|
+ _tlCtl = new tlCtl(_ctx,this,_menu,this);
|
|
1360
|
+
|
|
1361
|
+ cp->u.tksr.tlctl = _tlCtl;
|
|
1362
|
+ }
|
|
1363
|
+
|
|
1364
|
+ Fl_Widget* wdgt = cp->u.tksr.tlctl->initTakeSeqRendCtlr(x,y,w,h);
|
|
1365
|
+
|
|
1366
|
+ _insertNewCtl(cp,m,wdgt,cp->u.tksr.varIdArray,kTksrVarCnt);
|
|
1367
|
+
|
|
1368
|
+}
|
|
1369
|
+
|
|
1370
|
+void kcApp::_setTksrValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp )
|
|
1371
|
+{
|
|
1372
|
+ unsigned i;
|
|
1373
|
+
|
|
1374
|
+ for(i=0; i<kTksrVarCnt; ++i)
|
|
1375
|
+ if( cp->u.tksr.varIdArray[i] == instVarId )
|
|
1376
|
+ {
|
|
1377
|
+ switch(i)
|
|
1378
|
+ {
|
|
1379
|
+ case kTksrPtrArgIdx:
|
|
1380
|
+ if( _tlCtl != NULL )
|
|
1381
|
+ _tlCtl->openTakeSeqRend(cmDsvPtr(vp));
|
|
1382
|
+ break;
|
|
1383
|
+
|
|
1384
|
+ case kTksrRefreshArgIdx:
|
|
1385
|
+ if( _tlCtl != NULL )
|
|
1386
|
+ _tlCtl->refreshTakeSeqRend();
|
|
1387
|
+ break;
|
|
1388
|
+
|
|
1389
|
+ case kTksrSelArgIdx:
|
|
1390
|
+ break;
|
|
1391
|
+
|
|
1392
|
+ default:
|
|
1393
|
+ { assert(0); }
|
|
1394
|
+ }
|
|
1395
|
+ }
|
|
1396
|
+}
|
|
1397
|
+
|
|
1398
|
+
|
1278
|
1399
|
void kcApp::_newColumn( const cmDspUiHdr_t* m )
|
1279
|
1400
|
{
|
1280
|
1401
|
_incrColW = cmDsvGetUInt(&m->value);
|
|
@@ -1680,6 +1801,14 @@ void kcApp::_onRecvValue( const cmDspUiHdr_t* m )
|
1680
|
1801
|
_setScorValue(cp, m->instVarId, &m->value);
|
1681
|
1802
|
break;
|
1682
|
1803
|
|
|
1804
|
+ case kTksbTypeId:
|
|
1805
|
+ _setTksbValue(cp, m->instVarId, &m->value);
|
|
1806
|
+ break;
|
|
1807
|
+
|
|
1808
|
+ case kTksrTypeId:
|
|
1809
|
+ _setTksrValue(cp, m->instVarId, &m->value);
|
|
1810
|
+ break;
|
|
1811
|
+
|
1683
|
1812
|
default:
|
1684
|
1813
|
assert(0);
|
1685
|
1814
|
}
|
|
@@ -1737,6 +1866,14 @@ void kcApp::_handleUiMsg( const cmDspUiHdr_t* m )
|
1737
|
1866
|
_createScor(m);
|
1738
|
1867
|
break;
|
1739
|
1868
|
|
|
1869
|
+ case kTakeSeqBldrDuiId:
|
|
1870
|
+ _createTksb(m);
|
|
1871
|
+ break;
|
|
1872
|
+
|
|
1873
|
+ case kTakeSeqRendDuiId:
|
|
1874
|
+ _createTksr(m);
|
|
1875
|
+ break;
|
|
1876
|
+
|
1740
|
1877
|
case kValueDuiId:
|
1741
|
1878
|
_onRecvValue(m);
|
1742
|
1879
|
break;
|
|
@@ -2135,24 +2272,56 @@ void kcApp::_ctl_cb(ctl_t* cp)
|
2135
|
2272
|
}
|
2136
|
2273
|
break;
|
2137
|
2274
|
|
|
2275
|
+ case kTksbTypeId:
|
|
2276
|
+ {
|
|
2277
|
+ cmGrTksbFltk* tksbCtl = dynamic_cast<cmGrTksbFltk*>(cp->wdgtPtr);
|
|
2278
|
+
|
|
2279
|
+ switch( tksbCtl->cbTypeId() )
|
|
2280
|
+ {
|
|
2281
|
+ case cmGrTksbFltk::kSelectTId:
|
|
2282
|
+ {
|
|
2283
|
+ instVarId = cp->u.tksb.varIdArray[ kTksbSelArgIdx ];
|
|
2284
|
+ unsigned selEleIdx = cp->u.tksb.tlctl->tksbSelectedEleIndex();
|
|
2285
|
+ cmDsvSetUInt(&value, selEleIdx );
|
|
2286
|
+ }
|
|
2287
|
+ break;
|
|
2288
|
+
|
|
2289
|
+ case cmGrTksbFltk::kRefreshTId:
|
|
2290
|
+ instVarId = cp->u.tksb.varIdArray[ kTksbRefreshArgIdx ];
|
|
2291
|
+ cmDsvSetInt(&value,0);
|
|
2292
|
+ break;
|
|
2293
|
+
|
|
2294
|
+ default:
|
|
2295
|
+ { assert(0); }
|
|
2296
|
+ }
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+ }
|
|
2300
|
+ break;
|
|
2301
|
+
|
|
2302
|
+ case kTksrTypeId:
|
|
2303
|
+ {
|
|
2304
|
+ }
|
|
2305
|
+ break;
|
2138
|
2306
|
|
2139
|
2307
|
default:
|
2140
|
2308
|
{assert(0);}
|
2141
|
2309
|
|
2142
|
2310
|
}
|
2143
|
2311
|
|
2144
|
|
- if( cmAdIfSendMsgToAudioDSP(
|
2145
|
|
- _aiH,
|
2146
|
|
- cp->asSubIdx,
|
2147
|
|
- cp->mstrFl ? kUiMstrSelAsId : kUiSelAsId,
|
2148
|
|
- kValueDuiId,
|
2149
|
|
- 0,
|
2150
|
|
- cp->instId,
|
2151
|
|
- instVarId,
|
2152
|
|
- &value) != kOkAiRC)
|
2153
|
|
- {
|
2154
|
|
- cmErrMsg(&_ctx->err,kEngFailKmRC,"An attempt to send a UI message to the audio DSP interface failed.");
|
2155
|
|
- }
|
|
2312
|
+ if( instVarId != cmInvalidId )
|
|
2313
|
+ if( cmAdIfSendMsgToAudioDSP(
|
|
2314
|
+ _aiH,
|
|
2315
|
+ cp->asSubIdx,
|
|
2316
|
+ cp->mstrFl ? kUiMstrSelAsId : kUiSelAsId,
|
|
2317
|
+ kValueDuiId,
|
|
2318
|
+ 0,
|
|
2319
|
+ cp->instId,
|
|
2320
|
+ instVarId,
|
|
2321
|
+ &value) != kOkAiRC)
|
|
2322
|
+ {
|
|
2323
|
+ cmErrMsg(&_ctx->err,kEngFailKmRC,"An attempt to send a UI message to the audio DSP interface failed.");
|
|
2324
|
+ }
|
2156
|
2325
|
|
2157
|
2326
|
}
|
2158
|
2327
|
|