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/playback_menu.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/menus/playback_menu.c')
-rw-r--r-- | apps/menus/playback_menu.c | 34 |
1 files changed, 27 insertions, 7 deletions
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) |