Updated patch to Praat 6.0.04
[sgc2.git] / praat_module / adaptPraat.patch
blob98fa3fc40d7b297bd3b8252f7602928e3cacdb22
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 @@ -1023,10 +1023,14 @@ void MelderAudio_play16 (int16_t *buffer
5 my numberOfChannels = numberOfChannels;
6 my callback = playCallback;
7 my closure = playClosure;
8 + #ifdef DEMOAPP
9 + my asynchronicity = kMelder_asynchronicityLevel_ASYNCHRONOUS;
10 + #else
11 my asynchronicity =
12 Melder_batch ? kMelder_asynchronicityLevel_SYNCHRONOUS :
13 (Melder_backgrounding && ! Melder_asynchronous) ? kMelder_asynchronicityLevel_INTERRUPTABLE :
14 kMelder_asynchronicityLevel_ASYNCHRONOUS;
15 + #endif
16 if (my asynchronicity > preferences. maximumAsynchronicity)
17 my asynchronicity = preferences. maximumAsynchronicity;
18 trace (U"asynchronicity ", my asynchronicity);
19 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp demo_praat_sources/stat/praat_Stat.cpp
20 --- praat_sources/stat/praat_Stat.cpp 2011-10-01 13:32:45.000000000 +0200
21 +++ demo_praat_sources/stat/praat_Stat.cpp 2011-11-18 08:55:32.000000000 +0100
22 @@ -421,7 +421,9 @@ DO
23 END2 }
25 DIRECT2 (Table_edit) {
26 +#ifndef DEMOAPP
27 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot edit a Table from batch.");
28 +#endif
29 LOOP {
30 iam (Table);
31 autoTableEditor editor = TableEditor_create (ID_AND_FULL_NAME, me);
32 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_script.cpp demo_praat_sources/sys/praat_script.cpp
33 --- praat_sources/sys/praat_script.cpp 2011-09-02 13:53:33.000000000 +0200
34 +++ demo_praat_sources/sys/praat_script.cpp 2011-10-28 07:54:25.000000000 +0200
35 @@ -589,6 +589,7 @@ void praat_executeScriptFromText (wchar
36 autostring32 string = Melder_dup (text); // copy, because Interpreter will change it (UGLY)
37 Interpreter_run (interpreter.peek(), string.peek());
38 } catch (MelderError) {
39 + exit (0);
40 Melder_throw (U"Script not completed.");
43 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Graphics_text.cpp demo_praat_sources/sys/Graphics_text.cpp
44 --- praat_sources/sys/Graphics_text.cpp 2011-09-29 12:27:01.000000000 +0200
45 +++ demo_praat_sources/sys/Graphics_text.cpp 2011-10-27 09:14:57.000000000 +0200
46 @@ -151,7 +151,7 @@ static HFONT loadFont (GraphicsScreen me
47 ipaInited = true;
48 if (! charisAvailable && ! doulosAvailable) {
49 /* BUG: The next warning may cause reentry of drawing (on window exposure) and lead to crash. Some code must be non-reentrant !! */
50 - Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
51 + //Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
54 wcscpy (spec. lfFaceName,
55 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp
56 --- praat_sources/sys/praat.cpp 2014-04-22 11:09:57.000000000 +0200
57 +++ demo_praat_sources/sys/praat.cpp 2014-04-22 11:53:58.000000000 +0200
58 @@ -1253,7 +1253,7 @@ void praat_init (const char *title, unsi
60 char32 name [256];
61 #if defined (UNIX)
62 - Melder_sprint (name,256, U".", programName, U"-dir"); // for example .myProg-dir
63 + Melder_sprint (name,256, U".", programName, U""); // for example .myProg-dir
64 #elif defined (macintosh)
65 Melder_sprint (name,256, praatP.title, U" Prefs"); // for example MyProg Prefs
66 #elif defined (_WIN32)
67 @@ -1337,6 +1337,12 @@ void praat_init (const char *title, unsi
69 GuiWindow raam = nullptr;
70 if (Melder_batch) {
71 + #if defined (DEMOAPP) && gtk
72 + Machine_initLookAndFeel (argc, argv);
73 + char32 objectWindowTitle [100];
74 + Melder_sprint (objectWindowTitle,100, praatP.title, U"");
75 + GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 1, 1, objectWindowTitle, gui_cb_quit, NULL, 0);
76 + #endif
77 MelderString_empty (& theCurrentPraatApplication -> batchName);
78 for (unsigned int i = praatP.argumentNumber - 1; i < argc; i ++) {
79 if (i >= praatP.argumentNumber) MelderString_append (& theCurrentPraatApplication -> batchName, U" ");
80 @@ -1380,9 +1386,11 @@ void praat_init (const char *title, unsi
81 #if motif
82 GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell);
83 #endif
84 +#ifndef DEMOAPP
85 trace (U"before objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
86 GuiThing_show (raam);
87 trace (U"after objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
88 +#endif
90 Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, nullptr);
91 if (Melder_batch) {
92 @@ -1392,6 +1400,9 @@ void praat_init (const char *title, unsi
93 trace (U"adding fixed buttons without GUI");
94 praat_addFixedButtons (nullptr);
95 } else {
96 + #ifdef DEMOAPP
97 + Melder_backgrounding = true;
98 + #endif
100 #ifdef macintosh
101 #if ! useCarbon
102 @@ -1419,7 +1430,9 @@ void praat_init (const char *title, unsi
103 trace (U"creating the dynamic menu in the Objects window");
104 praat_actions_createDynamicMenu (raam);
105 trace (U"showing the Objects window");
106 +#ifndef DEMOAPP
107 GuiThing_show (raam);
108 +#endif
109 //Melder_fatal (U"stop");
110 #if defined (UNIX) && ! defined (NO_GRAPHICS)
111 try {
112 @@ -1450,7 +1463,12 @@ void praat_init (const char *title, unsi
114 trace (U"creating the Picture window");
115 trace (U"before picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
116 - if (! praatP.dontUsePictureWindow) praat_picture_init ();
117 + #ifdef DEMOAPP
118 + praat_picture_init ();
119 + praat_dontUsePictureWindow ();
120 + #else
121 + if (! praatP.dontUsePictureWindow) praat_picture_init ();
122 + #endif
123 trace (U"after picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr)));
125 if (unknownCommandLineOption) {
126 @@ -1606,11 +1624,11 @@ void praat_run (void) {
127 if (! str32equ (Melder_integer (dummy), U"1000000000000"))
128 Melder_fatal (U"The number 1000000000000 is mistaken written on this machine as ", dummy, U".");
130 - { uint32_t dummy = 0xffffffff;
131 - Melder_assert ((int64) dummy == 4294967295LL);
132 - Melder_assert (str32equ (Melder_integer (dummy), U"4294967295"));
133 - Melder_assert (double (dummy) == 4294967295.0);
135 +// { uint32_t dummy = 0xffffffff;
136 +// Melder_assert ((int64_t) dummy == 4294967295LL);
137 +// Melder_assert (str32equ (Melder_integer (dummy), U"4294967295"));
138 +// Melder_assert (double (dummy) == 4294967295.0);
139 +// }
140 { double dummy = 3000000000.0;
141 Melder_assert ((uint32) dummy == 3000000000);
143 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp
144 --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200
145 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200
146 @@ -1511,8 +1511,10 @@ void praat_picture_open (void) {
147 #elif cocoa
148 GuiThing_show (dialog);
149 #elif motif
150 +#ifndef DEMOAPP
151 XtMapWidget (dialog -> d_xmShell);
152 XMapRaised (XtDisplay (dialog -> d_xmShell), XtWindow (dialog -> d_xmShell));
153 +#endif
154 #endif
155 Picture_unhighlight (praat_picture);
157 @@ -1796,7 +1798,9 @@ void praat_picture_init (void) {
158 width = height = resolution * 12;
159 scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0);
160 drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, NULL, NULL, NULL, NULL, NULL, 0);
161 +#ifndef DEMOAPP
162 GuiThing_show (dialog);
163 +#endif
166 // TODO: Paul: deze moet VOOR de update functies anders krijgen die void_me 0x0
167 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp
168 --- praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:17:12.000000000 +0200
169 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:59:25.000000000 +0200
170 @@ -855,7 +855,9 @@ static void cb_TextGridEditor_publicatio
173 DIRECT2 (TextGrid_edit) {
174 +#ifndef DEMOAPP
175 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
176 +#endif
177 Sound sound = nullptr;
178 LOOP {
179 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay null
180 @@ -886,7 +888,9 @@ DIRECT (TextGrid_edit)
181 END2 }
183 DIRECT2 (TextGrid_LongSound_edit) {
184 +#ifndef DEMOAPP
185 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
186 +#endif
187 LongSound longSound = nullptr;
188 int ilongSound = 0;
189 LOOP {
190 @@ -902,7 +906,9 @@ DIRECT (TextGrid_LongSound_edit)
191 END2 }
193 DIRECT2 (TextGrid_SpellingChecker_edit) {
194 +#ifndef DEMOAPP
195 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
196 +#endif
197 SpellingChecker spellingChecker = NULL;
198 int ispellingChecker = 0;
199 Sound sound = NULL;
200 @@ -919,7 +925,9 @@ DIRECT (TextGrid_SpellingChecker_edit)
201 END2 }
203 DIRECT2 (TextGrid_LongSound_SpellingChecker_edit) {
204 +#ifndef DEMOAPP
205 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
206 +#endif
207 LongSound longSound = NULL;
208 SpellingChecker spellingChecker = nullptr;
209 int ilongSound = 0, ispellingChecker = 0;
210 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.cpp demo_praat_sources/fon/praat_Sound_init.cpp
211 --- praat_sources/fon/praat_Sound_init.cpp 2012-10-11 10:39:47.000000000 +0200
212 +++ demo_praat_sources/fon/praat_Sound_init.cpp 2012-10-18 15:09:22.000000000 +0200
213 @@ -172,7 +172,9 @@ DO
214 END2 }
216 DIRECT2 (LongSound_view) {
217 +#ifndef DEMOAPP
218 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a LongSound from batch.");
219 +#endif
220 LOOP {
221 iam (LongSound);
222 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
223 @@ -717,7 +719,9 @@ static void cb_SoundEditor_publication (
226 DIRECT2 (Sound_edit) {
227 +#ifndef DEMOAPP
228 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a Sound from batch.");
229 +#endif
230 LOOP {
231 iam (Sound);
232 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
233 @@ -1394,8 +1398,10 @@ static void cb_SoundRecorder_publication
234 praat_updateSelection ();
236 static void do_Sound_record (int numberOfChannels) {
237 +#ifndef DEMOAPP
238 if (theCurrentPraatApplication -> batch)
239 Melder_throw (U"Cannot record a Sound from batch.");
240 +#endif
241 if (theSoundRecorder) {
242 if (numberOfChannels == thePreviousNumberOfChannels) {
243 Editor_raise (theSoundRecorder);
244 @@ -1446,10 +1452,21 @@ FORM (Sound_recordFixedTime, U"Record So
245 POSITIVE (U"Duration (seconds)", U"1.0")
248 +#if defined (_WIN32) && defined (DEMOAPP)
249 + UINT numberOfDevices = waveInGetNumDevs (), i;
250 + if(numberOfDevices > 0) {
251 +#endif
252 autoSound me = Sound_recordFixedTime (GET_INTEGER (U"Input source"),
253 GET_REAL (U"Gain"), GET_REAL (U"Balance"),
254 Melder_atof (GET_STRING (U"Sampling frequency")), GET_REAL (U"Duration"));
255 praat_new (me.move(), U"untitled");
256 +#if defined (_WIN32) && defined (DEMOAPP)
257 + } else {
258 + // Create an empty sound if no input is available
259 + autoSound me = Sound_createSimple (1, GET_REAL (U"Duration"), GET_REAL (U"Sampling frequency"));
260 + praat_new (me.transfer(), U"untitled");
261 + };
262 +#endif
263 END2 }
265 FORM (Sound_resample, U"Sound: Resample", U"Sound: Resample...") {
266 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Ui.cpp demo_praat_sources/sys/Ui.cpp
267 --- praat_sources/sys/Ui.cpp 2014-01-27 09:02:44.000000000 +0100
268 +++ demo_praat_sources/sys/Ui.cpp 2014-03-27 12:22:58.000000000 +0100
269 @@ -729,12 +729,16 @@ void UiForm_finish (I) {
270 void UiForm_finish (UiForm me) {
271 if (! my d_dialogParent && ! my isPauseForm) return;
273 + int numberOfContinueButtons = my numberOfContinueButtons;
274 int size = my numberOfFields;
275 int dialogHeight = 0, x = Gui_LEFT_DIALOG_SPACING, y;
276 int textFieldHeight = Gui_TEXTFIELD_HEIGHT;
277 - int dialogWidth = 520, dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
278 + 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;
279 int labelWidth = fieldX - Gui_LABEL_SPACING - x, fieldWidth = labelWidth, halfFieldWidth = fieldWidth / 2 - 6;
281 + /* Ensure that the dialogs are wide enough */
282 + if (dialogWidth<520) dialogWidth = 520;
284 GuiForm form;
287 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/UiPause.cpp demo_praat_sources/sys/UiPause.cpp
288 --- praat_sources/sys/UiPause.cpp 2012-09-27 09:10:50.000000000 +0200
289 +++ demo_praat_sources/sys/UiPause.cpp 2012-09-27 13:25:18.000000000 +0200
290 @@ -155,6 +155,7 @@ int UiPause_end (int numberOfContinueBut
291 {// scope
292 autoMelderSaveDefaultDir saveDir;
293 thePauseForm_clicked = 0;
294 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))thePauseForm_clicked = 1;
295 Melder_assert (theEventLoopDepth == 0);
296 theEventLoopDepth ++;
297 try {
298 @@ -178,24 +179,28 @@ int UiPause_end (int numberOfContinueBut
299 [pool release];
300 } while (! thePauseForm_clicked);
301 #elif motif
302 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15) == 0){
303 do {
304 XEvent event;
305 GuiNextEvent (& event);
306 XtDispatchEvent (& event);
307 } while (! thePauseForm_clicked);
308 + };
309 #endif
310 } catch (MelderError) {
311 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");
313 theEventLoopDepth --;
315 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))forget(thePauseForm);
316 if (wasBackgrounding) praat_background ();
317 /* BUG: should also restore praatP. editor. */
318 thePauseForm = NULL; // undangle
319 thePauseFormRadio = NULL; // undangle
320 if (thePauseForm_clicked == -1) {
321 - Interpreter_stop (interpreter);
322 - Melder_throw (U"You interrupted the script.");
323 + thePauseForm_clicked = cancelContinueButton;
324 + //Interpreter_stop (interpreter);
325 + //Melder_throw (U"You interrupted the script.");
326 //Melder_flushError ();
327 //Melder_clearError ();
328 } else {
329 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.linux.alsa demo_praat_sources/makefiles/makefile.defs.linux.alsa
330 --- praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 10:17:12.000000000 +0200
331 +++ demo_praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 13:28:59.000000000 +0200
332 @@ -7,7 +7,7 @@ CC = gcc -std=gnu99
334 CXX = g++ -std=c++11
336 -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
337 +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
339 CXXFLAGS = $(CFLAGS) -Wshadow
341 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.darmin32 demo_praat_sources/makefiles/makefile.defs.darmin32
342 --- praat_sources/makefiles/makefile.defs.darmin32 2011-09-19 12:26:39.000000000 +0200
343 +++ demo_praat_sources/makefiles/makefile.defs.darmin32 2011-09-19 15:33:55.000000000 +0200
344 @@ -7,7 +7,7 @@ CC = /mingw32/bin/gcc -std=gnu99 -isyste
346 CXX = /mingw32/bin/g++ -std=c++0x -isystem /mingw32/include/c++/4.7.0 -isystem /mingw32/include -Wshadow
348 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
349 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
351 CXXFLAGS = $(CFLAGS)
353 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.darmin64 demo_praat_sources/makefiles/makefile.defs.darmin64
354 --- praat_sources/makefiles/makefile.defs.darmin64 2011-09-19 12:26:39.000000000 +0200
355 +++ demo_praat_sources/makefiles/makefile.defs.darmin64 2011-09-19 15:33:37.000000000 +0200
356 @@ -7,7 +7,7 @@ CC = /mingw64/bin/gcc -std=gnu99 -isyste
358 CXX = /mingw64/bin/g++ -std=c++0x -isystem /mingw64/include/c++/4.7.0 -isystem /mingw64/include -Wshadow -m64
360 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
361 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
363 CXXFLAGS = $(CFLAGS)
365 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw32 demo_praat_sources/makefiles/makefile.defs.mingw32
366 --- praat_sources/makefiles/makefile.defs.mingw32 2015-09-11 08:38:17.000000000 +0200
367 +++ demo_praat_sources/makefiles/makefile.defs.mingw32 2015-09-15 15:45:42.000000000 +0200
368 @@ -9,7 +9,7 @@ CC = $(PREFIX)gcc -std=gnu99
370 CXX = $(PREFIX)g++ -std=gnu++11 -Wshadow
372 -CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O1
373 +CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O1 -DDEMOAPP
374 # Probably implicit: -m32 -mwin32 -march=i686 -mtune=generic
376 CXXFLAGS = $(CFLAGS)
377 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw64 demo_praat_sources/makefiles/makefile.defs.mingw64
378 --- praat_sources/makefiles/makefile.defs.mingw64 2015-09-11 08:38:17.000000000 +0200
379 +++ demo_praat_sources/makefiles/makefile.defs.mingw64 2015-09-15 15:48:18.000000000 +0200
380 @@ -9,7 +9,7 @@ CC = $(PREFIX)gcc -std=gnu99
382 CXX = $(PREFIX)g++ -std=gnu++11 -Wshadow
384 -CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O1
385 +CFLAGS = -municode -D_FILE_OFFSET_BITS=64 -O1 -DDEMOAPP
386 # Probably implicit: -m64 -mwin32 -march=x86_64 -mtune=generic
388 CXXFLAGS = $(CFLAGS)
389 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp
390 --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200
391 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200
392 @@ -66,9 +66,9 @@ TextGrid Intensity_to_TextGrid_detectSil
393 Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum);
394 double intensity_dbRange = intensity_max_db - intensity_min_db;
396 - if (intensity_dbRange < 10) {
397 - Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB.");
399 + /*if (intensity_dbRange < 10) {
400 + Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB.");
401 + }*/
402 double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB);
404 if (minSilenceDuration > duration || intensityThreshold < intensity_min_db) {
405 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp
406 --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100
407 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100
408 @@ -505,8 +505,10 @@ FORM (SearchManual, U"Search manual", U"
409 TEXTFIELD (U"query", U"")
412 + #ifndef DEMOAPP
413 if (theCurrentPraatApplication -> batch)
414 Melder_throw (U"Cannot view a manual from batch.");
415 + #endif
416 Manual manPage = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
417 Manual_search (manPage, GET_STRING (U"query"));
418 END2 }
419 @@ -517,8 +519,10 @@ FORM (GoToManualPage, U"Go to manual pag
420 LIST (U"Page", numberOfPages, pages, 1)}
423 + #ifndef DEMOAPP
424 if (theCurrentPraatApplication -> batch)
425 Melder_throw (U"Cannot view a manual from batch.");
426 + #endif
427 Manual manPage = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
428 HyperPage_goToPage_i (manPage, GET_INTEGER (U"Page"));
429 END2 }
430 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/GuiMenu.cpp demo_praat_sources/sys/GuiMenu.cpp
431 --- praat_sources/sys/GuiMenu.cpp 2012-09-27 09:10:50.000000000 +0200
432 +++ demo_praat_sources/sys/GuiMenu.cpp 2012-10-25 09:55:23.000000000 +0200
433 @@ -368,7 +368,9 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
436 #elif motif
437 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
438 if (! window) {
439 + #endif
440 my d_xmMenuTitle = XmCreateCascadeButton (theGuiTopMenuBar, Melder_peek32to8 (title), nullptr, 0);
441 if (str32equ (title, U"Help"))
442 XtVaSetValues (theGuiTopMenuBar, XmNmenuHelpWidget, my d_xmMenuTitle, nullptr);
443 @@ -377,6 +379,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
444 XtSetSensitive (my d_xmMenuTitle, False);
445 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, nullptr);
446 XtManageChild (my d_xmMenuTitle);
447 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
448 } else {
449 my d_xmMenuTitle = XmCreateCascadeButton (window -> d_xmMenuBar, Melder_peek32to8 (title), nullptr, 0);
450 if (str32equ (title, U"Help"))
451 @@ -387,6 +390,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
452 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, nullptr);
453 XtManageChild (my d_xmMenuTitle);
455 + #endif
456 _GuiObject_setUserData (my d_widget, me);
457 #endif
459 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/DemoEditor.cpp demo_praat_sources/sys/DemoEditor.cpp
460 --- praat_sources/sys/DemoEditor.cpp 2014-05-09 08:59:02.000000000 +0200
461 +++ demo_praat_sources/sys/DemoEditor.cpp 2014-05-16 10:30:28.000000000 +0200
462 @@ -245,6 +245,7 @@ void Demo_waitForInput (Interpreter inte
463 if (theDemoEditor -> userWantsToClose) {
464 Interpreter_stop (interpreter);
465 forget (theDemoEditor);
466 + exit (0);
467 Melder_throw (U"You interrupted the script.");