summaryrefslogtreecommitdiff
path: root/src/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/view')
-rw-r--r--src/view/mplayer.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/view/mplayer.c b/src/view/mplayer.c
index a438cf1..c5c77f8 100644
--- a/src/view/mplayer.c
+++ b/src/view/mplayer.c
@@ -124,7 +124,6 @@ static void _draw_music_info(struct _priv *priv, app_media_info *mi)
static void _draw_progressbar(struct _priv *priv, app_media_info *mi)
{
- progressbar_reset(priv->progress, 0, mi->audio->duration);
progressbar_show(priv->progress);
}
@@ -152,6 +151,9 @@ static void _update_info(struct _priv *priv, app_media_info *mi)
{
struct view_update_data vdata;
+ /* update progressbar */
+ progressbar_reset(priv->progress, 0, mi->audio->duration);
+
/* update history */
app_contents_recent_add(CONTENTS_MEDIA, mi->media_id);
@@ -250,10 +252,6 @@ static int _player_get_position(void *data)
return playermgr_get_position(priv->player);
}
-static struct progressbar_ops _progressbar_ops = {
- .get_value = _player_get_position,
-};
-
static void _player_play_pause(struct _priv *priv)
{
app_media_info *mi;
@@ -388,6 +386,11 @@ static void _player_complete_cb(void *data)
_player_next(priv);
}
+static struct progressbar_ops _progressbar_ops = {
+ .get_value = _player_get_position,
+ .complete_cb = _player_complete_cb,
+};
+
static void _callback_music(void *data, const char *ev)
{
struct _priv *priv;
@@ -713,13 +716,6 @@ static Evas_Object *_create(Evas_Object *win, void *data)
return NULL;
}
- r = playermgr_set_completed_cb(player, _player_complete_cb, priv);
- if (!r) {
- _ERR("failed to set callback");
- playermgr_destroy(player);
- return NULL;
- }
-
priv->player = player;
r = _ui_init(priv);