return TTS_ERROR_OPERATION_FAILED;
}
+ // TODO: If use cpp, remove dupliceated code using command class pattern
int uid = tts_client_get_uid(client);
int ret = -1;
- int count = 0;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_add_text(uid, text, convert_language, voice_type, speed, new_utt_id, client->credential);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
{
int uid = tts_client_get_uid(client);
int ret = -1;
- int count = 0;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_play(uid, client->credential);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
return tts_core_set_current_state(client, TTS_STATE_PLAYING);
}
-/* Public functions */
int tts_core_initialize()
{
ecore_main_loop_thread_safe_call_async(__pkgmgr_thread, NULL);
SLOG(LOG_INFO, TAG_TTSC, "[INFO] screen_reader(%s), mode(%d)", (true == g_is_screen_reader_on) ? "True" : "False", mode);
int ret = -1;
- int count = 0;
if (false == g_is_screen_reader_on && TTS_MODE_SCREEN_READER == mode) {
SLOG(LOG_WARN, TAG_TTSC, "[WARNING] Do not request finalize : is_screen_reader(%d) mode(%d)", g_is_screen_reader_on, mode);
}
} else {
bool is_prepared = false;
-
- while(TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_finalize(uid);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE == ret) {
}
int uid = tts_client_get_uid(client);
- int ret = 0;
- int count = 0;
+ int ret = -1;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_pause(uid);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
}
int uid = tts_client_get_uid(client);
- int ret = 0;
- int count = 0;
+ int ret = -1;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_add_pcm(uid, event, data, data_size, audio_type, rate);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
}
int uid = tts_client_get_uid(client);
- int ret = 0;
- int count = 0;
+ int ret = -1;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_play_pcm(uid);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
}
int uid = tts_client_get_uid(client);
- int ret = 0;
- int count = 0;
+ int ret = -1;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_stop_pcm(uid);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
int uid = tts_client_get_uid(client);
int ret = -1;
- int count = 0;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_set_private_data(uid, key, data);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {
int uid = tts_client_get_uid(client);
int ret = -1;
- int count = 0;
bool is_prepared = false;
- while (TTS_RETRY_COUNT > count) {
+ for (int count = 0; count < TTS_RETRY_COUNT; count++) {
ret = tts_ipc_request_get_private_data(uid, key, data);
if (false == __handle_dbus_request_result(client, ret, &is_prepared)) {
break;
}
-
- count++;
}
if (TTS_ERROR_NONE != ret) {