From 6194c00c568361a1a8ca5c9f758e993bef71f84a Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 13 Dec 2012 15:43:24 -0800 Subject: [PATCH] Added more variables to score GUI to reflect performance information. --- src/kc/kcApp.cpp | 54 ++++++++++++++++++++++++++++++++++++++++-------- src/kc/kcApp.h | 21 +++++++++++++++---- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/src/kc/kcApp.cpp b/src/kc/kcApp.cpp index 82ef2c4..9db22d2 100644 --- a/src/kc/kcApp.cpp +++ b/src/kc/kcApp.cpp @@ -1182,7 +1182,8 @@ void kcApp::_createScor( const cmDspUiHdr_t* m ) { _tlCtl = new tlCtl(_ctx,this,_menu,this); - cp->u.scor.tlctl = _tlCtl; + cp->u.scor.tlctl = _tlCtl; + cp->u.scor.smpIdx = cmInvalidIdx; } Fl_Widget* wdgt = cp->u.scor.tlctl->initScoreCtlr(x,y,w,h); @@ -1217,6 +1218,47 @@ void kcApp::_setScorValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp } break; + case kScorSmpIdxArgIdx: + cp->u.scor.smpIdx = cmDsvUInt(vp); + break; + + case kScorPitchArgIdx: + cp->u.scor.pitch = cmDsvUInt(vp); + break; + + case kScorVelArgIdx: + cp->u.scor.vel = cmDsvUInt(vp); + break; + + case kScorEvtIdxArgIdx: + cp->u.scor.evtIdx = cmDsvUInt(vp); + break; + + case kScorDynArgIdx: + { + assert(cp->u.scor.evtIdx!=cmInvalidIdx); + _tlCtl->setScoreDynLevel(cp->u.scor.evtIdx,cmDsvUInt(vp)); + cp->u.scor.evtIdx = cmInvalidIdx; + } + break; + + case kScorLocIdxArgIdx: + { + assert( cp->u.scor.smpIdx != cmInvalidIdx ); + cp->u.scor.locIdx = cmDsvUInt(vp); + _tlCtl->setScoreLocation(cp->u.scor.locIdx,cp->u.scor.smpIdx,cp->u.scor.pitch,cp->u.scor.vel); + cp->u.scor.smpIdx = cmInvalidIdx; + } + break; + + case kScorValTypeArgIdx: + cp->u.scor.varId = cmDsvUInt(vp); + break; + + case kScorValueArgIdx: + _tlCtl->setScoreVarValue(cp->u.scor.locIdx,cp->u.scor.varId, cmDsvDouble(vp)); + break; + default: { assert(0); } } @@ -1748,8 +1790,6 @@ void kcApp::_handleUiMsg( const cmDspUiHdr_t* m ) // that are waiting in the audio DSP msg queue. void kcApp::_getEngMsg() { - - if( cmAdIfIsValid(_aiH) ) { unsigned i; @@ -1878,13 +1918,9 @@ bool kcApp::_status_timeout_cb() return _stopTimerFl==false || cmTsMp1cIsValid(_printqH); } - - - void kcApp::_s_menu_cb(Fl_Widget *w, void *data) { } - void kcApp::_s_tab_cb(Fl_Widget* w, void* data) { ((kcApp*)data)->_tab_cb(w); } @@ -2014,7 +2050,7 @@ void kcApp::_ctl_cb(ctl_t* cp) case kTmlnTypeId: { - instVarId = cp->u.text.varIdArray[ kTmlnSelArgIdx ]; + instVarId = cp->u.tmln.varIdArray[ kTmlnSelArgIdx ]; unsigned selMarkerId = cp->u.tmln.tlctl->timeLineSelectedMarkerId(); cmDsvSetUInt(&value, selMarkerId ); } @@ -2022,7 +2058,7 @@ void kcApp::_ctl_cb(ctl_t* cp) case kScorTypeId: { - instVarId = cp->u.text.varIdArray[ kScorSelArgIdx ]; + instVarId = cp->u.scor.varIdArray[ kScorSelArgIdx ]; unsigned selEleIdx = cp->u.scor.tlctl->scoreSelectedEleIndex(); cmDsvSetUInt(&value, selEleIdx ); } diff --git a/src/kc/kcApp.h b/src/kc/kcApp.h index 132d934..b26749c 100644 --- a/src/kc/kcApp.h +++ b/src/kc/kcApp.h @@ -123,9 +123,17 @@ private: kTmlnCursArgIdx= 3, kTmlnVarCnt = 4, - kScorFileArgIdx = 0, - kScorSelArgIdx = 1, - kScorVarCnt = 2 + kScorFileArgIdx = 0, + kScorSelArgIdx = 1, + kScorSmpIdxArgIdx = 2, + kScorPitchArgIdx = 3, + kScorVelArgIdx = 4, + kScorLocIdxArgIdx = 5, + kScorEvtIdxArgIdx = 6, + kScorDynArgIdx = 7, + kScorValTypeArgIdx = 8, + kScorValueArgIdx = 9, + kScorVarCnt = 10 }; @@ -218,7 +226,12 @@ private: typedef struct scor_str { tlCtl* tlctl; - char* val; + unsigned smpIdx; + unsigned pitch; + unsigned vel; + unsigned evtIdx; + unsigned locIdx; + unsigned varId; unsigned varIdArray[ kScorVarCnt ]; } scor_t;