[TBT][tizen_3.0_mobile][stt module updated: added text recgnition timestamp details] 16/86716/1
authornazib.ullah <nazib.ullah@samsung.com>
Fri, 2 Sep 2016 11:45:48 +0000 (17:45 +0600)
committernazib.ullah <nazib.ullah@samsung.com>
Fri, 2 Sep 2016 11:46:46 +0000 (17:46 +0600)
Change-Id: I2498225ae56e8fa6fb28e9ca97df20b4e509f685

release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
tbtcoreapp/res/edje/3.0/mobile/stt_viewer.edc
tbtcoreapp/src/view/tbt-stt-view.c

index 33ebcb064a91764ea7e71fe7d9b067688fa30ac6..a17a7b7d2399d7642d5fb58d4934e65d0de1c0be 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index 610cb577afa9073a26d0b5993e44378b86f3a5ca..22111843b35c1c571cf361cbae46318519a81874 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ
index 07f7e2e841d2c3b256ce4cdf305a27df53b01c89..146f45cc000850d424d4bd02b309f7d37dce5969 100644 (file)
@@ -53,6 +53,23 @@ collections
             }
          }
          
+         part{
+            name: "list_part";
+            type: SWALLOW;
+            description{
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               visible: 1;
+               rel1 {
+                  relative: 0.0 2*TEXT_HEIGHT;
+               }
+               rel2 {
+                  relative: 1.0 0.9;
+               }
+            }
+         }
+         
+         
          part{
             name: "btn_part";
             type: SWALLOW;
index ca72534d4fd4ef1654c873d5c3ddef66ff5b107a..4421f1a86c65b90be77bfd82c1f031662e5f5749 100644 (file)
@@ -42,6 +42,7 @@ struct _stt_view
     Evas_Object *input_text;
     Evas_Object *recognized_text;
     Evas_Object *btn_stt;
+    Evas_Object *list;
 
     stt_h stt_handle;
     bool is_recognition_completed;
@@ -56,6 +57,7 @@ static void _btn_stt_pressed_cb(void *data, Evas_Object *obj, void *event_info);
 static char* get_stt_state_str(stt_state_e state);
 static void _stt_state_changed_cb(stt_h stt, stt_state_e previous, stt_state_e current, void* user_data);
 static void _stt_recognition_result_cb(stt_h stt, stt_result_event_e event, const char** data, int data_count, const char* msg, void *user_data);
+static bool _stt_result_time_cb(stt_h stt, int index, stt_result_time_event_e event, const char* text, long start_time, long end_time, void* user_data);
 static bool _stt_supported_language_cb(stt_h stt, const char* language, void* user_data);
 static void _stt_error_cb(stt_h stt, stt_error_e reason, void *user_data);
 
@@ -96,6 +98,12 @@ stt_view *stt_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i
        {
                ui_utils_label_set_text(this->input_text, "Make sure Internet is connected", "left");
                ui_utils_label_set_text(this->recognized_text, "", "left");
+
+               this->list = elm_list_add(this->view->layout);
+               RETVM_IF(!this->list, NULL, "elm_list_add failed");
+               evas_object_data_set(this->list, "view_data", this);
+               elm_object_part_content_set(this->view->layout, "list_part", this->list);
+
        }
        else if(this->view->tbt_info->apptype == TBT_APP_STT_ERROR)
        {
@@ -209,6 +217,22 @@ static bool _stt_supported_language_cb(stt_h stt, const char* language, void* us
        DBG("language %s", language);
        return true;
 }
+
+static bool _stt_result_time_cb(stt_h stt, int index, stt_result_time_event_e event, const char* text, long start_time, long end_time, void* user_data)
+{
+       DBG("_stt_result_time_cb");
+       stt_view *this = NULL;
+       this = (stt_view*)user_data;
+       RETVM_IF(NULL == this,false, "view is NULL");
+
+       DBG("Text: %s, start_time: %ld end_time: %ld", text, start_time, end_time);
+       char *str = format_string("%s => start:%ld end:%ld", text, start_time, end_time);
+       elm_list_item_append(this->list, str, NULL, NULL, NULL, NULL);
+       SAFE_DELETE(str);
+
+       return true;
+}
+
 static void _stt_recognition_result_cb(stt_h stt, stt_result_event_e event, const char** data, int data_count, const char* msg, void *user_data)
 {
        DBG("_stt_recognition_result_cb");
@@ -222,6 +246,9 @@ static void _stt_recognition_result_cb(stt_h stt, stt_result_event_e event, cons
                this->is_recognition_completed = true;
        }
 
+       int ret = stt_foreach_detailed_result(stt, _stt_result_time_cb, this);
+       DBG("stt_foreach_detailed_result fail > Error = %s", get_stt_error(ret));
+
        for(int i=0; i<data_count; i++)
        {
                DBG("DATA: %s", data[i]);
@@ -231,6 +258,8 @@ static void _stt_recognition_result_cb(stt_h stt, stt_result_event_e event, cons
                SAFE_DELETE(str);
        }
 
+       elm_list_go(this->list);
+       evas_object_show(this->list);
 
 }