SET(INCLUDEDIR "${PREFIX}/include")
SET(VERSION 0.2.44)
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+
ADD_DEFINITIONS("-DTTS_LIBDIR=\"${LIBDIR}\"")
ADD_DEFINITIONS("-Werror")
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
aul capi-media-audio-io capi-system-info dbus-1 dlog ecore
- glib-2.0 libtzplatform-config libxml-2.0 vconf bundle
+ glib-2.0 libtzplatform-config libxml-2.0 vconf bundle buxton2
)
pkg_check_modules(pkgs_test REQUIRED
INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsnotiserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttssrserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
+## voice_getengine ##
+IF("${ARCH}" MATCHES "^arm.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/armv7l/voice_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^i586.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/voice_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^i686.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/voice_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^aarch64.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/aarch64/voice_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^x86_64.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/x86_64/voice_getengine DESTINATION ${TZ_SYS_BIN})
+ENDIF()
+
+
## Sample application ##
ADD_SUBDIRECTORY(test)
#include <unistd.h>
#include <sys/inotify.h>
#include <vconf.h>
+#include <buxton2.h>
#include "tts_config_mgr.h"
#include "tts_config_parser.h"
return TTS_CONFIG_ERROR_OPERATION_FAILED;
}
+int __tts_set_buxtonkey(const char* engine)
+{
+ /* Set vconfkey */
+ struct buxton_client * bux_cli;
+ struct buxton_layer * bux_layer;
+ struct buxton_value * bux_val;
+
+ int ret = buxton_open(&bux_cli, NULL, NULL);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, tta_tag(), "[DBUS-BUXTON2] buxton_open failed!! (%d)", ret);
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
+ bux_layer = buxton_create_layer("user");
+ if (NULL == bux_layer) {
+ SLOG(LOG_ERROR, tts_tag(), "[DBUS-BUXTON2] buxton_create_layer FAIL");
+ buxton_close(bux_cli);
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ }
+ bux_val = buxton_value_create_string(engine);
+ if (NULL == bux_val) {
+ SLOG(LOG_ERROR, tts_tag(), "[DBUS-BUXTON2] buxton_value_create_string FAIL");
+ buxton_free_layer(bux_layer);
+ buxton_close(bux_cli);
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, tts_tag(), "[DBUS-BUXTON2] layer: %s", buxton_layer_get_name(bux_layer));
+ }
+
+ ret = buxton_set_value_sync(bux_cli, bux_layer, TTS_ENGINE_DB_DEFAULT, bux_val);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, tta_tag(), "[DBUS-BUXTON2] buxton_set_value_sync failed!! (%d)", ret);
+ buxton_value_free(bux_val);
+ buxton_free_layer(bux_layer);
+ buxton_close(bux_cli);
+
+ bux_cli = NULL;
+ bux_layer = NULL;
+ bux_val = NULL;
+
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, tts_tag(), "[DBUS-BUXTON2] buxton_set_value_sync: %d, %s", ret, TTS_ENGINE_DB_DEFAULT);
+ }
+
+ buxton_value_free(bux_val);
+ buxton_free_layer(bux_layer);
+ buxton_close(bux_cli);
+
+ bux_cli = NULL;
+ bux_layer = NULL;
+ bux_val = NULL;
+
+ return TTS_CONFIG_ERROR_NONE;
+}
+
int tts_config_mgr_set_engine(const char* engine)
{
if (0 >= g_slist_length(g_config_client_list)) {
SLOG(LOG_DEBUG, tts_tag(), "New engine id : %s", engine);
+ int ret = __tts_set_buxtonkey(engine);
+ if (0 != ret) {
+ SLOG(LOG_DEBUG, tts_tag(), "[DEBUG] set_buxtonkey Fail!!");
+ return ret;
+ }
+
GSList *iter = NULL;
tts_engine_info_s *engine_info = NULL;
bool is_valid_engine = false;
#define TTS_LANGSET_KEY VCONFKEY_LANGSET
+#define TTS_ENGINE_DB_DEFAULT "db/voice/tts/engine/default"
#ifdef __cplusplus
}
[D-BUS Service]
Name=org.tizen.voice.ttsnotiserver
-#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-noti"
-Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
+Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-noti mode noti"
+#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
[D-BUS Service]
Name=org.tizen.voice.ttsserver
-#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}"
-Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default"
+Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}"
+#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default"
[D-BUS Service]
Name=org.tizen.voice.ttssrserver
-#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-sr"
-Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr"
+Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-sr mode sr"
+#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr"
Source1001: %{name}.manifest
Source1002: %{name}-devel.manifest
Requires(post): /sbin/ldconfig
+Requires(post): /usr/bin/buxton2ctl
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(buxton2)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(capi-media-audio-io)
BuildRequires: pkgconfig(capi-system-info)
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \
-DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN
make %{?jobs:-j%jobs}
mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
+# buxton2ctl create-string #
+buxton2ctl create-string "user" "db/voice/tts/engine/default" "org.tizen.tts-engine-default" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/platform"
+
%postun -p /sbin/ldconfig
%files
%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttssrserver.service
%{TZ_SYS_RO_SHARE}/voice/test/tts-test
%{TZ_SYS_RO_SHARE}/license/%{name}
+%{_bindir}/voice_getengine
%{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libtts-engine-parser.so*
#%{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libtts-engine-language-pack-parser.so*
/etc/dbus-1/system.d/tts-server.conf