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
   btn->callback( _s_btn_cb, kTestBtnId );
198
   btn->callback( _s_btn_cb, kTestBtnId );
199
   yy += btn->h() + vBord;
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
   _ena_chk = new Fl_Check_Button(xx,yy,ctl_width,kMenuH,"Enable Audio");
206
   _ena_chk = new Fl_Check_Button(xx,yy,ctl_width,kMenuH,"Enable Audio");
202
   _ena_chk->callback( _s_btn_cb, kEnableBtnId );
207
   _ena_chk->callback( _s_btn_cb, kEnableBtnId );
203
   yy += _ena_chk->h() + vBord;
208
   yy += _ena_chk->h() + vBord;
1147
             if((path = cmDsvStrcz(vp)) != NULL )
1152
             if((path = cmDsvStrcz(vp)) != NULL )
1148
             {
1153
             {
1149
               cp->u.tmln.tlctl->setAudioFilePath(path);
1154
               cp->u.tmln.tlctl->setAudioFilePath(path);
1150
-              //cp->u.tmln.tlctl->redraw();
1155
+              
1151
             }
1156
             }
1152
           }
1157
           }
1153
           break;
1158
           break;
1881
   _tlCtl->testStub();
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
 void kcApp::_s_callback(Fl_Widget* wp, void* data)
1911
 void kcApp::_s_callback(Fl_Widget* wp, void* data)
1886
 { ((kcApp*)data)->_callback(NULL); }
1912
 { ((kcApp*)data)->_callback(NULL); }
2022
       _testStub();
2048
       _testStub();
2023
       break;
2049
       break;
2024
 
2050
 
2051
+    case kPrintPgmBtnId:
2052
+      _printPgm();
2053
+      break;
2054
+
2025
     default:
2055
     default:
2026
       { assert(0); }
2056
       { assert(0); }
2027
   }
2057
   }

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

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

Loading…
Cancel
Save