switch (tts_client_get_current_state(client)) {
case TTS_STATE_PAUSED:
case TTS_STATE_PLAYING:
- case TTS_STATE_READY:
+ case TTS_STATE_READY: {
if (0 != tts_core_unprepare(client)) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to unprepare");
}
tts_client_set_current_state(client, TTS_STATE_CREATED);
- case TTS_STATE_CREATED:
+ }
+ case TTS_STATE_CREATED: {
/* Unset registered callbacks */
tts_client_unset_all_cb(client);
int thread_count = ecore_thread_active_get();
SLOG(LOG_INFO, TAG_TTSC, "[INFO] Active thread count: %d", thread_count);
- int cnt = 0;
- while (0 < thread_count) {
+ for (int cnt = 0; 0 < thread_count; cnt++) {
usleep(50000);
- cnt++;
if (30 == cnt) {
SLOG(LOG_WARN, TAG_TTSC, "[WARNNING] Thread is blocked, %d", thread_count);
break;
tts_client_destroy(tts);
break;
- default:
+ }
+ default: {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Client is not valid");
return TTS_ERROR_INVALID_PARAMETER;
}
+ }
unsigned int num_of_client = tts_client_get_size();
SLOG(LOG_ERROR, TAG_TTSC, "[INFO] num_of_client(%u)", num_of_client);
RETVM_IF(NULL == text || NULL == utt_id, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Parameter is invalid.");
RETVM_IF(false == tts_client_is_valid_client(client), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Client is invalid.");
- bool is_launched = __is_engine_launched(tts_client_get_mode(client));
+ bool is_launched = __is_engine_launched();
SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
tts_client_set_repeat_text(client, text);
{
RETVM_IF(false == tts_client_is_valid_client(client), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Client is invalid.");
- bool is_launched = __is_engine_launched(tts_client_get_mode(client));
+ bool is_launched = __is_engine_launched();
SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
return __request_play(client);
{
RETVM_IF(false == tts_client_is_valid_client(client), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Client is invalid.");
- bool is_launched = __is_engine_launched(tts_client_get_mode(client));
+ bool is_launched = __is_engine_launched();
SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts engine is launched(%d)", is_launched);
unsigned int uid = tts_client_get_uid(client);
}
}
- if (-1 != bg_volume_ratio) {
+ if (0.0 <= bg_volume_ratio) {
config_info.bg_volume_ratio = bg_volume_ratio;
SECURE_SLOG(LOG_DEBUG, TAG_TTSCONFIG, "background volume ratio change(%lf)", config_info.bg_volume_ratio);
static void __save_configuration(xmlDocPtr config_doc)
{
- if (0 != access(TTS_CONFIG, F_OK)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to access to %s", TTS_CONFIG);
- return;
- }
-
int ret = xmlSaveFile(TTS_CONFIG, config_doc);
if (0 > ret) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Save result : %d", ret);
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Save result : file(%s), ret(%d)", TTS_CONFIG, ret);
} else {
static FILE* pFile;
pFile = fopen(TTS_CONFIG, "r");
char* engine_id = vconf_get_str(TTS_ENGINE_DB_DEFAULT);
if (engine_id) {
- __set_value_into_configuration(TTS_TAG_CONFIG_ENGINE_ID, engine_id);
+ int ret = __set_value_into_configuration(TTS_TAG_CONFIG_ENGINE_ID, engine_id);
+ SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] Set engine ID into xml. engine_id(%s), ret(%d/%s)", engine_id, ret, get_error_message(ret));
free(engine_id);
}
__save_configuration(g_config_doc);
void BackgroundVolume::setVolumeRatio(double ratio)
{
- if (__volumeRatio.load() == ratio) {
- SLOG(LOG_INFO, tts_tag(), "[BackgroundVolume] Volume is not changed (%lf).", ratio);
- return;
- }
-
+ SLOG(LOG_INFO, tts_tag(), "[BackgroundVolume] Volume is changed from (%lf) to (%lf).", __volumeRatio.load(), ratio);
__volumeRatio = ratio;
ecore_main_loop_thread_safe_call_async(modifyVolumeOnMainThread, static_cast<void*>(this));
}