bool isTextsize = false;
xmlDocPtr doc = NULL;
xmlNodePtr cur = NULL;
- xmlChar *key = NULL;
- xmlChar *attr = NULL;
if (0 == access(path, F_OK)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] Success to access to %s", path);
while (cur != NULL) {
if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_NAME)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (NULL != temp->name) {
free(temp->name);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] <%s> has no content", TTS_TAG_ENGINE_NAME);
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_ID)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (NULL != temp->uuid) {
free(temp->uuid);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] <%s> has no content", TTS_TAG_ENGINE_ID);
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_SETTING)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (NULL != temp->setting) {
free(temp->setting);
break;
}
- attr = xmlGetProp(voice_node, (const xmlChar*)TTS_TAG_ENGINE_VOICE_TYPE);
+ xmlChar *attr = xmlGetProp(voice_node, (const xmlChar*)TTS_TAG_ENGINE_VOICE_TYPE);
if (NULL != attr) {
if (0 == xmlStrcmp(attr, (const xmlChar *)TTS_TAG_VOICE_TYPE_FEMALE)) {
temp_voice->type = (int)TTS_CONFIG_VOICE_TYPE_FEMALE;
continue;
}
- key = xmlNodeGetContent(voice_node);
+ xmlChar *key = xmlNodeGetContent(voice_node);
if (NULL != key) {
if (NULL != temp_voice->language) {
free(temp_voice->language);
voice_node = voice_node->next;
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_PITCH_SUPPORT)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (0 == xmlStrcmp(key, (const xmlChar *)"true")) {
temp->pitch_support = true;
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_TEXT_SIZE)) {
isTextsize = true;
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
temp->text_size = atoi((char*)key);
xmlFree(key);
engine_info->setting = NULL;
}
- tts_config_voice_s *temp_voice;
- temp_voice = g_slist_nth_data(engine_info->voices, 0);
-
- while (NULL != temp_voice) {
- if (NULL != temp_voice) {
- if (NULL != temp_voice->language) {
- free(temp_voice->language);
- temp_voice->language = NULL;
+ GSList *iter = NULL;
+ if (g_slist_length(engine_info->voices) > 0) {
+ iter = g_slist_nth(engine_info->voices, 0);
+ while (NULL != iter) {
+ tts_config_voice_s *temp_voice = (tts_config_voice_s*)iter->data;
+ if (NULL != temp_voice) {
+ if (NULL != temp_voice->language) {
+ free(temp_voice->language);
+ temp_voice->language = NULL;
+ }
+ free(temp_voice);
+ temp_voice = NULL;
}
- engine_info->voices = g_slist_remove(engine_info->voices, temp_voice);
- free(temp_voice);
- temp_voice = NULL;
- }
- temp_voice = g_slist_nth_data(engine_info->voices, 0);
+ engine_info->voices = g_slist_delete_link(engine_info->voices, iter);
+ iter = g_slist_nth(engine_info->voices, 0);
+ }
}
if (NULL != engine_info) {
{
xmlDocPtr doc = NULL;
xmlNodePtr cur = NULL;
- xmlChar *key;
bool is_default_open = false;
/* For Thread safety */
}
}
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
strncpy(temp->engine_id, (char*)key, sizeof(g_engine_id) - 1);
xmlFree(key);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] engine id is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_ENGINE_SETTING)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
strncpy(temp->setting, (char*)key, sizeof(g_setting) - 1);
xmlFree(key);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] setting path is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_AUTO_VOICE)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (0 == xmlStrcmp(key, (const xmlChar *)"on")) {
temp->auto_voice = true;
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] voice type is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_VOICE_TYPE)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
if (0 == xmlStrcmp(key, (const xmlChar *)TTS_TAG_VOICE_TYPE_MALE)) {
temp->type = (int)TTS_CONFIG_VOICE_TYPE_MALE;
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] voice type is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_LANGUAGE)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
strncpy(temp->language, (char*)key, sizeof(g_language) - 1);
xmlFree(key);
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_SPEECH_RATE)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
temp->speech_rate = atoi((char*)key);
xmlFree(key);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] speech rate is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_PITCH)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
temp->pitch = atoi((char*)key);
xmlFree(key);
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Pitch is NULL");
}
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_BACKGROUND_VOLUME_RATIO)) {
- key = xmlNodeGetContent(cur);
+ xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
temp->bg_volume_ratio = atof((char*)key);
xmlFree(key);
xmlNodePtr cur_new = NULL;
xmlNodePtr cur_old = NULL;
- xmlChar *key_new;
- xmlChar *key_old;
-
int retry_count = 0;
while (NULL == doc) {
if (0 == access(TTS_CONFIG, F_OK)) {
while (cur_new != NULL && cur_old != NULL) {
if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_ENGINE_ID)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_ENGINE_ID)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old engine id(%s), New engine(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_ENGINE_SETTING)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_ENGINE_SETTING)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old engine setting(%s), New engine setting(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_AUTO_VOICE)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_AUTO_VOICE)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old auto voice (%s), New auto voice(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_LANGUAGE)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_LANGUAGE)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old language(%s), New language(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_VOICE_TYPE)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_VOICE_TYPE)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old voice type(%s), New voice type(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_SPEECH_RATE)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_SPEECH_RATE)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old speech rate(%s), New speech rate(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_PITCH)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_PITCH)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old pitch(%s), New pitch(%s)",
}
} else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_BACKGROUND_VOLUME_RATIO)) {
if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_BACKGROUND_VOLUME_RATIO)) {
- key_old = xmlNodeGetContent(cur_old);
+ xmlChar *key_old = xmlNodeGetContent(cur_old);
if (NULL != key_old) {
- key_new = xmlNodeGetContent(cur_new);
+ xmlChar *key_new = xmlNodeGetContent(cur_new);
if (NULL != key_new) {
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old bg volume ratio(%s), New bg volume ratio(%s)",