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