/native/external/espeak/src/espeak_command.h

http://eyes-free.googlecode.com/ · C Header · 129 lines · 102 code · 26 blank · 1 comment · 0 complexity · cf8b9bd3ea51829e1176fe9255bd02aa MD5 · raw file

  1. #ifndef ESPEAK_COMMAND_H
  2. #define ESPEAK_COMMAND_H
  3. #ifndef PLATFORM_WINDOWS
  4. #include <unistd.h>
  5. #endif
  6. #include "speak_lib.h"
  7. enum t_espeak_type
  8. {
  9. ET_TEXT,
  10. ET_MARK,
  11. ET_KEY,
  12. ET_CHAR,
  13. ET_PARAMETER,
  14. ET_PUNCTUATION_LIST,
  15. ET_VOICE_NAME,
  16. ET_VOICE_SPEC,
  17. ET_TERMINATED_MSG
  18. };
  19. typedef struct
  20. {
  21. unsigned int unique_identifier;
  22. void* text;
  23. size_t size;
  24. unsigned int position;
  25. espeak_POSITION_TYPE position_type;
  26. unsigned int end_position;
  27. unsigned int flags;
  28. void* user_data;
  29. } t_espeak_text;
  30. typedef struct
  31. {
  32. unsigned int unique_identifier;
  33. void* text;
  34. size_t size;
  35. const char* index_mark;
  36. unsigned int end_position;
  37. unsigned int flags;
  38. void* user_data;
  39. } t_espeak_mark;
  40. typedef struct
  41. {
  42. unsigned int unique_identifier;
  43. void* user_data;
  44. } t_espeak_terminated_msg;
  45. typedef struct
  46. {
  47. espeak_PARAMETER parameter;
  48. int value;
  49. int relative;
  50. } t_espeak_parameter;
  51. enum t_command_state
  52. {
  53. CS_UNDEFINED, // The command has just been created
  54. CS_PENDING, // stored in the fifo
  55. CS_PROCESSED // processed
  56. };
  57. typedef struct
  58. {
  59. enum t_espeak_type type;
  60. t_command_state state;
  61. union command
  62. {
  63. t_espeak_text my_text;
  64. t_espeak_mark my_mark;
  65. const char* my_key;
  66. wchar_t my_char;
  67. t_espeak_parameter my_param;
  68. const wchar_t* my_punctuation_list;
  69. const char *my_voice_name;
  70. espeak_VOICE my_voice_spec;
  71. t_espeak_terminated_msg my_terminated_msg;
  72. } u;
  73. } t_espeak_command;
  74. t_espeak_command* create_espeak_text(const void *text, size_t size, unsigned int position, espeak_POSITION_TYPE position_type, unsigned int end_position, unsigned int flags, void* user_data);
  75. t_espeak_command* create_espeak_mark(const void *text, size_t size, const char *index_mark, unsigned int end_position, unsigned int flags, void* user_data);
  76. t_espeak_command* create_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
  77. t_espeak_command* create_espeak_key(const char *key_name);
  78. t_espeak_command* create_espeak_char(wchar_t character);
  79. t_espeak_command* create_espeak_parameter(espeak_PARAMETER parameter, int value, int relative);
  80. t_espeak_command* create_espeak_punctuation_list(const wchar_t *punctlist);
  81. t_espeak_command* create_espeak_voice_name(const char *name);
  82. t_espeak_command* create_espeak_voice_spec(espeak_VOICE *voice_spec);
  83. void process_espeak_command( t_espeak_command* the_command);
  84. int delete_espeak_command( t_espeak_command* the_command);
  85. void display_espeak_command(t_espeak_command* the_command);
  86. espeak_ERROR sync_espeak_Synth(unsigned int unique_identifier, const void *text, size_t size,
  87. unsigned int position, espeak_POSITION_TYPE position_type,
  88. unsigned int end_position, unsigned int flags, void* user_data);
  89. espeak_ERROR sync_espeak_Synth_Mark(unsigned int unique_identifier, const void *text, size_t size,
  90. const char *index_mark, unsigned int end_position,
  91. unsigned int flags, void* user_data);
  92. void sync_espeak_Key(const char *key);
  93. void sync_espeak_Char(wchar_t character);
  94. void sync_espeak_SetPunctuationList(const wchar_t *punctlist);
  95. void sync_espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
  96. int sync_espeak_SetVoiceByName(const char *name);
  97. int sync_espeak_SetVoiceByProperties(espeak_VOICE *voice_selector);
  98. espeak_ERROR SetVoiceByName(const char *name);
  99. espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector);
  100. void SetParameter(int parameter, int value, int relative);
  101. int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
  102. //>
  103. #endif