summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-06-15 00:13:34 +0200
committerChristian Soffke <christian.soffke@gmail.com>2023-06-15 00:46:23 +0200
commitcfd5ef8db8c0cf702e3fb49ec67f5fea94c558fa (patch)
treeb253e92ff32106aa2e6ddcab0cedfbf1d62282e7 /apps
parent666a836227fff725cba0884edd6113b5d548c7dd (diff)
downloadrockbox-cfd5ef8db8c0cf702e3fb49ec67f5fea94c558fa.tar.gz
rockbox-cfd5ef8db8c0cf702e3fb49ec67f5fea94c558fa.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
Diffstat (limited to 'apps')
-rw-r--r--apps/screens.c27
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
757 int key; 757 int key;
758 unsigned int i; 758 unsigned int i;
759 struct id3view_info info; 759 struct id3view_info info;
760 info.count = 0;
761 info.id3 = id3; 760 info.id3 = id3;
762 info.modified = modified; 761 info.modified = modified;
763 info.track_ct = track_ct; 762 info.track_ct = track_ct;
764 info.playlist_display_index = playlist_display_index;
765 info.playlist_amount = playlist_amount; 763 info.playlist_amount = playlist_amount;
766 bool ret = false; 764 bool ret = false;
767 int curr_activity = get_current_activity(); 765 int curr_activity = get_current_activity();
768 if (curr_activity != ACTIVITY_PLUGIN && 766 bool is_curr_track_info = curr_activity != ACTIVITY_PLUGIN &&
769 curr_activity != ACTIVITY_PLAYLISTVIEWER) 767 curr_activity != ACTIVITY_PLAYLISTVIEWER;
768 if (is_curr_track_info)
770 push_current_activity(ACTIVITY_ID3SCREEN); 769 push_current_activity(ACTIVITY_ID3SCREEN);
770refresh_info:
771 info.count = 0;
772 info.playlist_display_index = playlist_display_index;
771 for (i = 0; i < ARRAYLEN(id3_headers); i++) 773 for (i = 0; i < ARRAYLEN(id3_headers); i++)
772 { 774 {
773 char temp[8]; 775 char temp[8];
@@ -798,10 +800,23 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a
798 ret = true; 800 ret = true;
799 break; 801 break;
800 } 802 }
803 }
804 else if (is_curr_track_info)
805 {
806 if (!audio_status())
807 {
808 ret = false;
809 break;
810 }
811 else
812 {
813 playlist_display_index = playlist_get_display_index();
814 if (playlist_display_index != info.playlist_display_index)
815 goto refresh_info;
816 }
801 } 817 }
802 } 818 }
803 if (curr_activity != ACTIVITY_PLUGIN && 819 if (is_curr_track_info)
804 curr_activity != ACTIVITY_PLAYLISTVIEWER)
805 pop_current_activity(); 820 pop_current_activity();
806 return ret; 821 return ret;
807} 822}