playlist_viewer: add character-based Now Playing indicator
rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Thu, 16 Apr 2026 21:04:06 -0400
| Newsgroups | gmane.comp.systems.archos.rockbox.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit e85f1201902fb852bc25a56a21a4f313f3820940 Author: Christian Soffke <[email protected]> Date: Mon Apr 13 15:44:53 2026 +0200 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 diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 88f2590c3e..392131a8a9 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -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); } } -- rockbox-cvs mailing list [email protected] https://lists.haxx.se/mailman/listinfo/rockbox-cvs