Navit SVN

/work/compile/navit/src/navit/support/espeak/espeak_command.h

00001 #ifndef ESPEAK_COMMAND_H
00002 #define ESPEAK_COMMAND_H
00003 
00004 #ifndef PLATFORM_WINDOWS
00005 #include <unistd.h>
00006 #endif
00007 #include "speak_lib.h"
00008 
00009 enum t_espeak_type
00010   {
00011     ET_TEXT,
00012     ET_MARK,
00013     ET_KEY,
00014     ET_CHAR,
00015     ET_PARAMETER,
00016     ET_PUNCTUATION_LIST,
00017     ET_VOICE_NAME,
00018     ET_VOICE_SPEC,
00019     ET_TERMINATED_MSG
00020   };
00021 
00022 typedef struct
00023 {
00024   unsigned int unique_identifier;
00025   void* text;
00026   size_t size;
00027   unsigned int position;
00028   espeak_POSITION_TYPE position_type;
00029   unsigned int end_position;
00030   unsigned int flags;
00031   void* user_data;
00032 } t_espeak_text;
00033 
00034 typedef struct
00035 {
00036   unsigned int unique_identifier;
00037   void* text;
00038   size_t size;
00039   const char* index_mark;
00040   unsigned int end_position;
00041   unsigned int flags;
00042   void* user_data;
00043 } t_espeak_mark;
00044 
00045 typedef struct
00046 {
00047         unsigned int unique_identifier;
00048         void* user_data;
00049         wchar_t character;
00050 } t_espeak_character;
00051 
00052 typedef struct
00053 {
00054         unsigned int unique_identifier;
00055         void* user_data;
00056         const char* key_name;
00057 } t_espeak_key;
00058 
00059 
00060 typedef struct
00061 {
00062   unsigned int unique_identifier;
00063   void* user_data;
00064 } t_espeak_terminated_msg;
00065 
00066 
00067 typedef struct
00068 {
00069   espeak_PARAMETER parameter;
00070   int value;
00071   int relative;
00072 } t_espeak_parameter;
00073 
00074 enum t_command_state
00075 {
00076   CS_UNDEFINED, // The command has just been created
00077   CS_PENDING, // stored in the fifo
00078   CS_PROCESSED // processed
00079 };
00080 
00081 typedef struct
00082 {
00083   enum t_espeak_type type;
00084   enum t_command_state state;
00085 
00086   union command
00087   {
00088     t_espeak_text my_text;
00089     t_espeak_mark my_mark;
00090     t_espeak_key  my_key;
00091     t_espeak_character my_char;
00092     t_espeak_parameter my_param;
00093     const wchar_t* my_punctuation_list;
00094     const char *my_voice_name;
00095     espeak_VOICE my_voice_spec;
00096     t_espeak_terminated_msg my_terminated_msg;
00097   } u;
00098 } t_espeak_command;
00099 
00100 
00101 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);
00102 
00103 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);
00104 
00105 t_espeak_command* create_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
00106 
00107 t_espeak_command* create_espeak_key(const char *key_name, void *user_data);
00108 
00109 t_espeak_command* create_espeak_char(wchar_t character, void *user_data);
00110 
00111 t_espeak_command* create_espeak_parameter(espeak_PARAMETER parameter, int value, int relative);
00112 
00113 t_espeak_command* create_espeak_punctuation_list(const wchar_t *punctlist);
00114 
00115 t_espeak_command* create_espeak_voice_name(const char *name);
00116 
00117 t_espeak_command* create_espeak_voice_spec(espeak_VOICE *voice_spec);
00118 
00119 void process_espeak_command( t_espeak_command* the_command);
00120 
00121 int delete_espeak_command( t_espeak_command* the_command);
00122 
00123 void display_espeak_command(t_espeak_command* the_command);
00124 
00125 
00126 espeak_ERROR sync_espeak_Synth(unsigned int unique_identifier, const void *text, size_t size,
00127                       unsigned int position, espeak_POSITION_TYPE position_type,
00128                       unsigned int end_position, unsigned int flags, void* user_data);
00129 espeak_ERROR sync_espeak_Synth_Mark(unsigned int unique_identifier, const void *text, size_t size,
00130                            const char *index_mark, unsigned int end_position,
00131                            unsigned int flags, void* user_data);
00132 void sync_espeak_Key(const char *key);
00133 void sync_espeak_Char(wchar_t character);
00134 void sync_espeak_SetPunctuationList(const wchar_t *punctlist);
00135 void sync_espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
00136 int sync_espeak_SetVoiceByName(const char *name);
00137 int sync_espeak_SetVoiceByProperties(espeak_VOICE *voice_selector);
00138 espeak_ERROR SetVoiceByName(const char *name);
00139 espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector);
00140 void SetParameter(int parameter, int value, int relative);
00141 
00142 int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
00143 
00144 //>
00145 #endif