diff options
author | jinwoo.shin <jw0227.shin@samsung.com> | 2015-07-21 13:22:26 +0900 |
---|---|---|
committer | jinwoo.shin <jw0227.shin@samsung.com> | 2015-07-21 13:22:26 +0900 |
commit | a1547986f5ff3a92fe4323f0e818f66abefc1907 (patch) | |
tree | 525a9233390910d1a8453b9e5ef04b4e5d7de838 | |
parent | 01f1b370cbdbd46765ab9c000ed4253f4915b8bf (diff) | |
download | air_livetv-a1547986f5ff3a92fe4323f0e818f66abefc1907.tar.gz air_livetv-a1547986f5ff3a92fe4323f0e818f66abefc1907.tar.bz2 air_livetv-a1547986f5ff3a92fe4323f0e818f66abefc1907.zip |
Add channel history
Change-Id: I06f86572c3df25fb6c48f844689f6494ea565e47
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r-- | src/tv.c | 35 |
1 files changed, 33 insertions, 2 deletions
@@ -19,6 +19,7 @@ #include <iconv.h> #include <math.h> #include <app_debug.h> +#include <app_contents.h> #include <glib.h> #include <glib-object.h> @@ -612,6 +613,14 @@ void tv_channel_del_list(Eina_List *channel_list) free(data); } +void _tv_channel_add_history(int service_id) +{ + char buf[128]; + + snprintf(buf, sizeof(buf), "%d", service_id); + app_contents_recent_add(CONTENTS_CHANNEL, buf); +} + /** * Tunes to specific channel with service id. * @@ -633,6 +642,8 @@ int tv_channel_tune_with_service_id(int service_id) return -1; } + _tv_channel_add_history(service_id); + g_tv_info.viewing_locked_channel = -1; return 0; @@ -665,6 +676,8 @@ int tv_channel_tune(void) return -1; } + _tv_channel_add_history(service_id); + g_tv_info.viewing_locked_channel = -1; return 0; @@ -754,6 +767,8 @@ int tv_channel_tune_locked_channel(int service_id, char *password) return -1; } + _tv_channel_add_history(service_id); + g_tv_info.viewing_locked_channel = service_id; return 0; @@ -769,7 +784,7 @@ int tv_channel_tune_locked_channel(int service_id, char *password) int tv_channel_next(void) { TvServiceAntenna antenna_type; - int r; + int service_id, r; if (!g_tv_info.live_svc) { _ERR("failed to get live service"); @@ -791,6 +806,14 @@ int tv_channel_next(void) g_tv_info.viewing_locked_channel = -1; + r = tv_service_live_get_service_id(g_tv_info.live_svc, &service_id); + if (r < 0) { + _ERR("failed to get service id"); + return -1; + } + + _tv_channel_add_history(service_id); + return 0; } @@ -804,7 +827,7 @@ int tv_channel_next(void) int tv_channel_prev(void) { TvServiceAntenna antenna_type; - int r; + int service_id, r; if (!g_tv_info.live_svc) { _ERR("failed to get live service"); @@ -826,6 +849,14 @@ int tv_channel_prev(void) g_tv_info.viewing_locked_channel = -1; + r = tv_service_live_get_service_id(g_tv_info.live_svc, &service_id); + if (r < 0) { + _ERR("failed to get service id"); + return -1; + } + + _tv_channel_add_history(service_id); + return 0; } |