Line
Link Here
|
0 |
-- a/src/clients/say/options.c |
0 |
++ b/src/clients/say/options.c |
Lines 35-40
Link Here
|
35 |
#include "options.h" |
35 |
#include "options.h" |
36 |
#include <i18n.h> |
36 |
#include <i18n.h> |
37 |
|
37 |
|
|
|
38 |
signed int rate; |
39 |
signed int pitch; |
40 |
signed int pitch_range; |
41 |
signed int volume; |
42 |
|
43 |
int list_output_modules; |
44 |
char *output_module; |
45 |
char *sound_icon; |
46 |
char *language; |
47 |
char *voice_type; |
48 |
char *punctuation_mode; |
49 |
char *priority; |
50 |
int pipe_mode; |
51 |
SPDDataMode ssml_mode; |
52 |
int spelling; |
53 |
int wait_till_end; |
54 |
int stop_previous; |
55 |
int cancel_previous; |
56 |
int list_synthesis_voices; |
57 |
char *synthesis_voice; |
58 |
|
59 |
char *application_name; |
60 |
char *connection_name; |
61 |
|
38 |
void options_print_help(char *argv[]) |
62 |
void options_print_help(char *argv[]) |
39 |
{ |
63 |
{ |
40 |
assert(argv); |
64 |
assert(argv); |
41 |
-- a/src/clients/say/options.h |
65 |
++ b/src/clients/say/options.h |
Lines 24-51
Link Here
|
24 |
#include <getopt.h> |
24 |
#include <getopt.h> |
25 |
#include "speechd_types.h" |
25 |
#include "speechd_types.h" |
26 |
|
26 |
|
27 |
signed int rate; |
27 |
extern signed int rate; |
28 |
signed int pitch; |
28 |
extern signed int pitch; |
29 |
signed int volume; |
29 |
extern signed int volume; |
30 |
|
30 |
|
31 |
int list_output_modules; |
31 |
extern int list_output_modules; |
32 |
char *output_module; |
32 |
extern char *output_module; |
33 |
char *sound_icon; |
33 |
extern char *sound_icon; |
34 |
char *language; |
34 |
extern char *language; |
35 |
char *voice_type; |
35 |
extern char *voice_type; |
36 |
char *punctuation_mode; |
36 |
extern char *punctuation_mode; |
37 |
char *priority; |
37 |
extern char *priority; |
38 |
int pipe_mode; |
38 |
extern int pipe_mode; |
39 |
SPDDataMode ssml_mode; |
39 |
extern SPDDataMode ssml_mode; |
40 |
int spelling; |
40 |
extern int spelling; |
41 |
int wait_till_end; |
41 |
extern int wait_till_end; |
42 |
int stop_previous; |
42 |
extern int stop_previous; |
43 |
int cancel_previous; |
43 |
extern int cancel_previous; |
44 |
int list_synthesis_voices; |
44 |
extern int list_synthesis_voices; |
45 |
char *synthesis_voice; |
45 |
extern char *synthesis_voice; |
46 |
|
46 |
|
47 |
char *application_name; |
47 |
extern char *application_name; |
48 |
char *connection_name; |
48 |
extern char *connection_name; |
49 |
|
49 |
|
50 |
static struct option long_options[] = { |
50 |
static struct option long_options[] = { |
51 |
{"rate", 1, 0, 'r'}, |
51 |
{"rate", 1, 0, 'r'}, |
52 |
-- a/src/modules/festival_client.c |
52 |
++ b/src/modules/festival_client.c |
Lines 76-81
Link Here
|
76 |
/* For testing endianness */ |
76 |
/* For testing endianness */ |
77 |
int fapi_endian_loc = 1; |
77 |
int fapi_endian_loc = 1; |
78 |
|
78 |
|
|
|
79 |
int festival_connection_crashed; |
80 |
|
79 |
static char *socket_receive_file_to_buff(int fd, int *size); |
81 |
static char *socket_receive_file_to_buff(int fd, int *size); |
80 |
|
82 |
|
81 |
/* --- MANAGING FT STRUCTURES --- */ |
83 |
/* --- MANAGING FT STRUCTURES --- */ |
82 |
-- a/src/modules/festival_client.h |
84 |
++ b/src/modules/festival_client.h |
Lines 45-51
Link Here
|
45 |
#define FESTIVAL_DEFAULT_SERVER_PORT 1314 |
45 |
#define FESTIVAL_DEFAULT_SERVER_PORT 1314 |
46 |
#define FESTIVAL_DEFAULT_TEXT_MODE "fundamental" |
46 |
#define FESTIVAL_DEFAULT_TEXT_MODE "fundamental" |
47 |
|
47 |
|
48 |
int festival_connection_crashed; |
48 |
extern int festival_connection_crashed; |
49 |
|
49 |
|
50 |
typedef struct FT_Info { |
50 |
typedef struct FT_Info { |
51 |
int encoding; |
51 |
int encoding; |
52 |
-- a/src/modules/module_utils.c |
52 |
++ b/src/modules/module_utils.c |
Lines 37-42
Link Here
|
37 |
|
37 |
|
38 |
pthread_mutex_t module_stdout_mutex = PTHREAD_MUTEX_INITIALIZER; |
38 |
pthread_mutex_t module_stdout_mutex = PTHREAD_MUTEX_INITIALIZER; |
39 |
|
39 |
|
|
|
40 |
int log_level; |
41 |
|
42 |
AudioID *module_audio_id; |
43 |
|
44 |
SPDMsgSettings msg_settings; |
45 |
SPDMsgSettings msg_settings_old; |
46 |
|
47 |
int current_index_mark; |
48 |
|
49 |
int Debug; |
50 |
FILE *CustomDebugFile; |
51 |
|
52 |
configfile_t *configfile; |
53 |
configoption_t *module_dc_options; |
54 |
int module_num_dc_options; |
55 |
|
56 |
const char *module_name; |
57 |
|
58 |
char *module_index_mark; |
59 |
|
40 |
char *do_message(SPDMessageType msgtype) |
60 |
char *do_message(SPDMessageType msgtype) |
41 |
{ |
61 |
{ |
42 |
int ret; |
62 |
int ret; |
43 |
-- a/src/modules/module_utils.h |
63 |
++ b/src/modules/module_utils.h |
Lines 43-63
Link Here
|
43 |
#include <speechd_types.h> |
43 |
#include <speechd_types.h> |
44 |
#include "spd_audio.h" |
44 |
#include "spd_audio.h" |
45 |
|
45 |
|
46 |
int log_level; |
46 |
extern int log_level; |
47 |
|
47 |
|
48 |
AudioID *module_audio_id; |
48 |
extern AudioID *module_audio_id; |
49 |
|
49 |
|
50 |
SPDMsgSettings msg_settings; |
50 |
extern SPDMsgSettings msg_settings; |
51 |
SPDMsgSettings msg_settings_old; |
51 |
extern SPDMsgSettings msg_settings_old; |
52 |
|
52 |
|
53 |
int current_index_mark; |
53 |
extern int current_index_mark; |
54 |
|
54 |
|
55 |
int Debug; |
55 |
extern int Debug; |
56 |
FILE *CustomDebugFile; |
56 |
extern FILE *CustomDebugFile; |
57 |
|
57 |
|
58 |
configfile_t *configfile; |
58 |
extern configfile_t *configfile; |
59 |
configoption_t *module_dc_options; |
59 |
extern configoption_t *module_dc_options; |
60 |
int module_num_dc_options; |
60 |
extern int module_num_dc_options; |
61 |
|
61 |
|
62 |
#define CLEAN_OLD_SETTINGS_TABLE()\ |
62 |
#define CLEAN_OLD_SETTINGS_TABLE()\ |
63 |
msg_settings_old.rate = -101;\ |
63 |
msg_settings_old.rate = -101;\ |
Lines 367-373
Link Here
|
367 |
#define INDEX_MARK_BODY_LEN 6 |
367 |
#define INDEX_MARK_BODY_LEN 6 |
368 |
#define INDEX_MARK_BODY "__spd_" |
368 |
#define INDEX_MARK_BODY "__spd_" |
369 |
|
369 |
|
370 |
char *module_index_mark; |
370 |
extern char *module_index_mark; |
371 |
|
371 |
|
372 |
/* This macro must be placed at the initialization of the module so that the |
372 |
/* This macro must be placed at the initialization of the module so that the |
373 |
later functions are possible to use */ |
373 |
later functions are possible to use */ |
374 |
-- a/src/server/compare.c |
374 |
++ b/src/server/compare.c |
Lines 31-36
Link Here
|
31 |
#include "compare.h" |
31 |
#include "compare.h" |
32 |
|
32 |
|
33 |
/* Pointer to compare_message_uid */ |
33 |
/* Pointer to compare_message_uid */ |
|
|
34 |
gint(*p_msg_lc) (); |
34 |
gint(*p_msg_uid_lc) () = compare_message_uid; |
35 |
gint(*p_msg_uid_lc) () = compare_message_uid; |
35 |
|
36 |
|
36 |
gint compare_message_uid(gconstpointer element, gconstpointer value, gpointer x) |
37 |
gint compare_message_uid(gconstpointer element, gconstpointer value, gpointer x) |
37 |
-- a/src/server/compare.h |
38 |
++ b/src/server/compare.h |
Lines 29-35
Link Here
|
29 |
gpointer x); |
29 |
gpointer x); |
30 |
|
30 |
|
31 |
/* Pointer to function compare_message_uid */ |
31 |
/* Pointer to function compare_message_uid */ |
32 |
gint(*p_msg_lc) (); |
32 |
extern gint(*p_msg_lc) (); |
33 |
gint(*p_msg_uid_lc) (); |
33 |
extern gint(*p_msg_uid_lc) (); |
34 |
|
34 |
|
35 |
#endif /* COMPARE_H */ |
35 |
#endif /* COMPARE_H */ |
36 |
-- a/src/server/configuration.c |
36 |
++ b/src/server/configuration.c |
Lines 34-39
Link Here
|
34 |
#include "configuration.h" |
34 |
#include "configuration.h" |
35 |
#include <fdsetconv.h> |
35 |
#include <fdsetconv.h> |
36 |
|
36 |
|
|
|
37 |
configoption_t *spd_options; |
38 |
int spd_num_options; |
39 |
|
37 |
static TFDSetClientSpecific *cl_spec_section; |
40 |
static TFDSetClientSpecific *cl_spec_section; |
38 |
|
41 |
|
39 |
/* So that gcc doesn't comply about casts to char* */ |
42 |
/* So that gcc doesn't comply about casts to char* */ |
40 |
-- a/src/server/configuration.h |
43 |
++ b/src/server/configuration.h |
Lines 31-38
Link Here
|
31 |
#define SPEECHD_DEFAULT_PORT 6560 |
31 |
#define SPEECHD_DEFAULT_PORT 6560 |
32 |
|
32 |
|
33 |
/* Loading options from DotConf */ |
33 |
/* Loading options from DotConf */ |
34 |
configoption_t *spd_options; |
34 |
extern configoption_t *spd_options; |
35 |
int spd_num_options; |
35 |
extern int spd_num_options; |
36 |
|
36 |
|
37 |
configoption_t *load_config_options(int *num_options); |
37 |
configoption_t *load_config_options(int *num_options); |
38 |
void free_config_options(configoption_t * opts, int *num); |
38 |
void free_config_options(configoption_t * opts, int *num); |
39 |
-- a/src/server/speaking.c |
39 |
++ b/src/server/speaking.c |
Lines 47-52
Link Here
|
47 |
int SPEAKING = 0; |
47 |
int SPEAKING = 0; |
48 |
int poll_count; |
48 |
int poll_count; |
49 |
|
49 |
|
|
|
50 |
OutputModule *speaking_module; |
51 |
int speaking_uid; |
52 |
int speaking_gid; |
53 |
|
54 |
/* Pause and resume handling */ |
55 |
int pause_requested; |
56 |
int pause_requested_fd; |
57 |
int pause_requested_uid; |
58 |
int resume_requested; |
59 |
|
50 |
/* |
60 |
/* |
51 |
Speak() is responsible for getting right text from right |
61 |
Speak() is responsible for getting right text from right |
52 |
queue in right time and saying it loud through the corresponding |
62 |
queue in right time and saying it loud through the corresponding |
53 |
-- a/src/server/speaking.h |
63 |
++ b/src/server/speaking.h |
Lines 28-42
Link Here
|
28 |
|
28 |
|
29 |
#include <speechd_types.h> |
29 |
#include <speechd_types.h> |
30 |
|
30 |
|
31 |
OutputModule *speaking_module; |
31 |
extern OutputModule *speaking_module; |
32 |
int speaking_uid; |
32 |
extern int speaking_uid; |
33 |
int speaking_gid; |
33 |
extern int speaking_gid; |
34 |
|
34 |
|
35 |
/* Pause and resume handling */ |
35 |
/* Pause and resume handling */ |
36 |
int pause_requested; |
36 |
extern int pause_requested; |
37 |
int pause_requested_fd; |
37 |
extern int pause_requested_fd; |
38 |
int pause_requested_uid; |
38 |
extern int pause_requested_uid; |
39 |
int resume_requested; |
39 |
extern int resume_requested; |
40 |
|
40 |
|
41 |
/* Speak() is responsible for getting right text from right |
41 |
/* Speak() is responsible for getting right text from right |
42 |
* queue in right time and saying it loud through corresponding |
42 |
* queue in right time and saying it loud through corresponding |
43 |
-- a/src/server/speechd.c |
43 |
++ b/src/server/speechd.c |
Lines 63-68
Link Here
|
63 |
|
63 |
|
64 |
int client_count = 0; |
64 |
int client_count = 0; |
65 |
|
65 |
|
|
|
66 |
struct SpeechdOptions SpeechdOptions; |
67 |
struct SpeechdStatus SpeechdStatus; |
68 |
|
69 |
pthread_t speak_thread; |
70 |
pthread_mutex_t logging_mutex; |
71 |
pthread_mutex_t element_free_mutex; |
72 |
pthread_mutex_t output_layer_mutex; |
73 |
pthread_mutex_t socket_com_mutex; |
74 |
|
75 |
GHashTable *fd_settings; |
76 |
GHashTable *language_default_modules; |
77 |
GHashTable *fd_uid; |
78 |
|
79 |
TSpeechDQueue *MessageQueue; |
80 |
GList *MessagePausedList; |
81 |
|
82 |
GList *client_specific_settings; |
83 |
|
84 |
GList *last_p5_block; |
85 |
|
86 |
TFDSetElement GlobalFDSet; |
87 |
|
88 |
int speaking_pipe[2]; |
89 |
|
90 |
GHashTable *speechd_sockets_status; |
91 |
|
92 |
FILE *logfile; |
93 |
FILE *custom_logfile; |
94 |
char *custom_log_kind; |
95 |
FILE *debug_logfile; |
96 |
|
97 |
TSpeechDMode spd_mode; |
98 |
|
66 |
static gboolean speechd_client_terminate(gpointer key, gpointer value, gpointer user); |
99 |
static gboolean speechd_client_terminate(gpointer key, gpointer value, gpointer user); |
67 |
static gboolean speechd_reload_dead_modules(gpointer user_data); |
100 |
static gboolean speechd_reload_dead_modules(gpointer user_data); |
68 |
static gboolean speechd_load_configuration(gpointer user_data); |
101 |
static gboolean speechd_load_configuration(gpointer user_data); |
69 |
-- a/src/server/speechd.h |
102 |
++ b/src/server/speechd.h |
Lines 124-130
Link Here
|
124 |
SPD_MODE_SINGLE /* */ |
124 |
SPD_MODE_SINGLE /* */ |
125 |
} TSpeechDMode; |
125 |
} TSpeechDMode; |
126 |
|
126 |
|
127 |
TSpeechDMode spd_mode; |
127 |
extern TSpeechDMode spd_mode; |
128 |
|
128 |
|
129 |
/* TSpeechDQueue is a queue for messages. */ |
129 |
/* TSpeechDQueue is a queue for messages. */ |
130 |
typedef struct { |
130 |
typedef struct { |
Lines 149-155
Link Here
|
149 |
#include "alloc.h" |
149 |
#include "alloc.h" |
150 |
#include "speaking.h" |
150 |
#include "speaking.h" |
151 |
|
151 |
|
152 |
struct { |
152 |
extern struct SpeechdOptions { |
153 |
char *communication_method; |
153 |
char *communication_method; |
154 |
int communication_method_set; |
154 |
int communication_method_set; |
155 |
char *socket_path; |
155 |
char *socket_path; |
Lines 173-220
Link Here
|
173 |
int server_timeout_set; |
173 |
int server_timeout_set; |
174 |
} SpeechdOptions; |
174 |
} SpeechdOptions; |
175 |
|
175 |
|
176 |
struct { |
176 |
extern struct SpeechdStatus { |
177 |
int max_uid; /* The largest assigned uid + 1 */ |
177 |
int max_uid; /* The largest assigned uid + 1 */ |
178 |
int max_gid; /* The largest assigned gid + 1 */ |
178 |
int max_gid; /* The largest assigned gid + 1 */ |
179 |
int max_fd; |
179 |
int max_fd; |
180 |
} SpeechdStatus; |
180 |
} SpeechdStatus; |
181 |
|
181 |
|
182 |
/* speak() thread defined in speaking.c */ |
182 |
/* speak() thread defined in speaking.c */ |
183 |
pthread_t speak_thread; |
183 |
extern pthread_t speak_thread; |
184 |
pthread_mutex_t logging_mutex; |
184 |
extern pthread_mutex_t logging_mutex; |
185 |
pthread_mutex_t element_free_mutex; |
185 |
extern pthread_mutex_t element_free_mutex; |
186 |
pthread_mutex_t output_layer_mutex; |
186 |
extern pthread_mutex_t output_layer_mutex; |
187 |
pthread_mutex_t socket_com_mutex; |
187 |
extern pthread_mutex_t socket_com_mutex; |
188 |
|
188 |
|
189 |
/* Table of all configured (and succesfully loaded) output modules */ |
189 |
/* Table of all configured (and succesfully loaded) output modules */ |
190 |
extern GList *output_modules; |
190 |
extern GList *output_modules; |
191 |
|
191 |
|
192 |
/* Table of settings for each active client (=each active socket)*/ |
192 |
/* Table of settings for each active client (=each active socket)*/ |
193 |
GHashTable *fd_settings; |
193 |
extern GHashTable *fd_settings; |
194 |
/* Table of default output modules for different languages */ |
194 |
/* Table of default output modules for different languages */ |
195 |
GHashTable *language_default_modules; |
195 |
extern GHashTable *language_default_modules; |
196 |
/* Table of relations between client file descriptors and their uids */ |
196 |
/* Table of relations between client file descriptors and their uids */ |
197 |
GHashTable *fd_uid; |
197 |
extern GHashTable *fd_uid; |
198 |
|
198 |
|
199 |
/* Speech Dispatcher main priority queue for messages */ |
199 |
/* Speech Dispatcher main priority queue for messages */ |
200 |
TSpeechDQueue *MessageQueue; |
200 |
extern TSpeechDQueue *MessageQueue; |
201 |
/* List of messages from paused clients waiting for resume */ |
201 |
/* List of messages from paused clients waiting for resume */ |
202 |
GList *MessagePausedList; |
202 |
extern GList *MessagePausedList; |
203 |
|
203 |
|
204 |
/* List of different entries of client-specific configuration */ |
204 |
/* List of different entries of client-specific configuration */ |
205 |
GList *client_specific_settings; |
205 |
extern GList *client_specific_settings; |
206 |
|
206 |
|
207 |
/* Saves the last received priority progress message */ |
207 |
/* Saves the last received priority progress message */ |
208 |
GList *last_p5_block; |
208 |
extern GList *last_p5_block; |
209 |
|
209 |
|
210 |
/* Global default settings */ |
210 |
/* Global default settings */ |
211 |
TFDSetElement GlobalFDSet; |
211 |
extern TFDSetElement GlobalFDSet; |
212 |
|
212 |
|
213 |
/* Inter thread comm pipe */ |
213 |
/* Inter thread comm pipe */ |
214 |
int speaking_pipe[2]; |
214 |
extern int speaking_pipe[2]; |
215 |
|
215 |
|
216 |
/* Managing sockets communication */ |
216 |
/* Managing sockets communication */ |
217 |
GHashTable *speechd_sockets_status; |
217 |
extern GHashTable *speechd_sockets_status; |
218 |
typedef struct { |
218 |
typedef struct { |
219 |
int awaiting_data; |
219 |
int awaiting_data; |
220 |
int inside_block; |
220 |
int inside_block; |
Lines 235-244
Link Here
|
235 |
#define FATAL(msg) { fatal_error(); MSG(-1,"Fatal error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } |
235 |
#define FATAL(msg) { fatal_error(); MSG(-1,"Fatal error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } |
236 |
#define DIE(msg) { MSG(0,"Error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } |
236 |
#define DIE(msg) { MSG(0,"Error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } |
237 |
|
237 |
|
238 |
FILE *logfile; |
238 |
extern FILE *logfile; |
239 |
FILE *custom_logfile; |
239 |
extern FILE *custom_logfile; |
240 |
char *custom_log_kind; |
240 |
extern char *custom_log_kind; |
241 |
FILE *debug_logfile; |
241 |
extern FILE *debug_logfile; |
242 |
|
242 |
|
243 |
/* For debugging purposes, does nothing */ |
243 |
/* For debugging purposes, does nothing */ |
244 |
void fatal_error(void); |
244 |
void fatal_error(void); |