diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-08-08 13:11:19 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-08-08 13:11:19 +0900 |
commit | d8c754c84dcbbb35792f940845ffdebf0d20d4a3 (patch) | |
tree | dc0c51d9bf7a80cba6255086f020365556b415a2 | |
parent | 34239bcc9abfdf8395c7dfb01e3f975d6432952c (diff) | |
download | air_mediahub-d8c754c84dcbbb35792f940845ffdebf0d20d4a3.tar.gz air_mediahub-d8c754c84dcbbb35792f940845ffdebf0d20d4a3.tar.bz2 air_mediahub-d8c754c84dcbbb35792f940845ffdebf0d20d4a3.zip |
Don't handle Volume and Channel keys
Change-Id: Ied50b68ff1b3f5c23160d807c65d518195693ad5
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | include/util/timeout_handler.h | 2 | ||||
-rw-r--r-- | src/util/timeout_handler.c | 34 | ||||
-rw-r--r-- | src/view/viewer.c | 14 |
3 files changed, 40 insertions, 10 deletions
diff --git a/include/util/timeout_handler.h b/include/util/timeout_handler.h index 44ad82f..2a4c2ff 100644 --- a/include/util/timeout_handler.h +++ b/include/util/timeout_handler.h @@ -19,7 +19,7 @@ struct timeout_handler; -typedef void (*timeout_event_cb)(void *data, int type, void *ei); +typedef Eina_Bool (*timeout_event_cb)(void *data, int type, void *ei); struct timeout_handler *timeout_handler_init(double timeout, timeout_event_cb timeout_cb, void *timeout_data, diff --git a/src/util/timeout_handler.c b/src/util/timeout_handler.c index d66ac3b..148c41e 100644 --- a/src/util/timeout_handler.c +++ b/src/util/timeout_handler.c @@ -16,6 +16,7 @@ #include <stdbool.h> #include <Elementary.h> #include <app_debug.h> +#include <key_define.h> #include "define.h" #include "util/timeout_handler.h" @@ -37,6 +38,7 @@ struct timeout_handler { static Eina_Bool _timer_cb(void *data) { struct timeout_handler *handle; + Eina_Bool r; if (!data) return ECORE_CALLBACK_CANCEL; @@ -48,9 +50,9 @@ static Eina_Bool _timer_cb(void *data) if (!handle->enable) return ECORE_CALLBACK_CANCEL; - handle->timeout_cb(handle->timeout_data, 0, NULL); + r = handle->timeout_cb(handle->timeout_data, 0, NULL); - return ECORE_CALLBACK_CANCEL; + return r; } void _timer_reset(struct timeout_handler *handle) @@ -65,6 +67,7 @@ void _timer_reset(struct timeout_handler *handle) static Eina_Bool _event_occured(void *data, int type, void *event) { struct timeout_handler *handle; + Eina_Bool r; if (!data) return ECORE_CALLBACK_PASS_ON; @@ -74,11 +77,34 @@ static Eina_Bool _event_occured(void *data, int type, void *event) if (!handle->enable) return ECORE_CALLBACK_PASS_ON; - handle->event_cb(handle->event_data, type, event); + /* Don't handle Volume and Channel keys */ + if (type == ECORE_EVENT_KEY_UP) { + Evas_Event_Key_Up *ev; + + if (!event) + return ECORE_CALLBACK_PASS_ON; + + ev = event; + + if (!strcmp(ev->keyname, KEY_VOLUMEUP) || + !strcmp(ev->keyname, KEY_VOLUMEUP_REMOTE) || + !strcmp(ev->keyname, KEY_VOLUMEDOWN) || + !strcmp(ev->keyname, KEY_VOLUMEDOWN_REMOTE) || + !strcmp(ev->keyname, KEY_MUTE) || + !strcmp(ev->keyname, KEY_MUTE_REMOTE) || + !strcmp(ev->keyname, KEY_CHANNELUP) || + !strcmp(ev->keyname, KEY_CHANNELUP_REMOTE) || + !strcmp(ev->keyname, KEY_CHANNELDOWN) || + !strcmp(ev->keyname, KEY_CHANNELDOWN_REMOTE)) { + return ECORE_CALLBACK_PASS_ON; + } + } + + r = handle->event_cb(handle->event_data, type, event); _timer_reset(handle); - return ECORE_CALLBACK_PASS_ON; + return r; } void timeout_handler_enable(struct timeout_handler *handle, bool enable) diff --git a/src/view/viewer.c b/src/view/viewer.c index 2f7d9e2..56c6961 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -650,17 +650,19 @@ static void _pop_view(struct _priv *priv) ui_app_exit(); } -static void _timeout_cb(void *data, int type, void *ei) +static Eina_Bool _timeout_cb(void *data, int type, void *ei) { _hide_bar(data); + + return ECORE_CALLBACK_CANCEL; } -static void _event_cb(void *data, int type, void *ei) +static Eina_Bool _event_cb(void *data, int type, void *ei) { struct _priv *priv; if (!data) - return; + return ECORE_CALLBACK_PASS_ON; priv = data; @@ -668,7 +670,7 @@ static void _event_cb(void *data, int type, void *ei) Evas_Event_Key_Up *ev; if (!ei) - return; + return ECORE_CALLBACK_PASS_ON; ev = ei; @@ -676,12 +678,14 @@ static void _event_cb(void *data, int type, void *ei) !strcmp(ev->keyname, KEY_BACK_REMOTE)) { if (priv->bar_show) { _pop_view(priv); - return; + return ECORE_CALLBACK_DONE; } } } _show_bar(data); + + return ECORE_CALLBACK_PASS_ON; } static int _player_get_position(void *data) |