summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-11-21 03:15:03 +0100
committerWilliam Wilgus <me.theuser@yahoo.com>2022-11-23 01:22:14 -0500
commit0c7f66ab5f33ff18221fe9c772ff44a6f6d93805 (patch)
treeae73793a71cb4466f57e8940c20a63d23df1c1d5
parent6bc443f474ac1a7a77b287bb9bc65b083913abc1 (diff)
downloadrockbox-0c7f66ab5f.tar.gz
rockbox-0c7f66ab5f.zip
Playlist Viewer: Display playlist name in title
Change-Id: I7b258a566f55d026710d3441d1b4188f7614c5ee
-rw-r--r--apps/playlist_viewer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 0eaf559c66..7f98ccd8e3 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -102,7 +102,8 @@ struct playlist_buffer
/* Global playlist viewer settings */
struct playlist_viewer {
- struct playlist_info* playlist; /* playlist being viewed */
+ const char *title; /* Playlist Viewer list title */
+ struct playlist_info* playlist; /* Playlist being viewed */
int num_tracks; /* Number of tracks in playlist */
int current_playing_track; /* Index of current playing track */
int selected_track; /* The selected track, relative (first is 0) */
@@ -349,7 +350,10 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
return false;
if (!filename)
+ {
viewer->playlist = NULL;
+ viewer->title = (char *) str(LANG_PLAYLIST);
+ }
else
{
/* Viewing playlist on disk */
@@ -373,6 +377,7 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
dir = "/";
file = filename+1;
}
+ viewer->title = file;
if (is_playing)
{
@@ -771,7 +776,7 @@ static void update_lists(struct gui_synclist * playlist_lists)
gui_synclist_set_icon_callback(playlist_lists,
global_settings.playlist_viewer_icons?
&playlist_callback_icons:NULL);
- gui_synclist_set_title(playlist_lists, str(LANG_PLAYLIST), Icon_Playlist);
+ gui_synclist_set_title(playlist_lists, viewer.title, Icon_Playlist);
gui_synclist_draw(playlist_lists);
gui_synclist_speak_item(playlist_lists);
}
@@ -808,7 +813,7 @@ static void prepare_lists(struct gui_synclist * playlist_lists)
global_settings.playlist_viewer_icons ?
&playlist_callback_icons : NULL);
gui_synclist_set_nb_items(playlist_lists, viewer.num_tracks);
- gui_synclist_set_title(playlist_lists, str(LANG_PLAYLIST), Icon_Playlist);
+ gui_synclist_set_title(playlist_lists, viewer.title, Icon_Playlist);
gui_synclist_select_item(playlist_lists, viewer.selected_track);
gui_synclist_draw(playlist_lists);
gui_synclist_speak_item(playlist_lists);