mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-05-12 11:43:16 -04:00
playlist_viewer: add character-based Now Playing indicator
Addresses issue where it became difficult to find the currently playing track once you scrolled away from it, either with icons disabled in the Playlist Viewer, or if the theme's icon set used whitespace for the Music icon. An example scenario would be when you're moving some track and are trying to put it next to the currently playing one. Change-Id: I073a7e55fb723eeff755e32a78f88dcc7db1c245
This commit is contained in:
parent
f83cb1f7d5
commit
e85f120190
1 changed files with 13 additions and 5 deletions
|
|
@ -515,9 +515,15 @@ static void format_line(struct playlist_entry* track, char* str,
|
|||
int len)
|
||||
{
|
||||
char *id3viewc = NULL;
|
||||
char *skipped = "";
|
||||
char *skipped, *prefix, *suffix;
|
||||
skipped = prefix = suffix = "";
|
||||
if (track->attr & PLAYLIST_ATTR_SKIPPED)
|
||||
skipped = "(ERR) ";
|
||||
if (track->index == viewer.current_playing_track)
|
||||
{
|
||||
prefix = "[";
|
||||
suffix = "]";
|
||||
}
|
||||
if (!(track->attr & PLAYLIST_ATTR_RETRIEVE_ID3_ATTEMPTED) &&
|
||||
(global_settings.playlist_viewer_track_display ==
|
||||
PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE_AND_ALBUM ||
|
||||
|
|
@ -591,9 +597,10 @@ static void format_line(struct playlist_entry* track, char* str,
|
|||
format_name(name, track->name, sizeof(name));
|
||||
if (global_settings.playlist_viewer_indices)
|
||||
/* Display playlist index */
|
||||
snprintf(str, len, "%d. %s%s", track->display_index, skipped, name);
|
||||
snprintf(str, len, "%s%d. %s%s%s",
|
||||
prefix, track->display_index, skipped, name, suffix);
|
||||
else
|
||||
snprintf(str, len, "%s%s", skipped, name);
|
||||
snprintf(str, len, "%s%s%s%s", prefix, skipped, name, suffix);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -603,9 +610,10 @@ static void format_line(struct playlist_entry* track, char* str,
|
|||
}
|
||||
if (global_settings.playlist_viewer_indices)
|
||||
/* Display playlist index */
|
||||
snprintf(str, len, "%d. %s%s", track->display_index, skipped, id3viewc);
|
||||
snprintf(str, len, "%s%d. %s%s%s",
|
||||
prefix, track->display_index, skipped, id3viewc, suffix);
|
||||
else
|
||||
snprintf(str, len, "%s%s", skipped, id3viewc);
|
||||
snprintf(str, len, "%s%s%s%s", prefix, skipped, id3viewc, suffix);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue