2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "w-input-selector.h"
21 #include "w-input-stt-ise.h"
22 #include "w-input-stt-voice.h"
23 #include "w-input-stt-engine.h"
26 VoiceData *my_voicedata = NULL;
36 void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(char *, int))
38 PRINTFUNC(DLOG_ERROR, "show voice");
43 //stt_feedback_initialize();
46 my_voicedata = (VoiceData*)malloc(sizeof(VoiceData));
47 if (my_voicedata == NULL) {
48 PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__);
51 memset(my_voicedata, 0, sizeof(VoiceData));
55 init = init_voice(parent, lang, my_voicedata);
57 if (my_voicedata->naviframe) {
58 show_voice_window(my_voicedata->naviframe, my_voicedata);
62 PRINTFUNC(DLOG_ERROR, "%d::::Fail to create Voice window!", __LINE__);
67 vconf_notify_key_changed(VCONFKEY_ISE_STT_LANGUAGE, _stt_lang_changed_cb, my_voicedata);
71 PRINTFUNC(DLOG_DEBUG, "pause_voice");
75 on_stt_pause(my_voicedata);
81 PRINTFUNC(DLOG_DEBUG, "destroy voice");
83 //stt_feedback_deinitialize(); // It disable w-input-selector touch sound. So removed.
85 vconf_ignore_key_changed(VCONFKEY_ISE_STT_LANGUAGE, _stt_lang_changed_cb);
88 on_destroy(my_voicedata);
93 int is_lang_supported_by_voice_input(const char *lang)
95 PRINTFUNC(DLOG_DEBUG, "Is lang %s supported by voice input", lang);
101 strncpy(kbd_lang, lang, sizeof(kbd_lang));
104 return (is_lang_supported_by_stt(kbd_lang));
107 void ise_show_stt_popup(void *data)
109 App_Data* ad = (App_Data*)data;
114 show_voice_input((Evas_Object*)ad->naviframe, NULL, NULL);
117 void set_disclaimer_flag()
119 PRINTFUNC(DLOG_DEBUG, "set_disclaimer_flag");
122 my_voicedata->disclaimer = 1;