From 7dffbd84af8d4857f357ac33bd74fda3608c7ebd Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Tue, 28 Dec 2021 08:56:16 +0100 Subject: Playlist Viewer: Add Track Info Adds a command for showing track info to the Playlist Viewer's context menu, which brings up the same screen used by the WPS for currently playing tracks. Change-Id: I17d99671935934dad565d290a0d6fb3b0dfd8b01 --- apps/screens.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/screens.c') diff --git a/apps/screens.c b/apps/screens.c index fa2f9f9927..f3a969a838 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -40,7 +40,6 @@ #include "powermgmt.h" #include "talk.h" #include "misc.h" -#include "metadata.h" #include "screens.h" #include "debug.h" #include "led.h" @@ -389,6 +388,8 @@ static const int id3_headers[]= struct id3view_info { struct mp3entry* id3; int count; + int playlist_display_index; + int playlist_amount; int info_id[ARRAYLEN(id3_headers)]; }; @@ -589,13 +590,13 @@ static const char * id3_get_or_speak_info(int selected_item, void* data, break; case LANG_ID3_PLAYLIST: snprintf(buffer, buffer_len, "%d/%d", - playlist_get_display_index(), playlist_amount()); + info->playlist_display_index, info->playlist_amount); val=buffer; if(say_it) { - talk_number(playlist_get_display_index(), true); + talk_number(info->playlist_display_index, true); talk_id(VOICE_OF, true); - talk_number(playlist_amount(), true); + talk_number(info->playlist_amount, true); } break; case LANG_ID3_BITRATE: @@ -669,15 +670,16 @@ static int id3_speak_item(int selected_item, void* data) return 0; } -bool browse_id3(void) +bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount) { struct gui_synclist id3_lists; - struct mp3entry* id3 = audio_current_track(); int key; unsigned int i; struct id3view_info info; info.count = 0; info.id3 = id3; + info.playlist_display_index = playlist_display_index; + info.playlist_amount = playlist_amount; bool ret = false; push_current_activity(ACTIVITY_ID3SCREEN); for (i = 0; i < ARRAYLEN(id3_headers); i++) -- cgit v1.2.3