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/menus | |
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/menus')
-rw-r--r-- | apps/menus/display_menu.c | 51 | ||||
-rw-r--r-- | apps/menus/eq_menu.c | 9 | ||||
-rw-r--r-- | apps/menus/menu_common.c | 5 | ||||
-rw-r--r-- | apps/menus/menu_common.h | 4 | ||||
-rw-r--r-- | apps/menus/playback_menu.c | 34 | ||||
-rw-r--r-- | apps/menus/recording_menu.c | 9 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 57 | ||||
-rw-r--r-- | apps/menus/sound_menu.c | 12 | ||||
-rw-r--r-- | apps/menus/theme_menu.c | 20 | ||||
-rw-r--r-- | apps/menus/time_menu.c | 9 |
10 files changed, 161 insertions, 49 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 5d53cbfe16..83bd8066d5 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -50,10 +50,12 @@ | |||
50 | #include "rbunicode.h" | 50 | #include "rbunicode.h" |
51 | 51 | ||
52 | #ifdef HAVE_BACKLIGHT | 52 | #ifdef HAVE_BACKLIGHT |
53 | static int selectivebacklight_callback(int action,const struct menu_item_ex *this_item) | 53 | static int selectivebacklight_callback(int action, |
54 | const struct menu_item_ex *this_item, | ||
55 | struct gui_synclist *this_list) | ||
54 | { | 56 | { |
55 | (void)this_item; | 57 | (void)this_item; |
56 | 58 | (void)this_list; | |
57 | switch (action) | 59 | switch (action) |
58 | { | 60 | { |
59 | case ACTION_EXIT_MENUITEM: | 61 | case ACTION_EXIT_MENUITEM: |
@@ -69,10 +71,11 @@ static int selectivebacklight_callback(int action,const struct menu_item_ex *thi | |||
69 | return action; | 71 | return action; |
70 | } | 72 | } |
71 | 73 | ||
72 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 74 | static int filterfirstkeypress_callback(int action, |
75 | const struct menu_item_ex *this_item, | ||
76 | struct gui_synclist *this_list) | ||
73 | { | 77 | { |
74 | /*(void)this_item;REMOVED*/ | 78 | /*(void)this_item;REMOVED*/ |
75 | |||
76 | switch (action) | 79 | switch (action) |
77 | { | 80 | { |
78 | case ACTION_EXIT_MENUITEM: | 81 | case ACTION_EXIT_MENUITEM: |
@@ -81,7 +84,7 @@ static int filterfirstkeypress_callback(int action,const struct menu_item_ex *th | |||
81 | set_remote_backlight_filter_keypress( | 84 | set_remote_backlight_filter_keypress( |
82 | global_settings.remote_bl_filter_first_keypress); | 85 | global_settings.remote_bl_filter_first_keypress); |
83 | #endif /* HAVE_REMOTE_LCD */ | 86 | #endif /* HAVE_REMOTE_LCD */ |
84 | selectivebacklight_callback(action,this_item);/*uses Filter First KP*/ | 87 | selectivebacklight_callback(action,this_item, this_list);/*uses Filter First KP*/ |
85 | break; | 88 | break; |
86 | } | 89 | } |
87 | 90 | ||
@@ -118,9 +121,12 @@ static int selectivebacklight_set_mask(void* param) | |||
118 | 121 | ||
119 | #endif /* HAVE_BACKLIGHT */ | 122 | #endif /* HAVE_BACKLIGHT */ |
120 | #ifdef HAVE_LCD_FLIP | 123 | #ifdef HAVE_LCD_FLIP |
121 | static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | 124 | static int flipdisplay_callback(int action, |
125 | const struct menu_item_ex *this_item | ||
126 | struct gui_synclist *this_list) | ||
122 | { | 127 | { |
123 | (void)this_item; | 128 | (void)this_item; |
129 | (void)this_list; | ||
124 | switch (action) | 130 | switch (action) |
125 | { | 131 | { |
126 | case ACTION_EXIT_MENUITEM: | 132 | case ACTION_EXIT_MENUITEM: |
@@ -265,9 +271,12 @@ MENUITEM_SETTING(remote_flip_display, | |||
265 | #endif | 271 | #endif |
266 | 272 | ||
267 | #ifdef HAVE_REMOTE_LCD_TICKING | 273 | #ifdef HAVE_REMOTE_LCD_TICKING |
268 | static int ticking_callback(int action,const struct menu_item_ex *this_item) | 274 | static int ticking_callback(int action, |
275 | const struct menu_item_ex *this_item | ||
276 | struct gui_synclist *this_list) | ||
269 | { | 277 | { |
270 | (void)this_item; | 278 | (void)this_item; |
279 | (void)this_list; | ||
271 | switch (action) | 280 | switch (action) |
272 | { | 281 | { |
273 | case ACTION_EXIT_MENUITEM: | 282 | case ACTION_EXIT_MENUITEM: |
@@ -334,9 +343,12 @@ MENUITEM_SETTING(list_accel_start_delay, | |||
334 | MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL); | 343 | MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL); |
335 | #endif /* HAVE_WHEEL_ACCELERATION */ | 344 | #endif /* HAVE_WHEEL_ACCELERATION */ |
336 | #ifdef HAVE_LCD_BITMAP | 345 | #ifdef HAVE_LCD_BITMAP |
337 | static int screenscroll_callback(int action,const struct menu_item_ex *this_item) | 346 | static int screenscroll_callback(int action, |
347 | const struct menu_item_ex *this_item, | ||
348 | struct gui_synclist *this_list) | ||
338 | { | 349 | { |
339 | (void)this_item; | 350 | (void)this_item; |
351 | (void)this_list; | ||
340 | switch (action) | 352 | switch (action) |
341 | { | 353 | { |
342 | case ACTION_EXIT_MENUITEM: | 354 | case ACTION_EXIT_MENUITEM: |
@@ -375,9 +387,12 @@ MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, Icon_NOICON, | |||
375 | /* PEAK METER MENU */ | 387 | /* PEAK METER MENU */ |
376 | 388 | ||
377 | #ifdef HAVE_LCD_BITMAP | 389 | #ifdef HAVE_LCD_BITMAP |
378 | static int peakmeter_callback(int action,const struct menu_item_ex *this_item) | 390 | static int peakmeter_callback(int action, |
391 | const struct menu_item_ex *this_item, | ||
392 | struct gui_synclist *this_list) | ||
379 | { | 393 | { |
380 | (void)this_item; | 394 | (void)this_item; |
395 | (void)this_list; | ||
381 | switch (action) | 396 | switch (action) |
382 | { | 397 | { |
383 | case ACTION_EXIT_MENUITEM: | 398 | case ACTION_EXIT_MENUITEM: |
@@ -561,9 +576,12 @@ MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON, | |||
561 | 576 | ||
562 | 577 | ||
563 | #ifdef HAVE_TOUCHSCREEN | 578 | #ifdef HAVE_TOUCHSCREEN |
564 | static int touch_mode_callback(int action,const struct menu_item_ex *this_item) | 579 | static int touch_mode_callback(int action, |
580 | const struct menu_item_ex *this_item, | ||
581 | struct gui_synclist *this_list) | ||
565 | { | 582 | { |
566 | (void)this_item; | 583 | (void)this_item; |
584 | (void)this_list; | ||
567 | switch (action) | 585 | switch (action) |
568 | { | 586 | { |
569 | case ACTION_EXIT_MENUITEM: /* on exit */ | 587 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -573,10 +591,12 @@ static int touch_mode_callback(int action,const struct menu_item_ex *this_item) | |||
573 | return action; | 591 | return action; |
574 | } | 592 | } |
575 | 593 | ||
576 | static int line_padding_callback(int action,const struct menu_item_ex *this_item) | 594 | static int line_padding_callback(int action, |
595 | const struct menu_item_ex *this_item, | ||
596 | struct gui_synclist *this_list); | ||
577 | { | 597 | { |
578 | (void)this_item; | 598 | (void)this_item; |
579 | 599 | (void)this_list; | |
580 | if (action == ACTION_EXIT_MENUITEM) | 600 | if (action == ACTION_EXIT_MENUITEM) |
581 | viewportmanager_theme_changed(THEME_LISTS); | 601 | viewportmanager_theme_changed(THEME_LISTS); |
582 | return action; | 602 | return action; |
@@ -594,11 +614,14 @@ MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, | |||
594 | &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); | 614 | &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); |
595 | #endif | 615 | #endif |
596 | 616 | ||
597 | static int codepage_callback(int action, const struct menu_item_ex *this_item) | 617 | static int codepage_callback(int action, |
618 | const struct menu_item_ex *this_item, | ||
619 | struct gui_synclist *this_list) | ||
598 | { | 620 | { |
621 | (void)this_item; | ||
622 | (void)this_list; | ||
599 | static int old_codepage; | 623 | static int old_codepage; |
600 | int new_codepage = global_settings.default_codepage; | 624 | int new_codepage = global_settings.default_codepage; |
601 | (void)this_item; | ||
602 | switch (action) | 625 | switch (action) |
603 | { | 626 | { |
604 | case ACTION_ENTER_MENUITEM: | 627 | case ACTION_ENTER_MENUITEM: |
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 7cbf7b5d90..b41e4b0981 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c | |||
@@ -81,16 +81,19 @@ static void eq_apply(void) | |||
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | static int eq_setting_callback(int action, const struct menu_item_ex *this_item) | 84 | static int eq_setting_callback(int action, |
85 | const struct menu_item_ex *this_item, | ||
86 | struct gui_synclist *this_list) | ||
85 | { | 87 | { |
88 | (void)this_list; | ||
86 | switch (action) | 89 | switch (action) |
87 | { | 90 | { |
88 | case ACTION_ENTER_MENUITEM: | 91 | case ACTION_ENTER_MENUITEM: |
89 | action = lowlatency_callback(action, this_item); | 92 | action = lowlatency_callback(action, this_item, NULL); |
90 | break; | 93 | break; |
91 | case ACTION_EXIT_MENUITEM: | 94 | case ACTION_EXIT_MENUITEM: |
92 | eq_apply(); | 95 | eq_apply(); |
93 | action = lowlatency_callback(action, this_item); | 96 | action = lowlatency_callback(action, this_item, NULL); |
94 | break; | 97 | break; |
95 | } | 98 | } |
96 | 99 | ||
diff --git a/apps/menus/menu_common.c b/apps/menus/menu_common.c index e8a2a91f12..2ef48cc23b 100644 --- a/apps/menus/menu_common.c +++ b/apps/menus/menu_common.c | |||
@@ -31,9 +31,12 @@ | |||
31 | 31 | ||
32 | #if CONFIG_CODEC == SWCODEC | 32 | #if CONFIG_CODEC == SWCODEC |
33 | /* Use this callback if your menu adjusts DSP settings. */ | 33 | /* Use this callback if your menu adjusts DSP settings. */ |
34 | int lowlatency_callback(int action, const struct menu_item_ex *this_item) | 34 | int lowlatency_callback(int action, |
35 | const struct menu_item_ex *this_item, | ||
36 | struct gui_synclist *this_list) | ||
35 | { | 37 | { |
36 | (void)this_item; | 38 | (void)this_item; |
39 | (void)this_list; | ||
37 | switch (action) | 40 | switch (action) |
38 | { | 41 | { |
39 | case ACTION_ENTER_MENUITEM: /* on entering an item */ | 42 | case ACTION_ENTER_MENUITEM: /* on entering an item */ |
diff --git a/apps/menus/menu_common.h b/apps/menus/menu_common.h index bdf02a0092..e85ed8dc61 100644 --- a/apps/menus/menu_common.h +++ b/apps/menus/menu_common.h | |||
@@ -25,7 +25,9 @@ | |||
25 | #include "config.h" | 25 | #include "config.h" |
26 | 26 | ||
27 | #if CONFIG_CODEC == SWCODEC | 27 | #if CONFIG_CODEC == SWCODEC |
28 | int lowlatency_callback(int action, const struct menu_item_ex *this_item); | 28 | int lowlatency_callback(int action, |
29 | const struct menu_item_ex *this_item, | ||
30 | struct gui_synclist *this_list); | ||
29 | #endif | 31 | #endif |
30 | 32 | ||
31 | #endif /* _MENU_COMMON_H */ | 33 | #endif /* _MENU_COMMON_H */ |
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index 23f1cb55bf..bf770c0f11 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c | |||
@@ -45,9 +45,12 @@ | |||
45 | 45 | ||
46 | 46 | ||
47 | #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) | 47 | #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) |
48 | static int setcrossfadeonexit_callback(int action,const struct menu_item_ex *this_item) | 48 | static int setcrossfadeonexit_callback(int action, |
49 | const struct menu_item_ex *this_item, | ||
50 | struct gui_synclist *this_list) | ||
49 | { | 51 | { |
50 | (void)this_item; | 52 | (void)this_item; |
53 | (void)this_list; | ||
51 | switch (action) | 54 | switch (action) |
52 | { | 55 | { |
53 | case ACTION_EXIT_MENUITEM: /* on exit */ | 56 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -61,7 +64,9 @@ static int setcrossfadeonexit_callback(int action,const struct menu_item_ex *thi | |||
61 | 64 | ||
62 | /***********************************/ | 65 | /***********************************/ |
63 | /* PLAYBACK MENU */ | 66 | /* PLAYBACK MENU */ |
64 | static int playback_callback(int action,const struct menu_item_ex *this_item); | 67 | static int playback_callback(int action, |
68 | const struct menu_item_ex *this_item, | ||
69 | struct gui_synclist *this_list); | ||
65 | 70 | ||
66 | MENUITEM_SETTING(shuffle_item, &global_settings.playlist_shuffle, playback_callback); | 71 | MENUITEM_SETTING(shuffle_item, &global_settings.playlist_shuffle, playback_callback); |
67 | MENUITEM_SETTING(repeat_mode, &global_settings.repeat_mode, playback_callback); | 72 | MENUITEM_SETTING(repeat_mode, &global_settings.repeat_mode, playback_callback); |
@@ -73,9 +78,12 @@ MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON, | |||
73 | &ff_rewind_min_step, &ff_rewind_accel); | 78 | &ff_rewind_min_step, &ff_rewind_accel); |
74 | #ifdef HAVE_DISK_STORAGE | 79 | #ifdef HAVE_DISK_STORAGE |
75 | #if CONFIG_CODEC == SWCODEC | 80 | #if CONFIG_CODEC == SWCODEC |
76 | static int buffermargin_callback(int action,const struct menu_item_ex *this_item) | 81 | static int buffermargin_callback(int action, |
82 | const struct menu_item_ex *this_item, | ||
83 | struct gui_synclist *this_list) | ||
77 | { | 84 | { |
78 | (void)this_item; | 85 | (void)this_item; |
86 | (void)this_list; | ||
79 | switch (action) | 87 | switch (action) |
80 | { | 88 | { |
81 | case ACTION_EXIT_MENUITEM: /* on exit */ | 89 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -115,9 +123,12 @@ MAKE_MENU(crossfade_settings_menu,ID2P(LANG_CROSSFADE),0, Icon_NOICON, | |||
115 | 123 | ||
116 | /* replay gain submenu */ | 124 | /* replay gain submenu */ |
117 | 125 | ||
118 | static int replaygain_callback(int action,const struct menu_item_ex *this_item) | 126 | static int replaygain_callback(int action, |
127 | const struct menu_item_ex *this_item, | ||
128 | struct gui_synclist *this_list) | ||
119 | { | 129 | { |
120 | (void)this_item; | 130 | (void)this_item; |
131 | (void)this_list; | ||
121 | switch (action) | 132 | switch (action) |
122 | { | 133 | { |
123 | case ACTION_EXIT_MENUITEM: /* on exit */ | 134 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -147,9 +158,12 @@ MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL); | |||
147 | MENUITEM_SETTING(next_folder, &global_settings.next_folder, NULL); | 158 | MENUITEM_SETTING(next_folder, &global_settings.next_folder, NULL); |
148 | MENUITEM_SETTING(constrain_next_folder, | 159 | MENUITEM_SETTING(constrain_next_folder, |
149 | &global_settings.constrain_next_folder, NULL); | 160 | &global_settings.constrain_next_folder, NULL); |
150 | static int audioscrobbler_callback(int action,const struct menu_item_ex *this_item) | 161 | static int audioscrobbler_callback(int action, |
162 | const struct menu_item_ex *this_item, | ||
163 | struct gui_synclist *this_list) | ||
151 | { | 164 | { |
152 | (void)this_item; | 165 | (void)this_item; |
166 | (void)this_list; | ||
153 | switch (action) | 167 | switch (action) |
154 | { | 168 | { |
155 | case ACTION_EXIT_MENUITEM: /* on exit */ | 169 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -165,9 +179,12 @@ static int audioscrobbler_callback(int action,const struct menu_item_ex *this_it | |||
165 | MENUITEM_SETTING(audioscrobbler, &global_settings.audioscrobbler, audioscrobbler_callback); | 179 | MENUITEM_SETTING(audioscrobbler, &global_settings.audioscrobbler, audioscrobbler_callback); |
166 | 180 | ||
167 | 181 | ||
168 | static int cuesheet_callback(int action,const struct menu_item_ex *this_item) | 182 | static int cuesheet_callback(int action, |
183 | const struct menu_item_ex *this_item, | ||
184 | struct gui_synclist *this_list) | ||
169 | { | 185 | { |
170 | (void)this_item; | 186 | (void)this_item; |
187 | (void)this_list; | ||
171 | switch (action) | 188 | switch (action) |
172 | { | 189 | { |
173 | case ACTION_EXIT_MENUITEM: /* on exit */ | 190 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -236,8 +253,11 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, | |||
236 | #endif | 253 | #endif |
237 | ); | 254 | ); |
238 | 255 | ||
239 | static int playback_callback(int action,const struct menu_item_ex *this_item) | 256 | static int playback_callback(int action, |
257 | const struct menu_item_ex *this_item, | ||
258 | struct gui_synclist *this_list) | ||
240 | { | 259 | { |
260 | (void)this_list; | ||
241 | static bool old_shuffle = false; | 261 | static bool old_shuffle = false; |
242 | static int old_repeat = 0; | 262 | static int old_repeat = 0; |
243 | switch (action) | 263 | switch (action) |
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c index 54dc415de7..21c6cff5fb 100644 --- a/apps/menus/recording_menu.c +++ b/apps/menus/recording_menu.c | |||
@@ -69,7 +69,9 @@ | |||
69 | #include "exported_menus.h" | 69 | #include "exported_menus.h" |
70 | 70 | ||
71 | static bool no_source_in_menu = false; | 71 | static bool no_source_in_menu = false; |
72 | static int recmenu_callback(int action,const struct menu_item_ex *this_item); | 72 | static int recmenu_callback(int action, |
73 | const struct menu_item_ex *this_item, | ||
74 | struct gui_synclist *this_list); | ||
73 | 75 | ||
74 | static int recsource_func(void) | 76 | static int recsource_func(void) |
75 | { | 77 | { |
@@ -313,8 +315,11 @@ MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS), | |||
313 | #endif /* CONFIG_CODEC == SWCODEC */ | 315 | #endif /* CONFIG_CODEC == SWCODEC */ |
314 | 316 | ||
315 | 317 | ||
316 | static int recmenu_callback(int action,const struct menu_item_ex *this_item) | 318 | static int recmenu_callback(int action, |
319 | const struct menu_item_ex *this_item, | ||
320 | struct gui_synclist *this_list) | ||
317 | { | 321 | { |
322 | (void)this_list; | ||
318 | switch (action) | 323 | switch (action) |
319 | { | 324 | { |
320 | case ACTION_REQUEST_MENUITEM: | 325 | case ACTION_REQUEST_MENUITEM: |
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 67595498ad..2a08ab0a4e 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -59,9 +59,11 @@ | |||
59 | 59 | ||
60 | #ifndef HAS_BUTTON_HOLD | 60 | #ifndef HAS_BUTTON_HOLD |
61 | static int selectivesoftlock_callback(int action, | 61 | static int selectivesoftlock_callback(int action, |
62 | const struct menu_item_ex *this_item) | 62 | const struct menu_item_ex *this_item, |
63 | struct gui_synclist *this_list) | ||
63 | { | 64 | { |
64 | (void)this_item; | 65 | (void)this_item; |
66 | (void)this_list; | ||
65 | 67 | ||
66 | switch (action) | 68 | switch (action) |
67 | { | 69 | { |
@@ -176,7 +178,10 @@ MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON, | |||
176 | 178 | ||
177 | /***********************************/ | 179 | /***********************************/ |
178 | /* FILE VIEW MENU */ | 180 | /* FILE VIEW MENU */ |
179 | static int fileview_callback(int action,const struct menu_item_ex *this_item); | 181 | static int fileview_callback(int action, |
182 | const struct menu_item_ex *this_item, | ||
183 | struct gui_synclist *this_list); | ||
184 | |||
180 | MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL); | 185 | MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL); |
181 | MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback); | 186 | MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback); |
182 | MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback); | 187 | MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback); |
@@ -196,8 +201,11 @@ static int clear_start_directory(void) | |||
196 | } | 201 | } |
197 | MENUITEM_FUNCTION(clear_start_directory_item, 0, ID2P(LANG_RESET_START_DIR), | 202 | MENUITEM_FUNCTION(clear_start_directory_item, 0, ID2P(LANG_RESET_START_DIR), |
198 | clear_start_directory, NULL, NULL, Icon_file_view_menu); | 203 | clear_start_directory, NULL, NULL, Icon_file_view_menu); |
199 | static int fileview_callback(int action,const struct menu_item_ex *this_item) | 204 | static int fileview_callback(int action, |
205 | const struct menu_item_ex *this_item, | ||
206 | struct gui_synclist *this_list) | ||
200 | { | 207 | { |
208 | (void)this_list; | ||
201 | static int oldval; | 209 | static int oldval; |
202 | int *variable = this_item->variable; | 210 | int *variable = this_item->variable; |
203 | switch (action) | 211 | switch (action) |
@@ -236,9 +244,12 @@ MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL); | |||
236 | MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL); | 244 | MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL); |
237 | #endif | 245 | #endif |
238 | #ifdef HAVE_USB_CHARGING_ENABLE | 246 | #ifdef HAVE_USB_CHARGING_ENABLE |
239 | static int usbcharging_callback(int action,const struct menu_item_ex *this_item) | 247 | static int usbcharging_callback(int action, |
248 | const struct menu_item_ex *this_item, | ||
249 | struct gui_synclist *this_list) | ||
240 | { | 250 | { |
241 | (void)this_item; | 251 | (void)this_item; |
252 | (void)this_list; | ||
242 | switch (action) | 253 | switch (action) |
243 | { | 254 | { |
244 | case ACTION_EXIT_MENUITEM: /* on exit */ | 255 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -265,9 +276,12 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON, | |||
265 | MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL); | 276 | MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL); |
266 | #endif | 277 | #endif |
267 | #ifdef HAVE_DIRCACHE | 278 | #ifdef HAVE_DIRCACHE |
268 | static int dircache_callback(int action,const struct menu_item_ex *this_item) | 279 | static int dircache_callback(int action, |
280 | const struct menu_item_ex *this_item, | ||
281 | struct gui_synclist *this_list) | ||
269 | { | 282 | { |
270 | (void)this_item; | 283 | (void)this_item; |
284 | (void)this_list; | ||
271 | switch (action) | 285 | switch (action) |
272 | { | 286 | { |
273 | case ACTION_EXIT_MENUITEM: /* on exit */ | 287 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -328,9 +342,12 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON, | |||
328 | 342 | ||
329 | #if CONFIG_CODEC == MAS3507D | 343 | #if CONFIG_CODEC == MAS3507D |
330 | void dac_line_in(bool enable); | 344 | void dac_line_in(bool enable); |
331 | static int linein_callback(int action,const struct menu_item_ex *this_item) | 345 | static int linein_callback(int action, |
346 | const struct menu_item_ex *this_item, | ||
347 | struct gui_synclist *this_list) | ||
332 | { | 348 | { |
333 | (void)this_item; | 349 | (void)this_item; |
350 | (void)this_list; | ||
334 | switch (action) | 351 | switch (action) |
335 | { | 352 | { |
336 | case ACTION_EXIT_MENUITEM: /* on exit */ | 353 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -545,9 +562,11 @@ static int toggle_sleeptimer(void) | |||
545 | /* Handle restarting a current sleep timer to the newly set default | 562 | /* Handle restarting a current sleep timer to the newly set default |
546 | duration */ | 563 | duration */ |
547 | static int sleeptimer_duration_cb(int action, | 564 | static int sleeptimer_duration_cb(int action, |
548 | const struct menu_item_ex *this_item) | 565 | const struct menu_item_ex *this_item, |
566 | struct gui_synclist *this_list) | ||
549 | { | 567 | { |
550 | (void)this_item; | 568 | (void)this_item; |
569 | (void)this_list; | ||
551 | static int initial_duration; | 570 | static int initial_duration; |
552 | switch (action) | 571 | switch (action) |
553 | { | 572 | { |
@@ -590,9 +609,12 @@ MAKE_MENU(startup_shutdown_menu, ID2P(LANG_STARTUP_SHUTDOWN), | |||
590 | 609 | ||
591 | /***********************************/ | 610 | /***********************************/ |
592 | /* BOOKMARK MENU */ | 611 | /* BOOKMARK MENU */ |
593 | static int bmark_callback(int action,const struct menu_item_ex *this_item) | 612 | static int bmark_callback(int action, |
613 | const struct menu_item_ex *this_item, | ||
614 | struct gui_synclist *this_list) | ||
594 | { | 615 | { |
595 | (void)this_item; | 616 | (void)this_item; |
617 | (void)this_list; | ||
596 | switch (action) | 618 | switch (action) |
597 | { | 619 | { |
598 | case ACTION_EXIT_MENUITEM: /* on exit */ | 620 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -623,9 +645,12 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0, | |||
623 | #ifdef HAVE_TAGCACHE | 645 | #ifdef HAVE_TAGCACHE |
624 | #if CONFIG_CODEC == SWCODEC | 646 | #if CONFIG_CODEC == SWCODEC |
625 | 647 | ||
626 | static int autoresume_callback(int action, const struct menu_item_ex *this_item) | 648 | static int autoresume_callback(int action, |
649 | const struct menu_item_ex *this_item, | ||
650 | struct gui_synclist *this_list) | ||
627 | { | 651 | { |
628 | (void)this_item; | 652 | (void)this_item; |
653 | (void)this_list; | ||
629 | 654 | ||
630 | if (action == ACTION_EXIT_MENUITEM /* on exit */ | 655 | if (action == ACTION_EXIT_MENUITEM /* on exit */ |
631 | && global_settings.autoresume_enable | 656 | && global_settings.autoresume_enable |
@@ -642,9 +667,11 @@ static int autoresume_callback(int action, const struct menu_item_ex *this_item) | |||
642 | } | 667 | } |
643 | 668 | ||
644 | static int autoresume_nexttrack_callback(int action, | 669 | static int autoresume_nexttrack_callback(int action, |
645 | const struct menu_item_ex *this_item) | 670 | const struct menu_item_ex *this_item, |
671 | struct gui_synclist *this_list) | ||
646 | { | 672 | { |
647 | (void)this_item; | 673 | (void)this_item; |
674 | (void)this_list; | ||
648 | static int oldval = 0; | 675 | static int oldval = 0; |
649 | switch (action) | 676 | switch (action) |
650 | { | 677 | { |
@@ -678,14 +705,20 @@ MAKE_MENU(autoresume_menu, ID2P(LANG_AUTORESUME), | |||
678 | 705 | ||
679 | /***********************************/ | 706 | /***********************************/ |
680 | /* VOICE MENU */ | 707 | /* VOICE MENU */ |
681 | static int talk_callback(int action,const struct menu_item_ex *this_item); | 708 | static int talk_callback(int action, |
709 | const struct menu_item_ex *this_item, | ||
710 | struct gui_synclist *this_list); | ||
711 | |||
682 | MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL); | 712 | MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL); |
683 | MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL); | 713 | MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL); |
684 | MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback); | 714 | MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback); |
685 | MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL); | 715 | MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL); |
686 | MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback); | 716 | MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback); |
687 | static int talk_callback(int action,const struct menu_item_ex *this_item) | 717 | static int talk_callback(int action, |
718 | const struct menu_item_ex *this_item, | ||
719 | struct gui_synclist *this_list) | ||
688 | { | 720 | { |
721 | (void)this_list; | ||
689 | static int oldval = 0; | 722 | static int oldval = 0; |
690 | switch (action) | 723 | switch (action) |
691 | { | 724 | { |
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c index fb9a7fa26e..f39d980a35 100644 --- a/apps/menus/sound_menu.c +++ b/apps/menus/sound_menu.c | |||
@@ -38,9 +38,12 @@ | |||
38 | #include "option_select.h" | 38 | #include "option_select.h" |
39 | #include "misc.h" | 39 | #include "misc.h" |
40 | 40 | ||
41 | static int volume_limit_callback(int action,const struct menu_item_ex *this_item) | 41 | static int volume_limit_callback(int action, |
42 | const struct menu_item_ex *this_item, | ||
43 | struct gui_synclist *this_list) | ||
42 | { | 44 | { |
43 | (void)this_item; | 45 | (void)this_item; |
46 | (void)this_list; | ||
44 | 47 | ||
45 | static struct int_setting volume_limit_int_setting; | 48 | static struct int_setting volume_limit_int_setting; |
46 | volume_limit_int_setting.option_callback = NULL; | 49 | volume_limit_int_setting.option_callback = NULL; |
@@ -147,8 +150,11 @@ MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL); | |||
147 | &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); | 150 | &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); |
148 | 151 | ||
149 | #ifdef HAVE_PITCHCONTROL | 152 | #ifdef HAVE_PITCHCONTROL |
150 | static int timestretch_callback(int action,const struct menu_item_ex *this_item) | 153 | static int timestretch_callback(int action, |
154 | const struct menu_item_ex *this_item, | ||
155 | struct gui_synclist *this_list) | ||
151 | { | 156 | { |
157 | (void)this_list; | ||
152 | switch (action) | 158 | switch (action) |
153 | { | 159 | { |
154 | case ACTION_EXIT_MENUITEM: /* on exit */ | 160 | case ACTION_EXIT_MENUITEM: /* on exit */ |
@@ -156,7 +162,7 @@ static int timestretch_callback(int action,const struct menu_item_ex *this_item) | |||
156 | splash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); | 162 | splash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); |
157 | break; | 163 | break; |
158 | } | 164 | } |
159 | lowlatency_callback(action, this_item); | 165 | lowlatency_callback(action, this_item, NULL); |
160 | return action; | 166 | return action; |
161 | } | 167 | } |
162 | MENUITEM_SETTING(timestretch_enabled, | 168 | MENUITEM_SETTING(timestretch_enabled, |
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index f64ded1615..10d1291daa 100644 --- a/apps/menus/theme_menu.c +++ b/apps/menus/theme_menu.c | |||
@@ -182,20 +182,29 @@ static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item | |||
182 | } | 182 | } |
183 | 183 | ||
184 | #ifdef HAVE_REMOTE_LCD | 184 | #ifdef HAVE_REMOTE_LCD |
185 | static int statusbar_callback_remote(int action,const struct menu_item_ex *this_item) | 185 | static int statusbar_callback_remote(int action, |
186 | const struct menu_item_ex *this_item, | ||
187 | struct gui_synclist *this_list) | ||
186 | { | 188 | { |
189 | (void)this_list; | ||
187 | return statusbar_callback_ex(action, this_item, SCREEN_REMOTE); | 190 | return statusbar_callback_ex(action, this_item, SCREEN_REMOTE); |
188 | } | 191 | } |
189 | #endif | 192 | #endif |
190 | static int statusbar_callback(int action,const struct menu_item_ex *this_item) | 193 | static int statusbar_callback(int action, |
194 | const struct menu_item_ex *this_item, | ||
195 | struct gui_synclist *this_list) | ||
191 | { | 196 | { |
197 | (void)this_list; | ||
192 | return statusbar_callback_ex(action, this_item, SCREEN_MAIN); | 198 | return statusbar_callback_ex(action, this_item, SCREEN_MAIN); |
193 | } | 199 | } |
194 | 200 | ||
195 | #ifdef HAVE_BUTTONBAR | 201 | #ifdef HAVE_BUTTONBAR |
196 | static int buttonbar_callback(int action, const struct menu_item_ex *this_item) | 202 | static int buttonbar_callback(int action, |
203 | const struct menu_item_ex *this_item, | ||
204 | struct gui_synclist *this_list) | ||
197 | { | 205 | { |
198 | (void)this_item; | 206 | (void)this_item; |
207 | (void)this_list; | ||
199 | switch (action) | 208 | switch (action) |
200 | { | 209 | { |
201 | case ACTION_EXIT_MENUITEM: | 210 | case ACTION_EXIT_MENUITEM: |
@@ -369,9 +378,12 @@ MENUITEM_FUNCTION(browse_rfms, MENU_FUNC_USEPARAM, | |||
369 | #endif | 378 | #endif |
370 | 379 | ||
371 | 380 | ||
372 | static int showicons_callback(int action, const struct menu_item_ex *this_item) | 381 | static int showicons_callback(int action, |
382 | const struct menu_item_ex *this_item, | ||
383 | struct gui_synclist *this_list) | ||
373 | { | 384 | { |
374 | (void)this_item; | 385 | (void)this_item; |
386 | (void)this_list; | ||
375 | static bool old_icons; | 387 | static bool old_icons; |
376 | switch (action) | 388 | switch (action) |
377 | { | 389 | { |
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index 94e19b06aa..811996ca40 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -93,9 +93,12 @@ MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU), | |||
93 | /* This need only be shown if we dont have recording, because if we do | 93 | /* This need only be shown if we dont have recording, because if we do |
94 | then always show the setting item, because there will always be at least | 94 | then always show the setting item, because there will always be at least |
95 | 2 items */ | 95 | 2 items */ |
96 | static int alarm_callback(int action,const struct menu_item_ex *this_item) | 96 | static int alarm_callback(int action, |
97 | const struct menu_item_ex *this_item, | ||
98 | struct gui_synclist *this_list) | ||
97 | { | 99 | { |
98 | (void)this_item; | 100 | (void)this_item; |
101 | (void)this_list; | ||
99 | switch (action) | 102 | switch (action) |
100 | { | 103 | { |
101 | case ACTION_REQUEST_MENUITEM: | 104 | case ACTION_REQUEST_MENUITEM: |
@@ -204,9 +207,11 @@ static void draw_timedate(struct viewport *vp, struct screen *display) | |||
204 | static struct viewport clock_vps[NB_SCREENS], menu[NB_SCREENS]; | 207 | static struct viewport clock_vps[NB_SCREENS], menu[NB_SCREENS]; |
205 | static bool menu_was_pressed; | 208 | static bool menu_was_pressed; |
206 | static int time_menu_callback(int action, | 209 | static int time_menu_callback(int action, |
207 | const struct menu_item_ex *this_item) | 210 | const struct menu_item_ex *this_item, |
211 | struct gui_synclist *this_list) | ||
208 | { | 212 | { |
209 | (void)this_item; | 213 | (void)this_item; |
214 | (void)this_list; | ||
210 | static int last_redraw = 0; | 215 | static int last_redraw = 0; |
211 | bool redraw = false; | 216 | bool redraw = false; |
212 | 217 | ||