main_Praat.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* main_Praat.cpp
  2. *
  3. * Copyright (C) 1992-2008,2010-2017 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 2 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. #include "../sys/praat.h"
  19. #include "../sys/praat_version.h"
  20. static void logo (Graphics graphics) {
  21. Graphics_setWindow (graphics, 0.0, 1.0, 0.0, 0.8);
  22. Graphics_setTextAlignment (graphics, Graphics_CENTRE, Graphics_HALF);
  23. Graphics_setFont (graphics, kGraphics_font::TIMES);
  24. Graphics_setFontSize (graphics, 45);
  25. Graphics_setColour (graphics, Graphics_MAROON);
  26. Graphics_text (graphics, 0.385, 0.66, U"P");
  27. Graphics_text (graphics, 0.448, 0.66, U"\\s{R}");
  28. Graphics_text (graphics, 0.510, 0.66, U"\\s{A}");
  29. Graphics_text (graphics, 0.575, 0.66, U"\\s{A}");
  30. Graphics_text (graphics, 0.628, 0.66, U"\\s{T}");
  31. Graphics_setFontSize (graphics, 15);
  32. Graphics_text (graphics, 0.5, 0.55, U"%%doing phonetics by computer");
  33. #define xstr(s) str(s)
  34. #define str(s) #s
  35. Graphics_text (graphics, 0.5, 0.45, U"version " xstr(PRAAT_VERSION_STR));
  36. Graphics_setColour (graphics, Graphics_BLACK);
  37. Graphics_setFontSize (graphics, 14);
  38. Graphics_text (graphics, 0.5, 0.33, U"www.praat.org");
  39. Graphics_setFont (graphics, kGraphics_font::HELVETICA);
  40. Graphics_setFontSize (graphics, 10);
  41. Graphics_text (graphics, 0.5, 0.16, U"Copyright © 1992–" xstr(PRAAT_YEAR) " by Paul Boersma and David Weenink");
  42. }
  43. int main (int argc, char *argv []) {
  44. try {
  45. praat_setLogo (130.0, 80.0, logo);
  46. praat_init (U"Praat", argc, argv);
  47. INCLUDE_LIBRARY (praat_uvafon_init)
  48. INCLUDE_LIBRARY (praat_contrib_Ola_KNN_init)
  49. praat_run ();
  50. } catch (MelderError) {
  51. Melder_flushError (U"This error message percolated all the way to the top."); // an attempt to catch Apache errors
  52. }
  53. return 0;
  54. }
  55. /* End of file main_Praat.cpp */