diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-06-15 00:13:34 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-06-15 00:46:23 +0200 |
commit | cfd5ef8db8c0cf702e3fb49ec67f5fea94c558fa (patch) | |
tree | b253e92ff32106aa2e6ddcab0cedfbf1d62282e7 | |
parent | 666a836227fff725cba0884edd6113b5d548c7dd (diff) | |
download | rockbox-cfd5ef8db8.tar.gz rockbox-cfd5ef8db8.zip |
Current Track Info: Respond to track changes or finished playlist
Properly update displayed playlist index and all available
metadata for the currently playing track. Also exit screen
when playlist has finished to prevent nonsense data from
being displayed.
Change-Id: Iecc53c0eda5cbd374b51827a25916ee4e2c6456f
-rw-r--r-- | apps/screens.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/apps/screens.c b/apps/screens.c index d359267d8d..4c220e4751 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -757,17 +757,19 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a int key; unsigned int i; struct id3view_info info; - info.count = 0; info.id3 = id3; info.modified = modified; info.track_ct = track_ct; - info.playlist_display_index = playlist_display_index; info.playlist_amount = playlist_amount; bool ret = false; int curr_activity = get_current_activity(); - if (curr_activity != ACTIVITY_PLUGIN && - curr_activity != ACTIVITY_PLAYLISTVIEWER) + bool is_curr_track_info = curr_activity != ACTIVITY_PLUGIN && + curr_activity != ACTIVITY_PLAYLISTVIEWER; + if (is_curr_track_info) push_current_activity(ACTIVITY_ID3SCREEN); +refresh_info: + info.count = 0; + info.playlist_display_index = playlist_display_index; for (i = 0; i < ARRAYLEN(id3_headers); i++) { char temp[8]; @@ -798,10 +800,23 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a ret = true; break; } + } + else if (is_curr_track_info) + { + if (!audio_status()) + { + ret = false; + break; + } + else + { + playlist_display_index = playlist_get_display_index(); + if (playlist_display_index != info.playlist_display_index) + goto refresh_info; + } } } - if (curr_activity != ACTIVITY_PLUGIN && - curr_activity != ACTIVITY_PLAYLISTVIEWER) + if (is_curr_track_info) pop_current_activity(); return ret; } |