adapted patch file
[sgc2.git] / praat_module / adaptPraat.patch
blobe68052b757e6247685a076e06e52e6986564ae48
1 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.c demo_praat_sources/fon/praat_TextGrid_init.c
2 --- praat_sources/fon/praat_TextGrid_init.c 2010-08-10 09:18:22.145443134 +0200
3 +++ demo_praat_sources/fon/praat_TextGrid_init.c 2010-11-23 13:41:36.291182479 +0100
4 @@ -683,7 +683,7 @@ static void cb_TextGridEditor_publish (A
7 DIRECT (TextGrid_edit)
8 - if (theCurrentPraatApplication -> batch) {
9 + if (theCurrentPraatApplication -> batch == 1) {
10 return Melder_error1 (L"Cannot edit a TextGrid from batch.");
11 } else {
12 WHERE (SELECTED && CLASS == classTextGrid) {
13 @@ -696,7 +696,7 @@ DIRECT (TextGrid_edit)
14 END
16 DIRECT (TextGrid_LongSound_edit)
17 - if (theCurrentPraatApplication -> batch) {
18 + if (theCurrentPraatApplication -> batch == 1) {
19 return Melder_error1 (L"Cannot edit a TextGrid from batch.");
20 } else {
21 LongSound longSound = NULL;
22 @@ -711,7 +711,7 @@ DIRECT (TextGrid_LongSound_edit)
23 END
25 DIRECT (TextGrid_SpellingChecker_edit)
26 - if (theCurrentPraatApplication -> batch) {
27 + if (theCurrentPraatApplication -> batch == 1) {
28 return Melder_error1 (L"Cannot edit a TextGrid from batch.");
29 } else {
30 SpellingChecker spellingChecker = NULL;
31 @@ -726,7 +726,7 @@ DIRECT (TextGrid_SpellingChecker_edit)
32 END
34 DIRECT (TextGrid_LongSound_SpellingChecker_edit)
35 - if (theCurrentPraatApplication -> batch) {
36 + if (theCurrentPraatApplication -> batch == 1) {
37 return Melder_error1 (L"Cannot edit a TextGrid from batch.");
38 } else {
39 LongSound longSound = NULL;
40 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp
41 --- praat_sources/sys/praat.cpp 2010-11-02 09:30:25.285982433 +0100
42 +++ demo_praat_sources/sys/praat.cpp 2010-11-23 13:42:53.000000000 +0100
43 @@ -1103,9 +1103,9 @@ void praat_init (const char *title, unsi
44 * Make sure that the program's private directory exists.
46 #if defined (UNIX)
47 - swprintf (name, 256, L".%s-dir", programName); /* For example .myProg-dir */
48 + swprintf (name, 256, L".%s", praatP.title); /* For example .myProg-dir */
49 #elif defined (macintosh)
50 - swprintf (name, 256, L"%s Prefs", praatP.title); /* For example MyProg Prefs */
51 + swprintf (name, 256, L"%s", "SpeakGoodChinese2"); /* For example MyProg Prefs */
52 #elif defined (_WIN32)
53 swprintf (name, 256, L"%s", praatP.title); /* For example MyProg */
54 #endif
55 @@ -1390,6 +1390,7 @@ void praat_run (void) {
57 if (Melder_batch) {
58 if (thePraatStandAloneScriptText != NULL) {
59 + theCurrentPraatApplication -> batch = 2;
60 praat_executeScriptFromText (thePraatStandAloneScriptText);
61 praat_exit (0);
62 } else if (doingCommandLineInterface) {
63 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.c demo_praat_sources/fon/praat_Sound_init.c
64 --- praat_sources/fon/praat_Sound_init.c 2010-12-14 09:46:11.000000000 +0100
65 +++ demo_praat_sources/fon/praat_Sound_init.c 2010-12-14 10:28:58.876918235 +0100
66 @@ -152,7 +152,7 @@ DO
67 END
69 DIRECT (LongSound_view)
70 - if (theCurrentPraatApplication -> batch)
71 + if (theCurrentPraatApplication -> batch == 1)
72 return Melder_error1 (L"Cannot view a LongSound from batch.");
73 else
74 WHERE (SELECTED)
75 @@ -625,7 +625,7 @@ static void cb_SoundEditor_publish (Any
78 DIRECT (Sound_edit)
79 - if (theCurrentPraatApplication -> batch) {
80 + if (theCurrentPraatApplication -> batch == 1) {
81 return Melder_error1 (L"Cannot edit a Sound from batch.");
82 } else {
83 WHERE (SELECTED) {
84 @@ -1168,7 +1168,7 @@ static void cb_SoundRecorder_publish (An
85 praat_updateSelection ();
87 DIRECT (Sound_record_mono)
88 - if (theCurrentPraatApplication -> batch) return Melder_error1 (L"Cannot record a Sound from batch.");
89 + if (theCurrentPraatApplication -> batch == 1) return Melder_error1 (L"Cannot record a Sound from batch.");
90 if (soundRecorder) {
91 if (previousNumberOfChannels == 1) {
92 Editor_raise (SoundRecorder_as_Editor (soundRecorder));
93 @@ -1191,7 +1191,7 @@ static void cb_SoundRecorder_publish2 (A
94 praat_updateSelection ();
96 DIRECT (Sound_record_stereo)
97 - if (theCurrentPraatApplication -> batch) return Melder_error1 (L"Cannot record a Sound from batch.");
98 + if (theCurrentPraatApplication -> batch == 1) return Melder_error1 (L"Cannot record a Sound from batch.");
99 if (soundRecorder) {
100 if (previousNumberOfChannels == 2) {
101 Editor_raise (SoundRecorder_as_Editor (soundRecorder));