123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
-
-
-
- #include "wx/wx.h"
-
- #include "main.h"
-
- wxMenu *speak_menu;
- wxMenu *data_menu = NULL;
- wxMenuBar *menu_bar = NULL;
-
-
- wxMenuBar *MakeMenu(int type, const char *dict_name)
- {
- char buf[100];
- wxMenu *old_menu;
- wxMenu *file_menu;
- wxMenu *help_menu;
- wxMenu *option_menu = NULL;
- wxMenu *paths_menu;
- wxMenu *tools_menu;
- wxMenu *voice_menu;
- wxMenu *vowelchart_menu;
- wxMenu *lexicon_menu;
-
-
- file_menu = new wxMenu;
- file_menu->Append(MENU_SPECTRUM, _("&Open..."));
- file_menu->Append(MENU_SPECTRUM2, _("O&pen2..."));
-
- if(type<=1)
- {
- }
- else
- if(type==2)
- {
- file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
- file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As..."));
- file_menu->Append(SPECTSEQ_SAVESELECT, _("Save Selection"));
- file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
- file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
- file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
- }
- else
- if(type==3)
- {
-
-
- file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
- file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
- }
- file_menu->Append(MENU_QUIT, _("&Quit"));
-
- if(type==0)
- {
-
-
- speak_menu = new wxMenu;
- speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate"));
- speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules"));
- speak_menu->Append(MENU_SPEAK_IPA, _("Show &IPA"));
- speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak"));
- speak_menu->AppendSeparator();
- speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file..."));
- speak_menu->Append(MENU_SPEAK_PAUSE, _("&Pause"));
- speak_menu->Append(MENU_SPEAK_STOP, _("St&op"));
-
-
- voice_menu = new wxMenu;
- voice_menu->Append(MENU_SPEAK_VOICE, _("Select &Voice.."));
- voice_menu->Append(MENU_SPEAK_VOICE_VARIANT, _("Select Voice Va&riant..."));
-
-
- data_menu = new wxMenu;
- data_menu->Append(MENU_COMPILE_DICT, _("Compile &dictionary"));
- data_menu->Append(MENU_COMPILE_DICT_DEBUG, _("Compile dictionary (debu&g)"));
- data_menu->Append(MENU_COMPILE_PH, _("Compile &phoneme data 22050Hz"));
- data_menu->Append(MENU_COMPILE_PH2, _("Compile at sample &rate"));
- data_menu->AppendSeparator();
- data_menu->Append(MENU_COMPILE_MBROLA, _("Compile &mbrola phonemes list..."));
- data_menu->Append(MENU_COMPILE_INTONATION, _("Compile &intonation data"));
- data_menu->AppendSeparator();
- data_menu->Append(MENU_FORMAT_DICTIONARY, _("&Layout *_rules file"));
- data_menu->Append(MENU_SORT_DICTIONARY, _("&Sort *_rules file"));
-
- sprintf(buf,"Compile &dictionary '%s'",dict_name);
- data_menu->SetLabel(MENU_COMPILE_DICT, wxString(buf,wxConvLocal));
- sprintf(buf,"&Layout '%s_rules' file",dict_name);
- data_menu->SetLabel(MENU_FORMAT_DICTIONARY, wxString(buf,wxConvLocal));
- sprintf(buf,"&Sort '%s_rules' file",dict_name);
- data_menu->SetLabel(MENU_SORT_DICTIONARY, wxString(buf,wxConvLocal));
-
-
- paths_menu = new wxMenu;
- paths_menu->Append(MENU_PATH0, _("Master phonemes file..."));
- paths_menu->Append(MENU_PATH1, _("Phoneme data source..."));
- paths_menu->Append(MENU_PATH2, _("Dictionary data source..."));
- paths_menu->Append(MENU_PATH3, _("Synthesized sound WAV file..."));
- paths_menu->AppendSeparator();
- paths_menu->Append(MENU_PATH4, _("Voice file to modify formant peaks..."));
-
- option_menu = new wxMenu;
- option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu);
- option_menu->Append(MENU_OPT_SPEED, _("Speed..."));
- option_menu->AppendSeparator();
- option_menu->Append(MENU_OPT_PUNCT, _("Speak punctuation"));
- option_menu->Append(MENU_OPT_SPELL, _("Speak characters"));
- option_menu->Append(MENU_OPT_SPELL2, _("Speak character name"));
-
-
- vowelchart_menu = new wxMenu;
- vowelchart_menu->Append(MENU_VOWELCHART1, _("From compiled phoneme data"));
-
- vowelchart_menu->Append(MENU_VOWELCHART3, _("From directory of vowel files..."));
-
- lexicon_menu = new wxMenu;
- lexicon_menu->Append(MENU_LEXICON_RU, _("Russian"));
- lexicon_menu->Append(MENU_LEXICON_BG, _("Bulgarian"));
- lexicon_menu->Append(MENU_LEXICON_DE, _("German"));
- lexicon_menu->Append(MENU_LEXICON_IT, _("Italian"));
-
-
- tools_menu = new wxMenu;
- tools_menu->Append(MENU_VOWELCHART, _("Make &Vowels Chart"), vowelchart_menu);
-
- tools_menu->Append(MENU_LEXICON, _("Process &Lexicon"), lexicon_menu);
- tools_menu->Append(MENU_TO_UTF8, _("Convert file to &UTF8..."));
- tools_menu->Append(MENU_COUNT_WORDS, _("Count word &frequencies..."));
- tools_menu->Append(MENU_TEST , _("Test (temporary)"));
-
-
-
- help_menu = new wxMenu;
- help_menu->Append(MENU_DOCS, _("eSpeak &Documentation"));
- help_menu->Append(MENU_ABOUT, _("&About"));
-
-
- menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, _("&File"));
- menu_bar->Append(speak_menu, _("&Speak"));
- menu_bar->Append(voice_menu, _("&Voice"));
- menu_bar->Append(option_menu, _("&Options"));
- menu_bar->Append(tools_menu, _("&Tools"));
- menu_bar->Append(data_menu, _("&Compile"));
- menu_bar->Append(help_menu, _("&Help"));
- }
- else
- {
-
- old_menu = menu_bar->Replace(0, file_menu, _("&File"));
- delete old_menu;
- }
- return(menu_bar);
- }
-
|