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.

main.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #include "wx/toolbar.h"
  2. #include "wx/laywin.h"
  3. #include "wx/progdlg.h"
  4. #include "wx/notebook.h"
  5. typedef unsigned short USHORT;
  6. typedef unsigned char UCHAR;
  7. extern wxMenuBar *MakeMenu(int type, const char *dict_name);
  8. extern wxString path_phsource;
  9. extern wxString path_speaktext;
  10. extern wxString path_speech;
  11. extern wxProgressDialog *progress;
  12. extern int progress_max;
  13. extern int gui_flag;
  14. extern char *WavFileName();
  15. extern char voice_name2[40];
  16. class SpectDisplay;
  17. // Define a new application
  18. class MyApp: public wxApp
  19. {
  20. public:
  21. bool OnInit(void);
  22. int OnExit(void);
  23. };
  24. // Define a new frame
  25. class MyFrame: public wxFrame
  26. {
  27. public:
  28. MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
  29. ~MyFrame(void);
  30. void OnAbout(wxCommandEvent& event);
  31. void OnQuit(wxCommandEvent& event);
  32. void OnOptions(wxCommandEvent& event);
  33. void OnSpeak(wxCommandEvent& event);
  34. void OnTools(wxCommandEvent& event);
  35. void OnKey(wxKeyEvent& event);
  36. void OnTimer(wxTimerEvent& event);
  37. void LoadWavFile(void);
  38. void OnNewWindow(wxCommandEvent& event);
  39. void OnProsody(wxCommandEvent& event);
  40. void PageCmd(wxCommandEvent& event);
  41. void SetVoiceTitle(char *voice_name);
  42. void OnPageChanged(wxNotebookEvent& event);
  43. protected:
  44. wxTimer m_timer;
  45. DECLARE_EVENT_TABLE()
  46. };
  47. #ifdef deleted
  48. class MyChild: public wxPanel
  49. {
  50. public:
  51. SpectDisplay *canvas;
  52. MyChild(wxNotebook *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
  53. ~MyChild(void);
  54. void OnActivate(wxActivateEvent& event);
  55. void OnQuit(wxCommandEvent& event);
  56. void OnSave(wxCommandEvent& event);
  57. void OnSaveAs(wxCommandEvent& event);
  58. void OnSaveSelect(wxCommandEvent& event);
  59. void OnSavePitchenv(wxCommandEvent& event);
  60. // void OnVoiceDlg(wxCommandEvent& event);
  61. DECLARE_EVENT_TABLE()
  62. };
  63. #endif
  64. class TranslDlg : public wxPanel
  65. {//=============================
  66. public:
  67. TranslDlg(wxWindow *parent);
  68. void OnKey(wxKeyEvent& event);
  69. void SpeakFile(void);
  70. void ReadVoice(int variant);
  71. void OnCommand(wxCommandEvent& event);
  72. wxTextCtrl* t_source;
  73. private:
  74. wxButton *t_translate;
  75. wxButton *t_process;
  76. wxTextCtrl* t_phonetic;
  77. DECLARE_EVENT_TABLE()
  78. };
  79. extern MyFrame *myframe;
  80. extern wxNotebook* screenpages;
  81. extern TranslDlg *transldlg;
  82. extern wchar_t ipa1[256];
  83. extern wxFont FONT_SMALL;
  84. extern wxFont FONT_MEDIUM;
  85. extern wxFont FONT_NORMAL;
  86. enum {
  87. MENU_QUIT = 1,
  88. MENU_SPECTRUM,
  89. MENU_SPECTRUM2,
  90. MENU_CLOSE_ALL,
  91. MENU_ABOUT,
  92. MENU_DOCS,
  93. MENU_OPTIONS,
  94. MENU_OPT_SPEED,
  95. MENU_OPT_PUNCT,
  96. MENU_OPT_SPELL,
  97. MENU_OPT_SPELL2,
  98. MENU_PATHS,
  99. MENU_PATH0,
  100. MENU_PATH1,
  101. MENU_PATH2,
  102. MENU_PATH3,
  103. MENU_PATH4,
  104. MENU_PROSODY,
  105. MENU_COMPILE_PH,
  106. MENU_COMPILE_PH2,
  107. MENU_COMPILE_DICT,
  108. MENU_COMPILE_DICT_DEBUG,
  109. MENU_FORMAT_DICTIONARY,
  110. MENU_SORT_DICTIONARY,
  111. MENU_COMPILE_MBROLA,
  112. MENU_COMPILE_INTONATION,
  113. MENU_SPEAK_TRANSLATE,
  114. MENU_SPEAK_RULES,
  115. MENU_SPEAK_IPA,
  116. MENU_SPEAK_TEXT,
  117. MENU_SPEAK_FILE,
  118. MENU_SPEAK_PAUSE,
  119. MENU_SPEAK_STOP,
  120. MENU_SPEAK_VOICE,
  121. MENU_SPEAK_VOICE_VARIANT,
  122. MENU_LOAD_WAV,
  123. MENU_VOWELCHART,
  124. MENU_VOWELCHART1,
  125. MENU_VOWELCHART2,
  126. MENU_VOWELCHART3,
  127. MENU_LEXICON,
  128. MENU_LEXICON_RU,
  129. MENU_LEXICON_BG,
  130. MENU_LEXICON_DE,
  131. MENU_LEXICON_IT,
  132. MENU_LEXICON_TEST,
  133. MENU_TO_UTF8,
  134. MENU_COUNT_WORDS,
  135. MENU_TEST,
  136. MENU_TEST2,
  137. SPECTSEQ_CLOSE,
  138. SPECTSEQ_SAVE,
  139. SPECTSEQ_SAVEAS,
  140. SPECTSEQ_SAVESELECT,
  141. SPECTSEQ_SAVEPITCH,
  142. SPECTSEQ_VOICEDLG,
  143. ID_SCREENPAGES,
  144. ID_NOTEBOOK
  145. };