Refinements to integrating time line ctl

This commit is contained in:
kpl 2012-11-16 10:00:40 -08:00
parent 76ac60f9f3
commit 2a701ba707
2 changed files with 20 additions and 10 deletions

View File

@ -347,7 +347,7 @@ void kcApp::_createMenu(int w, int h)
_menu->copy(items);
}
void kcApp::_createPage( const char* title )
kcApp::page_t* kcApp::_createPage( const char* title )
{
int tx,ty,th,tw;
tabs->client_area(tx,ty,tw,th);
@ -367,6 +367,7 @@ void kcApp::_createPage( const char* title )
page->grp->end();
tabs->end();
return page;
}
// return the count of engine ctls
@ -1211,13 +1212,21 @@ void kcApp::_setLabelValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* v
void kcApp::_createTmln( const cmDspUiHdr_t* m )
{
int x,y,w=0,h=0;
ctl_t* cp = _createCtl(m, kTmlnTypeId, x,y,w,h, false );
cp->u.tmln.tlctl = new tlCtl(&_ctx,NULL);
page_t* pg = _createPage("TimeLine");
_createPage("TimeLine");
ctl_t* cp = _createCtl(m, kTmlnTypeId, x,y,w,h, true );
w = pg->grp->w();
h = pg->grp->h();
cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
_insertNewCtl(cp,m,wdgt,cp->u.tmln.varIdArray,kTmlnVarCnt);
cp->u.tmln.tlctl->initScoreCtlr(this, _pageList->grp, _menu );
}
void kcApp::_setTmlnValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp )
@ -1883,6 +1892,11 @@ void kcApp::_callback(void* data)
{
unsigned cc = _closeCnt;
ctl_t* cp = _ctlList;
for(; cp!=NULL; cp=cp->linkPtr)
if( cp->typeId == kTmlnTypeId )
delete cp->u.tmln.tlctl;
// attempt to shut down the pgm
if( audioDspFinalize() != kOkKmRC )
++_closeCnt;
@ -1899,10 +1913,6 @@ void kcApp::_callback(void* data)
return;
}
ctl_t* cp = _ctlList;
for(; cp!=NULL; cp=cp->linkPtr)
if( cp->typeId == kTmlnTypeId )
delete cp->u.tmln.tlctl;
// When all windows are windows are closed then the app.
// will close - so hiding the application window

View File

@ -308,7 +308,7 @@ private:
void _createSetupDlg(Fl_Group* grp);
void _createMenu( int w, int h );
void _createPage( const char* title );
page_t* _createPage( const char* title );
unsigned _getCtlCount() const;
void _clearCtlList(bool mstrFl);