flowm.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*************************************************************************/
  2. /* */
  3. /* Language Technologies Institute */
  4. /* Carnegie Mellon University */
  5. /* Copyright (c) 2008 */
  6. /* All Rights Reserved. */
  7. /* */
  8. /* Permission is hereby granted, free of charge, to use and distribute */
  9. /* this software and its documentation without restriction, including */
  10. /* without limitation the rights to use, copy, modify, merge, publish, */
  11. /* distribute, sublicense, and/or sell copies of this work, and to */
  12. /* permit persons to whom this work is furnished to do so, subject to */
  13. /* the following conditions: */
  14. /* 1. The code must retain the above copyright notice, this list of */
  15. /* conditions and the following disclaimer. */
  16. /* 2. Any modifications must be clearly marked as such. */
  17. /* 3. Original authors' names are not deleted. */
  18. /* 4. The authors' names are not used to endorse or promote products */
  19. /* derived from this software without specific prior written */
  20. /* permission. */
  21. /* */
  22. /* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */
  23. /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
  24. /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
  25. /* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */
  26. /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
  27. /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
  28. /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
  29. /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
  30. /* THIS SOFTWARE. */
  31. /* */
  32. /*************************************************************************/
  33. #ifndef __FLOWM_H_
  34. #define __FLOWM_H_
  35. /* Following the program structure in Boling's Promgramming in WinCE */
  36. typedef LRESULT (*MsgDispatcher)(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  37. typedef struct MsgDispatch_struct
  38. {
  39. UINT Code; /* messages */
  40. MsgDispatcher Fxn;
  41. } MsgDispatch;
  42. typedef LRESULT (*CMDDispatcher)(HWND h, WORD w, HWND h2, WORD w2);
  43. typedef struct CMDDispatch_struct
  44. {
  45. UINT Code;
  46. CMDDispatcher Fxn;
  47. } CMDDispatch;
  48. /* Some globals that serve to communcate between threads */
  49. extern int flowm_play_status;
  50. extern TCHAR fl_filename[257];
  51. extern int flowm_file_pos;
  52. extern int flowm_file_size;
  53. extern int flowm_selected_voice;
  54. extern int flowm_selected_relation;
  55. extern HWND TTSWindow;
  56. #define FL_MAX_MSG_CHARS 300
  57. extern TCHAR fl_tts_msg[FL_MAX_MSG_CHARS];
  58. extern TCHAR fl_fp_msg[FL_MAX_MSG_CHARS];
  59. #define FLOWM_NUM_UTT_POS 200
  60. extern int flowm_utt_pos_pos;
  61. extern int flowm_prev_utt_pos[FLOWM_NUM_UTT_POS];
  62. extern float flowm_duration;
  63. /* The interface to the Flite TTS system */
  64. void flowm_init();
  65. void flowm_terminate();
  66. int flowm_say_text(TCHAR *text);
  67. int flowm_say_file(TCHAR *filename);
  68. int flowm_save_wave(TCHAR *filename); /* save previous waveform */
  69. float flowm_find_file_percentage();
  70. TCHAR *flowm_voice_name(int i);
  71. int InitApp (HINSTANCE h);
  72. HWND InitInstance (HINSTANCE h, LPWSTR p , int i);
  73. #ifdef __MINGW32__
  74. /* These aren't needed in MINGW32 and give compiler warnings */
  75. #undef CALLBACK
  76. #define CALLBACK
  77. #undef WINAPI
  78. #define WINAPI
  79. #endif
  80. void WINAPI SystemIdleTimerReset( void);
  81. LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  82. LRESULT DoCreateMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  83. LRESULT DoNotifyMain (HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  84. LRESULT DoPaintMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  85. LRESULT DoSizeMain(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  86. LRESULT DoCommandMain(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  87. LRESULT DoSettingChangeMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  88. LRESULT DoHibernateMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  89. LRESULT DoActivateMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  90. LRESULT DoDestroyMain(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  91. LPARAM DoMainCommandExit(HWND hwnd,WORD idItem,HWND hwndCtl,WORD wNotifyCode);
  92. LPARAM DoMainCommandAbout(HWND hwnd, WORD idItem,
  93. HWND hwndCtl, WORD wNotifyCode);
  94. LPARAM DoMainCommandPlay(HWND hwnd, WORD idItem,HWND hwndCtl,WORD wNotifyCode);
  95. LPARAM DoMainCommandFile(HWND hwnd, WORD idItem,HWND hwndCtl,WORD wNotifyCode);
  96. BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  97. BOOL CALLBACK PlayDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  98. BOOL CALLBACK FileDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  99. #define FL_TOOLBAR1 101
  100. #define FL_MAIN 102
  101. #define FL_TOOLMENU 103
  102. #define FL_ABOUTMENU 104
  103. #define FL_RPTLIST 105
  104. #define FLS_TOOLMENUNAME 150
  105. #define FLS_ABOUTMENUNAME 151
  106. #define FL_EXIT 201
  107. #define FL_PLAY 202
  108. #define FL_FILE 203
  109. #define FL_ABOUT 204
  110. #define FL_OPTIONS 205
  111. #define FL_FILENAME 301
  112. #define FL_TEXT 302
  113. #define FL_PUSHPLAY 303
  114. #define FL_PUSHTTS 304
  115. #define FL_PUSHSTOP 305
  116. #define FL_PUSHSELECT 306
  117. #define FL_SYNTHTEXT 307
  118. #define FL_FILEPOS 308
  119. #define FL_PUSHFORWARD 309
  120. #define FL_PUSHBACK 310
  121. #define FL_BENCH 311
  122. #define FL_SCREENOFF 312
  123. #define FL_PUSHEND 313
  124. #define FL_PUSHSAVE 314
  125. #define FL_VOXLIST 401
  126. #define FL_RELLIST 402
  127. #define FL_OUTPUT 403
  128. #define FL_MAX_TEXTLEN 256
  129. #define FLOWM_PLAY 0
  130. #define FLOWM_STOP 1
  131. #define FLOWM_SKIP 2
  132. #define FLOWM_BACKSKIP 3
  133. #define FLOWM_BENCH 4
  134. #endif