From: ulgal-park Date: Thu, 6 Oct 2022 07:17:21 +0000 (+0900) Subject: Add operation command X-Git-Tag: accepted/tizen/unified/20221121.163723~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5da3bffd0ebf6fc9ff088378f3adcbefa1cb4db4;p=platform%2Fcore%2Fuifw%2Fmmi-manager.git Add operation command Change-Id: If65ca0661dec6dd4757f94adf2b862143863a3ad --- diff --git a/src/mmimgr/iu/VoiceTouchEngine.cpp b/src/mmimgr/iu/VoiceTouchEngine.cpp index 4aef063..5405512 100644 --- a/src/mmimgr/iu/VoiceTouchEngine.cpp +++ b/src/mmimgr/iu/VoiceTouchEngine.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "mmi_iu_log.h" #include "StringUtil.h" @@ -37,6 +38,18 @@ static const vector __SHOW_LABEL_KOKR = {"힌트 메세지 보여줘", " static const vector __SHOW_GRID_KOKR = {"그리드", "그리드 모드", "그리드로 보여줘", "그리드 보여줘"}; static const vector __REFRESH_WINDOW_INFO = {"화면 갱신해줘", "화면 업데이트", "리프레시", "새로고침", "새로 고침"}; static const vector __TURN_OF_REQUEST = {"동작 그만", "이제 그만"}; +static const map __OPERATION_REQUEST = { + {"뒤로", MMI_VOICE_TOUCH_OPERATION_PRESS_BACK}, + {"위", MMI_VOICE_TOUCH_OPERATION_PRESS_UP}, {"위로", MMI_VOICE_TOUCH_OPERATION_PRESS_UP}, + {"아래", MMI_VOICE_TOUCH_OPERATION_PRESS_DOWN}, {"아래로", MMI_VOICE_TOUCH_OPERATION_PRESS_DOWN}, + {"왼쪽", MMI_VOICE_TOUCH_OPERATION_PRESS_LEFT}, {"왼쪽으로", MMI_VOICE_TOUCH_OPERATION_PRESS_LEFT}, + {"오른쪽", MMI_VOICE_TOUCH_OPERATION_PRESS_RIGHT}, {"오른쪽으로", MMI_VOICE_TOUCH_OPERATION_PRESS_RIGHT}, + {"선택", MMI_VOICE_TOUCH_OPERATION_PRESS_RETURN}, {"선택해줘", MMI_VOICE_TOUCH_OPERATION_PRESS_RETURN}, {"클릭", MMI_VOICE_TOUCH_OPERATION_PRESS_RETURN}, + {"트레이 열어", MMI_VOICE_TOUCH_OPERATION_TRAY_ON}, {"트레이 올려", MMI_VOICE_TOUCH_OPERATION_TRAY_ON}, + {"트레이 닫아", MMI_VOICE_TOUCH_OPERATION_TRAY_OFF}, {"트레이 내려", MMI_VOICE_TOUCH_OPERATION_TRAY_OFF}, + {"패널 열어", MMI_VOICE_TOUCH_OPERATION_PANEL_ON}, {"패널 내려", MMI_VOICE_TOUCH_OPERATION_PANEL_ON}, + {"패널 닫아", MMI_VOICE_TOUCH_OPERATION_PANEL_OFF}, {"패널 올려", MMI_VOICE_TOUCH_OPERATION_PANEL_OFF}, + }; static const int __DEFAULT_DISPLAY_WIDTH = 1920; static const int __DEFAULT_DISPLAY_HEIGHT = 1080; @@ -79,6 +92,7 @@ void VoiceTouchEngine::InitializeMembers() __touchModality.object_id = nullptr; __touchModality.coord_x = 0; __touchModality.coord_y = 0; + __touchModality.operation = -1; __currentMode = VOICE_TOUCH_MODE_TOOLTIP_TEXT; @@ -222,6 +236,14 @@ bool VoiceTouchEngine::handleVoiceInput(mmi_provider_event_voice *voiceEvent) return true; } + auto operationIterator = __OPERATION_REQUEST.find(asrResult); + if (operationIterator != __OPERATION_REQUEST.end()) { + int operation = operationIterator->second; + makeOperation(timestamp, operation); + invokeOutputModalityCallback(&__touchModality); + return true; + } + voice_touch_mode_e mode = getVoiceTouchMode(asrResult); if (mode == VOICE_TOUCH_MODE_INVALID) { _I("[VoiceTouchEngine] This is not mode command. Try to find proper command"); @@ -451,6 +473,12 @@ void VoiceTouchEngine::makeTouchModality(const ClickableItem &item, int timestam setTouchModality(item, timestamp); } +void VoiceTouchEngine::makeOperation(int timestamp, int operation) +{ + _I("[VoiceTouchEngine] Make operation. timestamp(%d). operation(%d)", timestamp, operation); + setOperationModality(timestamp, operation); +} + void VoiceTouchEngine::setRejectedEventResult(int timestamp, JsonProvider &provider) { _I("[VoiceTouchEngine] Set command rejected event into output. timestamp(%d)", timestamp); @@ -550,6 +578,17 @@ void VoiceTouchEngine::setTouchModality(const ClickableItem &item, int timestamp __touchModality.object_id = item.objectId.c_str(); __touchModality.coord_x = item.coordX + (item.width / 2); __touchModality.coord_y = item.coordY + (item.height / 2); + __touchModality.operation = -1; +} + +void VoiceTouchEngine::setOperationModality(int timestamp, int operation) +{ + __touchModality.timestamp = timestamp; + __touchModality.mode = MMI_VOICE_TOUCH_MODE_OPERATION; + __touchModality.object_id = nullptr; + __touchModality.coord_x = 0; + __touchModality.coord_y = 0; + __touchModality.operation = operation; } bool VoiceTouchEngine::handleScreenAnalyzerInput(mmi_provider_event_screen_analyzer *screenAnalyzerEvent) diff --git a/src/mmimgr/iu/VoiceTouchEngine.h b/src/mmimgr/iu/VoiceTouchEngine.h index d235e9b..298a929 100644 --- a/src/mmimgr/iu/VoiceTouchEngine.h +++ b/src/mmimgr/iu/VoiceTouchEngine.h @@ -97,6 +97,9 @@ private: void makeTouchModality(const ClickableItem &item, int timestamp); void setTouchModality(const ClickableItem &item, int timestamp); + void makeOperation(int timestamp, int operation); + void setOperationModality(int timestamp, int operation); + void resetCurrentGridInfo(); void updateCurrentGridInfo(const ClickableItem &item);