music: update now playing item referring to player status 23/54823/1
authorJehun Lim <jehun.lim@samsung.com>
Fri, 18 Dec 2015 05:50:40 +0000 (14:50 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Fri, 18 Dec 2015 05:50:40 +0000 (14:50 +0900)
Change-Id: Ic92fc3fdd0bc903b6a6ee3caa5dcd16bc7f64178
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
src/layout/music.c
src/view/base.c

index a11324a..4234f9b 100644 (file)
@@ -62,6 +62,8 @@ struct _priv {
        int view_mode;
        int source_type;
 
+       int status;
+
        struct grid_data *gdata;
 };
 
@@ -400,6 +402,11 @@ static void _update_playing_item(struct _priv *priv, const char *id)
        app_media_info *info;
        struct datamgr *dmgr;
 
+       if (priv->status == E_PLAYER_STOP) {
+               listmgr_update_play_info(priv->listmgr, NULL);
+               return;
+       }
+
        dmgr = priv->dmgr[E_DATA_MEDIA];
        if (!dmgr)
                return;
@@ -649,6 +656,17 @@ static void _update(void *layout_data, int update_type, void *data)
 
                _update_playing_item(priv, vdata->id);
                break;
+       case UPDATE_PLAYER:
+               if (!data) {
+                       _ERR("invalid argument");
+                       return;
+               }
+
+               vdata = data;
+
+               priv->status = vdata->status;
+               _update_playing_item(priv, NULL);
+               break;
        case UPDATE_FOCUS:
                listmgr_focus_play_info(priv->listmgr);
                break;
index b318011..0a53ee0 100644 (file)
@@ -968,6 +968,7 @@ static void _update(void *view_data, int update_type, void *data)
        switch (update_type) {
        case UPDATE_FOCUS:
        case UPDATE_PLAY_INFO:
+       case UPDATE_PLAYER:
                if (!data)
                        goto err;