X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=server%2Fttsd_engine_agent.c;h=83abe14f2caeedac977adc5fa1396d469b6a843a;hb=616ead4395c7cd83a0d9e232aa5e880570647484;hp=221582bc846e1ba2776b4addecb0c7fdacc674f5;hpb=13ffac57fa76b431f66c1cc64a9c48577cc609bc;p=platform%2Fcore%2Fuifw%2Ftts.git diff --git a/server/ttsd_engine_agent.c b/server/ttsd_engine_agent.c index 221582b..83abe14 100644 --- a/server/ttsd_engine_agent.c +++ b/server/ttsd_engine_agent.c @@ -73,7 +73,7 @@ static void __free_voice_list(GList* voice_list); static int ttsd_print_voicelist(); /** Get engine info */ -int __internal_get_engine_info(ttse_request_callback_s* callback); +static int __internal_get_engine_info(ttse_request_callback_s* callback); static const char* __ttsd_get_engine_error_code(ttse_error_e err) { @@ -259,7 +259,7 @@ static int __update_voice_list() int ttsd_engine_agent_load_current_engine(ttse_request_callback_s* callback) { - SLOG(LOG_DEBUG, tts_tag(), "[Engine Agent DEBUG] === ttsd_engine_agent_load_current_engine START"); + SLOG(LOG_DEBUG, tts_tag(), "[Engine Agent DEBUG] load current engine START"); if (false == g_agent_init) { @@ -833,7 +833,7 @@ int ttsd_engine_load_voice(const char* lang, const int vctype) return TTSD_ERROR_OPERATION_FAILED; } - /* 2. increse ref count */ + /* 2. increase ref count */ data->client_ref_count++; /* 3. if ref count change 0 to 1 and not default, load voice */ @@ -907,7 +907,7 @@ int ttsd_engine_unload_voice(const char* lang, const int vctype) return TTSD_ERROR_OPERATION_FAILED; } - /* 2. Decrese ref count */ + /* 2. Decrease ref count */ data->client_ref_count--; /* 3. if ref count change 0 and not default, load voice */ @@ -1166,6 +1166,42 @@ int ttsd_engine_get_private_data(const char* key, char** data) return ret; } +int ttsd_engine_check_app_agreed(const char* appid, bool* is_agreed) +{ + if (false == g_agent_init) { + SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not Initialized"); + return TTSD_ERROR_OPERATION_FAILED; + } + + if (false == g_engine_info->is_loaded) { + SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] No loaded engine"); + return TTSD_ERROR_ENGINE_NOT_FOUND; + } + + if (NULL == appid || NULL == is_agreed) { + SLOG(LOG_WARN, tts_tag(), "[Engine Agent WARNING] Invalid parameter, appid is NULL"); + return TTSD_ERROR_NONE; + } + + + if (NULL == g_engine_info->callbacks->check_app_agreed) { + SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not supported feature"); + return TTSD_ERROR_NOT_SUPPORTED_FEATURE; + } + + int ret = 0; + bool tmp = true; // default value is true until now + ret = g_engine_info->callbacks->check_app_agreed(appid, &tmp); + if (0 != ret) { + SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Fail to check app agreed(%d)", ret); + return TTSD_ERROR_OPERATION_FAILED; + } + + *is_agreed = tmp; + + return ret; +} + void __free_voice_list(GList* voice_list) { GList *iter = NULL; @@ -1206,7 +1242,7 @@ int ttsd_print_voicelist() GSList *iter = NULL; ttsvoice_s* data = NULL; - SLOG(LOG_DEBUG, tts_tag(), "=== Voice list ==="); + SLOG(LOG_DEBUG, tts_tag(), "@@@ Voice list @@@"); if (g_slist_length(g_cur_voices) > 0) { /* Get a first item */ @@ -1231,14 +1267,14 @@ int ttsd_print_voicelist() } } - SLOG(LOG_DEBUG, tts_tag(), "=================="); + SLOG(LOG_DEBUG, tts_tag(), "@@@@@"); return 0; } -int __internal_get_engine_info(ttse_request_callback_s* callback) +static int __internal_get_engine_info(ttse_request_callback_s* callback) { - SLOG(LOG_DEBUG, tts_tag(), "[Engine Agent DEBUG] === inside __internal_get_engine_info"); + SLOG(LOG_DEBUG, tts_tag(), "[Engine Agent DEBUG] internal get engine info"); if (NULL == callback) { SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Invalid engine");