Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Christian Soffke and committed by
Solomon Peachy
e85f1201 f83cb1f7

+13 -5
+13 -5
apps/playlist_viewer.c
··· 515 515 int len) 516 516 { 517 517 char *id3viewc = NULL; 518 - char *skipped = ""; 518 + char *skipped, *prefix, *suffix; 519 + skipped = prefix = suffix = ""; 519 520 if (track->attr & PLAYLIST_ATTR_SKIPPED) 520 521 skipped = "(ERR) "; 522 + if (track->index == viewer.current_playing_track) 523 + { 524 + prefix = "["; 525 + suffix = "]"; 526 + } 521 527 if (!(track->attr & PLAYLIST_ATTR_RETRIEVE_ID3_ATTEMPTED) && 522 528 (global_settings.playlist_viewer_track_display == 523 529 PLAYLIST_VIEWER_ENTRY_SHOW_ID3_TITLE_AND_ALBUM || ··· 591 597 format_name(name, track->name, sizeof(name)); 592 598 if (global_settings.playlist_viewer_indices) 593 599 /* Display playlist index */ 594 - snprintf(str, len, "%d. %s%s", track->display_index, skipped, name); 600 + snprintf(str, len, "%s%d. %s%s%s", 601 + prefix, track->display_index, skipped, name, suffix); 595 602 else 596 - snprintf(str, len, "%s%s", skipped, name); 603 + snprintf(str, len, "%s%s%s%s", prefix, skipped, name, suffix); 597 604 } 598 605 else 599 606 { ··· 603 610 } 604 611 if (global_settings.playlist_viewer_indices) 605 612 /* Display playlist index */ 606 - snprintf(str, len, "%d. %s%s", track->display_index, skipped, id3viewc); 613 + snprintf(str, len, "%s%d. %s%s%s", 614 + prefix, track->display_index, skipped, id3viewc, suffix); 607 615 else 608 - snprintf(str, len, "%s%s", skipped, id3viewc); 616 + snprintf(str, len, "%s%s%s%s", prefix, skipped, id3viewc, suffix); 609 617 } 610 618 } 611 619