Commit ccf2b82a authored by Ludovic Fauvet's avatar Ludovic Fauvet

audio player: show and update covers for the mini and fullscreen player

parent 46846163
......@@ -45,7 +45,7 @@ struct audio_player {
Evas_Object *layout, *fs_layout;
Evas_Object *popup;
Evas_Object *slider, *fs_slider;
Evas_Object *cover, *fs_cover, *fs_time, *fs_total_time;
Evas_Object *fs_time, *fs_total_time;
Evas_Object *fs_title, *fs_sub_title;
Evas_Object *play_pause_img;
......@@ -374,6 +374,17 @@ update_player_display(audio_player* mpd)
elm_object_part_text_set(mpd->layout, "swallow.subtitle", psz_meta);
elm_object_part_text_set(mpd->fs_layout, "subtitle_text", psz_meta);
}
const char *cover = p_mi->psz_snapshot;
if (cover)
{
elm_object_part_content_set(mpd->layout, "swallow.cover", create_image(mpd->layout, cover));
elm_object_part_content_set(mpd->fs_layout, "cover", create_image(mpd->fs_layout, cover));
}
else
{
elm_object_part_content_set(mpd->layout, "swallow.cover", create_icon(mpd->layout, "background_cone.png"));
elm_object_part_content_set(mpd->fs_layout, "cover", create_icon(mpd->fs_layout, "background_cone.png"));
}
}
/* Change the play/pause button img */
......@@ -664,8 +675,8 @@ swallow_mini_player(audio_player *mpd, Evas_Object *layout)
player_update_sliders(mpd, playback_service_get_pos(mpd->p_ps));
/* set the cover image */
mpd->cover = create_icon(layout, "background_cone.png");
elm_object_part_content_set(layout, "swallow.cover", mpd->cover);
Evas_Object *cover = create_icon(layout, "background_cone.png");
elm_object_part_content_set(layout, "swallow.cover", cover);
/* set the play/pause button */
mpd->play_pause_img = create_icon(layout, "ic_pause_circle_normal_o.png");
......@@ -703,9 +714,9 @@ add_fullscreen_item_table(audio_player *mpd, Evas_Object *parent)
elm_object_part_content_set(layout, "more_button", mpd->fs_more_btn);
/* Cover */
mpd->fs_cover = create_icon(parent, "background_cone.png");
evas_object_show(mpd->fs_cover);
elm_object_part_content_set(layout, "cover", mpd->fs_cover);
Evas_Object *cover = create_icon(parent, "background_cone.png");
evas_object_show(cover);
elm_object_part_content_set(layout, "cover", cover);
/* Seek */
mpd->fs_slider = elm_slider_add(parent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment