Browse Source

kcApp.h/cpp: Added 'print pgm' option.

master
kpl 11 years ago
parent
commit
d212ce24d2
2 changed files with 33 additions and 1 deletions
  1. 31
    1
      src/kc/kcApp.cpp
  2. 2
    0
      src/kc/kcApp.h

+ 31
- 1
src/kc/kcApp.cpp View File

@@ -198,6 +198,11 @@ void kcApp::_createSetupDlg( Fl_Group* grp )
198 198
   btn->callback( _s_btn_cb, kTestBtnId );
199 199
   yy += btn->h() + vBord;
200 200
 
201
+  btn = new Fl_Button(xx,yy,200,kMenuH,"Print program");
202
+  btn->callback( _s_btn_cb, kPrintPgmBtnId );
203
+  yy += btn->h() + vBord;
204
+
205
+
201 206
   _ena_chk = new Fl_Check_Button(xx,yy,ctl_width,kMenuH,"Enable Audio");
202 207
   _ena_chk->callback( _s_btn_cb, kEnableBtnId );
203 208
   yy += _ena_chk->h() + vBord;
@@ -1147,7 +1152,7 @@ void kcApp::_setTmlnValue( ctl_t* cp, unsigned instVarId, const cmDspValue_t* vp
1147 1152
             if((path = cmDsvStrcz(vp)) != NULL )
1148 1153
             {
1149 1154
               cp->u.tmln.tlctl->setAudioFilePath(path);
1150
-              //cp->u.tmln.tlctl->redraw();
1155
+              
1151 1156
             }
1152 1157
           }
1153 1158
           break;
@@ -1881,6 +1886,27 @@ void kcApp::_testStub()
1881 1886
   _tlCtl->testStub();
1882 1887
 }
1883 1888
 
1889
+void kcApp::_printPgm()
1890
+{
1891
+  const char* pathStr   = cmFsUserDir(); // make the default dir the user's home dir
1892
+  const char patStr[]   = ""; //"Text Files (*.txt)\tAudio Files (*.{wav,aif,aiff})"; // All Files (*.*) is append to this automatically
1893
+  const char titleStr[] = "JSON output file name";
1894
+
1895
+  Fl_File_Chooser fc = Fl_File_Chooser(pathStr,patStr,Fl_File_Chooser::CREATE,titleStr);
1896
+        
1897
+  fc.preview(0); // default the previous option to 'off'.
1898
+  fc.show();     // show the chooser
1899
+
1900
+  // make the chooser modal
1901
+  while( fc.shown() )
1902
+          Fl::wait();
1903
+
1904
+  if( fc.count() > 0)
1905
+    cmAdIfPrintPgm(_aiH, cmInvalidIdx, fc.value(0) );
1906
+
1907
+}
1908
+
1909
+
1884 1910
 
1885 1911
 void kcApp::_s_callback(Fl_Widget* wp, void* data)
1886 1912
 { ((kcApp*)data)->_callback(NULL); }
@@ -2022,6 +2048,10 @@ void kcApp::_btn_cb(Fl_Widget* w, long data)
2022 2048
       _testStub();
2023 2049
       break;
2024 2050
 
2051
+    case kPrintPgmBtnId:
2052
+      _printPgm();
2053
+      break;
2054
+
2025 2055
     default:
2026 2056
       { assert(0); }
2027 2057
   }

+ 2
- 0
src/kc/kcApp.h View File

@@ -148,6 +148,7 @@ private:
148 148
     kSubSystemIdxBtnId,
149 149
     kSrateBtnId,
150 150
     kTestBtnId,
151
+    kPrintPgmBtnId,
151 152
     
152 153
     kAboutMenuId,
153 154
     kQuitMenuId
@@ -389,6 +390,7 @@ private:
389 390
   void          _onCloseApp();
390 391
   
391 392
   void          _testStub();
393
+  void          _printPgm();
392 394
 
393 395
   // main app callback
394 396
   static void _s_callback(Fl_Widget* wp, void* data);

Loading…
Cancel
Save