static int g_config_fd_noti;
static int g_config_wd_noti;
+static tts_config_client_type_e g_client_type = TTS_CONFIG_CLIENT_TYPE_DEFAULT;
+
/* For engine directory monitoring */
typedef struct {
Ecore_Fd_Handler* dir_fd_handler;
return TTS_CONFIG_ERROR_INVALID_PARAMETER;
}
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ return TTS_CONFIG_ERROR_NONE;
+ }
+
if (0 != tts_parser_set_engine(config_info.engine_id, config_info.setting, config_info.language, config_info.type)) {
SLOG(LOG_ERROR, TAG_TTSCONFIG, " Fail to save config");
return TTS_CONFIG_ERROR_OPERATION_FAILED;
char* before_lang = NULL;
int before_type;
- if (0 != tts_parser_set_voice(temp_lang, config_info.type)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save default voice");
- return -1;
- }
-
before_lang = strdup(config_info.language);
before_type = config_info.type;
return -1;
}
- if (0 != tts_parser_set_voice(tmp_language, tmp_type)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
- return -1;
- }
-
SECURE_SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[Config] Default voice : lang(%s) type(%d)",
tmp_language, tmp_type);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to set configure information");
return TTS_CONFIG_ERROR_INVALID_PARAMETER;
}
+
return 0;
}
}
if (true == config_info.auto_voice) {
__tts_config_set_auto_language();
+
+ if (TTS_CONFIG_CLIENT_TYPE_SERVER == g_client_type) {
+ if (0 != tts_parser_get_config_info(&config_info)){
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get configure information");
+ return;
+ }
+
+ if (0 != tts_parser_set_voice(config_info.language, config_info.type)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
+ return;
+ }
+ }
}
return;
if (0 != ret) {
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to set voice");
} else {
- SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] Saved default voice : lang(%s), type(%d)", config_info.language, config_info.type);
+ SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] Saved default voice : lang(%s), type(%d)", temp_lang, temp_type);
}
if (NULL != temp_lang) {
free(temp_lang);
}
}
+ if (0 != tts_parser_get_config_info(&config_info)){
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get configure information");
+ return TTS_CONFIG_ERROR_INVALID_PARAMETER;
+ }
+
GSList *iter = NULL;
tts_config_client_s* temp_client = NULL;
/* Call all callbacks of client*/
return 0;
}
-int tts_config_mgr_initialize(int uid)
+int tts_config_mgr_initialize(int uid, tts_config_client_type_e client_type)
{
GSList *iter = NULL;
int* get_uid;
}
}
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type : %d", client_type);
+ g_client_type = client_type;
+
if (0 != __tts_config_mgr_get_engine_info()) {
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get engine info");
__tts_config_release_client(uid);
if (true == config_info.auto_voice) {
/* Check language with display language */
__tts_config_set_auto_language();
+
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT != g_client_type) {
+ if (0 != tts_parser_get_config_info(&config_info)){
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get configure information");
+ }
+
+ if (0 != tts_parser_set_voice(config_info.language, config_info.type)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
+ }
+ }
} else {
if (false == __tts_config_mgr_check_lang_is_valid(config_info.engine_id, config_info.language, config_info.type)) {
/* Default language is not valid */
return TTS_CONFIG_ERROR_OPERATION_FAILED;
}
- if (0 != tts_parser_set_voice(config_info.language, config_info.type)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
- __tts_config_release_client(uid);
- __tts_config_release_engine();
- tts_parser_unload_config();
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_voice(config_info.language, config_info.type)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
+ __tts_config_release_client(uid);
+ __tts_config_release_engine();
+ tts_parser_unload_config();
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
}
}
SECURE_SLOG(LOG_DEBUG, TAG_TTSCONFIG, " Language : %s", config_info.language);
SECURE_SLOG(LOG_DEBUG, TAG_TTSCONFIG, " Type : %d", config_info.type);
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ return TTS_CONFIG_ERROR_NONE;
+ }
+
if (0 != tts_parser_set_engine(config_info.engine_id, config_info.setting,
config_info.language, config_info.type)) {
SLOG(LOG_ERROR, TAG_TTSCONFIG, " Fail to save config");
}
/* Check language is valid */
- if (0 != tts_parser_set_voice(language, type)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save default voice");
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_voice(language, type)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save default voice");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
+
memset(g_language, '\0', sizeof(g_language));
config_info.language = g_language;
strncpy(config_info.language, language, sizeof(g_language) - 1);
if (config_info.auto_voice != value) {
/* Check language is valid */
- if (0 != tts_parser_set_auto_voice(value)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save auto voice option");
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_auto_voice(value)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save auto voice option");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
config_info.auto_voice = value;
if (true == config_info.auto_voice) {
__tts_config_set_auto_language();
+
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT != g_client_type) {
+ if (0 != tts_parser_get_config_info(&config_info)){
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get configure information");
+ }
+
+ if (0 != tts_parser_set_voice(config_info.language, config_info.type)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to save config");
+ }
+ }
}
}
if (TTS_CONFIG_SPEED_MIN <= value && value <= TTS_CONFIG_SPEED_MAX) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[Config] Set speech rate : %d", value);
- if (0 != tts_parser_set_speech_rate(value)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save speech rate");
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_speech_rate(value)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save speech rate");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
tts_config_s config_info;
}
}
- if (0 != tts_parser_set_pitch(value)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save speech rate");
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_pitch(value)) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save speech rate");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
config_info.pitch = value;
}
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[Config] Set bg volume ratio : %lf", value);
- if (0 != tts_parser_set_bg_volume_ratio(value))
- {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save bg volume ratio");
- return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ if (TTS_CONFIG_CLIENT_TYPE_DEFAULT == g_client_type) {
+ SLOG(LOG_INFO, TAG_TTSCONFIG, "Client type is default. Skip saving configuration file.");
+ } else {
+ if (0 != tts_parser_set_bg_volume_ratio(value))
+ {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "Fail to save bg volume ratio");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
}
tts_config_s config_info;