Removed patch for Windows rec ording without input
[sgc2.git] / praat_module / adaptPraat.patch
blobf21aa156a6139e73af47cfa65850d3d0567f9ad9
1 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/melder_audio.cpp demo_praat_sources/sys/melder_audio.cpp
2 --- praat_sources/sys/melder_audio.cpp 2014-12-29 08:24:04.000000000 +0100
3 +++ demo_praat_sources/sys/melder_audio.cpp 2015-05-12 09:48:06.000000000 +0200
4 # Allow playback in the background
5 @@ -1019,10 +1019,14 @@ void MelderAudio_play16 (int16_t *buffer
6 my numberOfChannels = numberOfChannels;
7 my callback = playCallback;
8 my closure = playClosure;
9 + #ifdef DEMOAPP
10 + my asynchronicity = kMelder_asynchronicityLevel_ASYNCHRONOUS;
11 + #else
12 my asynchronicity =
13 Melder_batch ? kMelder_asynchronicityLevel_SYNCHRONOUS :
14 (Melder_backgrounding && ! Melder_asynchronous) ? kMelder_asynchronicityLevel_INTERRUPTABLE :
15 kMelder_asynchronicityLevel_ASYNCHRONOUS;
16 + #endif
17 if (my asynchronicity > preferences. maximumAsynchronicity)
18 my asynchronicity = preferences. maximumAsynchronicity;
19 trace (U"asynchronicity ", my asynchronicity);
20 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_script.cpp demo_praat_sources/sys/praat_script.cpp
21 --- praat_sources/sys/praat_script.cpp 2011-09-02 13:53:33.000000000 +0200
22 +++ demo_praat_sources/sys/praat_script.cpp 2011-10-28 07:54:25.000000000 +0200
23 # In case of an error, terminate the program
24 @@ -602,6 +602,7 @@ void praat_executeScriptFromText (wchar
25 autostring32 string = Melder_dup (text); // copy, because Interpreter will change it (UGLY)
26 Interpreter_run (interpreter.get(), string.peek());
27 } catch (MelderError) {
28 + exit (0);
29 Melder_throw (U"Script not completed.");
32 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Graphics_text.cpp demo_praat_sources/sys/Graphics_text.cpp
33 --- praat_sources/sys/Graphics_text.cpp 2011-09-29 12:27:01.000000000 +0200
34 +++ demo_praat_sources/sys/Graphics_text.cpp 2011-10-27 09:14:57.000000000 +0200
35 # Supress the annoying message about the phonetic font not being installed
36 @@ -105,7 +105,7 @@ static HFONT loadFont (GraphicsScreen me
37 ipaInited = true;
38 if (! charisAvailable && ! doulosAvailable) {
39 /* BUG: The next warning may cause reentry of drawing (on window exposure) and lead to crash. Some code must be non-reentrant !! */
40 - Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
41 + //Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
44 wcscpy (spec. lfFaceName,
45 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp
46 --- praat_sources/sys/praat.cpp 2016-01-11 08:45:44.000000000 +0100
47 +++ demo_praat_sources/sys/praat.cpp 2016-01-27 15:29:23.000000000 +0100
48 # When running thePraatStandAloneScriptText, block the Melder_batch flag
49 @@ -1136,7 +1136,9 @@ void praat_init (const char32 *title, in
51 //Melder_casual (U"Script file name <<", theCurrentPraatApplication -> batchName.string, U">>");
53 + #if ! ( defined (_WIN32) && defined (DEMOAPP) )
54 Melder_batch |= !! thePraatStandAloneScriptText;
55 + #endif
58 * Running the Praat shell from the command line:
59 # Change the name of the Unix preference dir
60 @@ -1188,7 +1190,7 @@ void praat_init (const char32 *title, in
62 char32 name [256];
63 #if defined (UNIX)
64 - Melder_sprint (name,256, U".", programName, U"-dir"); // for example .myProg-dir
65 + Melder_sprint (name,256, U".", programName, U""); // for example .myProg-dir
66 #elif defined (macintosh)
67 Melder_sprint (name,256, praatP.title, U" Prefs"); // for example MyProg Prefs
68 #elif defined (_WIN32)
69 # Something in Linux (GTK)? Do not know what?
70 @@ -1272,6 +1274,12 @@ void praat_init (const char32 *title, in
72 GuiWindow raam = nullptr;
73 if (Melder_batch) {
74 + #if defined (DEMOAPP) && gtk
75 + Machine_initLookAndFeel (argc, argv);
76 + char32 objectWindowTitle [100];
77 + Melder_sprint (objectWindowTitle,100, praatP.title, U"");
78 + GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 1, 1, objectWindowTitle, gui_cb_quit, NULL, 0);
79 + #endif
80 MelderString_empty (& theCurrentPraatApplication -> batchName);
81 for (int i = praatP.argumentNumber - 1; i < argc; i ++) {
82 if (i >= praatP.argumentNumber) MelderString_append (& theCurrentPraatApplication -> batchName, U" ");
83 # Supress opening the object window, initialize praat under Mac 64 bit (cocoa) Needed for 10.7
84 @@ -1313,10 +1321,32 @@ void praat_init (const char32 *title, in
85 #if motif
86 GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell);
87 #endif
88 +#ifndef DEMOAPP
89 trace (U"before objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
90 GuiThing_show (raam);
91 trace (U"after objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
92 +#endif
95 + #if cocoa
96 + {
97 + trace (U"starting the application");
98 + Machine_initLookAndFeel (argc, argv);
99 + /*
100 + * Start the application.
101 + */
102 + //[NSApplication sharedApplication];
103 + [GuiCocoaApplication sharedApplication];
105 + trace (U"creating and installing the Objects window");
106 + char32 objectWindowTitle [100];
107 + double x, y;
108 + trace (U"locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
109 + Gui_getWindowPositioningBounds (& x, & y, nullptr, nullptr);
110 + trace (U"locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
112 + #endif
114 Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classStringSet, nullptr);
115 Thing_recognizeClassByOtherName (classStringSet, U"SortedSetOfString");
116 if (Melder_batch) {
117 # Seems to speed startup, but not sure whether it is necessary
118 @@ -1326,6 +1356,9 @@ void praat_init (const char32 *title, in
119 trace (U"adding fixed buttons without GUI");
120 praat_addFixedButtons (nullptr);
121 } else {
122 + #ifdef DEMOAPP
123 + Melder_backgrounding = true;
124 + #endif
126 #ifdef macintosh
127 AEInstallEventHandler (758934755, 0, (AEEventHandlerProcPtr) (mac_processSignal8), 0, false); // for receiving sendpraat
128 # Supress opening the object window
129 @@ -1347,7 +1380,9 @@ void praat_init (const char32 *title, in
130 trace (U"creating the dynamic menu in the Objects window");
131 praat_actions_createDynamicMenu (raam);
132 trace (U"showing the Objects window");
133 +#ifndef DEMOAPP
134 GuiThing_show (raam);
135 +#endif
136 //Melder_fatal (U"stop");
137 #if defined (UNIX) && ! defined (NO_GRAPHICS)
138 try {
139 # Initialize a picture window, but close it immediately
140 @@ -1378,7 +1413,12 @@ void praat_init (const char32 *title, in
142 trace (U"creating the Picture window");
143 trace (U"before picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
144 - if (! praatP.dontUsePictureWindow) praat_picture_init ();
145 + #ifdef DEMOAPP
146 + praat_picture_init ();
147 + praat_dontUsePictureWindow ();
148 + #else
149 + if (! praatP.dontUsePictureWindow) praat_picture_init ();
150 + #endif
151 trace (U"after picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
153 if (unknownCommandLineOption) {
154 # No idea why this is needed?
155 @@ -1541,7 +1581,7 @@ void praat_run () {
156 Melder_fatal (U"The number 1000000000000 is mistakenly written on this machine as ", dummy, U".");
158 { uint32_t dummy = 0xffffffff;
159 - Melder_assert ((int64) dummy == 4294967295LL);
160 + Melder_assert ((int64_t) dummy == 4294967295LL);
161 Melder_assert (str32equ (Melder_integer (dummy), U"4294967295"));
162 Melder_assert (double (dummy) == 4294967295.0);
164 # Next chunk is needed to start the Demo window under Windows (motif)
165 @@ -1653,10 +1693,20 @@ void praat_run () {
166 trace (U"locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
167 gtk_main ();
168 #elif motif
169 - for (;;) {
170 - XEvent event;
171 - GuiNextEvent (& event);
172 - XtDispatchEvent (& event);
173 + if (thePraatStandAloneScriptText) {
174 + try {
175 + praat_executeScriptFromText (thePraatStandAloneScriptText);
176 + praat_exit (0);
177 + } catch (MelderError) {
178 + Melder_flushError (praatP.title, U": stand-alone script session interrupted.");
179 + praat_exit (-1);
181 + } else {
182 + for (;;) {
183 + XEvent event;
184 + GuiNextEvent (& event);
185 + XtDispatchEvent (& event);
186 + }
188 #elif cocoa
189 [NSApp run];
190 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp
191 --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200
192 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200
193 # Supress picture window
194 @@ -1595,8 +1595,10 @@ void praat_picture_open (void) {
195 #if gtk
196 gtk_window_present (GTK_WINDOW (dialog -> d_gtkWindow));
197 #elif motif
198 +#ifndef DEMOAPP
199 XtMapWidget (dialog -> d_xmShell);
200 XMapRaised (XtDisplay (dialog -> d_xmShell), XtWindow (dialog -> d_xmShell));
201 +#endif
202 #elif cocoa
203 GuiThing_show (dialog);
204 #endif
205 @@ -1888,7 +1890,9 @@ void praat_picture_init (void) {
206 width = height = resolution * 12;
207 scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0);
208 drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, nullptr, nullptr, nullptr, nullptr, nullptr, 0);
209 +#ifndef DEMOAPP
210 GuiThing_show (dialog);
211 +#endif
214 // TODO: Paul: deze moet VOOR de update functies anders krijgen die void_me 0x0
215 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound.cpp demo_praat_sources/fon/praat_Sound.cpp
216 --- praat_sources/fon/praat_Sound.cpp 2017-06-08 11:26:20.000000000 +0200
217 +++ demo_praat_sources/fon/praat_Sound.cpp 2017-06-08 12:22:45.000000000 +0200
218 # View and edit Long/Sounds in a DemoApp (when Melder_back = True)
219 @@ -157,7 +157,9 @@ DO
222 DIRECT (WINDOW_LongSound_view) {
223 +#ifndef DEMOAPP
224 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a LongSound from batch.");
225 +#endif
226 LOOP {
227 iam (LongSound);
228 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
229 @@ -671,7 +673,9 @@ static void cb_SoundEditor_publication (
232 DIRECT (WINDOW_Sound_viewAndEdit) {
233 +#ifndef DEMOAPP
234 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a Sound from batch.");
235 +#endif
236 LOOP {
237 iam (Sound);
238 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
239 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Ui.cpp demo_praat_sources/sys/Ui.cpp
240 --- praat_sources/sys/Ui.cpp 2014-01-27 09:02:44.000000000 +0100
241 +++ demo_praat_sources/sys/Ui.cpp 2014-03-27 12:22:58.000000000 +0100
242 # Increase size of Pause Forms
243 @@ -841,12 +841,16 @@ void UiForm_finish (I) {
244 void UiForm_finish (UiForm me) {
245 if (! my d_dialogParent && ! my isPauseForm) return;
247 + int numberOfContinueButtons = my numberOfContinueButtons;
248 int size = my numberOfFields;
249 int dialogHeight = 0, x = Gui_LEFT_DIALOG_SPACING, y;
250 int textFieldHeight = Gui_TEXTFIELD_HEIGHT;
251 - int dialogWidth = 520, dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
252 + int dialogWidth = REVERT_BUTTON_WIDTH + STOP_BUTTON_WIDTH + 2*Gui_LABEL_SPACING + numberOfContinueButtons*(STANDARDS_BUTTON_WIDTH + Gui_LABEL_SPACING), dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
253 int labelWidth = fieldX - Gui_LABEL_SPACING - x, fieldWidth = labelWidth, halfFieldWidth = fieldWidth / 2 - 6;
255 + /* Ensure that the dialogs are wide enough */
256 + if (dialogWidth<520) dialogWidth = 520;
258 GuiForm form;
261 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/UiPause.cpp demo_praat_sources/sys/UiPause.cpp
262 --- praat_sources/sys/UiPause.cpp 2012-09-27 09:10:50.000000000 +0200
263 +++ demo_praat_sources/sys/UiPause.cpp 2012-09-27 13:25:18.000000000 +0200
264 # Catch close buttons of Pause window and prevent terminating the script
265 @@ -143,6 +143,7 @@ int UiPause_end (int numberOfContinueBut
266 {// scope
267 autoMelderSaveDefaultDir saveDir;
268 thePauseForm_clicked = 0;
269 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))thePauseForm_clicked = 1;
270 Melder_assert (theEventLoopDepth == 0);
271 theEventLoopDepth ++;
272 try {
273 @@ -166,24 +167,28 @@ int UiPause_end (int numberOfContinueBut
274 [pool release];
275 } while (! thePauseForm_clicked);
276 #elif motif
277 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15) == 0){
278 do {
279 XEvent event;
280 GuiNextEvent (& event);
281 XtDispatchEvent (& event);
282 } while (! thePauseForm_clicked);
283 + };
284 #endif
285 } catch (MelderError) {
286 Melder_flushError (U"An error made it to the outer level in a pause window; should not occur! Please write to paul.boersma@uva.nl");
288 theEventLoopDepth --;
290 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))forget(thePauseForm);
291 if (wasBackgrounding) praat_background ();
292 /* BUG: should also restore praatP. editor. */
293 thePauseForm = nullptr; // undangle
294 thePauseFormRadio = nullptr; // undangle
295 if (thePauseForm_clicked == -1) {
296 - Interpreter_stop (interpreter);
297 - Melder_throw (U"You interrupted the script.");
298 + thePauseForm_clicked = cancelContinueButton;
299 + //Interpreter_stop (interpreter);
300 + //Melder_throw (U"You interrupted the script.");
301 //Melder_flushError ();
302 //Melder_clearError ();
303 } else {
304 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp
305 --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200
306 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200
307 @@ -65,9 +65,9 @@ TextGrid Intensity_to_TextGrid_detectSil
308 Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum);
309 double intensity_dbRange = intensity_max_db - intensity_min_db;
311 - if (intensity_dbRange < 10) {
312 - Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB.");
314 + /*if (intensity_dbRange < 10) {
315 + Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB.");
316 + }*/
317 double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB);
319 if (minSilenceDuration > duration || intensityThreshold < intensity_min_db) {
320 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp
321 --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100
322 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100
323 # Allow the man pages
324 @@ -511,8 +511,10 @@ FORM (SearchManual, U"Search manual", U"
325 TEXTFIELD4 (query, U"query", U"")
328 + #ifndef DEMOAPP
329 if (theCurrentPraatApplication -> batch)
330 Melder_throw (U"Cannot view a manual from batch.");
331 + #endif
332 autoManual manual = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
333 Manual_search (manual.get(), query);
334 manual.releaseToUser();
335 @@ -524,8 +526,10 @@ FORM (GoToManualPage, U"Go to manual pag
336 LIST (U"Page", numberOfPages, pages, 1)
339 + #ifndef DEMOAPP
340 if (theCurrentPraatApplication -> batch)
341 Melder_throw (U"Cannot view a manual from batch.");
342 + #endif
343 autoManual manual = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
344 HyperPage_goToPage_i (manual.get(), GET_INTEGER (U"Page"));
345 manual.releaseToUser();
346 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/GuiMenu.cpp demo_praat_sources/sys/GuiMenu.cpp
347 --- praat_sources/sys/GuiMenu.cpp 2017-06-08 11:26:20.000000000 +0200
348 +++ demo_praat_sources/sys/GuiMenu.cpp 2017-06-09 15:29:42.000000000 +0200
349 @@ -313,7 +313,9 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
350 gtk_menu_item_set_submenu (GTK_MENU_ITEM (my d_gtkMenuTitle), GTK_WIDGET (my d_widget));
351 _GuiObject_setUserData (my d_widget, me.get());
352 #elif motif
353 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
354 Melder_assert (window);
355 + #endif
356 my d_xmMenuTitle = XmCreateCascadeButton (window -> d_xmMenuBar, Melder_peek32to8 (title), nullptr, 0);
357 if (str32equ (title, U"Help"))
358 XtVaSetValues (window -> d_xmMenuBar, XmNmenuHelpWidget, my d_xmMenuTitle, nullptr);
359 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/DemoEditor.cpp demo_praat_sources/sys/DemoEditor.cpp
360 --- praat_sources/sys/DemoEditor.cpp 2014-05-09 08:59:02.000000000 +0200
361 +++ demo_praat_sources/sys/DemoEditor.cpp 2014-05-16 10:30:28.000000000 +0200
362 # Close the script and stop Praat. If you do not stop praat, you retain Zombie Praat processes under Windows
363 @@ -266,6 +266,7 @@ void Demo_waitForInput (Interpreter inte
364 if (theReferenceToTheOnlyDemoEditor -> userWantsToClose) {
365 Interpreter_stop (interpreter);
366 forget (theReferenceToTheOnlyDemoEditor);
367 + exit (0);
368 Melder_throw (U"You interrupted the script.");
371 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp demo_praat_sources/stat/praat_Stat.cpp
372 --- praat_sources/stat/praat_Stat.cpp 2017-06-08 11:26:20.000000000 +0200
373 +++ demo_praat_sources/stat/praat_Stat.cpp 2017-06-09 15:14:12.000000000 +0200
374 # Allow to view tables when in a Demo app
375 @@ -291,7 +291,9 @@ DIRECT (HELP_StatisticsTutorial) {
376 // MARK: View & Edit
378 DIRECT (WINDOW_Table_viewAndEdit) {
379 +#ifndef DEMOAPP
380 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot edit a Table from batch.");
381 +#endif
382 LOOP {
383 iam_LOOP (Table);
384 autoTableEditor editor = TableEditor_create (ID_AND_FULL_NAME, me);
385 --- praat_sources/stat/praat_Stat.cpp 2011-10-01 13:32:45.000000000 +0200
386 +++ demo_praat_sources/stat/praat_Stat.cpp 2011-11-18 08:55:32.000000000 +0100
387 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp
388 --- praat_sources/fon/praat_TextGrid_init.cpp 2017-06-08 11:26:20.000000000 +0200
389 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2017-06-09 15:49:13.000000000 +0200
390 # View and edit TextGrids in a DemoApp (when Melder_back = True)
391 @@ -703,7 +703,9 @@ static void cb_TextGridEditor_publicatio
394 DIRECT (WINDOW_TextGrid_viewAndEdit) {
395 +#ifndef DEMOAPP
396 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
397 +#endif
398 Sound sound = nullptr;
399 LOOP {
400 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay null
401 @@ -721,7 +723,9 @@ FORM (WINDOW_TextGrid_viewAndEditWithCal
402 SENTENCE4 (callbackText, U"Callback text", U"r1")
405 +#ifndef DEMOAPP
406 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
407 +#endif
408 Sound sound = nullptr;
409 LOOP {
410 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay null
411 @@ -736,7 +740,9 @@ DO
412 END }
414 DIRECT (WINDOW_TextGrid_LongSound_viewAndEdit) {
415 +#ifndef DEMOAPP
416 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
417 +#endif
418 LongSound longSound = nullptr;
419 int ilongSound = 0;
420 LOOP {
421 @@ -753,7 +759,9 @@ DIRECT (WINDOW_TextGrid_LongSound_viewAn
422 END }
424 DIRECT (WINDOW_TextGrid_SpellingChecker_viewAndEdit) {
425 +#ifndef DEMOAPP
426 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
427 +#endif
428 SpellingChecker spellingChecker = nullptr;
429 int ispellingChecker = 0;
430 Sound sound = nullptr;
431 @@ -771,7 +779,9 @@ DIRECT (WINDOW_TextGrid_SpellingChecker_
432 END }
434 DIRECT (WINDOW_TextGrid_LongSound_SpellingChecker_viewAndEdit) {
435 +#ifndef DEMOAPP
436 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
437 +#endif
438 LongSound longSound = nullptr;
439 SpellingChecker spellingChecker = nullptr;
440 int ilongSound = 0, ispellingChecker = 0;
442 # Add DEMOAPP flag to compiler
443 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.linux.alsa demo_praat_sources/makefiles/makefile.defs.linux.alsa
444 --- praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 10:17:12.000000000 +0200
445 +++ demo_praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 13:28:59.000000000 +0200
446 @@ -7,7 +7,7 @@ CC = gcc -std=gnu99
448 CXX = g++ -std=c++11
450 -CFLAGS = -DUNIX -Dlinux -DALSA -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O1 -g1 -pthread
451 +CFLAGS = -DUNIX -Dlinux -DALSA -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -DDEMOAPP -O1 -g1 -pthread
453 CXXFLAGS = $(CFLAGS) -Wshadow
455 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.darmin32 demo_praat_sources/makefiles/makefile.defs.darmin32
456 --- praat_sources/makefiles/makefile.defs.darmin32 2011-09-19 12:26:39.000000000 +0200
457 +++ demo_praat_sources/makefiles/makefile.defs.darmin32 2011-09-19 15:33:55.000000000 +0200
458 @@ -7,7 +7,7 @@ CC = /mingw32/bin/gcc -std=gnu99 -isyste
460 CXX = /mingw32/bin/g++ -std=c++0x -isystem /mingw32/include/c++/4.7.0 -isystem /mingw32/include -Wshadow
462 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
463 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
465 CXXFLAGS = $(CFLAGS)
467 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.darmin64 demo_praat_sources/makefiles/makefile.defs.darmin64
468 --- praat_sources/makefiles/makefile.defs.darmin64 2011-09-19 12:26:39.000000000 +0200
469 +++ demo_praat_sources/makefiles/makefile.defs.darmin64 2011-09-19 15:33:37.000000000 +0200
470 @@ -7,7 +7,7 @@ CC = /mingw64/bin/gcc -std=gnu99 -isyste
472 CXX = /mingw64/bin/g++ -std=c++0x -isystem /mingw64/include/c++/4.7.0 -isystem /mingw64/include -Wshadow -m64
474 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
475 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
477 CXXFLAGS = $(CFLAGS)
479 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw32 demo_praat_sources/makefiles/makefile.defs.mingw32
480 --- praat_sources/makefiles/makefile.defs.mingw32 2015-09-11 08:38:17.000000000 +0200
481 +++ demo_praat_sources/makefiles/makefile.defs.mingw32 2015-09-15 15:45:42.000000000 +0200
482 @@ -9,7 +9,7 @@ CC = $(PREFIX)gcc -std=gnu99
484 CXX = $(PREFIX)g++ -std=gnu++11 -Wshadow
486 -CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O3
487 +CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O3 -DDEMOAPP
488 # Probably implicit: -m32 -mwin32 -march=i686 -mtune=generic
490 CXXFLAGS = $(CFLAGS)
491 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw64 demo_praat_sources/makefiles/makefile.defs.mingw64
492 --- praat_sources/makefiles/makefile.defs.mingw64 2015-09-11 08:38:17.000000000 +0200
493 +++ demo_praat_sources/makefiles/makefile.defs.mingw64 2015-09-15 15:48:18.000000000 +0200
494 @@ -9,7 +9,7 @@ CC = $(PREFIX)gcc -std=gnu99
496 CXX = $(PREFIX)g++ -std=gnu++11 -Wshadow
498 -CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O3
499 +CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O3 -DDEMOAPP
500 # Probably implicit: -m64 -mwin32 -march=x86_64 -mtune=generic
502 CXXFLAGS = $(CFLAGS)