kcApp.h/cpp : Added routing of bar numbers from score and timeline to/from UI to set the current time location.

This commit is contained in:
kevin 2016-05-23 18:30:28 -04:00
parent c236bb2754
commit 4994d375a1
2 changed files with 47 additions and 4 deletions

View File

@ -1165,6 +1165,10 @@ void kcApp::_setTmlnValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
//tp->value( cmDsvStrcz(vp)); //tp->value( cmDsvStrcz(vp));
break; break;
case kTmlnMeasArgIdx:
cp->u.tmln.tlctl->setTimeLineSelectBar( cmDsvUInt(vp));
break;
case kTmlnCursArgIdx: case kTmlnCursArgIdx:
cp->u.tmln.tlctl->setAudioFileCursor(cmDsvUInt(vp)); cp->u.tmln.tlctl->setAudioFileCursor(cmDsvUInt(vp));
break; break;
@ -1272,6 +1276,10 @@ void kcApp::_setScorValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
_tlCtl->setScoreVarValue(cp->u.scor.locIdx,cp->u.scor.varId, cmDsvDouble(vp)); _tlCtl->setScoreVarValue(cp->u.scor.locIdx,cp->u.scor.varId, cmDsvDouble(vp));
break; break;
case kScorMeasArgIdx:
_tlCtl->setScoreSelectBar( cmDsvUInt(vp));
break;
default: default:
{ assert(0); } { assert(0); }
} }
@ -1462,6 +1470,17 @@ void kcApp::_insertAudioSysCfgLabel(unsigned long idx, const char* label)
_as_btn->add(label,0,NULL,(void*)idx,0); _as_btn->add(label,0,NULL,(void*)idx,0);
} }
void kcApp::_setDfltAudioSysCfg(unsigned long idx, const char* label )
{
int i;
if((i = _as_btn->find_index(label)) != -1 )
{
_setMenuButton(_as_btn,i,"Audio System Cfg");
cmAdIfSetAudioSysCfg(_aiH,_as_btn->mvalue()->argument());
}
}
void kcApp::_insertDeviceLabel( unsigned long devIdx, bool inputFl, const cmChar_t* label ) void kcApp::_insertDeviceLabel( unsigned long devIdx, bool inputFl, const cmChar_t* label )
{ {
Fl_Menu_Button* bp = inputFl ? _ai_btn : _ao_btn; Fl_Menu_Button* bp = inputFl ? _ai_btn : _ao_btn;
@ -1481,6 +1500,18 @@ void kcApp::_insertProgramLabel( unsigned long idx, const cmChar_t* label )
_pgm_btn->add(label,0,NULL,(void*)idx,0); _pgm_btn->add(label,0,NULL,(void*)idx,0);
} }
void kcApp::_setDfltProgram(unsigned long idx, const char* label )
{
int i;
if((i = _pgm_btn->find_index(label)) != -1 )
{
_setMenuButton(_pgm_btn,i,"Programs");
cmAdIfLoadProgram(_aiH,_getCurAudioSubSysIdx(),_pgm_btn->mvalue()->argument());
}
}
void kcApp::_insertSubSysCnt( unsigned long subSysCnt ) void kcApp::_insertSubSysCnt( unsigned long subSysCnt )
{ {
long unsigned i; long unsigned i;
@ -1952,6 +1983,10 @@ void kcApp::_handleUiMsg( const cmDspUiHdr_t* m )
_insertAudioSysCfgLabel(m->instId,cmDsvStrcz(&m->value)); _insertAudioSysCfgLabel(m->instId,cmDsvStrcz(&m->value));
break; break;
case kAudioSysCfgDfltDuiId:
_setDfltAudioSysCfg(m->instId,cmDsvStrcz(&m->value));
break;
case kDeviceDuiId: case kDeviceDuiId:
_insertDeviceLabel(m->instId,m->flags,cmDsvStrcz(&m->value)); _insertDeviceLabel(m->instId,m->flags,cmDsvStrcz(&m->value));
break; break;
@ -1960,6 +1995,10 @@ void kcApp::_handleUiMsg( const cmDspUiHdr_t* m )
_insertProgramLabel(m->instId,cmDsvStrcz(&m->value)); _insertProgramLabel(m->instId,cmDsvStrcz(&m->value));
break; break;
case kProgramDfltDuiId:
_setDfltProgram(m->instId,cmDsvStrcz(&m->value));
break;
// the below codes are used to notify the application // the below codes are used to notify the application
// of changes in state of the audio DSP system // of changes in state of the audio DSP system

View File

@ -123,8 +123,9 @@ private:
kTmlnFileArgIdx= 0, kTmlnFileArgIdx= 0,
kTmlnPathArgIdx= 1, kTmlnPathArgIdx= 1,
kTmlnSelArgIdx = 2, kTmlnSelArgIdx = 2,
kTmlnCursArgIdx= 3, kTmlnMeasArgIdx= 3,
kTmlnVarCnt = 4, kTmlnCursArgIdx= 4,
kTmlnVarCnt = 5,
kScorFileArgIdx = 0, kScorFileArgIdx = 0,
kScorSelArgIdx = 1, kScorSelArgIdx = 1,
@ -136,7 +137,8 @@ private:
kScorDynArgIdx = 7, kScorDynArgIdx = 7,
kScorValTypeArgIdx = 8, kScorValTypeArgIdx = 8,
kScorValueArgIdx = 9, kScorValueArgIdx = 9,
kScorVarCnt = 10, kScorMeasArgIdx = 10,
kScorVarCnt = 11,
kTksbFileArgIdx = 0, kTksbFileArgIdx = 0,
kTksbPtrArgIdx = 1, kTksbPtrArgIdx = 1,
@ -406,8 +408,10 @@ private:
void _newColumn( const cmDspUiHdr_t* m ); void _newColumn( const cmDspUiHdr_t* m );
void _insertAudioSysCfgLabel(unsigned long idx, const cmChar_t* label ); void _insertAudioSysCfgLabel(unsigned long idx, const cmChar_t* label );
void _setDfltAudioSysCfg(unsigned long idx, const cmChar_t* label );
void _insertDeviceLabel( unsigned long idx, bool inputFl, const cmChar_t* label ); void _insertDeviceLabel( unsigned long idx, bool inputFl, const cmChar_t* label );
void _insertProgramLabel( unsigned long idx, const cmChar_t* label ); void _insertProgramLabel( unsigned long idx, const cmChar_t* label );
void _setDfltProgram(unsigned long idx, const cmChar_t* label );
void _insertSubSysCnt( unsigned long subSysCnt ); void _insertSubSysCnt( unsigned long subSysCnt );
unsigned _getCurAudioSubSysIdx(); unsigned _getCurAudioSubSysIdx();
void _setMenuButton( Fl_Menu_Button* b, unsigned value, const char* dfltLabel ); void _setMenuButton( Fl_Menu_Button* b, unsigned value, const char* dfltLabel );