1
0
Fork 0
forked from len0rd/rockbox

Generate A-Z menus in the tagtree

this adds a new command %byfirstletter

%byfirstletter "custom_track" "Track A to Z" "title"
^ command       ^menu name     ^menu title   ^subitem

need a better name for subitem btw..

this patch also allows us to tell when we are in the BFL menu
by checking customaction == ONPLAY_CUSTOMACTION_FIRSTLETTER
we then enable spelling of the letters in the menu
it spells Numeric too but that shouldn't matter with the upcoming voice patch

Change-Id: I59815f697a4ef84a8cb540783b620d15f6670e00
This commit is contained in:
William Wilgus 2024-09-23 03:23:36 -04:00
parent 67ad6589fb
commit 06986d27f0
4 changed files with 93 additions and 99 deletions

View file

@ -205,6 +205,7 @@ static int tree_voice_cb(int selected_item, void * data)
struct tree_context * local_tc=(struct tree_context *)data;
char *name;
int attr=0;
int customaction = ONPLAY_NO_CUSTOMACTION;
#ifdef HAVE_TAGCACHE
bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
char buf[AVERAGE_FILENAME_LENGTH*2];
@ -213,6 +214,7 @@ static int tree_voice_cb(int selected_item, void * data)
{
attr = tagtree_get_attr(local_tc);
name = tagtree_get_entry_name(local_tc, selected_item, buf, sizeof(buf));
customaction = tagtree_get_custom_action(local_tc);
}
else
#endif
@ -245,7 +247,7 @@ static int tree_voice_cb(int selected_item, void * data)
did_clip = false;
}
}
bool spell_name = false;
bool spell_name = (customaction == ONPLAY_CUSTOMACTION_FIRSTLETTER);
if(!did_clip)
{
/* say the number or spell if required or as a fallback */