* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_NOT_SUPPORTED TTS NOT supported
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* @pre The ttse_main() function should be invoked before this function is called.
* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_NOT_SUPPORTED TTS NOT supported
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* @pre The ttse_main() function should be invoked before this function is called.
#include <Ecore.h>
#include <vconf.h>
#include <app_manager.h>
+#include <system_info.h>
#include "ttse.h"
+static int g_feature_enabled = -1;
static bool g_is_terminated = false;
+
const char* tts_tag()
{
return "ttsd";
}
+static bool __is_feature_enabled()
+{
+ if (1 == g_feature_enabled) {
+ return true;
+ }
+
+ if (0 == g_feature_enabled) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS feature NOT supported");
+ return false;
+ }
+
+ bool tts_supported = false;
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(TTS_FEATURE_PATH, &tts_supported)) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to get feature value");
+ return false;
+ }
+
+ if (false == tts_supported) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS feature NOT supported");
+ g_feature_enabled = 0;
+ return false;
+ }
+
+ g_feature_enabled = 1;
+ return true;
+}
+
static bool __is_default_engine()
{
char* engine = NULL;
int ttse_get_activated_mode(int* activated_mode)
{
+ if (false == __is_feature_enabled()) {
+ return TTSE_ERROR_NOT_SUPPORTED;
+ }
+
if (NULL == activated_mode) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Invalid parameter");
return TTSE_ERROR_INVALID_PARAMETER;
int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback)
{
+ if (false == __is_feature_enabled()) {
+ return TTSE_ERROR_NOT_SUPPORTED;
+ }
+
if (NULL == callback) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Invalid parameter");
return TTSE_ERROR_INVALID_PARAMETER;