Sfoglia il codice sorgente

kcApp.h/cpp Further time line ctl integration

master
kevin 12 anni fa
parent
commit
7a322b8b4c
2 ha cambiato i file con 25 aggiunte e 15 eliminazioni
  1. 20
    10
      src/kc/kcApp.cpp
  2. 5
    5
      src/kc/kcApp.h

+ 20
- 10
src/kc/kcApp.cpp Vedi File

@@ -77,7 +77,8 @@ kcApp::kcApp(int w, int h, const char *l, int argc, char *argv[])
77 77
     _adlH(cmAdlNullHandle),_aiH(cmAiNullHandle),
78 78
     _statIdx(0),_pageList(NULL),_ctlList(NULL),_prH(cmPrNullHandle),_prefsFn(NULL),
79 79
     _stopTimerFl(false),_jsH(cmJsonNullHandle),_newPageFl(true),_incrColW(0),_colW(0),_horzBordFl(false),_horzBord(0),
80
-    _closeCnt(0),_ssCnt(0),_ssArray(0),_ssPhase(0),_ssUpdateFl(false),_printqH(cmTsQueueNullHandle)
80
+    _closeCnt(0),_ssCnt(0),_ssArray(0),_ssPhase(0),_ssUpdateFl(false),_printqH(cmTsQueueNullHandle),
81
+    _tlCtl(NULL)
81 82
 {
82 83
   // install a callback to cleanup when the app window closes
83 84
   // (the btn callbacks and _getApp() rely on a pointer to 'this' being found in kcApp.user_data())
@@ -423,6 +424,7 @@ void kcApp::_clearCtlList(bool mstrFl)
423 424
   if( mstrFl )
424 425
     mstr_grp->clear();
425 426
  
427
+  _tlCtl = NULL;
426 428
 }
427 429
 
428 430
 
@@ -1222,6 +1224,11 @@ void kcApp::_createTmln(  const cmDspUiHdr_t* m )
1222 1224
 
1223 1225
   cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
1224 1226
 
1227
+  // currently we only support one time-line control because
1228
+  // we have not yet implmenented a method of providing
1229
+  // timer callbacks to a list of UI controls
1230
+  assert( _tlCtl == NULL ); 
1231
+  _tlCtl = cp->u.tmln.tlctl;
1225 1232
 
1226 1233
   Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
1227 1234
 
@@ -1239,15 +1246,10 @@ void kcApp::_setTmlnValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
1239 1246
     {
1240 1247
       switch(i)
1241 1248
       {
1242
-        case kTmlnValArgIdx:
1249
+        case kTmlnSelArgIdx:
1243 1250
           //tp->value( cmDsvStrcz(vp));
1244 1251
           break;
1245 1252
 
1246
-        case kTmlnLblArgIdx:
1247
-          {
1248
-            const char* lbl = cmDsvStrcz(vp);
1249
-          }
1250
-          break;
1251 1253
 
1252 1254
         case kTmlnFileArgIdx:
1253 1255
           {
@@ -1907,12 +1909,13 @@ void kcApp::_callback(void* data)
1907 1909
     // to be diplayed in the console - all successive
1908 1910
     // times the return value from finalizePgm() is
1909 1911
     // ignored and the program is terminated.
1912
+    /*
1910 1913
     if( _closeCnt == 1 && cc==0)
1911 1914
     {
1912 1915
       deactivate(); // send a strong hint that a problem occurred
1913 1916
       return;
1914 1917
     }
1915
-
1918
+    */
1916 1919
 
1917 1920
     // When all windows are windows are closed then the app.
1918 1921
     // will close - so hiding the application window
@@ -1949,7 +1952,11 @@ bool kcApp::_status_timeout_cb()
1949 1952
     _checkPrintQueue();
1950 1953
 
1951 1954
   if( !_stopTimerFl )
1955
+  {
1952 1956
     _getEngMsg();
1957
+    if( _tlCtl != NULL )
1958
+      _tlCtl->onIdle();
1959
+  }
1953 1960
 
1954 1961
   if( _ssUpdateFl )
1955 1962
   {
@@ -2129,8 +2136,11 @@ void kcApp::_ctl_cb(ctl_t* cp)
2129 2136
       break;
2130 2137
 
2131 2138
     case kTmlnTypeId:
2132
-      //instVarId = cp->u.text.varIdArray[ kTmlnValArgIdx ];
2133
-      //cmDsvSetStrz(&value,(cmChar_t*)cp->u.tmln.text->value());
2139
+      {
2140
+        instVarId = cp->u.text.varIdArray[ kTmlnSelArgIdx ];
2141
+        unsigned selMarkerId = cp->u.tmln.tlctl->timeLineSelectedMarkerId();
2142
+        cmDsvSetUInt(&value, selMarkerId );
2143
+      }
2134 2144
       break;
2135 2145
 
2136 2146
     default:

+ 5
- 5
src/kc/kcApp.h Vedi File

@@ -137,11 +137,10 @@ private:
137 137
     kMetrLblArgIdx = 3,
138 138
     kMetrVarCnt    = 4,
139 139
 
140
-    kTmlnValArgIdx = 0,
141
-    kTmlnLblArgIdx = 1,
142
-    kTmlnFileArgIdx= 2,
143
-    kTmlnPathArgIdx= 3,
144
-    kTmlnVarCnt    = 4
140
+    kTmlnFileArgIdx= 0,
141
+    kTmlnPathArgIdx= 1,
142
+    kTmlnSelArgIdx = 2,
143
+    kTmlnVarCnt    = 3
145 144
 
146 145
   }; 
147 146
 
@@ -303,6 +302,7 @@ private:
303 302
   int             _ssPhase;
304 303
   bool            _ssUpdateFl; 
305 304
   cmTsQueueH_t    _printqH; // thread-safe queue for controlling access to the output console from multiple threads
305
+  tlCtl*          _tlCtl;
306 306
 
307 307
   void resize(int x, int y, int w, int h);
308 308
 

Loading…
Annulla
Salva