summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-12-28 08:56:16 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-12-28 11:15:57 -0500
commit7dffbd84af8d4857f357ac33bd74fda3608c7ebd (patch)
treecef86518c43e92fb74658356bad1919ee868acbc /apps/screens.c
parente8b912320561c1178d45eb12cf753be62e40ee73 (diff)
downloadrockbox-7dffbd84af8d4857f357ac33bd74fda3608c7ebd.tar.gz
rockbox-7dffbd84af8d4857f357ac33bd74fda3608c7ebd.zip
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
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c14
1 files changed, 8 insertions, 6 deletions
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 @@
40#include "powermgmt.h" 40#include "powermgmt.h"
41#include "talk.h" 41#include "talk.h"
42#include "misc.h" 42#include "misc.h"
43#include "metadata.h"
44#include "screens.h" 43#include "screens.h"
45#include "debug.h" 44#include "debug.h"
46#include "led.h" 45#include "led.h"
@@ -389,6 +388,8 @@ static const int id3_headers[]=
389struct id3view_info { 388struct id3view_info {
390 struct mp3entry* id3; 389 struct mp3entry* id3;
391 int count; 390 int count;
391 int playlist_display_index;
392 int playlist_amount;
392 int info_id[ARRAYLEN(id3_headers)]; 393 int info_id[ARRAYLEN(id3_headers)];
393}; 394};
394 395
@@ -589,13 +590,13 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
589 break; 590 break;
590 case LANG_ID3_PLAYLIST: 591 case LANG_ID3_PLAYLIST:
591 snprintf(buffer, buffer_len, "%d/%d", 592 snprintf(buffer, buffer_len, "%d/%d",
592 playlist_get_display_index(), playlist_amount()); 593 info->playlist_display_index, info->playlist_amount);
593 val=buffer; 594 val=buffer;
594 if(say_it) 595 if(say_it)
595 { 596 {
596 talk_number(playlist_get_display_index(), true); 597 talk_number(info->playlist_display_index, true);
597 talk_id(VOICE_OF, true); 598 talk_id(VOICE_OF, true);
598 talk_number(playlist_amount(), true); 599 talk_number(info->playlist_amount, true);
599 } 600 }
600 break; 601 break;
601 case LANG_ID3_BITRATE: 602 case LANG_ID3_BITRATE:
@@ -669,15 +670,16 @@ static int id3_speak_item(int selected_item, void* data)
669 return 0; 670 return 0;
670} 671}
671 672
672bool browse_id3(void) 673bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount)
673{ 674{
674 struct gui_synclist id3_lists; 675 struct gui_synclist id3_lists;
675 struct mp3entry* id3 = audio_current_track();
676 int key; 676 int key;
677 unsigned int i; 677 unsigned int i;
678 struct id3view_info info; 678 struct id3view_info info;
679 info.count = 0; 679 info.count = 0;
680 info.id3 = id3; 680 info.id3 = id3;
681 info.playlist_display_index = playlist_display_index;
682 info.playlist_amount = playlist_amount;
681 bool ret = false; 683 bool ret = false;
682 push_current_activity(ACTIVITY_ID3SCREEN); 684 push_current_activity(ACTIVITY_ID3SCREEN);
683 for (i = 0; i < ARRAYLEN(id3_headers); i++) 685 for (i = 0; i < ARRAYLEN(id3_headers); i++)