#include "view.h"
#define KEY_MAX 256
+#define PAUSE_WAIT_TIME 0.5
SET_TAG(PACKAGE)
Ecore_Event_Handler *key_up;
tzsh_h tzsh;
tzsh_tvsrv_h ta;
+ Ecore_Timer *pause_timer;
int is_signal;
int is_channel;
}
}
-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)
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");
return;
}
}
-
- if (ad->win)
- elm_win_activate(ad->win);
}
static bool _create(void *data)
ad = data;
+ if (ad->pause_timer) {
+ ecore_timer_del(ad->pause_timer);
+ ad->pause_timer = NULL;
+ }
+
if (ad->win) {
tv_destroy();
viewmgr_update_view(VIEW_ERROR, UPDATE_TYPE_NOCHANNEL, NULL);
} else {
ad->is_channel = true;
- viewmgr_show_view(VIEW_CHANNELINFO);
}
}