priv->playlist.list, priv->playlist.cur);
vdata.id = _playlist_get_current_media_id(priv);
viewmgr_update_view(VIEW_BASE, UPDATE_PLAY_INFO, &vdata);
+ viewmgr_update_view(VIEW_DETAIL, UPDATE_PLAY_INFO, &vdata);
/* update history */
util_add_to_recent(priv->playlist.list, priv->playlist.cur);
}
+static void _update_player(struct _priv *priv)
+{
+ struct view_update_data vdata;
+ player_state_e state;
+
+ playermgr_get_state(priv->player, &state);
+
+ switch (state) {
+ case PLAYER_STATE_PAUSED:
+ vdata.status = E_PLAYER_PAUSE;
+ break;
+ case PLAYER_STATE_PLAYING:
+ vdata.status = E_PLAYER_PLAY;
+ break;
+ case PLAYER_STATE_IDLE:
+ case PLAYER_STATE_READY:
+ default:
+ vdata.status = E_PLAYER_STOP;
+ break;
+ }
+
+ /* update player */
+ viewmgr_update_view(VIEW_BASE, UPDATE_PLAYER, &vdata);
+ viewmgr_update_view(VIEW_DETAIL, UPDATE_PLAYER, &vdata);
+}
+
static void _mplayer_show(struct _priv *priv)
{
struct controller *ctl;
_ERR("player was not created");
break;
}
+
+ _update_player(priv);
}
static void _player_next(struct _priv *priv)
_ERR("player was not created");
break;
}
+
+ _update_player(priv);
}
static void _player_pause(struct _priv *priv)
ctl = priv->ctl;
ctl->ops->signal(ctl->handle, BTN_LOC_PLAY, SIG_SET_PLAY);
+
+ _update_player(priv);
}
static void _player_play(struct _priv *priv)
ctl = priv->ctl;
ctl->ops->signal(ctl->handle, BTN_LOC_PLAY, SIG_SET_PAUSE);
+
+ _update_player(priv);
}
static void _player_stop(struct _priv *priv)
ctl = priv->ctl;
ctl->ops->signal(ctl->handle, BTN_LOC_PLAY, SIG_SET_PLAY);
+
+ _update_player(priv);
}
static void _player_complete_cb(void *data)
struct _priv *priv;
struct view_update_data *vdata;
- if (!view_data) {
+ if (!view_data || !data) {
_ERR("failed to get view data");
return;
}
switch (update_type) {
case UPDATE_CONTENT:
- if (!vdata)
- break;
-
if (priv->playlist.list_org != vdata->list) {
priv->playlist.list_org = vdata->list;
priv->playlist.list = eina_list_clone(vdata->list);
_add_playlist_item(priv);
break;
case UPDATE_PLAYER:
- _player_stop(priv);
+ if (vdata->status == E_PLAYER_STOP)
+ _player_stop(priv);
+ /* NOTE: if need, adds play/pause */
break;
default:
break;