[prev in list] [next in list] [prev in thread] [next in thread]
List: rockbox-cvs
Subject: Current Track Info: Respond to track changes or finished playlist
From: rockbox-gerrit-noreply--- via rockbox-cvs <rockbox-cvs () lists ! haxx ! se>
Date: 2023-06-14 23:01:27
Message-ID: 202306142301.35EN1RL1382220 () archos ! rockbox ! org
[Download RAW message or body]
commit cfd5ef8db8c0cf702e3fb49ec67f5fea94c558fa
Author: Christian Soffke <christian.soffke@gmail.com>
Date: Thu Jun 15 00:13:34 2023 +0200
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
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;
}
--
rockbox-cvs mailing list
rockbox-cvs@lists.haxx.se
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic