From 22b7b18d16eca0f4a8ebc309f060c7562d09069d Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Mon, 2 Nov 2015 10:23:50 +0100 Subject: [PATCH] Updated patch to Praat 6.0.04 --- praat_module/adaptPraat.patch | 52 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/praat_module/adaptPraat.patch b/praat_module/adaptPraat.patch index 25b3156..98fa3fc 100644 --- a/praat_module/adaptPraat.patch +++ b/praat_module/adaptPraat.patch @@ -19,7 +19,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/melder_audio.cpp diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp demo_praat_sources/stat/praat_Stat.cpp --- praat_sources/stat/praat_Stat.cpp 2011-10-01 13:32:45.000000000 +0200 +++ demo_praat_sources/stat/praat_Stat.cpp 2011-11-18 08:55:32.000000000 +0100 -@@ -422,7 +422,9 @@ DO +@@ -421,7 +421,9 @@ DO END2 } DIRECT2 (Table_edit) { @@ -55,7 +55,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Graphics_text.cpp diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp --- praat_sources/sys/praat.cpp 2014-04-22 11:09:57.000000000 +0200 +++ demo_praat_sources/sys/praat.cpp 2014-04-22 11:53:58.000000000 +0200 -@@ -1250,7 +1250,7 @@ void praat_init (const char *title, unsi +@@ -1253,7 +1253,7 @@ void praat_init (const char *title, unsi */ char32 name [256]; #if defined (UNIX) @@ -64,7 +64,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr #elif defined (macintosh) Melder_sprint (name,256, praatP.title, U" Prefs"); // for example MyProg Prefs #elif defined (_WIN32) -@@ -1334,6 +1334,12 @@ void praat_init (const char *title, unsi +@@ -1337,6 +1337,12 @@ void praat_init (const char *title, unsi GuiWindow raam = nullptr; if (Melder_batch) { @@ -77,7 +77,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr MelderString_empty (& theCurrentPraatApplication -> batchName); for (unsigned int i = praatP.argumentNumber - 1; i < argc; i ++) { if (i >= praatP.argumentNumber) MelderString_append (& theCurrentPraatApplication -> batchName, U" "); -@@ -1377,9 +1383,11 @@ void praat_init (const char *title, unsi +@@ -1380,9 +1386,11 @@ void praat_init (const char *title, unsi #if motif GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell); #endif @@ -89,7 +89,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr } Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, nullptr); if (Melder_batch) { -@@ -1389,6 +1397,9 @@ void praat_init (const char *title, unsi +@@ -1392,6 +1400,9 @@ void praat_init (const char *title, unsi trace (U"adding fixed buttons without GUI"); praat_addFixedButtons (nullptr); } else { @@ -99,7 +99,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr #ifdef macintosh #if ! useCarbon -@@ -1416,7 +1427,9 @@ void praat_init (const char *title, unsi +@@ -1419,7 +1430,9 @@ void praat_init (const char *title, unsi trace (U"creating the dynamic menu in the Objects window"); praat_actions_createDynamicMenu (raam); trace (U"showing the Objects window"); @@ -109,7 +109,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr //Melder_fatal (U"stop"); #if defined (UNIX) && ! defined (NO_GRAPHICS) try { -@@ -1447,7 +1460,12 @@ void praat_init (const char *title, unsi +@@ -1450,7 +1463,12 @@ void praat_init (const char *title, unsi trace (U"creating the Picture window"); trace (U"before picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr))); @@ -123,7 +123,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr trace (U"after picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, nullptr))); if (unknownCommandLineOption) { -@@ -1603,11 +1621,11 @@ void praat_run (void) { +@@ -1606,11 +1624,11 @@ void praat_run (void) { if (! str32equ (Melder_integer (dummy), U"1000000000000")) Melder_fatal (U"The number 1000000000000 is mistaken written on this machine as ", dummy, U"."); } @@ -167,27 +167,27 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp --- praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:17:12.000000000 +0200 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:59:25.000000000 +0200 -@@ -857,7 +857,9 @@ static void cb_TextGridEditor_publicatio +@@ -855,7 +855,9 @@ static void cb_TextGridEditor_publicatio } } DIRECT2 (TextGrid_edit) { +#ifndef DEMOAPP if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch."); +#endif - Sound sound = NULL; + Sound sound = nullptr; LOOP { - if (CLASS == classSound) sound = (Sound) OBJECT; // may stay NULL -@@ -888,7 +890,9 @@ DIRECT (TextGrid_edit) + if (CLASS == classSound) sound = (Sound) OBJECT; // may stay null +@@ -886,7 +888,9 @@ DIRECT (TextGrid_edit) END2 } DIRECT2 (TextGrid_LongSound_edit) { +#ifndef DEMOAPP if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch."); +#endif - LongSound longSound = NULL; + LongSound longSound = nullptr; int ilongSound = 0; LOOP { -@@ -904,7 +908,9 @@ DIRECT (TextGrid_LongSound_edit) +@@ -902,7 +906,9 @@ DIRECT (TextGrid_LongSound_edit) END2 } DIRECT2 (TextGrid_SpellingChecker_edit) { @@ -197,7 +197,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_in SpellingChecker spellingChecker = NULL; int ispellingChecker = 0; Sound sound = NULL; -@@ -921,7 +927,9 @@ DIRECT (TextGrid_SpellingChecker_edit) +@@ -919,7 +925,9 @@ DIRECT (TextGrid_SpellingChecker_edit) END2 } DIRECT2 (TextGrid_LongSound_SpellingChecker_edit) { @@ -205,7 +205,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_in if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch."); +#endif LongSound longSound = NULL; - SpellingChecker spellingChecker = NULL; + SpellingChecker spellingChecker = nullptr; int ilongSound = 0, ispellingChecker = 0; diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.cpp demo_praat_sources/fon/praat_Sound_init.cpp --- praat_sources/fon/praat_Sound_init.cpp 2012-10-11 10:39:47.000000000 +0200 @@ -240,8 +240,8 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init. +#endif if (theSoundRecorder) { if (numberOfChannels == thePreviousNumberOfChannels) { - Editor_raise (theSoundRecorder.get()); -@@ -1445,10 +1451,21 @@ FORM (Sound_recordFixedTime, U"Record So + Editor_raise (theSoundRecorder); +@@ -1446,10 +1452,21 @@ FORM (Sound_recordFixedTime, U"Record So POSITIVE (U"Duration (seconds)", U"1.0") OK2 DO @@ -252,7 +252,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init. autoSound me = Sound_recordFixedTime (GET_INTEGER (U"Input source"), GET_REAL (U"Gain"), GET_REAL (U"Balance"), Melder_atof (GET_STRING (U"Sampling frequency")), GET_REAL (U"Duration")); - praat_new (me.transfer(), U"untitled"); + praat_new (me.move(), U"untitled"); +#if defined (_WIN32) && defined (DEMOAPP) + } else { + // Create an empty sound if no input is available @@ -389,17 +389,19 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.de diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200 -@@ -67,8 +67,8 @@ TextGrid Intensity_to_TextGrid_detectSil +@@ -66,9 +66,9 @@ TextGrid Intensity_to_TextGrid_detectSil Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum); double intensity_dbRange = intensity_max_db - intensity_min_db; -- if (intensity_dbRange < 10) Melder_warning (U"The loudest and softest part in your sound only differ by ", -- intensity_dbRange, U" dB."); -+ /*if (intensity_dbRange < 10) Melder_warning (U"The loudest and softest part in your sound only differ by ", -+ intensity_dbRange, U" dB.");*/ - +- if (intensity_dbRange < 10) { +- Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB."); +- } ++ /*if (intensity_dbRange < 10) { ++ Melder_warning (U"The loudest and softest part in your sound only differ by ", intensity_dbRange, U" dB."); ++ }*/ double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB); + if (minSilenceDuration > duration || intensityThreshold < intensity_min_db) { diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100 -- 2.11.4.GIT