| 1 | /* main_Praat.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2008,2010-2021,2023-2026 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "../sys/praat.h"cxx . . $ `<file>/sys/praat.h`/ |
| 20 | #include "main_Praat.h"cxx . . $ `<file>/main/main_Praat.h`/ |
| 21 | |
| 22 | static void logocxx . . $ logo(2d838ed765120c5d). (Graphicscxx . . $ Graphics# graphics) { |
| 23 | Graphics_setWindowcxx . . $ Graphics_setWindow(72bdb7937dbb13da). (graphics, 0.0, 1.0, 0.0, 1.0); |
| 24 | Graphics_setGreycxx . . $ Graphics_setGrey(2514a1c07b6be5e2). (graphics, 0.95); |
| 25 | Graphics_fillRectanglecxx . . $ Graphics_fillRectangle(72bdb7937dbb13da). (graphics, 0.0, 1.0, 0.0, 1.0); |
| 26 | Graphics_setTextAlignmentcxx . . $ Graphics_setTextAlignment(a697afee548943ae). (graphics, Graphics_CENTREcxx . . $ `sys/Graphics.h:250:9`!, Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 27 | Graphics_setFontcxx . . $ Graphics_setFont(f6e617e53e6c04dc). (graphics, kGraphics_fontcxx . . $ kGraphics_font#::TIMEScxx . . $ kGraphics_font#TIMES.); |
| 28 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 45.0); |
| 29 | Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (graphics, Melder_MAROONcxx . . $ Melder_MAROON.); |
| 30 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.385, 0.89, U"P"); |
| 31 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.448, 0.89, U"\\s{R}"); |
| 32 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.510, 0.89, U"\\s{A}"); |
| 33 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.575, 0.89, U"\\s{A}"); |
| 34 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.628, 0.89, U"\\s{T}"); |
| 35 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 18.0); |
| 36 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.5, 0.77, U"%%doing phonetics by computer"); |
| 37 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 14.0); |
| 38 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.5, 0.62, Melder_catcxx . . $ Melder_cat(7fbf27f4d367f442). (U"version ", Melder_appVersionSTRcxx . . $ Melder_appVersionSTR(1912f6684645c851).(), |
| 39 | U" (", Melder_appDaycxx . . $ Melder_appDay(da6335ded91d79c2).(), U" ", Melder_appMonthSTRcxx . . $ Melder_appMonthSTR(1912f6684645c851).(), U" ", Melder_appYearcxx . . $ Melder_appYear(da6335ded91d79c2).(), U")")); |
| 40 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 12.0); |
| 41 | [[maybe_unused]] constexpr bool isArm64 = |
| 42 | #if defined (__aarch64__) || defined (_M_ARM64_) |
| 43 | true; |
| 44 | #else |
| 45 | false; |
| 46 | #endif |
| 47 | [[maybe_unused]] constexpr int x64_version = |
| 48 | #if defined (__AVX2__) && defined (__FMA__) && defined (__F16C__) |
| 49 | 3; |
| 50 | #else |
| 51 | 1; |
| 52 | #endif |
| 53 | const conststring32cxx . . $ conststring32# builtFor = |
| 54 | #if defined (macintosh) |
| 55 | isArm64 ? U"ARM64 macOS" : U"Intel64 macOS"; |
| 56 | #elif defined (_WIN32) |
| 57 | isArm64 ? U"ARM64 Windows" : |
| 58 | sizeof (void *) == 4 ? U"Intel32 Windows" : |
| 59 | x64_version == 3 ? U"x64(v3) Windows" : |
| 60 | U"x64(v1) Windows"; |
| 61 | #elif defined (__s390x__) |
| 62 | U"s390x Linux"; |
| 63 | #elif defined (raspberrypi) |
| 64 | U"ARMV7 Raspberry Pi"; |
| 65 | #elif defined (chrome) |
| 66 | isArm64 ? U"ARM64 Chromebook" : |
| 67 | x64_version == 3 ? U"x64(v3) Chromebook" : |
| 68 | U"x64(v1) Chromebook"; |
| 69 | #elif defined (linuxcxx . . $ `<built-in>:480:9`!) |
| 70 | isArm64 ? U"ARM64 Linux" : |
| 71 | x64_version == 3 ? U"x64(v3) Linux" : |
| 72 | U"x64(v1) Linux"; |
| 73 | #else |
| 74 | U""; |
| 75 | #error Unknown OS type. |
| 76 | #endif |
| 77 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.5, 0.54, Melder_catcxx . . $ Melder_cat(7fbf27f4d367f442). (U"built for ", builtFor)); |
| 78 | Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (graphics, Melder_BLACKcxx . . $ Melder_BLACK.); |
| 79 | Graphics_setFontcxx . . $ Graphics_setFont(f6e617e53e6c04dc). (graphics, kGraphics_fontcxx . . $ kGraphics_font#::HELVETICAcxx . . $ kGraphics_font#HELVETICA.); |
| 80 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 10.0); |
| 81 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.5, 0.37, Melder_catcxx . . $ Melder_cat(7fbf27f4d367f442). (U"Copyright © 1992–", Melder_appYearcxx . . $ Melder_appYear(da6335ded91d79c2).(), U" Paul Boersma, David Weenink, Anastasia Shchupak")); |
| 82 | Graphics_setFontSizecxx . . $ Graphics_setFontSize(2514a1c07b6be5e2). (graphics, 10.0); |
| 83 | Graphics_setTextAlignmentcxx . . $ Graphics_setTextAlignment(a697afee548943ae). (graphics, Graphics_RIGHTcxx . . $ `sys/Graphics.h:251:9`!, Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 84 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.34, 0.28, U"Download sites:"); |
| 85 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.27, 0.14, U"Source code:"); |
| 86 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.32, 0.065, U"Praat Users List:"); |
| 87 | Graphics_setTextAlignmentcxx . . $ Graphics_setTextAlignment(a697afee548943ae). (graphics, Graphics_LEFTcxx . . $ `sys/Graphics.h:249:9`!, Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 88 | Graphics_setFontcxx . . $ Graphics_setFont(f6e617e53e6c04dc). (graphics, kGraphics_fontcxx . . $ kGraphics_font#::COURIERcxx . . $ kGraphics_font#COURIER.); |
| 89 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.36, 0.28, U"https://praat.org"); |
| 90 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.36, 0.22, U"https://www.fon.hum.uva.nl/praat"); |
| 91 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.28, 0.14, U"https://github.com/praat/praat.github.io"); |
| 92 | Graphics_textcxx . . $ Graphics_text(8e1820bb471fc8c8). (graphics, 0.33, 0.065, U"https://groups.io/g/Praat-Users-List"); |
| 93 | } |
| 94 | |
| 95 | int maincxx . . $ main(afcd3168fc1188a4). (int argc, char *argv []) { |
| 96 | try { |
| 97 | //TRACE |
| 98 | praat_setLogocxx . . $ praat_setLogo(e52f01cf3c7c2f40). (130.0, 100.0, logocxx . . $ logo(2d838ed765120c5d).); |
| 99 | MelderStopwatchcxx . . $ MelderStopwatch# stopwatchcxx . . $ MelderStopwatch#MelderStopwatch(49f6e7a06ebc5aa8).; |
| 100 | praat_initcxx . . $ praat_init(d8f80fb324ce6fc2). (U"" stringizecxx . . $ `melder/melder.h:58:9`! (PRAAT_NAMEcxx . . $ `main/main_Praat.h:26:9`!), |
| 101 | U"" stringizecxx . . $ `melder/melder.h:58:9`! (PRAAT_VERSION_STRcxx . . $ `main/main_Praat.h:27:9`!), PRAAT_VERSION_NUMcxx . . $ `main/main_Praat.h:28:9`!, |
| 102 | PRAAT_YEARcxx . . $ `main/main_Praat.h:29:9`!, PRAAT_MONTHcxx . . $ `main/main_Praat.h:30:9`!, PRAAT_DAYcxx . . $ `main/main_Praat.h:31:9`!, |
| 103 | U"paul.boersma", U"uva.nl", |
| 104 | argc, argv |
| 105 | ); |
| 106 | tracecxx . . $ `melder/melder_debug.h:60:10`! (stopwatch()); |
| 107 | INCLUDE_LIBRARYcxx . . $ `sys/praat.h:237:9`! (praat_uvafon_init) |
| 108 | tracecxx . . $ `melder/melder_debug.h:60:10`! (stopwatch()); |
| 109 | praat_runcxx . . $ praat_run(49f6e7a06ebc5aa8). (); |
| 110 | tracecxx . . $ `melder/melder_debug.h:60:10`! (stopwatch()); |
| 111 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 112 | Melder_flushErrorcxx . . $ Melder_flushError(6298c93241566110). ( |
| 113 | U"This error message percolated all the way to the top.\n" |
| 114 | U"Praat will now quit; contact the authors if this is unexpected." |
| 115 | ); // an attempt to catch Apache errors |
| 116 | } |
| 117 | return 0; // obligatory (because on Windows `main` is just a normal function called from our WinMain) |
| 118 | } |
| 119 | |
| 120 | /* End of file main_Praat.cpp */ |