Browse Source

Refinements to integrating time line ctl

master
kpl 12 years ago
parent
commit
2a701ba707
2 changed files with 20 additions and 10 deletions
  1. 19
    9
      src/kc/kcApp.cpp
  2. 1
    1
      src/kc/kcApp.h

+ 19
- 9
src/kc/kcApp.cpp View File

@@ -347,7 +347,7 @@ void kcApp::_createMenu(int w, int h)
347 347
   _menu->copy(items);
348 348
 }
349 349
 
350
-void  kcApp::_createPage( const char* title )
350
+kcApp::page_t*  kcApp::_createPage( const char* title )
351 351
 {
352 352
   int tx,ty,th,tw;
353 353
   tabs->client_area(tx,ty,tw,th);
@@ -367,6 +367,7 @@ void  kcApp::_createPage( const char* title )
367 367
   page->grp->end();
368 368
   tabs->end();
369 369
 
370
+  return page;
370 371
 }
371 372
 
372 373
 // return the count of engine ctls
@@ -1211,13 +1212,21 @@ void kcApp::_setLabelValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* v
1211 1212
 void kcApp::_createTmln(  const cmDspUiHdr_t* m )
1212 1213
 {
1213 1214
   int x,y,w=0,h=0;
1214
-  ctl_t* cp = _createCtl(m, kTmlnTypeId, x,y,w,h, false );
1215 1215
 
1216
-  cp->u.tmln.tlctl = new tlCtl(&_ctx,NULL);
1216
+  page_t* pg = _createPage("TimeLine");
1217 1217
 
1218
-  _createPage("TimeLine");
1218
+  ctl_t* cp = _createCtl(m, kTmlnTypeId, x,y,w,h, true );
1219
+
1220
+  w = pg->grp->w();
1221
+  h = pg->grp->h();
1222
+
1223
+  cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
1224
+
1225
+
1226
+  Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
1227
+
1228
+  _insertNewCtl(cp,m,wdgt,cp->u.tmln.varIdArray,kTmlnVarCnt);
1219 1229
 
1220
-  cp->u.tmln.tlctl->initScoreCtlr(this, _pageList->grp, _menu );
1221 1230
 }
1222 1231
 
1223 1232
 void kcApp::_setTmlnValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp )
@@ -1883,6 +1892,11 @@ void kcApp::_callback(void* data)
1883 1892
   {
1884 1893
     unsigned cc = _closeCnt;
1885 1894
 
1895
+    ctl_t* cp = _ctlList;
1896
+    for(; cp!=NULL; cp=cp->linkPtr)
1897
+      if( cp->typeId == kTmlnTypeId )
1898
+        delete cp->u.tmln.tlctl;
1899
+
1886 1900
     // attempt to shut down the pgm
1887 1901
     if( audioDspFinalize() != kOkKmRC )
1888 1902
       ++_closeCnt;
@@ -1899,10 +1913,6 @@ void kcApp::_callback(void* data)
1899 1913
       return;
1900 1914
     }
1901 1915
 
1902
-    ctl_t* cp = _ctlList;
1903
-    for(; cp!=NULL; cp=cp->linkPtr)
1904
-      if( cp->typeId == kTmlnTypeId )
1905
-        delete cp->u.tmln.tlctl;
1906 1916
 
1907 1917
     // When all windows are windows are closed then the app.
1908 1918
     // will close - so hiding the application window

+ 1
- 1
src/kc/kcApp.h View File

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

Loading…
Cancel
Save