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 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /***************************************************************************
  2. * Copyright (C) 2005 to 2010 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 *MakeMenu(int type, const char *dict_name)
  24. {//=================================================
  25. char buf[100];
  26. wxMenu *file_menu;
  27. wxMenu *help_menu;
  28. wxMenu *option_menu = NULL;
  29. wxMenu *paths_menu;
  30. wxMenu *tools_menu;
  31. wxMenu *voice_menu;
  32. wxMenu *vowelchart_menu;
  33. wxMenu *lexicon_menu;
  34. // FILE MENU
  35. file_menu = new wxMenu;
  36. file_menu->Append(MENU_SPECTRUM, _("&Open..."));
  37. file_menu->Append(MENU_SPECTRUM2, _("O&pen2..."));
  38. // file_menu->Append(MENU_PROSODY, _T("&Prosody window"));
  39. if(type==0)
  40. {
  41. }
  42. else
  43. if(type==1)
  44. {
  45. file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
  46. file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As..."));
  47. file_menu->Append(SPECTSEQ_SAVESELECT, _("Save Selection"));
  48. file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
  49. file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
  50. // file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
  51. }
  52. else
  53. if(type==2)
  54. {
  55. file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
  56. file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As..."));
  57. // file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
  58. file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
  59. // file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
  60. }
  61. file_menu->Append(MENU_QUIT, _("&Quit"));
  62. // SPEAK_MENU
  63. speak_menu = new wxMenu;
  64. speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate"));
  65. speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules"));
  66. speak_menu->Append(MENU_SPEAK_IPA, _("Show &IPA"));
  67. speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak"));
  68. speak_menu->AppendSeparator();
  69. speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file..."));
  70. speak_menu->Append(MENU_SPEAK_PAUSE, _("&Pause"));
  71. speak_menu->Append(MENU_SPEAK_STOP, _("St&op"));
  72. // VOICE MENU
  73. voice_menu = new wxMenu;
  74. voice_menu->Append(MENU_SPEAK_VOICE, _("Select &Voice.."));
  75. voice_menu->Append(MENU_SPEAK_VOICE_VARIANT, _("Select Voice Va&riant..."));
  76. // DATA MENU
  77. data_menu = new wxMenu;
  78. data_menu->Append(MENU_COMPILE_PH, _("Compile &phoneme data"));
  79. data_menu->Append(MENU_COMPILE_DICT, _("Compile &dictionary"));
  80. data_menu->Append(MENU_COMPILE_DICT_DEBUG, _("Compile dictionary (debu&g)"));
  81. data_menu->AppendSeparator();
  82. data_menu->Append(MENU_COMPILE_MBROLA, _("Compile &mbrola phonemes list..."));
  83. data_menu->Append(MENU_COMPILE_INTONATION, _("Compile &intonation data"));
  84. data_menu->AppendSeparator();
  85. data_menu->Append(MENU_FORMAT_DICTIONARY, _("&Layout *_rules file"));
  86. data_menu->Append(MENU_SORT_DICTIONARY, _("&Sort *_rules file"));
  87. sprintf(buf,"Compile &dictionary '%s'",dict_name);
  88. data_menu->SetLabel(MENU_COMPILE_DICT, wxString(buf,wxConvLocal));
  89. sprintf(buf,"&Layout '%s_rules' file",dict_name);
  90. data_menu->SetLabel(MENU_FORMAT_DICTIONARY, wxString(buf,wxConvLocal));
  91. sprintf(buf,"&Sort '%s_rules' file",dict_name);
  92. data_menu->SetLabel(MENU_SORT_DICTIONARY, wxString(buf,wxConvLocal));
  93. // OPTIONS MENU
  94. paths_menu = new wxMenu;
  95. paths_menu->Append(MENU_PATH0, _("Master phonemes file..."));
  96. paths_menu->Append(MENU_PATH1, _("Phoneme data source..."));
  97. paths_menu->Append(MENU_PATH2, _("Dictionary data source..."));
  98. paths_menu->Append(MENU_PATH3, _("Synthesized sound WAV file..."));
  99. paths_menu->AppendSeparator();
  100. paths_menu->Append(MENU_PATH4, _("Voice file to modify formant peaks..."));
  101. option_menu = new wxMenu;
  102. option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu);
  103. option_menu->Append(MENU_OPT_SPEED, _("Speed..."));
  104. option_menu->Append(MENU_OPT_PUNCT, _("Speak punctiation"));
  105. option_menu->Append(MENU_OPT_SPELL, _("Speak character names"));
  106. // TOOLS
  107. vowelchart_menu = new wxMenu;
  108. vowelchart_menu->Append(MENU_VOWELCHART1, _("From compiled phoneme data"));
  109. // vowelchart_menu->Append(MENU_VOWELCHART2, _("From list of formants..."));
  110. vowelchart_menu->Append(MENU_VOWELCHART3, _("From directory of vowel files..."));
  111. lexicon_menu = new wxMenu;
  112. lexicon_menu->Append(MENU_LEXICON_RU, _("Russian (lexicon.dict)"));
  113. lexicon_menu->Append(MENU_LEXICON_BG, _("Bulgarian"));
  114. lexicon_menu->Append(MENU_LEXICON_DE, _("German"));
  115. lexicon_menu->Append(MENU_LEXICON_IT, _("Italian"));
  116. lexicon_menu->Append(MENU_LEXICON_IT2, _("Italian, pass 2"));
  117. // lexicon_menu->Append(MENU_LEXICON_TEST, _("Test"));
  118. tools_menu = new wxMenu;
  119. tools_menu->Append(MENU_VOWELCHART, _("Make &Vowels Chart"), vowelchart_menu);
  120. // tools_menu->Append(MENU_LOAD_WAV, _T("Analyse WAV file"));
  121. tools_menu->Append(MENU_LEXICON, _("Process &Lexicon"), lexicon_menu);
  122. tools_menu->Append(MENU_TO_UTF8, _("Convert file to &UTF8..."));
  123. tools_menu->Append(MENU_COUNT_WORDS, _("Count word &frequencies..."));
  124. tools_menu->Append(MENU_TEST , _("Test (temporary)"));
  125. // tools_menu->Append(MENU_TEST2 , _T("Test2"));
  126. // HELP MENU
  127. help_menu = new wxMenu;
  128. help_menu->Append(MENU_DOCS, _("eSpeak &Documentation"));
  129. help_menu->Append(MENU_ABOUT, _("&About"));
  130. wxMenuBar *menu_bar = new wxMenuBar;
  131. menu_bar->Append(file_menu, _("&File"));
  132. menu_bar->Append(speak_menu, _("&Speak"));
  133. menu_bar->Append(voice_menu, _("&Voice"));
  134. menu_bar->Append(option_menu, _("&Options"));
  135. menu_bar->Append(tools_menu, _("&Tools"));
  136. menu_bar->Append(data_menu, _("&Compile"));
  137. menu_bar->Append(help_menu, _("&Help"));
  138. return(menu_bar);
  139. } // end of MakeMenu