From 2a701ba707581c044d223e0aa2ed7a480b5ce8f8 Mon Sep 17 00:00:00 2001 From: kpl Date: Fri, 16 Nov 2012 10:00:40 -0800 Subject: [PATCH] Refinements to integrating time line ctl --- src/kc/kcApp.cpp | 28 +++++++++++++++++++--------- src/kc/kcApp.h | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/kc/kcApp.cpp b/src/kc/kcApp.cpp index fafee45..d59e30f 100644 --- a/src/kc/kcApp.cpp +++ b/src/kc/kcApp.cpp @@ -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 diff --git a/src/kc/kcApp.h b/src/kc/kcApp.h index 30c9b34..d8659d9 100644 --- a/src/kc/kcApp.h +++ b/src/kc/kcApp.h @@ -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);