From 6f21e9bfac925021f159e89fc47793d241644cce Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Thu, 23 Jul 2015 16:16:33 +0200 Subject: [PATCH] Folded sys_praat_name.patch into adaptPraat.patch, adapted patch to Praat 5.4.13 --- praat_module/adaptPraat.patch | 33 +++++++++++++++++++++------------ praat_module/main_Praat.patch | 4 ++-- praat_module/sys_praat_name.patch | 12 ------------ 3 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 praat_module/sys_praat_name.patch diff --git a/praat_module/adaptPraat.patch b/praat_module/adaptPraat.patch index d1408bc..3cab0dc 100644 --- a/praat_module/adaptPraat.patch +++ b/praat_module/adaptPraat.patch @@ -32,7 +32,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp d diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_script.cpp demo_praat_sources/sys/praat_script.cpp --- praat_sources/sys/praat_script.cpp 2011-09-02 13:53:33.000000000 +0200 +++ demo_praat_sources/sys/praat_script.cpp 2011-10-28 07:54:25.000000000 +0200 -@@ -586,6 +586,7 @@ void praat_executeScriptFromText (wchar +@@ -585,6 +585,7 @@ void praat_executeScriptFromText (wchar autoInterpreter interpreter = Interpreter_create (NULL, NULL); Interpreter_run (interpreter.peek(), text); } catch (MelderError) { @@ -55,7 +55,16 @@ 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 -@@ -1215,6 +1215,12 @@ void praat_init (const char *title, unsi +@@ -1144,7 +1144,7 @@ void praat_init (const char *title, unsi + * Make sure that the program's private directory exists. + */ + #if defined (UNIX) +- Melder_sprint (name,256, U".", programName, U"-dir"); // for example .myProg-dir ++ Melder_sprint (name,256, U".", programName, U""); // for example .myProg-dir + #elif defined (macintosh) + Melder_sprint (name,256, praatP.title, U" Prefs"); // for example MyProg Prefs + #elif defined (_WIN32) +@@ -1217,6 +1217,12 @@ void praat_init (const char *title, unsi GuiWindow raam = NULL; if (Melder_batch) { @@ -63,12 +72,12 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr + char objectWindowTitle [100]; + Machine_initLookAndFeel (argc, argv); + sprintf (objectWindowTitle, "%s Objects", praatP.title); -+ GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 0, 0, Melder_peekUtf8ToWcs (objectWindowTitle), gui_cb_quit, NULL, 0); ++ GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 0, 0, Melder_peek8to32 (objectWindowTitle), gui_cb_quit, NULL, 0); + #endif #if defined (UNIX) || defined (macintosh) || defined (_WIN32) && defined (CONSOLE_APPLICATION) MelderString_empty (& theCurrentPraatApplication -> batchName); for (unsigned int i = iarg_batchName; i < argc; i ++) { -@@ -1261,9 +1267,11 @@ void praat_init (const char *title, unsi +@@ -1263,9 +1269,11 @@ void praat_init (const char *title, unsi #if motif GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell); #endif @@ -80,7 +89,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr } Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, NULL); if (Melder_batch) { -@@ -1273,6 +1281,9 @@ void praat_init (const char *title, unsi +@@ -1275,6 +1283,9 @@ void praat_init (const char *title, unsi trace (U"adding fixed buttons without GUI"); praat_addFixedButtons (NULL); } else { @@ -90,7 +99,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr #ifdef macintosh #if ! useCarbon -@@ -1300,7 +1311,9 @@ void praat_init (const char *title, unsi +@@ -1302,7 +1313,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"); @@ -100,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 { -@@ -1329,7 +1342,12 @@ void praat_init (const char *title, unsi +@@ -1331,7 +1344,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, NULL))); @@ -114,9 +123,9 @@ 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, NULL))); } -@@ -1478,11 +1496,11 @@ void praat_run (void) { +@@ -1480,11 +1498,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); + Melder_fatal (U"The number 1000000000000 is mistaken written on this machine as ", dummy, U"."); } - { uint32_t dummy = 0xffffffff; - Melder_assert ((int64) dummy == 4294967295LL); @@ -131,7 +140,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr { double dummy = 3000000000.0; Melder_assert ((uint32) dummy == 3000000000); } -@@ -1626,6 +1644,14 @@ void praat_run (void) { +@@ -1628,6 +1646,14 @@ void praat_run (void) { s ++; } } @@ -149,7 +158,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_pr diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200 -@@ -1483,8 +1483,10 @@ void praat_picture_open (void) { +@@ -1511,8 +1511,10 @@ void praat_picture_open (void) { #elif cocoa GuiThing_show (dialog); #elif motif @@ -160,7 +169,7 @@ diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp #endif Picture_unhighlight (praat_picture); } -@@ -1771,7 +1773,9 @@ void praat_picture_init (void) { +@@ -1796,7 +1798,9 @@ void praat_picture_init (void) { width = height = resolution * 12; scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0); drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, NULL, NULL, NULL, NULL, NULL, 0); diff --git a/praat_module/main_Praat.patch b/praat_module/main_Praat.patch index e747bba..5954b46 100644 --- a/praat_module/main_Praat.patch +++ b/praat_module/main_Praat.patch @@ -8,9 +8,9 @@ int main (int argc, char *argv []) { try { praat_setLogo (130, 80, logo); -- praat_init ("Praat", (unsigned int) argc, argv); +- praat_init (U"Praat", (unsigned int) argc, argv); + praat_setStandAloneScriptText (myDemoScript); -+ praat_init ("SpeakGoodChinese2", argc, argv); ++ praat_init (U"SpeakGoodChinese2", (unsigned int) argc, argv); INCLUDE_LIBRARY (praat_uvafon_init) INCLUDE_LIBRARY (praat_contrib_Ola_KNN_init) praat_run (); diff --git a/praat_module/sys_praat_name.patch b/praat_module/sys_praat_name.patch deleted file mode 100644 index f90d4dd..0000000 --- a/praat_module/sys_praat_name.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp ---- praat_sources/sys/praat.cpp 2015-07-14 08:17:48.000000000 +0200 -+++ demo_praat_sources/sys/praat.cpp 2015-07-14 10:08:59.000000000 +0200 -@@ -1142,7 +1142,7 @@ void praat_init (const char *title, unsi - * Make sure that the program's private directory exists. - */ - #if defined (UNIX) -- Melder_sprint (name,256, U".", Melder_peek8to32 (programName), U"-dir"); // for example .myProg-dir -+ Melder_sprint (name,256, U".", Melder_peek8to32 (praatP.title), U"-dir"); // for example .myProg-dir - #elif defined (macintosh) - Melder_sprint (name,256, Melder_peek8to32 (praatP.title), U" Prefs"); // for example MyProg Prefs - #elif defined (_WIN32) -- 2.11.4.GIT