Fix issue that Speak now icon display and work wrong after tap to pause and tap to... 50/99450/2
authorsungwook79.park <sungwook79.park@samsung.com>
Wed, 23 Nov 2016 02:07:31 +0000 (11:07 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Wed, 23 Nov 2016 02:30:04 +0000 (11:30 +0900)
Change-Id: I213989bf5bbc86102483c8317c98d55026383ee9
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/ise-stt-mode.cpp

index c0a81dc..b7cd20e 100644 (file)
@@ -113,21 +113,6 @@ static Eina_Bool _recognition_failure_cb(void *data)
     return ECORE_CALLBACK_CANCEL;
 }
 
-static Eina_Bool hide_guide_text(void *data)
-{
-    VoiceData *voicedata = (VoiceData *) data;
-    if (!voicedata) return ECORE_CALLBACK_CANCEL;
-
-    voicedata->guide_text_timer = NULL;
-    elm_object_part_text_set(voicedata->layout_main, "elm.text", "");
-
-    if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING ||
-        voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING)
-        set_guide_text(voicedata, SK_TAP_TO_PAUSE, true);
-
-    return ECORE_CALLBACK_CANCEL;
-}
-
 static void set_guide_text(VoiceData *vd, const char* text, bool translatable)
 {
 #ifdef _WEARABLE
@@ -140,11 +125,6 @@ static void set_guide_text(VoiceData *vd, const char* text, bool translatable)
         elm_object_domain_translatable_part_text_set(vd->layout_main, "elm.text", PACKAGE, text);
     else
         elm_object_part_text_set(vd->layout_main, "elm.text", text);
-
-    if (!strcmp(text, SK_SPEAK_NOW)) {
-        if (vd->guide_text_timer == NULL)
-            vd->guide_text_timer = ecore_timer_add(2.0, hide_guide_text, vd);
-    }
 }
 
 void start_by_press(VoiceData *voicedata)
@@ -190,6 +170,10 @@ static void on_mic_button_press_cb(void *data, Evas_Object *obj, void *event_inf
         }
         set_guide_text(voicedata, SK_SPEAK_NOW, true);
     } else {
+        if (NULL != voicedata->guide_text_timer) {
+            ecore_timer_del(voicedata->guide_text_timer);
+            voicedata->guide_text_timer = NULL;
+        }
         edje_object_signal_emit(_EDJ(voicedata->layout_main), "mouse,clicked,1", "background");
     }
 }
@@ -308,7 +292,7 @@ void set_animation_state(VoiceData *voicedata)
 #endif
 
         if (voicedata->effector)
-            voicedata->effector->Start();
+            voicedata->effector->Stop(true);
 
         set_guide_text(voicedata, "");
 
@@ -316,7 +300,7 @@ void set_animation_state(VoiceData *voicedata)
         set_guide_text(voicedata, SK_SPEAK_NOW, true);
 
         if (voicedata->effector)
-            voicedata->effector->Stop(true);
+            voicedata->effector->Start();
 
     } else if (voicedata->state == STT_STATE_VAL_PROCESSING) {
         set_guide_text(voicedata, "");
@@ -334,7 +318,7 @@ void set_animation_state(VoiceData *voicedata)
         }
 
         if (voicedata->effector)
-            voicedata->effector->Start();
+            voicedata->effector->Stop(true);
 
         voicedata->refresh_timer = ecore_timer_add(2.0, _recognition_failure_cb, voicedata);
     }