eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

menus.cpp 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /***************************************************************************
  2. * Copyright (C) 2005 to 2013 by Jonathan Duddington *
  3. * email: [email protected] *
  4. * *
  5. * This program 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 *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * 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 program; if not, see: *
  17. * <http://www.gnu.org/licenses/>. *
  18. ***************************************************************************/
  19. #include "wx/wx.h"
  20. #include "main.h"
  21. wxMenu *speak_menu;
  22. wxMenu *data_menu = NULL;
  23. wxMenuBar *menu_bar = NULL;
  24. wxMenuBar *MakeMenu(int type, const char *dict_name)
  25. {//===================================================
  26. char buf[100];
  27. wxMenu *old_menu;
  28. wxMenu *file_menu;
  29. wxMenu *help_menu;
  30. wxMenu *option_menu = NULL;
  31. wxMenu *paths_menu;
  32. wxMenu *tools_menu;
  33. wxMenu *voice_menu;
  34. wxMenu *vowelchart_menu;
  35. wxMenu *lexicon_menu;
  36. // FILE MENU
  37. file_menu = new wxMenu;
  38. file_menu->Append(MENU_SPECTRUM, _("&Open..."));
  39. file_menu->Append(MENU_SPECTRUM2, _("O&pen2..."));
  40. // file_menu->Append(MENU_PROSODY, _T("&Prosody window"));
  41. if(type<=1)
  42. {
  43. }
  44. else
  45. if(type==2)
  46. {
  47. file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
  48. file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As..."));
  49. file_menu->Append(SPECTSEQ_SAVESELECT, _("Save Selection"));
  50. file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
  51. file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
  52. file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
  53. }
  54. else
  55. if(type==3)
  56. {
  57. // file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
  58. // file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As..."));
  59. file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
  60. file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
  61. }
  62. file_menu->Append(MENU_QUIT, _("&Quit"));
  63. if(type==0)
  64. {
  65. // Initialization, make all the menus
  66. // SPEAK_MENU
  67. speak_menu = new wxMenu;
  68. speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate"));
  69. speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules"));
  70. speak_menu->Append(MENU_SPEAK_IPA, _("Show &IPA"));
  71. speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak"));
  72. speak_menu->AppendSeparator();
  73. speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file..."));
  74. speak_menu->Append(MENU_SPEAK_PAUSE, _("&Pause"));
  75. speak_menu->Append(MENU_SPEAK_STOP, _("St&op"));
  76. // VOICE MENU
  77. voice_menu = new wxMenu;
  78. voice_menu->Append(MENU_SPEAK_VOICE, _("Select &Voice.."));
  79. voice_menu->Append(MENU_SPEAK_VOICE_VARIANT, _("Select Voice Va&riant..."));
  80. // DATA MENU
  81. data_menu = new wxMenu;
  82. data_menu->Append(MENU_COMPILE_DICT, _("Compile &dictionary"));
  83. data_menu->Append(MENU_COMPILE_DICT_DEBUG, _("Compile dictionary (debu&g)"));
  84. data_menu->Append(MENU_COMPILE_PH, _("Compile &phoneme data 22050Hz"));
  85. data_menu->Append(MENU_COMPILE_PH2, _("Compile at sample &rate"));
  86. data_menu->AppendSeparator();
  87. data_menu->Append(MENU_COMPILE_MBROLA, _("Compile &mbrola phonemes list..."));
  88. data_menu->Append(MENU_COMPILE_INTONATION, _("Compile &intonation data"));
  89. data_menu->AppendSeparator();
  90. data_menu->Append(MENU_FORMAT_DICTIONARY, _("&Layout *_rules file"));
  91. data_menu->Append(MENU_SORT_DICTIONARY, _("&Sort *_rules file"));
  92. sprintf(buf,"Compile &dictionary '%s'",dict_name);
  93. data_menu->SetLabel(MENU_COMPILE_DICT, wxString(buf,wxConvLocal));
  94. sprintf(buf,"&Layout '%s_rules' file",dict_name);
  95. data_menu->SetLabel(MENU_FORMAT_DICTIONARY, wxString(buf,wxConvLocal));
  96. sprintf(buf,"&Sort '%s_rules' file",dict_name);
  97. data_menu->SetLabel(MENU_SORT_DICTIONARY, wxString(buf,wxConvLocal));
  98. // OPTIONS MENU
  99. paths_menu = new wxMenu;
  100. paths_menu->Append(MENU_PATH0, _("Master phonemes file..."));
  101. paths_menu->Append(MENU_PATH1, _("Phoneme data source..."));
  102. paths_menu->Append(MENU_PATH2, _("Dictionary data source..."));
  103. paths_menu->Append(MENU_PATH3, _("Synthesized sound WAV file..."));
  104. paths_menu->AppendSeparator();
  105. paths_menu->Append(MENU_PATH4, _("Voice file to modify formant peaks..."));
  106. option_menu = new wxMenu;
  107. option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu);
  108. option_menu->Append(MENU_OPT_SPEED, _("Speed..."));
  109. option_menu->AppendSeparator();
  110. option_menu->Append(MENU_OPT_PUNCT, _("Speak punctuation"));
  111. option_menu->Append(MENU_OPT_SPELL, _("Speak characters"));
  112. option_menu->Append(MENU_OPT_SPELL2, _("Speak character name"));
  113. // TOOLS
  114. vowelchart_menu = new wxMenu;
  115. vowelchart_menu->Append(MENU_VOWELCHART1, _("From compiled phoneme data"));
  116. // vowelchart_menu->Append(MENU_VOWELCHART2, _("From list of formants..."));
  117. vowelchart_menu->Append(MENU_VOWELCHART3, _("From directory of vowel files..."));
  118. lexicon_menu = new wxMenu;
  119. lexicon_menu->Append(MENU_LEXICON_RU, _("Russian"));
  120. lexicon_menu->Append(MENU_LEXICON_BG, _("Bulgarian"));
  121. lexicon_menu->Append(MENU_LEXICON_DE, _("German"));
  122. lexicon_menu->Append(MENU_LEXICON_IT, _("Italian"));
  123. // lexicon_menu->Append(MENU_LEXICON_TEST, _("Test"));
  124. tools_menu = new wxMenu;
  125. tools_menu->Append(MENU_VOWELCHART, _("Make &Vowels Chart"), vowelchart_menu);
  126. // tools_menu->Append(MENU_LOAD_WAV, _T("Analyse WAV file"));
  127. tools_menu->Append(MENU_LEXICON, _("Process &Lexicon"), lexicon_menu);
  128. tools_menu->Append(MENU_TO_UTF8, _("Convert file to &UTF8..."));
  129. tools_menu->Append(MENU_COUNT_WORDS, _("Count word &frequencies..."));
  130. tools_menu->Append(MENU_TEST , _("Test (temporary)"));
  131. // tools_menu->Append(MENU_TEST2 , _T("Test2"));
  132. // HELP MENU
  133. help_menu = new wxMenu;
  134. help_menu->Append(MENU_DOCS, _("eSpeak &Documentation"));
  135. help_menu->Append(MENU_ABOUT, _("&About"));
  136. menu_bar = new wxMenuBar;
  137. menu_bar->Append(file_menu, _("&File"));
  138. menu_bar->Append(speak_menu, _("&Speak"));
  139. menu_bar->Append(voice_menu, _("&Voice"));
  140. menu_bar->Append(option_menu, _("&Options"));
  141. menu_bar->Append(tools_menu, _("&Tools"));
  142. menu_bar->Append(data_menu, _("&Compile"));
  143. menu_bar->Append(help_menu, _("&Help"));
  144. }
  145. else
  146. {
  147. // Just replace the File menu
  148. old_menu = menu_bar->Replace(0, file_menu, _("&File"));
  149. delete old_menu;
  150. }
  151. return(menu_bar);
  152. } // end of MakeMenu