From 06986d27f06528c8eb9f672a8f4913d3e3e7a307 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 23 Sep 2024 03:23:36 -0400 Subject: 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 --- apps/tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index ac82b6c2df..c422100de8 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -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 */ -- cgit v1.2.3