static int g_max_text_size = -1;
+static Ecore_Timer* g_check_state_timer = NULL;
+
+
/* for repetition */
static char* g_language = NULL;
return code;
}
+//LCOV_EXCL_START
void __tts_config_voice_changed_cb(const char* before_lang, int before_voice_type, const char* language, int voice_type, bool auto_voice, void* user_data)
{
SLOG(LOG_DEBUG, TAG_TTSC, "Voice changed : Before lang(%s) type(%d) , Current lang(%s), type(%d)",
}
return;
}
+//LCOV_EXCL_STOP
int tts_create(tts_h* tts)
{
do {
ret = tts_dbus_request_finalize(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] result : %s", __tts_get_error_code(ret));
break;
break;
}
}
+ //LCOV_EXCL_STOP
}
} while (0 != ret);
} else {
g_language = NULL;
}
+ /* Delete state timer before destroying handle */
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+
tts = NULL;
SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
return TTS_ERROR_NONE;
}
+//LCOV_EXCL_START
void __tts_screen_reader_changed_cb(bool value)
{
g_screen_reader = value;
}
+//LCOV_EXCL_STOP
int tts_set_mode(tts_h tts, tts_mode_e mode)
{
return TTS_ERROR_NONE;
}
+//LCOV_EXCL_START
int tts_set_server_tts(tts_h tts, const char* credential)
{
if (0 != __tts_get_feature_enabled()) {
return TTS_ERROR_NONE;
}
+// LCOV_EXCL_STOP
static Eina_Bool __tts_connect_daemon(void *data)
{
return TTS_ERROR_INVALID_STATE;
}
+ ecore_thread_main_loop_begin();
client->conn_timer = ecore_timer_add(0.02, __tts_connect_daemon, (void*)tts);
+ ecore_thread_main_loop_end();
SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
return TTS_ERROR_NONE;
}
+//LCOV_EXCL_START
int tts_prepare_sync(tts_h tts)
{
if (0 != __tts_get_feature_enabled()) {
return TTS_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int tts_unprepare(tts_h tts)
{
do {
ret = tts_dbus_request_finalize(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
break;
}
}
+ //LCOV_EXCL_STOP
}
} while (0 != ret);
} else {
while (0 != ret) {
ret = tts_dbus_request_add_text(client->uid, text, temp, voice_type, speed, client->current_utt_id, client->credential);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
break;
}
}
+ //LCOV_EXCL_STOP
} else {
*utt_id = client->current_utt_id;
}
return ret;
}
+//LCOV_EXCL_START
static void __tts_play_async(void *data)
{
tts_h tts = (tts_h)data;
return TTS_ERROR_NONE;
}
-
+//LCOV_EXCL_STOP
int tts_play(tts_h tts)
{
if (0 != __tts_get_feature_enabled()) {
while (0 != ret) {
ret = tts_dbus_request_play(client->uid, client->credential);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
return TTS_ERROR_NONE;
}
-
+//LCOV_EXCL_START
static void __tts_stop_async(void *data)
{
tts_h tts = (tts_h)data;
return TTS_ERROR_NONE;
}
-
+//LCOV_EXCL_STOP
int tts_stop(tts_h tts)
{
if (0 != __tts_get_feature_enabled()) {
while (0 != ret) {
ret = tts_dbus_request_stop(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
return TTS_ERROR_NONE;
}
-
+//LCOV_EXCL_START
static void __tts_pause_async(void *data)
{
tts_h tts = (tts_h)data;
return TTS_ERROR_NONE;
}
-
+//LCOV_EXCL_STOP
int tts_pause(tts_h tts)
{
if (0 != __tts_get_feature_enabled()) {
while (0 != ret) {
ret = tts_dbus_request_pause(client->uid);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
SLOG(LOG_INFO, TAG_TTSC, "@@@ Set private data, key(%s), data(%s)", key, data);
if (NULL == tts) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Input handle isnull");
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Input handle is null");
return TTS_ERROR_INVALID_PARAMETER;
}
while (0 != ret) {
ret = tts_dbus_request_set_private_data(client->uid, key, data);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
while (0 != ret) {
ret = tts_dbus_request_get_private_data(client->uid, key, data);
if (0 != ret) {
+ //LCOV_EXCL_START
if (TTS_ERROR_INVALID_PARAMETER == ret && false == is_prepared) {
client->current_state = TTS_STATE_CREATED;
if (0 == tts_prepare_sync(tts)) {
return ret;
}
}
+ //LCOV_EXCL_STOP
}
}
return 0;
}
+//LCOV_EXCL_START
static Eina_Bool __tts_notify_error(void *data)
{
tts_h tts = (tts_h)data;
}
if (NULL != client->state_changed_cb) {
- ecore_timer_add(0, __tts_notify_state_changed, client->tts);
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+ g_check_state_timer = ecore_timer_add(0, __tts_notify_state_changed, client->tts);
} else {
SLOG(LOG_WARN, TAG_TTSC, "[WARNING] State changed callback is null");
}
return 0;
}
+//LCOV_EXCL_STOP
int __tts_cb_utt_started(int uid, int utt_id)
{
client->state_changed_cb = NULL;
client->state_changed_user_data = NULL;
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+
SLOG(LOG_DEBUG, TAG_TTSC, "[SUCCESS] Unset state changed cb");
return 0;
return 0;
}
+//LCOV_EXCL_START
int tts_add_pcm(tts_h tts, int event, const void* data, unsigned int data_size, int audio_type, int rate)
{
if (0 != __tts_get_feature_enabled()) {
return TTS_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int tts_repeat(tts_h tts, char** text_repeat, int* utt_id)
{