|
@@ -40,44 +40,35 @@
|
40
|
40
|
#include "cmMsgProtocol.h"
|
41
|
41
|
#include "cmAudDspIF.h"
|
42
|
42
|
#include "cmAudDspLocal.h"
|
43
|
|
-#include "kcApp.h"
|
44
|
|
-
|
45
|
43
|
#include "cmAudioFile.h"
|
46
|
44
|
#include "cmAudioFileMgr.h"
|
47
|
|
-
|
48
|
45
|
#include "cmMidi.h"
|
49
|
46
|
#include "cmMidiFile.h"
|
50
|
47
|
#include "cmTimeLine.h"
|
51
|
48
|
#include "cmScore.h"
|
|
49
|
+#include "cmdIf.h"
|
|
50
|
+#include "tlCtl.h"
|
|
51
|
+#include "kcApp.h"
|
|
52
|
+
|
|
53
|
+
|
52
|
54
|
#include "cmGr.h"
|
53
|
55
|
#include "cmGrDevCtx.h"
|
54
|
56
|
#include "cmGrPlot.h"
|
55
|
57
|
#include "cmGrPage.h"
|
56
|
|
-#include "cmGrDevDrvFltk.h"
|
57
|
|
-#include "cmGrDevDrvCairoFltk.h"
|
58
|
|
-#include "cmGrWidgetFltk.h"
|
59
|
|
-
|
60
|
|
-#include "Fl_CbLinker.h"
|
|
58
|
+#include "cmGrFltk.h"
|
61
|
59
|
|
62
|
|
-#include "cmGrPlotPageFltk.h"
|
63
|
|
-#include "cmGrPlotCtlrFltk.h"
|
64
|
|
-#include "gvHashFunc.h"
|
65
|
|
-#include "cmGrTlCtlrFltk.h"
|
66
|
|
-#include "cmGrScCtlrFltk.h"
|
67
|
|
-
|
68
|
|
-#include "cmdIf.h"
|
69
|
|
-#include "tlCtl.h"
|
70
|
60
|
|
71
|
61
|
#define TIMER_PERIOD (1.0/20.0) // 50ms
|
72
|
62
|
|
73
|
63
|
|
74
|
|
-kcApp::kcApp(int w, int h, const char *l, int argc, char *argv[])
|
75
|
|
- : Fl_Double_Window(w, h, l),
|
76
|
|
- splt(NULL),_menu(NULL),
|
77
|
|
- _adlH(cmAdlNullHandle),_aiH(cmAiNullHandle),
|
78
|
|
- _statIdx(0),_pageList(NULL),_ctlList(NULL),_prH(cmPrNullHandle),_prefsFn(NULL),
|
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),
|
|
64
|
+kcApp::kcApp(cmCtx_t* ctx, cmTsMp1cH_t printqH, int w, int h, const cmChar_t* title, cmAiH_t aiH, int argc, char* argv[] )
|
|
65
|
+ : Fl_Double_Window(w, h,title),
|
|
66
|
+ splt(NULL),_menu(NULL),_aiH(aiH),
|
|
67
|
+ _statIdx(0),_pageList(NULL),_ctlList(NULL),
|
|
68
|
+ _stopTimerFl(false),_newPageFl(true),
|
|
69
|
+ _incrColW(0),_colW(0),_horzBordFl(false),_horzBord(0),
|
|
70
|
+ _closeCnt(0),_ssCnt(0),_ssArray(0),_ssPhase(0),_ssUpdateFl(false),
|
|
71
|
+ _printqH(printqH),_printFl(0),
|
81
|
72
|
_tlCtl(NULL)
|
82
|
73
|
{
|
83
|
74
|
// install a callback to cleanup when the app window closes
|
|
@@ -91,8 +82,7 @@ kcApp::kcApp(int w, int h, const char *l, int argc, char *argv[])
|
91
|
82
|
splt = new Fl_HSplitter(0, kMenuH, w, h-kStatusH-kMenuH, h-kStatusH-kMenuH-100);
|
92
|
83
|
end();
|
93
|
84
|
|
94
|
|
- // Create a text display object for console output and
|
95
|
|
- // add it to the lower splitter area
|
|
85
|
+ // Create a text display object for console output andvadd it to the lower splitter area
|
96
|
86
|
buf = new Fl_Text_Buffer();
|
97
|
87
|
con = new Fl_Text_Display(splt->container2->x(),splt->container2->y(),splt->container2->w(),splt->container2->h());
|
98
|
88
|
con->buffer(buf);
|
|
@@ -101,39 +91,26 @@ kcApp::kcApp(int w, int h, const char *l, int argc, char *argv[])
|
101
|
91
|
// Create a tab view and added it to the upper splitter area
|
102
|
92
|
tabs = new Fl_Tabs(splt->container1->x(),splt->container1->y(),splt->container1->w(),splt->container1->h());
|
103
|
93
|
tabs->callback(_s_tab_cb,this);
|
104
|
|
-
|
|
94
|
+ tabs->end();
|
105
|
95
|
splt->container1->add(tabs);
|
106
|
96
|
|
107
|
97
|
int tx,ty,th,tw;
|
108
|
98
|
tabs->client_area(tx,ty,tw,th);
|
109
|
99
|
|
110
|
100
|
// Create the 'Setup' tab group
|
111
|
|
- tabs->begin();
|
112
|
101
|
Fl_Group* setup_grp = new Fl_Group(tx,ty,tw,th,"Setup");
|
|
102
|
+ tabs->add(setup_grp);
|
113
|
103
|
_createSetupDlg(setup_grp);
|
114
|
|
- tabs->end();
|
115
|
104
|
|
|
105
|
+ // Create the master group
|
|
106
|
+ tabs->add(mstr_grp = new Fl_Group(tx,ty,tw,th,"Master"));
|
116
|
107
|
|
117
|
|
- tabs->begin();
|
118
|
|
- mstr_grp = new Fl_Group(tx,ty,tw,th,"Master");
|
119
|
|
- tabs->end();
|
120
|
|
-
|
121
|
|
- // Create the 'Controls' tab group
|
122
|
|
- /*
|
123
|
|
- tabs->begin();
|
124
|
|
- ctl_grp = new Fl_Group(tx,ty,tw,th,"Controls");
|
125
|
|
- ctl_grp->begin();
|
126
|
|
- Fl_Box* bx = new Fl_Box(FL_NO_BOX,ctl_grp->x()+ctl_grp->w(),ctl_grp->y()+ctl_grp->h(),1,1,NULL);
|
127
|
|
- ctl_grp->resizable(bx);
|
128
|
|
- ctl_grp->end(); tabs->end();
|
129
|
|
- */
|
130
|
108
|
|
131
|
109
|
// Create an empty tab group and make it resizable
|
132
|
110
|
// to prevent the other tab groups from being resizable.
|
133
|
|
- tabs->begin();
|
134
|
111
|
Fl_Group* wdgt = new Fl_Group(tx,ty+30,1,1);
|
|
112
|
+ tabs->add(wdgt);
|
135
|
113
|
tabs->resizable(wdgt); // make other tabs non-resizable
|
136
|
|
- tabs->end();
|
137
|
114
|
|
138
|
115
|
|
139
|
116
|
// make the splitter the resizable group element (thereby making the menu non-resizable).
|
|
@@ -142,13 +119,13 @@ kcApp::kcApp(int w, int h, const char *l, int argc, char *argv[])
|
142
|
119
|
show(argc, argv);
|
143
|
120
|
|
144
|
121
|
|
145
|
|
- // initialize the audio DSP system
|
146
|
|
- audioDspInitialize(&_ctx,_s_print,this);
|
|
122
|
+ // direct all output to the console window
|
|
123
|
+ cmRptSetup(&_ctx.rpt,_s_print,_s_print, this);
|
|
124
|
+ cmTsMp1cSetCbFunc(_printqH, _s_print_queue_cb, this );
|
147
|
125
|
|
148
|
126
|
// install a timer to check for messages from the engine
|
149
|
127
|
Fl::add_timeout(TIMER_PERIOD,_s_status_timeout_cb,this);
|
150
|
128
|
|
151
|
|
-
|
152
|
129
|
}
|
153
|
130
|
|
154
|
131
|
kcApp::~kcApp()
|
|
@@ -158,119 +135,18 @@ kcApp::~kcApp()
|
158
|
135
|
}
|
159
|
136
|
|
160
|
137
|
|
161
|
|
-// this function is only called from the constructor
|
162
|
|
-kcApp::kcKmRC_t kcApp::audioDspInitialize(cmCtx_t* ctx, cmRptPrintFunc_t printFunc, void* printFuncArg)
|
163
|
|
-{
|
164
|
|
- kcKmRC_t rc = kOkKmRC;
|
165
|
|
-
|
166
|
|
- // initialize the heap check library
|
167
|
|
- bool memDebugFl = cmDEBUG_FL;
|
168
|
|
- unsigned memPadByteCnt = memDebugFl ? 8 : 0;
|
169
|
|
- unsigned memAlignByteCnt = 16;
|
170
|
|
- unsigned memFlags = memDebugFl ? (kTrackMmFl | kDeferFreeMmFl | kFillUninitMmFl) : 0;
|
171
|
|
-
|
172
|
|
- cmCtxSetup(ctx,"KC Main",printFunc,printFunc,printFuncArg,memPadByteCnt,memAlignByteCnt,memFlags);
|
173
|
|
-
|
174
|
|
- cmMdInitialize( memPadByteCnt, memAlignByteCnt, memFlags, &ctx->rpt );
|
175
|
|
-
|
176
|
|
- cmTsInitialize(ctx);
|
177
|
|
-
|
178
|
|
- cmFsInitialize( ctx, "kc" );
|
179
|
|
-
|
180
|
|
- cmJsonInitialize(&_jsH,&_ctx);
|
181
|
|
-
|
182
|
|
- //_loadPrefs(ctx);
|
183
|
|
-
|
184
|
|
- // create the print queue
|
185
|
|
- if( cmTsQueueCreate( &_printqH, 4*8192, kcApp::_s_print_queue_cb, this, &_ctx.rpt ) != kOkThRC )
|
186
|
|
- cmErrMsg(&ctx->err,kPrintQueFailKmRC,"Print queue creation failed.");
|
187
|
|
-
|
188
|
|
- cmAdIfDispatch_t r;
|
189
|
|
- r.cbDataPtr = this;
|
190
|
|
- r.ssInitFunc = _s_handleSsInitMsg;
|
191
|
|
- r.statusFunc = _s_handleStatusMsg;
|
192
|
|
- r.uiFunc = _s_handleUiMsg;
|
193
|
|
-
|
194
|
|
- if( cmAudDspLocalAllocate(ctx,&_adlH,&r) != kOkAdlRC )
|
195
|
|
- {
|
196
|
|
- rc = cmErrMsg(&ctx->err,kEngFailKmRC,"The audio DSP local server allocation failed.");
|
197
|
|
- goto errLabel;
|
198
|
|
- }
|
199
|
|
-
|
200
|
|
- if(cmAdIfIsValid(_aiH = cmAudDspLocalIF_Handle(_adlH)) == false )
|
201
|
|
- {
|
202
|
|
- rc = cmErrMsg(&ctx->err,kEngFailKmRC,"The audio DSP interface handle is not valid.");
|
203
|
|
- goto errLabel;
|
204
|
|
- }
|
205
|
|
-
|
206
|
|
- errLabel:
|
207
|
|
- return rc;
|
208
|
|
-}
|
209
|
|
-
|
210
|
|
-bool kcApp::audioDspIsValid()
|
211
|
|
-{ return cmAudDspLocalIsValid(_adlH) && cmAdIfIsValid(_aiH); }
|
212
|
|
-
|
213
|
|
-kcApp::kcKmRC_t kcApp::audioDspFinalize()
|
214
|
|
-{
|
215
|
|
- kcKmRC_t rc = kOkKmRC;
|
216
|
|
-
|
217
|
|
- _stopTimerFl = true;
|
218
|
|
-
|
219
|
|
- if( cmJsonFinalize(&_jsH) != kOkJsRC )
|
220
|
|
- rc = cmErrMsg(&_ctx.err,kJsonFailKmRC,"JSON object finalization failed.");
|
221
|
|
-
|
222
|
|
- // If the preferences are dirty or the prefs file does not exist then write them
|
223
|
|
- if( cmPrefsIsValid(_prH) )
|
224
|
|
- {
|
225
|
|
-
|
226
|
|
- if( _prefsFn != NULL && (cmPrefsIsValid(_prH) && (cmPrefsIsDirty(_prH) || cmFsIsFile(_prefsFn)==false)) )
|
227
|
|
- if( cmPrefsWrite(_prH,_prefsFn) != kOkPrRC )
|
228
|
|
- rc = cmErrMsg(&_ctx.err,kPrefWriteFailKmRC,"Preference save failed on file '%s'.",_prefsFn);
|
229
|
|
-
|
230
|
|
- if( cmPrefsFinalize(&_prH) != kOkPrRC )
|
231
|
|
- rc = cmErrMsg(&_ctx.err,kPrefFailKmRC,"Prefrence finalization failed.");
|
232
|
|
-
|
233
|
|
- }
|
234
|
|
-
|
235
|
|
- // finalize the real-time system
|
236
|
|
- //rc = stopEngine(_ctx,*hp);
|
237
|
|
-
|
238
|
|
- // release the engine
|
239
|
|
- if( cmAudDspLocalFree(&_adlH) != kOkAdlRC )
|
240
|
|
- rc = cmErrMsg(&_ctx.err,kEngFailKmRC,"Audio DSP release failed.");
|
241
|
|
-
|
242
|
|
- // print any pending text in the print queue
|
243
|
|
- _checkPrintQueue();
|
244
|
|
-
|
245
|
|
- // the app threads are stopped so it is safe to stop using the print queue
|
246
|
|
- if( cmTsQueueDestroy(&_printqH) == kOkThRC )
|
247
|
|
- _printqH = cmTsQueueNullHandle;
|
248
|
|
- else
|
249
|
|
- cmErrMsg(&_ctx.err,kPrintQueFailKmRC,"Print queue destroy failed.");
|
250
|
|
-
|
251
|
|
- // finalize the file system
|
252
|
|
- cmFsFinalize();
|
253
|
|
-
|
254
|
|
- cmTsFinalize();
|
255
|
|
-
|
256
|
|
- // report memory mgr errors
|
257
|
|
- if( cmMdReport( kIgnoreNormalMmFl ) != kOkMmRC )
|
258
|
|
- rc = kMemFailKmRC;
|
259
|
|
-
|
260
|
|
- // finalize the memory manager
|
261
|
|
- if( cmMdFinalize() != kOkMmRC )
|
262
|
|
- rc = kMemFailKmRC;
|
263
|
|
-
|
264
|
|
- return rc;
|
265
|
|
-}
|
266
|
|
-
|
267
|
|
-
|
268
|
138
|
void kcApp::resize(int x, int y, int w, int h)
|
269
|
139
|
{
|
270
|
140
|
Fl_Double_Window::resize(x, y, w, h);
|
271
|
141
|
splt->resize(0, kMenuH, w, h-kStatusH);
|
272
|
142
|
}
|
273
|
143
|
|
|
144
|
+void kcApp::tlCtlNewTimeLineFile( tlCtl* tlCtl, const cmChar_t* fn )
|
|
145
|
+{}
|
|
146
|
+
|
|
147
|
+void kcApp::tlCtlNewScoreFile( tlCtl* tlCtl, const cmChar_t* fn )
|
|
148
|
+{}
|
|
149
|
+
|
274
|
150
|
|
275
|
151
|
void kcApp::_createSetupDlg( Fl_Group* grp )
|
276
|
152
|
{
|
|
@@ -334,12 +210,7 @@ void kcApp::_createMenu(int w, int h)
|
334
|
210
|
Fl_Menu_Item items[] =
|
335
|
211
|
{
|
336
|
212
|
{ "&File", 0, 0, 0, FL_SUBMENU },
|
337
|
|
- { "&New File", 0, (Fl_Callback*)_s_file_new_cb },
|
338
|
|
- { "&Open File", FL_COMMAND + 'o', (Fl_Callback*)_s_file_open_cb },
|
339
|
|
- { 0 },
|
340
|
|
- { "&Edit", 0, 0, 0, FL_SUBMENU },
|
341
|
|
- { "&Copy", FL_COMMAND + 'c', (Fl_Callback*)_s_edit_copy_cb },
|
342
|
|
- { "&Paste", FL_COMMAND + 'v', (Fl_Callback*)_s_edit_paste_cb },
|
|
213
|
+ { "&New File", 0, (Fl_Callback*)_s_menu_cb },
|
343
|
214
|
{ 0 },
|
344
|
215
|
{ 0 }
|
345
|
216
|
};
|
|
@@ -1222,7 +1093,7 @@ void kcApp::_createTmln( const cmDspUiHdr_t* m )
|
1222
|
1093
|
w = pg->grp->w();
|
1223
|
1094
|
h = pg->grp->h();
|
1224
|
1095
|
|
1225
|
|
- cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
|
|
1096
|
+ cp->u.tmln.tlctl = new tlCtl(&_ctx,this,_menu,this);
|
1226
|
1097
|
|
1227
|
1098
|
// currently we only support one time-line control because
|
1228
|
1099
|
// we have not yet implmenented a method of providing
|
|
@@ -1230,7 +1101,7 @@ void kcApp::_createTmln( const cmDspUiHdr_t* m )
|
1230
|
1101
|
assert( _tlCtl == NULL );
|
1231
|
1102
|
_tlCtl = cp->u.tmln.tlctl;
|
1232
|
1103
|
|
1233
|
|
- Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
|
|
1104
|
+ Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(x,y,w,h);
|
1234
|
1105
|
|
1235
|
1106
|
_insertNewCtl(cp,m,wdgt,cp->u.tmln.varIdArray,kTmlnVarCnt);
|
1236
|
1107
|
|
|
@@ -1570,7 +1441,7 @@ void kcApp::_handleSsInitMsg( const cmAudioSysSsInitMsg_t* m, const cmChar_t* in
|
1570
|
1441
|
ss_t* ss = _ssArray + m->asSubIdx;
|
1571
|
1442
|
|
1572
|
1443
|
int x = 20;
|
1573
|
|
- int y = 30;
|
|
1444
|
+ int y = 30 + kMenuH;
|
1574
|
1445
|
int w = 80;
|
1575
|
1446
|
int h = 20;
|
1576
|
1447
|
char lblArray[][10] = { "Update","Wakeup","Mesg","Audio" };
|
|
@@ -1792,28 +1663,6 @@ void kcApp::_handleUiMsg( const cmDspUiHdr_t* m )
|
1792
|
1663
|
}
|
1793
|
1664
|
}
|
1794
|
1665
|
|
1795
|
|
-cmRC_t kcApp::_s_handleSsInitMsg( void* cbDataPtr, const cmAudioSysSsInitMsg_t* r, const char* iDevLabel, const char* oDevLabel )
|
1796
|
|
-{
|
1797
|
|
- kcApp* p = (kcApp*)cbDataPtr;
|
1798
|
|
- p->_handleSsInitMsg(r,iDevLabel,oDevLabel);
|
1799
|
|
- return cmOkRC;
|
1800
|
|
-}
|
1801
|
|
-
|
1802
|
|
-cmRC_t kcApp::_s_handleStatusMsg( void* cbDataPtr, const cmAudioSysStatus_t* r, const double* iMeterArray, const double* oMeterArray )
|
1803
|
|
-{
|
1804
|
|
- kcApp* p = (kcApp*)cbDataPtr;
|
1805
|
|
- p->_handleStatusMsg(r,iMeterArray,oMeterArray);
|
1806
|
|
- return cmOkRC;
|
1807
|
|
-}
|
1808
|
|
-
|
1809
|
|
-cmRC_t kcApp::_s_handleUiMsg( void* cbDataPtr, const cmDspUiHdr_t* r )
|
1810
|
|
-{
|
1811
|
|
- kcApp* p = (kcApp*)cbDataPtr;
|
1812
|
|
- p->_handleUiMsg(r);
|
1813
|
|
- return cmOkRC;
|
1814
|
|
-}
|
1815
|
|
-
|
1816
|
|
-
|
1817
|
1666
|
|
1818
|
1667
|
// Check for and forward any messages sent to the UI
|
1819
|
1668
|
// that are waiting in the audio DSP msg queue.
|
|
@@ -1821,7 +1670,7 @@ void kcApp::_getEngMsg()
|
1821
|
1670
|
{
|
1822
|
1671
|
|
1823
|
1672
|
|
1824
|
|
- if( audioDspIsValid() )
|
|
1673
|
+ if( cmAdIfIsValid(_aiH) )
|
1825
|
1674
|
{
|
1826
|
1675
|
unsigned i;
|
1827
|
1676
|
|
|
@@ -1892,16 +1741,18 @@ void kcApp::_callback(void* data)
|
1892
|
1741
|
{
|
1893
|
1742
|
if( Fl::event() == FL_CLOSE )
|
1894
|
1743
|
{
|
1895
|
|
- unsigned cc = _closeCnt;
|
|
1744
|
+ //unsigned cc = _closeCnt;
|
1896
|
1745
|
|
1897
|
1746
|
ctl_t* cp = _ctlList;
|
1898
|
1747
|
for(; cp!=NULL; cp=cp->linkPtr)
|
1899
|
1748
|
if( cp->typeId == kTmlnTypeId )
|
1900
|
1749
|
delete cp->u.tmln.tlctl;
|
1901
|
1750
|
|
|
1751
|
+ _stopTimerFl = true;
|
|
1752
|
+
|
1902
|
1753
|
// attempt to shut down the pgm
|
1903
|
|
- if( audioDspFinalize() != kOkKmRC )
|
1904
|
|
- ++_closeCnt;
|
|
1754
|
+ //if( audioDspFinalize() != kOkKmRC )
|
|
1755
|
+ // ++_closeCnt;
|
1905
|
1756
|
|
1906
|
1757
|
// the first time the pgm fails to shut down
|
1907
|
1758
|
// do not allow the pgm to close the main window
|
|
@@ -1931,14 +1782,6 @@ void kcApp::_callback(void* data)
|
1931
|
1782
|
}
|
1932
|
1783
|
|
1933
|
1784
|
|
1934
|
|
-void kcApp::_s_on_idle(void *data)
|
1935
|
|
-{ ((kcApp*)data)->_on_idle(); }
|
1936
|
|
-
|
1937
|
|
-void kcApp::_on_idle()
|
1938
|
|
-{
|
1939
|
|
- //_getEngMsg();
|
1940
|
|
- //_getEngStatus();
|
1941
|
|
-}
|
1942
|
1785
|
|
1943
|
1786
|
void kcApp::_s_status_timeout_cb(void* userPtr)
|
1944
|
1787
|
{
|
|
@@ -1948,7 +1791,7 @@ void kcApp::_s_status_timeout_cb(void* userPtr)
|
1948
|
1791
|
|
1949
|
1792
|
bool kcApp::_status_timeout_cb()
|
1950
|
1793
|
{
|
1951
|
|
- if( cmTsQueueIsValid(_printqH) )
|
|
1794
|
+ if( cmTsMp1cIsValid(_printqH) )
|
1952
|
1795
|
_checkPrintQueue();
|
1953
|
1796
|
|
1954
|
1797
|
if( !_stopTimerFl )
|
|
@@ -1974,37 +1817,13 @@ bool kcApp::_status_timeout_cb()
|
1974
|
1817
|
//if( !_stopTimerFl )
|
1975
|
1818
|
// _getEngStatus();
|
1976
|
1819
|
|
1977
|
|
- return _stopTimerFl==false || cmTsQueueIsValid(_printqH);
|
|
1820
|
+ return _stopTimerFl==false || cmTsMp1cIsValid(_printqH);
|
1978
|
1821
|
}
|
1979
|
1822
|
|
1980
|
1823
|
|
1981
|
1824
|
|
1982
|
1825
|
|
1983
|
|
-void kcApp::_s_file_new_cb(Fl_Widget *w, void *data)
|
1984
|
|
-{ ((kcApp*)data)->_file_new_cb(w); }
|
1985
|
|
-
|
1986
|
|
-void kcApp::_file_new_cb(Fl_Widget *w)
|
1987
|
|
-{ }
|
1988
|
|
-
|
1989
|
|
-
|
1990
|
|
-void kcApp::_s_file_open_cb(Fl_Widget *w, void *data)
|
1991
|
|
-{ ((kcApp*)data)->_file_open_cb(w); }
|
1992
|
|
-
|
1993
|
|
-void kcApp::_file_open_cb(Fl_Widget *w)
|
1994
|
|
-{ }
|
1995
|
|
-
|
1996
|
|
-
|
1997
|
|
-void kcApp::_s_edit_copy_cb(Fl_Widget *w, void *data)
|
1998
|
|
-{ ((kcApp*)data)->_edit_copy_cb(w); }
|
1999
|
|
-
|
2000
|
|
-void kcApp::_edit_copy_cb(Fl_Widget *w)
|
2001
|
|
-{ }
|
2002
|
|
-
|
2003
|
|
-
|
2004
|
|
-void kcApp::_s_edit_paste_cb(Fl_Widget *w, void *data)
|
2005
|
|
-{ ((kcApp*)data)->_edit_paste_cb(w); }
|
2006
|
|
-
|
2007
|
|
-void kcApp::_edit_paste_cb(Fl_Widget *w)
|
|
1826
|
+void kcApp::_s_menu_cb(Fl_Widget *w, void *data)
|
2008
|
1827
|
{ }
|
2009
|
1828
|
|
2010
|
1829
|
|
|
@@ -2016,7 +1835,7 @@ void kcApp::_tab_cb(Fl_Widget*)
|
2016
|
1835
|
Fl_Widget* w = tabs->value();
|
2017
|
1836
|
_ssUpdateFl = w == (Fl_Widget*)mstr_grp;
|
2018
|
1837
|
_ssPhase = kSsPhaseMax;
|
2019
|
|
- if( audioDspIsValid() )
|
|
1838
|
+ if( cmAdIfIsValid(_aiH) )
|
2020
|
1839
|
{
|
2021
|
1840
|
if( cmAdIfEnableStatusNotify(_aiH, _ssUpdateFl ) != kOkAiRC )
|
2022
|
1841
|
cmErrMsg(&_ctx.err,kEngFailKmRC,"A request to enable/disable status notification failed.");
|
|
@@ -2174,15 +1993,15 @@ void kcApp::vprint(const char* fmt, va_list vl )
|
2174
|
1993
|
if( n > 0 )
|
2175
|
1994
|
{
|
2176
|
1995
|
// if the print queue exists (it might not during startup or shutdown) ...
|
2177
|
|
- if( cmTsQueueIsValid(_printqH) )
|
|
1996
|
+ if( cmTsMp1cIsValid(_printqH) )
|
2178
|
1997
|
{
|
2179
|
1998
|
// ... enqueue the text to print
|
2180
|
|
- if( cmTsQueueEnqueueMsg(_printqH,buf,n+1) != kOkThRC )
|
|
1999
|
+ if( cmTsMp1cEnqueueMsg(_printqH,buf,n+1) != kOkThRC && _printFl==0 )
|
2181
|
2000
|
{
|
2182
|
|
- printf("Print enqueue failed on msg:%s\n",buf);
|
2183
|
|
- // we can't call an error here because it would generate an error
|
2184
|
|
- // msg which would possibly fail at this same point resulting in
|
2185
|
|
- // a recursion which would eventually overflow the stack.
|
|
2001
|
+ // use _printFl to guard against recursion which would eventually overflow the stack.
|
|
2002
|
+ ++_printFl;
|
|
2003
|
+ cmErrMsg(&_ctx.err,kQueueFailKmRC,"Print enqueue failed on msg:%s.",buf);
|
|
2004
|
+ --_printFl;
|
2186
|
2005
|
|
2187
|
2006
|
}
|
2188
|
2007
|
}
|
|
@@ -2212,9 +2031,13 @@ cmRC_t kcApp::_s_print_queue_cb(void* userCbPtr, unsigned msgByteCnt, const void
|
2212
|
2031
|
|
2213
|
2032
|
void kcApp::_checkPrintQueue()
|
2214
|
2033
|
{
|
2215
|
|
- while( cmTsQueueMsgWaiting(_printqH) )
|
2216
|
|
- if( cmTsQueueDequeueMsg(_printqH, NULL, 0) != kOkThRC )
|
|
2034
|
+ while( cmTsMp1cMsgWaiting(_printqH) )
|
|
2035
|
+ if( cmTsMp1cDequeueMsg(_printqH, NULL, 0) != kOkThRC && _printFl==0 )
|
|
2036
|
+ {
|
|
2037
|
+ ++_printFl;
|
2217
|
2038
|
cmErrMsg(&_ctx.err,kPrintQueFailKmRC,"Print dequeue failed.");
|
|
2039
|
+ --_printFl;
|
|
2040
|
+ }
|
2218
|
2041
|
}
|
2219
|
2042
|
|
2220
|
2043
|
void kcApp::_print( const char* text )
|