1 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp demo_praat_sources/stat/praat_Stat.cpp
2 --- praat_sources/stat/praat_Stat.cpp 2011-10-01 13:32:45.000000000 +0200
3 +++ demo_praat_sources/stat/praat_Stat.cpp 2011-11-18 08:55:32.000000000 +0100
9 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot edit a Table from batch.");
13 autoTableEditor editor = TableEditor_create (ID_AND_FULL_NAME, me);
14 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_script.cpp demo_praat_sources/sys/praat_script.cpp
15 --- praat_sources/sys/praat_script.cpp 2011-09-02 13:53:33.000000000 +0200
16 +++ demo_praat_sources/sys/praat_script.cpp 2011-10-28 07:54:25.000000000 +0200
17 @@ -462,6 +462,7 @@ void praat_executeScriptFromText (wchar
18 autoInterpreter interpreter = Interpreter_create (NULL, NULL);
19 Interpreter_run (interpreter.peek(), text);
20 } catch (MelderError) {
22 Melder_throw (L"Script not completed.");
25 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Graphics_text.cpp demo_praat_sources/sys/Graphics_text.cpp
26 --- praat_sources/sys/Graphics_text.cpp 2011-09-29 12:27:01.000000000 +0200
27 +++ demo_praat_sources/sys/Graphics_text.cpp 2011-10-27 09:14:57.000000000 +0200
28 @@ -136,7 +136,7 @@ static HFONT loadFont (GraphicsScreen me
30 if (! charisAvailable && ! doulosAvailable) {
31 /* BUG: The next warning may cause reentry of drawing (on window exposure) and lead to crash. Some code must be non-reentrant !! */
32 - Melder_warning (L"The phonetic font is not available.\nSeveral characters will not look correct.\nSee www.praat.org");
33 + //Melder_warning (L"The phonetic font is not available.\nSeveral characters will not look correct.\nSee www.praat.org");
37 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp
38 --- praat_sources/sys/praat.cpp 2012-10-15 10:41:10.000000000 +0200
39 +++ demo_praat_sources/sys/praat.cpp 2012-10-15 13:47:24.000000000 +0200
40 @@ -1184,9 +1184,9 @@ void praat_init (const char *title, unsi
41 * Make sure that the program's private directory exists.
44 - swprintf (name, 256, L".%ls-dir", Melder_utf8ToWcs (programName)); /* For example .myProg-dir */
45 + swprintf (name, 256, L".%ls", Melder_utf8ToWcs (praatP.title)); /* For example .myProg-dir */
46 #elif defined (macintosh)
47 - swprintf (name, 256, L"%ls Prefs", Melder_utf8ToWcs (praatP.title)); /* For example MyProg Prefs */
48 + swprintf (name, 256, L"%ls", L"SpeakGoodChinese2"); /* For example MyProg Prefs */
49 #elif defined (_WIN32)
50 swprintf (name, 256, L"%ls", Melder_utf8ToWcs (praatP.title)); /* For example MyProg */
52 @@ -1259,6 +1259,12 @@ void praat_init (const char *title, unsi
54 GuiWindow raam = NULL;
56 + #if defined (DEMOAPP) && gtk
57 + char objectWindowTitle [100];
58 + Machine_initLookAndFeel (argc, argv);
59 + sprintf (objectWindowTitle, "%s Objects", praatP.title);
60 + GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT,Melder_peekUtf8ToWcs (objectWindowTitle), gui_cb_quit, NULL, 0);
62 #if defined (UNIX) || defined (macintosh) || defined (_WIN32) && defined (CONSOLE_APPLICATION)
63 MelderString_empty (& theCurrentPraatApplication -> batchName);
64 for (unsigned int i = iarg_batchName; i < argc; i ++) {
65 @@ -1305,9 +1311,11 @@ void praat_init (const char *title, unsi
67 GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell);
70 trace ("before objects window shows locale %s", setlocale (LC_ALL, NULL));
72 trace ("after objects window shows locale %s", setlocale (LC_ALL, NULL));
75 Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, NULL);
77 @@ -1317,6 +1325,9 @@ void praat_init (const char *title, unsi
78 trace ("adding fixed buttons without GUI");
79 praat_addFixedButtons (NULL);
82 + Melder_backgrounding = true;
87 @@ -1344,7 +1355,9 @@ void praat_init (const char *title, unsi
88 trace ("creating the dynamic menu in the Objects window");
89 praat_actions_createDynamicMenu (raam);
90 trace ("showing the Objects window");
94 //Melder_fatal ("stop");
97 @@ -1369,7 +1382,12 @@ void praat_init (const char *title, unsi
99 trace ("creating the Picture window");
100 trace ("before picture window shows: locale is %s", setlocale (LC_ALL, NULL));
101 - if (! praatP.dontUsePictureWindow) praat_picture_init ();
103 + praat_picture_init ();
104 + praat_dontUsePictureWindow ();
106 + if (! praatP.dontUsePictureWindow) praat_picture_init ();
108 trace ("after picture window shows: locale is %s", setlocale (LC_ALL, NULL));
111 @@ -1615,6 +1633,14 @@ void praat_run (void) {
112 Melder_flushError (NULL);
115 + else if (thePraatStandAloneScriptText != NULL) {
117 + praat_executeScriptFromText (thePraatStandAloneScriptText);
119 + } catch (MelderError) {
120 + Melder_flushError (NULL);
126 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp
127 --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200
128 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200
129 @@ -1684,7 +1684,9 @@ void praat_picture_init (void) {
130 width = height = resolution * 12;
131 scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0);
132 drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, NULL, NULL, NULL, NULL, NULL, 0);
138 // TODO: Paul: deze moet VOOR de update functies anders krijgen die void_me 0x0
139 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp
140 --- praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:17:12.000000000 +0200
141 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:59:25.000000000 +0200
142 @@ -825,7 +825,9 @@ static void cb_TextGridEditor_publicatio
145 DIRECT (TextGrid_edit)
147 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
151 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay NULL
152 @@ -839,7 +841,9 @@ DIRECT (TextGrid_edit)
155 DIRECT (TextGrid_LongSound_edit)
157 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
159 LongSound longSound = NULL;
162 @@ -855,7 +859,9 @@ DIRECT (TextGrid_LongSound_edit)
165 DIRECT (TextGrid_SpellingChecker_edit)
167 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
169 SpellingChecker spellingChecker = NULL;
170 int ispellingChecker = 0;
172 @@ -872,7 +878,9 @@ DIRECT (TextGrid_SpellingChecker_edit)
175 DIRECT (TextGrid_LongSound_SpellingChecker_edit)
177 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
179 LongSound longSound = NULL;
180 SpellingChecker spellingChecker = NULL;
181 int ilongSound = 0, ispellingChecker = 0;
182 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.cpp demo_praat_sources/fon/praat_Sound_init.cpp
183 --- praat_sources/fon/praat_Sound_init.cpp 2011-09-12 10:17:12.000000000 +0200
184 +++ demo_praat_sources/fon/praat_Sound_init.cpp 2011-09-12 11:03:24.000000000 +0200
185 @@ -172,7 +172,9 @@ DO
188 DIRECT (LongSound_view)
190 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a LongSound from batch.");
194 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
195 @@ -717,7 +719,9 @@ static void cb_SoundEditor_publication (
200 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a Sound from batch.");
204 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
205 @@ -1396,8 +1400,10 @@ static void cb_SoundRecorder_publication
206 praat_updateSelection ();
208 static void do_Sound_record (int numberOfChannels) {
210 if (theCurrentPraatApplication -> batch)
211 Melder_throw ("Cannot record a Sound from batch.");
213 if (theSoundRecorder) {
214 if (numberOfChannels == thePreviousNumberOfChannels) {
215 theSoundRecorder -> raise ();
216 @@ -1447,10 +1453,21 @@ FORM (Sound_recordFixedTime, L"Record So
217 POSITIVE (L"Duration (seconds)", L"1.0")
220 +#if defined (_WIN32) && defined (DEMOAPP)
221 + UINT numberOfDevices = waveInGetNumDevs (), i;
222 + if(numberOfDevices > 0) {
224 autoSound me = Sound_recordFixedTime (GET_INTEGER (L"Input source"),
225 GET_REAL (L"Gain"), GET_REAL (L"Balance"),
226 wcstod (GET_STRING (L"Sampling frequency"), NULL), GET_REAL (L"Duration"));
227 praat_new (me.transfer(), L"untitled");
228 +#if defined (_WIN32) && defined (DEMOAPP)
230 + // Create an empty sound if no input is available
231 + autoSound me = Sound_createSimple (1, GET_REAL (L"Duration"), wcstod (GET_STRING (L"Sampling frequency"), NULL));
232 + praat_new (me.transfer(), L"untitled");
237 FORM (Sound_resample, L"Sound: Resample", L"Sound: Resample...")
238 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/UiPause.cpp demo_praat_sources/sys/UiPause.cpp
239 --- praat_sources/sys/UiPause.cpp 2012-09-27 09:10:50.000000000 +0200
240 +++ demo_praat_sources/sys/UiPause.cpp 2012-09-27 13:25:18.000000000 +0200
241 @@ -159,6 +159,7 @@ int UiPause_end (int numberOfContinueBut
243 autoMelderSaveDefaultDir saveDir;
244 thePauseForm_clicked = 0;
245 + if(wcsnequ(continueText1, L"DESTROY WINDOW ", 15))thePauseForm_clicked = 1;
246 Melder_assert (theEventLoopDepth == 0);
247 theEventLoopDepth ++;
249 @@ -182,24 +183,28 @@ int UiPause_end (int numberOfContinueBut
251 } while (! thePauseForm_clicked);
253 + if(wcsnequ(continueText1, L"DESTROY WINDOW ", 15) == 0){
256 GuiNextEvent (& event);
257 XtDispatchEvent (& event);
258 } while (! thePauseForm_clicked);
261 } catch (MelderError) {
262 Melder_flushError ("An error made it to the outer level in a pause window; should not occur! Please write to paul.boersma@uva.nl");
264 theEventLoopDepth --;
266 + if(wcsnequ(continueText1, L"DESTROY WINDOW ", 15))forget(thePauseForm);
267 if (wasBackgrounding) praat_background ();
268 /* BUG: should also restore praatP. editor. */
269 thePauseForm = NULL; // undangle
270 thePauseFormRadio = NULL; // undangle
271 if (thePauseForm_clicked == -1) {
272 - Interpreter_stop (interpreter);
273 - Melder_throw ("You interrupted the script.");
274 + thePauseForm_clicked = cancelContinueButton;
275 + //Interpreter_stop (interpreter);
276 + //Melder_throw ("You interrupted the script.");
277 //Melder_flushError (NULL);
278 //Melder_clearError ();
280 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.linux.alsa demo_praat_sources/makefiles/makefile.defs.linux.alsa
281 --- praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 10:17:12.000000000 +0200
282 +++ demo_praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 13:28:59.000000000 +0200
283 @@ -7,7 +7,7 @@ CC = gcc -std=gnu99
287 -CFLAGS = -DUNIX -Dlinux -DALSA `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O1 -g1
288 +CFLAGS = -DUNIX -Dlinux -DALSA `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -DDEMOAPP -O1
290 CXXFLAGS = $(CFLAGS) -Wshadow
292 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw32 demo_praat_sources/makefiles/makefile.defs.mingw32
293 --- praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 12:26:39.000000000 +0200
294 +++ demo_praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 15:33:55.000000000 +0200
295 @@ -7,7 +7,7 @@ CC = /mingw32/bin/gcc -std=gnu99 -isyste
297 CXX = /mingw32/bin/g++ -isystem /mingw32/include/c++/4.7.0 -isystem /mingw32/include -Wshadow
299 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -Dmain=wingwmain -O1
300 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -Dmain=wingwmain -O1 -DDEMOAPP
304 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw64 demo_praat_sources/makefiles/makefile.defs.mingw64--- praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 12:26:39.000000000 +0200
305 --- praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 12:26:39.000000000 +0200
306 +++ demo_praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 15:33:37.000000000 +0200
307 @@ -7,7 +7,7 @@ CC = /mingw64/bin/gcc -std=gnu99 -isyste
309 CXX = /mingw64/bin/g++ -isystem /mingw64/include/c++/4.7.0 -isystem /mingw64/include -Wshadow -m64
311 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -Dmain=wingwmain -O1
312 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -Dmain=wingwmain -O1 -DDEMOAPP
316 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp
317 --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200
318 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200
319 @@ -67,8 +67,8 @@ TextGrid Intensity_to_TextGrid_detectSil
320 Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum);
321 double intensity_dbRange = intensity_max_db - intensity_min_db;
323 - if (intensity_dbRange < 10) Melder_warning (L"The loudest and softest part in your sound only differ by ",
324 - Melder_double (intensity_dbRange), L" dB.");
325 + /*if (intensity_dbRange < 10) Melder_warning (L"The loudest and softest part in your sound only differ by ",
326 + Melder_double (intensity_dbRange), L" dB.");*/
328 double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB);
330 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp
331 --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100
332 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100
333 @@ -470,8 +470,10 @@ FORM (SearchManual, L"Search manual", L"
334 TEXTFIELD (L"query", L"")
338 if (theCurrentPraatApplication -> batch)
339 Melder_throw (L"Cannot view a manual from batch.");
341 Manual manPage = Manual_create (L"Intro", theCurrentPraatApplication -> manPages, false);
342 Manual_search (manPage, GET_STRING (L"query"));
344 @@ -482,8 +484,10 @@ FORM (GoToManualPage, L"Go to manual pag
345 LIST (L"Page", numberOfPages, pages, 1)}
349 if (theCurrentPraatApplication -> batch)
350 Melder_throw (L"Cannot view a manual from batch.");
352 Manual manPage = Manual_create (L"Intro", theCurrentPraatApplication -> manPages, false);
353 HyperPage_goToPage_i (manPage, GET_INTEGER (L"Page"));
355 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/GuiMenu.cpp demo_praat_sources/sys/GuiMenu.cpp
356 --- praat_sources/sys/GuiMenu.cpp 2012-09-27 09:10:50.000000000 +0200
357 +++ demo_praat_sources/sys/GuiMenu.cpp 2012-10-25 09:55:23.000000000 +0200
358 @@ -347,7 +347,9 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
362 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
363 if (window == NULL) {
365 my d_xmMenuTitle = XmCreateCascadeButton (theGuiTopMenuBar, Melder_peekWcsToUtf8 (title), NULL, 0);
366 if (wcsequ (title, L"Help"))
367 XtVaSetValues (theGuiTopMenuBar, XmNmenuHelpWidget, my d_xmMenuTitle, NULL);
368 @@ -356,6 +358,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
369 XtSetSensitive (my d_xmMenuTitle, False);
370 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
371 XtManageChild (my d_xmMenuTitle);
372 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
374 my d_xmMenuTitle = XmCreateCascadeButton (window -> d_xmMenuBar, Melder_peekWcsToUtf8 (title), NULL, 0);
375 if (wcsequ (title, L"Help"))
376 @@ -366,6 +369,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
377 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
378 XtManageChild (my d_xmMenuTitle);
381 _GuiObject_setUserData (my d_widget, me);