summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehun Lim <jehun.lim@samsung.com>2015-12-30 08:06:36 (GMT)
committerJehun Lim <jehun.lim@samsung.com>2015-12-30 08:15:15 (GMT)
commit387bda6e97f1f33b4c0fb6eebde4ade3469006e9 (patch)
tree324b1e3069bd07f92ae5054e4429d1d3c4c552a7
parentfa32cb0408b4739e73ca81926a3a8b7cb5f39a90 (diff)
downloadair_mediahub-387bda6e97f1f33b4c0fb6eebde4ade3469006e9.zip
air_mediahub-387bda6e97f1f33b4c0fb6eebde4ade3469006e9.tar.gz
air_mediahub-387bda6e97f1f33b4c0fb6eebde4ade3469006e9.tar.bz2
Change-Id: I3537416ece3d1b674e6947148886ed83f0e08b88 Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
-rw-r--r--src/layout/movie.c7
-rw-r--r--src/layout/music.c43
-rw-r--r--src/view/detail.c9
3 files changed, 25 insertions, 34 deletions
diff --git a/src/layout/movie.c b/src/layout/movie.c
index 2159412..520c213 100644
--- a/src/layout/movie.c
+++ b/src/layout/movie.c
@@ -665,6 +665,7 @@ static void _update(void *layout_data, int update_type, void *data)
struct view_update_data *vdata;
struct _priv *priv;
struct datamgr *dmgr;
+ app_media_info *mi;
int mode;
if (!layout_data) {
@@ -683,7 +684,11 @@ static void _update(void *layout_data, int update_type, void *data)
break;
case UPDATE_CONTENT_ITEM:
listmgr_update_content_item(priv->listmgr);
- _update_recent_item(priv, NULL);
+
+ if (priv->recent_info) {
+ mi = app_media_get_info(priv->recent_info);
+ _update_recent_item(priv, mi->media_id);
+ }
break;
case UPDATE_FOCUS:
if (!data) {
diff --git a/src/layout/music.c b/src/layout/music.c
index 7e68bd2..20b5c7a 100644
--- a/src/layout/music.c
+++ b/src/layout/music.c
@@ -373,30 +373,6 @@ static void _update_content_list(struct _priv *priv)
_ERR("failed to update list area");
}
-static app_media *_get_playing_item(Eina_List *list)
-{
- GList *rlist;
- app_media *am;
- struct recent_data *rdata;
- int r;
-
- rlist = NULL;
- am = NULL;
- r = app_contents_get_recent_list(CONTENTS_MUSIC, 1, &rlist);
- if (r != APP_CONTENTS_ERROR_NONE) {
- _ERR("failed to get movie recent list");
- return NULL;
- }
-
- rdata = g_list_nth_data(rlist, 0);
- if (rdata && rdata->id)
- am = util_find_media_info(list, rdata->id);
-
- app_contents_free_recent_list(rlist);
-
- return am;
-}
-
static void _update_playing_item(struct _priv *priv, const char *id)
{
Eina_List *list;
@@ -404,7 +380,7 @@ static void _update_playing_item(struct _priv *priv, const char *id)
app_media_info *info;
struct datamgr *dmgr;
- if (priv->status == E_PLAYER_STOP) {
+ if (!id) {
listmgr_update_play_info(priv->listmgr, NULL);
return;
}
@@ -417,11 +393,7 @@ static void _update_playing_item(struct _priv *priv, const char *id)
list = dmgr->ops->get_list(dmgr->handle, E_LIST_MEDIA, NULL);
- if (id)
- am = util_find_media_info(list, id);
- else
- am = _get_playing_item(list);
-
+ am = util_find_media_info(list, id);
if (am) {
info = app_media_get_info(am);
if (!info)
@@ -630,6 +602,7 @@ static void _update(void *layout_data, int update_type, void *data)
{
struct view_update_data *vdata;
struct _priv *priv;
+ app_media_info *mi;
int mode;
if (!layout_data) {
@@ -646,7 +619,11 @@ static void _update(void *layout_data, int update_type, void *data)
break;
case UPDATE_CONTENT_ITEM:
listmgr_update_content_item(priv->listmgr);
- _update_playing_item(priv, NULL);
+
+ if (priv->playing_info) {
+ mi = app_media_get_info(priv->playing_info);
+ _update_playing_item(priv, mi->media_id);
+ }
break;
case UPDATE_PLAY_INFO:
if (!data) {
@@ -667,7 +644,9 @@ static void _update(void *layout_data, int update_type, void *data)
vdata = data;
priv->status = vdata->status;
- _update_playing_item(priv, NULL);
+
+ if (priv->status == E_PLAYER_STOP)
+ _update_playing_item(priv, NULL);
break;
case UPDATE_FOCUS:
listmgr_focus_play_info(priv->listmgr);
diff --git a/src/view/detail.c b/src/view/detail.c
index 836b528..8ec7fc8 100644
--- a/src/view/detail.c
+++ b/src/view/detail.c
@@ -808,6 +808,8 @@ static void _set_no_play_info(struct _priv *priv)
elm_object_signal_emit(priv->btn, SIG_SET_STATUS_STOP, SIG_SOURCE_SRC);
elm_object_disabled_set(priv->btn, EINA_TRUE);
+
+ priv->play_info = NULL;
}
static void _set_movie_play_info(struct _priv *priv, app_media_info *mi)
@@ -1103,6 +1105,7 @@ static void _update(void *view_data, int update_type, void *data)
{
struct _priv *priv;
struct view_update_data *vdata;
+ app_media_info *mi;
if (!view_data) {
_ERR("failed to get view data");
@@ -1134,7 +1137,11 @@ static void _update(void *view_data, int update_type, void *data)
break;
case UPDATE_PLAYER:
priv->status = vdata->status;
- _update_play_info(priv, NULL);
+
+ if (priv->play_info) {
+ mi = app_media_get_info(priv->play_info);
+ _update_play_info(priv, mi->media_id);
+ }
break;
default:
break;