From c39f95465b9844f70f375f1690e0bf75c7ee7cc1 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 19 Jul 2020 13:42:04 -0400 Subject: do_menu pass internal synclist reference to callback keep running into the rigid nature of do_menu it isn't too bad when you don't need voice but once you do the fun awaits do_menu likes to talk on menu enter which is in a loop when you use do_menu I would like to move the processing to the callback TOO BAD you only get an action and the menu_item_ex struct you sent it when calling the function Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a --- apps/enc_config.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apps/enc_config.c') diff --git a/apps/enc_config.c b/apps/enc_config.c index 7741c293f0..a971343cab 100644 --- a/apps/enc_config.c +++ b/apps/enc_config.c @@ -40,9 +40,11 @@ if (fn) fn(__VA_ARGS__) static int enc_menuitem_callback(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); static int enc_menuitem_enteritem(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); static void enc_rec_settings_changed(struct encoder_config *cfg); /* this is used by all encoder menu items, MUST be initialised before the call to do_menu() */ @@ -262,9 +264,11 @@ static inline bool rec_format_ok(int rec_format) /* This is called before entering the menu with the encoder settings Its needed to make sure the settings can take effect. */ static int enc_menuitem_enteritem(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; /* this struct must be init'ed before calling do_menu() so this is safe */ struct menucallback_data *data = &menu_callback_data; if (action == ACTION_STD_OK) /* entering the item */ @@ -277,8 +281,10 @@ static int enc_menuitem_enteritem(int action, /* this is called when a encoder setting is exited It is used to update the status bar and save the setting */ static int enc_menuitem_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; struct menucallback_data *data = (struct menucallback_data*)this_item->function->param; -- cgit v1.2.3