summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjinwoo.shin <jw0227.shin@samsung.com>2015-08-12 14:31:56 +0900
committerjinwoo.shin <jw0227.shin@samsung.com>2015-08-12 14:31:56 +0900
commit54a3b67d7271ec9034670a7e73d0d4c4b0b634cc (patch)
tree8389d1640a449b0d00abdb4f97aa167c7cb735e0
parent1481c623c2a6eb1ecc529a62c04ee89bafd72ec6 (diff)
downloadair_livetv-54a3b67d7271ec9034670a7e73d0d4c4b0b634cc.tar.gz
air_livetv-54a3b67d7271ec9034670a7e73d0d4c4b0b634cc.tar.bz2
air_livetv-54a3b67d7271ec9034670a7e73d0d4c4b0b634cc.zip
Add timer call for live service pause
Change-Id: I98902148dcb481e7ec29909224db65969e8c0a96 Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r--src/main.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 6616c90..e7c444b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,6 +28,7 @@
#include "view.h"
#define KEY_MAX 256
+#define PAUSE_WAIT_TIME 0.5
SET_TAG(PACKAGE)
@@ -38,6 +39,7 @@ struct _appdata {
Ecore_Event_Handler *key_up;
tzsh_h tzsh;
tzsh_tvsrv_h ta;
+ Ecore_Timer *pause_timer;
int is_signal;
int is_channel;
@@ -201,13 +203,39 @@ static void _tv_signal_cb(void *data, int is_signal)
}
}
-static void _pause(void *data)
+Eina_Bool _tv_pause(void *data)
{
+ struct _appdata *ad;
int r;
+ if (!data) {
+ _ERR("failed to get data");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ ad = data;
+
r = tv_pause();
if (r < 0)
_ERR("Pause tv service failed");
+
+ ad->pause_timer = NULL;
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void _pause(void *data)
+{
+ struct _appdata *ad;
+
+ if (!data) {
+ _ERR("failed to get data");
+ return;
+ }
+
+ ad = data;
+
+ ad->pause_timer = ecore_timer_add(PAUSE_WAIT_TIME, _tv_pause, ad);
}
static void _resume(void *data)
@@ -222,6 +250,11 @@ static void _resume(void *data)
ad = data;
+ if (ad->pause_timer) {
+ ecore_timer_del(ad->pause_timer);
+ ad->pause_timer = NULL;
+ }
+
r = tv_resume();
if (r < 0) {
_ERR("Resume tv service failed");
@@ -233,9 +266,6 @@ static void _resume(void *data)
return;
}
}
-
- if (ad->win)
- elm_win_activate(ad->win);
}
static bool _create(void *data)
@@ -313,6 +343,11 @@ static void _terminate(void *data)
ad = data;
+ if (ad->pause_timer) {
+ ecore_timer_del(ad->pause_timer);
+ ad->pause_timer = NULL;
+ }
+
if (ad->win) {
tv_destroy();
@@ -369,7 +404,6 @@ static void _control(app_control_h control, void *data)
viewmgr_update_view(VIEW_ERROR, UPDATE_TYPE_NOCHANNEL, NULL);
} else {
ad->is_channel = true;
- viewmgr_show_view(VIEW_CHANNELINFO);
}
}