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.4KB

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