From: Kamil Lipiszko Date: Fri, 27 Nov 2015 14:37:11 +0000 (+0100) Subject: haptic: Vibrate on highlighted object change. X-Git-Tag: accepted/tizen/tv/20160311.055419~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c666a4a0161ac6f319580d4f76c2cb24e07a2cc;p=profile%2Ftv%2Fapps%2Fnative%2Fscreen-reader.git haptic: Vibrate on highlighted object change. Change-Id: Ic2749bc8520ed85721190ec8a06b4964d5ba5e59 Signed-off-by: Kamil Lipiszko --- diff --git a/include/screen_reader_haptic.h b/include/screen_reader_haptic.h index d3f9beb..6bc6dcf 100644 --- a/include/screen_reader_haptic.h +++ b/include/screen_reader_haptic.h @@ -1,4 +1,4 @@ void haptic_module_init(void); void haptic_module_disconnect(void); -void haptic_vibrate_start(void); +void haptic_vibrate_start(int duration, int feedback); void haptic_vibrate_stop(void); diff --git a/org.tizen.screen-reader.xml b/org.tizen.screen-reader.xml index 99284a4..bc7e0a6 100755 --- a/org.tizen.screen-reader.xml +++ b/org.tizen.screen-reader.xml @@ -10,5 +10,8 @@ + + http://tizen.org/privilege/haptic + diff --git a/src/navigator.c b/src/navigator.c index b5b9e66..014260a 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -48,6 +48,9 @@ #define TTS_MAX_TEXT_SIZE 2000 #define GESTURE_LIMIT 10 +#define HAPTIC_VIBRATE_DURATION 50 +#define HAPTIC_VIBRATE_INTENSITY 50 + //Timeout in ms which will be used as interval for handling ongoing //hoved gesture updates. It is introduced to improve performance. //Even if user makes many mouse move events within hover gesture @@ -1634,6 +1637,9 @@ static void _new_highlighted_obj_changed(AtspiAccessible * new_highlighted_obj, if (context && flat_navi_context_current_get(context) != new_highlighted_obj) { flat_navi_context_current_set(context, g_object_ref(new_highlighted_obj)); } + + haptic_vibrate_start(HAPTIC_VIBRATE_DURATION, HAPTIC_VIBRATE_INTENSITY); + } void clear(gpointer d) diff --git a/src/screen_reader_haptic.c b/src/screen_reader_haptic.c index f099cb4..028ba0e 100644 --- a/src/screen_reader_haptic.c +++ b/src/screen_reader_haptic.c @@ -67,13 +67,13 @@ void haptic_module_disconnect(void) * @brief Start vibrations * */ -void haptic_vibrate_start(void) +void haptic_vibrate_start(int duration, int feedback) { if (!handle) { ERROR("Haptic handle lost"); return; } - if (!device_haptic_vibrate(handle, 1000, 100, &effect_handle)) { + if (!device_haptic_vibrate(handle, duration, feedback, &effect_handle)) { DEBUG(RED "Vibrations started!" RESET); } else { ERROR("Cannot start vibration"); diff --git a/src/smart_notification.c b/src/smart_notification.c index e519797..70b0a16 100644 --- a/src/smart_notification.c +++ b/src/smart_notification.c @@ -141,7 +141,9 @@ void smart_notification_init(void) atspi_event_listener_register(listener, "object:scroll-start", NULL); atspi_event_listener_register(listener, "object:scroll-end", NULL); +#ifndef SCREEN_READER_TV haptic_module_init(); +#endif status = EINA_TRUE; } @@ -152,6 +154,9 @@ void smart_notification_init(void) */ void smart_notification_shutdown(void) { +#ifndef SCREEN_READER_TV + haptic_module_disconnect(); +#endif status = EINA_FALSE; }