timeout_handler: add pause/resume function 69/55869/1
authorMinkyu Kang <mk7.kang@samsung.com>
Wed, 30 Dec 2015 02:37:23 +0000 (11:37 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 30 Dec 2015 02:37:23 +0000 (11:37 +0900)
Change-Id: I50a58a5234e7894aad9f86c234fc5b64efc91a4b
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
include/util/timeout_handler.h
src/util/timeout_handler.c
src/view/viewer.c

index 2a4c2ff..0f5ede3 100644 (file)
@@ -28,5 +28,7 @@ struct timeout_handler *timeout_handler_init(double timeout,
 void timeout_handler_fini(struct timeout_handler *handle);
 
 void timeout_handler_enable(struct timeout_handler *handle, bool enable);
+void timeout_handler_pause(struct timeout_handler *handle);
+void timeout_handler_resume(struct timeout_handler *handle);
 
 #endif
index 411666b..244b24a 100644 (file)
@@ -101,16 +101,25 @@ static Eina_Bool _event_occured(void *data, int type, void *event)
        return r;
 }
 
+void timeout_handler_pause(struct timeout_handler *handle)
+{
+       ecore_timer_del(handle->timer);
+       handle->timer = NULL;
+}
+
+void timeout_handler_resume(struct timeout_handler *handle)
+{
+       _timer_reset(handle);
+}
+
 void timeout_handler_enable(struct timeout_handler *handle, bool enable)
 {
        handle->enable = enable;
 
-       if (enable) {
-               _timer_reset(handle);
-       } else {
-               ecore_timer_del(handle->timer);
-               handle->timer = NULL;
-       }
+       if (enable)
+               timeout_handler_resume(handle);
+       else
+               timeout_handler_pause(handle);
 }
 
 struct timeout_handler *timeout_handler_init(double timeout,
index 707643d..cb51621 100644 (file)
@@ -1068,7 +1068,7 @@ static void _player_set_wind(struct _priv *priv, int wind)
        case WIND_FF:
                elm_object_signal_emit(priv->base, SIG_VIEWER_SHOW_FF, "");
                playermgr_set_ff(priv->player);
-               timeout_handler_enable(priv->timeout, false);
+               timeout_handler_pause(priv->timeout);
                progressbar_resume(priv->progress);
 
                ctl = priv->viewer.ctl[priv->viewer.cur];
@@ -1077,7 +1077,7 @@ static void _player_set_wind(struct _priv *priv, int wind)
        case WIND_REW:
                elm_object_signal_emit(priv->base, SIG_VIEWER_SHOW_REW, "");
                playermgr_set_rew(priv->player);
-               timeout_handler_enable(priv->timeout, false);
+               timeout_handler_pause(priv->timeout);
                progressbar_resume(priv->progress);
 
                ctl = priv->viewer.ctl[priv->viewer.cur];
@@ -1087,7 +1087,7 @@ static void _player_set_wind(struct _priv *priv, int wind)
        default:
                elm_object_signal_emit(priv->base, SIG_VIEWER_HIDE_WIND, "");
                playermgr_stop_wind(priv->player);
-               timeout_handler_enable(priv->timeout, true);
+               timeout_handler_resume(priv->timeout);
                break;
        }
 
@@ -1450,6 +1450,7 @@ static void _hide(void *view_data)
        _slideshow_disable(priv);
        _viewer_hide(priv);
 
+       _player_set_wind(priv, WIND_NONE);
        progressbar_stop(priv->progress);
        playermgr_stop(priv->player);
        _image_unload(priv);