diff options
-rw-r--r-- | main.c | 39 |
1 files changed, 37 insertions, 2 deletions
@@ -9,6 +9,9 @@ Player pl; UIButton* play_button; UISlider* seek_slider; UIImageDisplay* cover_image; +UILabel* title_text; +UILabel* album_text; +UILabel* artist_text; void ui_update_play(void) { UI_FREE(play_button->label); @@ -16,7 +19,6 @@ void ui_update_play(void) { pl.play? "Pause": "Play", -1 ); - UIElementRefresh((UIElement*)play_button); UIImageDisplaySetContent( cover_image, pl.cover, @@ -24,7 +26,22 @@ void ui_update_play(void) { album_cover_h, album_cover_w * 4 ); - UIElementRepaint((UIElement*)cover_image, 0); + UILabelSetContent( + title_text, + pl.song->name, + -1 + ); + UILabelSetContent( + album_text, + pl.song->album, + -1 + ); + UILabelSetContent( + artist_text, + pl.song->artist, + -1 + ); + UIElementRefresh(cover_image->e.parent); } void ui_update_seek(void) { @@ -203,6 +220,24 @@ int prog_main(void* mem) { pctrl = UIPanelCreate(&split3->e, UI_PANEL_GRAY); pctrl->gap = 5; pctrl->border = UI_RECT_1(5); + title_text = UILabelCreate( + &pctrl->e, + 0, + "", + -1 + ); + album_text = UILabelCreate( + &pctrl->e, + 0, + "", + -1 + ); + artist_text = UILabelCreate( + &pctrl->e, + 0, + "", + -1 + ); cover_image = UIImageDisplayCreate( &pctrl->e, 0, |