diff options
author | William Wilgus <wilgus.william@gmail.com> | 2020-07-19 13:42:04 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2020-07-19 22:10:26 +0000 |
commit | c39f95465b9844f70f375f1690e0bf75c7ee7cc1 (patch) | |
tree | 2fda6bd805a74f41dd4303c7699eabb9e1aa4a1c /apps/enc_config.c | |
parent | 4663d94b4e4edec609b6a24581ee345f2a1bedaa (diff) | |
download | rockbox-c39f95465b9844f70f375f1690e0bf75c7ee7cc1.tar.gz rockbox-c39f95465b9844f70f375f1690e0bf75c7ee7cc1.zip |
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
Diffstat (limited to 'apps/enc_config.c')
-rw-r--r-- | apps/enc_config.c | 14 |
1 files changed, 10 insertions, 4 deletions
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 @@ | |||
40 | if (fn) fn(__VA_ARGS__) | 40 | if (fn) fn(__VA_ARGS__) |
41 | 41 | ||
42 | static int enc_menuitem_callback(int action, | 42 | static int enc_menuitem_callback(int action, |
43 | const struct menu_item_ex *this_item); | 43 | const struct menu_item_ex *this_item, |
44 | struct gui_synclist *this_list); | ||
44 | static int enc_menuitem_enteritem(int action, | 45 | static int enc_menuitem_enteritem(int action, |
45 | const struct menu_item_ex *this_item); | 46 | const struct menu_item_ex *this_item, |
47 | struct gui_synclist *this_list); | ||
46 | static void enc_rec_settings_changed(struct encoder_config *cfg); | 48 | static void enc_rec_settings_changed(struct encoder_config *cfg); |
47 | /* this is used by all encoder menu items, | 49 | /* this is used by all encoder menu items, |
48 | MUST be initialised before the call to do_menu() */ | 50 | MUST be initialised before the call to do_menu() */ |
@@ -262,9 +264,11 @@ static inline bool rec_format_ok(int rec_format) | |||
262 | /* This is called before entering the menu with the encoder settings | 264 | /* This is called before entering the menu with the encoder settings |
263 | Its needed to make sure the settings can take effect. */ | 265 | Its needed to make sure the settings can take effect. */ |
264 | static int enc_menuitem_enteritem(int action, | 266 | static int enc_menuitem_enteritem(int action, |
265 | const struct menu_item_ex *this_item) | 267 | const struct menu_item_ex *this_item, |
268 | struct gui_synclist *this_list) | ||
266 | { | 269 | { |
267 | (void)this_item; | 270 | (void)this_item; |
271 | (void)this_list; | ||
268 | /* this struct must be init'ed before calling do_menu() so this is safe */ | 272 | /* this struct must be init'ed before calling do_menu() so this is safe */ |
269 | struct menucallback_data *data = &menu_callback_data; | 273 | struct menucallback_data *data = &menu_callback_data; |
270 | if (action == ACTION_STD_OK) /* entering the item */ | 274 | if (action == ACTION_STD_OK) /* entering the item */ |
@@ -277,8 +281,10 @@ static int enc_menuitem_enteritem(int action, | |||
277 | /* this is called when a encoder setting is exited | 281 | /* this is called when a encoder setting is exited |
278 | It is used to update the status bar and save the setting */ | 282 | It is used to update the status bar and save the setting */ |
279 | static int enc_menuitem_callback(int action, | 283 | static int enc_menuitem_callback(int action, |
280 | const struct menu_item_ex *this_item) | 284 | const struct menu_item_ex *this_item, |
285 | struct gui_synclist *this_list) | ||
281 | { | 286 | { |
287 | (void)this_list; | ||
282 | struct menucallback_data *data = | 288 | struct menucallback_data *data = |
283 | (struct menucallback_data*)this_item->function->param; | 289 | (struct menucallback_data*)this_item->function->param; |
284 | 290 | ||