#include <stdlib.h>
#include <stdbool.h>
#include <Elementary.h>
+#include <vconf.h>
+#include <voice_control_elm.h>
+#include <voice_control_elm_private.h>
#include "appcore_efl_base_private.h"
#include "appcore_efl_base.h"
+static bool vc_elm_initialized;
+
+static void __vc_vtauto_changed_cb(keynode_t *key, void *data)
+{
+ const char *name;
+ int vt_automode;
+
+ name = vconf_keynode_get_name(key);
+ if (!name || strcmp(name, VCONFKEY_VC_VOICE_TOUCH_AUTOMODE) != 0)
+ return;
+
+ vt_automode = vconf_keynode_get_bool(key);
+ if (vt_automode) {
+ if (!vc_elm_initialized) {
+ vc_elm_initialize();
+ vc_elm_initialized = true;
+ }
+ vc_elm_set_auto_register_mode(2, 0);
+ } else {
+ vc_elm_deinitialize();
+ vc_elm_initialized = false;
+ }
+}
+
static int __efl_app_init(int argc, char **argv, void *data)
{
int hint;
const char *hwacc;
+ int vt_automode = 0;
elm_init(argc, argv);
}
}
+ /* VC voice touch setting */
+ vconf_notify_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE,
+ __vc_vtauto_changed_cb, NULL);
+ vconf_get_bool(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &vt_automode);
+ if (vt_automode) {
+ if (!vc_elm_initialized) {
+ vc_elm_initialize();
+ vc_elm_initialized = true;
+ }
+ vc_elm_set_auto_register_mode(2, 0);
+ }
+
return 0;
}
static void __efl_app_finish(void)
{
+ vconf_ignore_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE,
+ __vc_vtauto_changed_cb);
+ if (vc_elm_initialized) {
+ vc_elm_deinitialize();
+ vc_elm_initialized = false;
+ }
+
elm_shutdown();
/* Check loader case */