return EINA_FALSE;
}
-static Eina_Bool __notify_state_timer_cb(void *data)
-{
- unsigned int uid = (uintptr_t)data;
- tts_client_s* client = tts_client_get_by_uid(uid);
- if (NULL == client) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] UID is not valid. (%u)", uid);
- } else {
- __client_state_changed_cb(client, client->before_state, client->current_state);
- client->notify_state_timer = NULL;
- }
-
- return EINA_FALSE;
-}
-
static bool __is_engine_installed(const char* appid)
{
app_info_h app_info = NULL;
return TTS_ERROR_NONE;
}
-int tts_core_notify_state_changed_async(tts_client_s* client, tts_state_e current_state)
-{
- if (false == tts_client_is_valid_client(client)) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Handle is not valid.");
- return TTS_ERROR_INVALID_PARAMETER;
- }
-
- tts_state_e before_state = tts_client_get_current_state(client);
- if (before_state == current_state) {
- SLOG(LOG_INFO, TAG_TTSC, "[INFO] State is not changed. before(%s), current(%s)", __convert_state(before_state), __convert_state(current_state));
- return TTS_ERROR_NONE;
- }
-
- SLOG(LOG_DEBUG, TAG_TTSC, "Notify state changed asynchronously");
- tts_client_set_current_state(client, current_state);
- if (NULL != client->notify_state_timer) {
- ecore_timer_del(client->notify_state_timer);
- }
-
- uintptr_t uid = tts_client_get_uid(client);
- client->notify_state_timer = ecore_timer_add(0, __notify_state_timer_cb, (void*)uid);
-
- return TTS_ERROR_NONE;
-}
-
int tts_core_notify_utt_started(tts_client_s* client, int utt_id)
{
if (false == tts_client_is_valid_client(client)) {
tts_ipc_request_set_mode(uid, tts_client_get_mode(client));
- tts_core_notify_state_changed_async(client, TTS_STATE_READY);
+ tts_core_notify_state_changed(client, TTS_STATE_READY);
SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
return TTS_ERROR_NONE;
// common function
int tts_core_notify_state_changed(tts_client_s* client, tts_state_e current_state);
-int tts_core_notify_state_changed_async(tts_client_s* client, tts_state_e current_state);
int tts_core_notify_utt_started(tts_client_s* client, int utt_id);
int tts_core_notify_utt_completeted(tts_client_s* client, int utt_id);
int tts_core_notify_error_async(tts_client_s* client, tts_error_e reason, int utt_id, const char* err_msg);
dbus_error_free(&err);
}
- if (0 == tts_core_notify_state_changed_async(tts_client_get_by_uid(uid), (tts_state_e)state)) {
+ if (0 == tts_core_notify_state_changed(tts_client_get_by_uid(uid), (tts_state_e)state)) {
SLOG(LOG_DEBUG, TAG_TTSC, "<<<< tts state changed : uid(%u) state(%d)", uid, state);
}
} /* TTSD_SIGNAL_SET_STATE */
} else if (0 == strncmp(TTSD_METHOD_SET_STATE, method, strlen(TTSD_METHOD_SET_STATE))) {
bundle_get_str(msg, TTS_BUNDLE_MESSAGE, &val);
if (val) {
- tts_core_notify_state_changed_async(client, (tts_state_e)atoi(val));
+ tts_core_notify_state_changed(client, (tts_state_e)atoi(val));
}
} else if (0 == strncmp(TTSD_METHOD_ERROR, method, strlen(TTSD_METHOD_ERROR))) {
char *uttid = NULL;