#include <iconv.h>
#include <math.h>
#include <app_debug.h>
+#include <app_contents.h>
#include <glib.h>
#include <glib-object.h>
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.
*
return -1;
}
+ _tv_channel_add_history(service_id);
+
g_tv_info.viewing_locked_channel = -1;
return 0;
return -1;
}
+ _tv_channel_add_history(service_id);
+
g_tv_info.viewing_locked_channel = -1;
return 0;
return -1;
}
+ _tv_channel_add_history(service_id);
+
g_tv_info.viewing_locked_channel = service_id;
return 0;
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");
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;
}
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");
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;
}