summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-17 02:43:41 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2022-12-17 02:51:43 -0500
commitccf1aaa5bede11c95d219adbf6267426b57613d2 (patch)
treea2670a79c42b743d19631055385004706369b5d2
parent6f54bb63fc1f0da06330806321fbba50b1364907 (diff)
downloadrockbox-ccf1aaa5bede11c95d219adbf6267426b57613d2.tar.gz
rockbox-ccf1aaa5bede11c95d219adbf6267426b57613d2.zip
menus move functions with parameters to their own type
left the union with function(void) and function_w_param(param) as a few areas might still need to use both (onplay.c) there might be a few I missed yet.. Change-Id: I593a6875301923e19ba04ad1b0f3173dc9ebdf1f
-rw-r--r--apps/enc_config.c4
-rw-r--r--apps/menu.c11
-rw-r--r--apps/menu.h52
-rw-r--r--apps/menus/audiohw_eq_menu.c156
-rw-r--r--apps/menus/eq_menu.c2
-rw-r--r--apps/menus/main_menu.c8
-rw-r--r--apps/menus/playlist_menu.c2
-rw-r--r--apps/menus/radio_menu.c2
-rw-r--r--apps/menus/recording_menu.c4
-rw-r--r--apps/menus/settings_menu.c2
-rw-r--r--apps/menus/theme_menu.c28
-rw-r--r--apps/onplay.c38
-rw-r--r--apps/onplay.h2
13 files changed, 173 insertions, 138 deletions
diff --git a/apps/enc_config.c b/apps/enc_config.c
index 65ef65667a..9d83bf7b19 100644
--- a/apps/enc_config.c
+++ b/apps/enc_config.c
@@ -193,7 +193,7 @@ static bool mp3_enc_bitrate(struct menucallback_data *data)
193} /* mp3_enc_bitrate */ 193} /* mp3_enc_bitrate */
194 194
195/* mp3_enc configuration menu */ 195/* mp3_enc configuration menu */
196MENUITEM_FUNCTION(mp3_bitrate, MENU_FUNC_USEPARAM, ID2P(LANG_BITRATE), 196MENUITEM_FUNCTION_W_PARAM(mp3_bitrate, 0, ID2P(LANG_BITRATE),
197 mp3_enc_bitrate, 197 mp3_enc_bitrate,
198 &menu_callback_data, enc_menuitem_callback, Icon_NOICON); 198 &menu_callback_data, enc_menuitem_callback, Icon_NOICON);
199MAKE_MENU( mp3_enc_menu, ID2P(LANG_ENCODER_SETTINGS), 199MAKE_MENU( mp3_enc_menu, ID2P(LANG_ENCODER_SETTINGS),
@@ -286,7 +286,7 @@ static int enc_menuitem_callback(int action,
286{ 286{
287 (void)this_list; 287 (void)this_list;
288 struct menucallback_data *data = 288 struct menucallback_data *data =
289 (struct menucallback_data*)this_item->function->param; 289 (struct menucallback_data*)this_item->function_param->param;
290 290
291 if (action == ACTION_EXIT_MENUITEM) 291 if (action == ACTION_EXIT_MENUITEM)
292 { 292 {
diff --git a/apps/menu.c b/apps/menu.c
index 48eea70454..2ef8e0d839 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -644,14 +644,19 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
644 init_menu_lists(menu, &lists, 0, true, vps); 644 init_menu_lists(menu, &lists, 0, true, vps);
645 } 645 }
646 break; 646 break;
647 case MT_FUNCTION_CALL_W_PARAM:
647 case MT_FUNCTION_CALL: 648 case MT_FUNCTION_CALL:
648 { 649 {
649 int return_value; 650 int return_value;
650 if (temp->flags&MENU_FUNC_USEPARAM) 651 if (type == MT_FUNCTION_CALL_W_PARAM)
651 return_value = temp->function->function_w_param( 652 {
652 temp->function->param); 653 return_value = temp->function_param->function_w_param(
654 temp->function_param->param);
655 }
653 else 656 else
657 {
654 return_value = temp->function->function(); 658 return_value = temp->function->function();
659 }
655 if (!(menu->flags&MENU_EXITAFTERTHISMENU) || 660 if (!(menu->flags&MENU_EXITAFTERTHISMENU) ||
656 (temp->flags&MENU_EXITAFTERTHISMENU)) 661 (temp->flags&MENU_EXITAFTERTHISMENU))
657 { 662 {
diff --git a/apps/menu.h b/apps/menu.h
index e56a4a149b..acdc8e987f 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -37,12 +37,13 @@ enum menu_item_type {
37 text for the setting title, 37 text for the setting title,
38 ID2P() or "literal" for the str param */ 38 ID2P() or "literal" for the str param */
39 MT_FUNCTION_CALL, /* call a function from the menus */ 39 MT_FUNCTION_CALL, /* call a function from the menus */
40 MT_FUNCTION_CALL_W_PARAM, /* call a function from the menus */
40 MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/ 41 MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/
41 MT_RETURN_VALUE, /* returns a value associated with an item */ 42 MT_RETURN_VALUE, /* returns a value associated with an item */
42}; 43};
43#define MENU_TYPE_MASK 0xF /* MT_* type */ 44#define MENU_TYPE_MASK 0xF /* MT_* type */
44 45
45struct menu_func { 46struct menu_func_param {
46 union { 47 union {
47 int (*function_w_param)(void* param); /* intptr_t instead of void* 48 int (*function_w_param)(void* param); /* intptr_t instead of void*
48 for 64bit systems */ 49 for 64bit systems */
@@ -51,6 +52,10 @@ struct menu_func {
51 void *param; /* passed to function_w_param */ 52 void *param; /* passed to function_w_param */
52}; 53};
53 54
55struct menu_func {
56 int (*function)(void);
57};
58
54/* these next two are mutually exclusive */ 59/* these next two are mutually exclusive */
55#define MENU_HAS_DESC 0x10 60#define MENU_HAS_DESC 0x10
56#define MENU_DYNAMIC_DESC 0x20 /* the name of this menu item is set by the \ 61#define MENU_DYNAMIC_DESC 0x20 /* the name of this menu item is set by the \
@@ -75,6 +80,7 @@ struct menu_item_ex {
75 void *variable; /* used with MT_SETTING, 80 void *variable; /* used with MT_SETTING,
76 must be in the settings_list.c list */ 81 must be in the settings_list.c list */
77 const struct menu_func *function; /* MT_FUNCTION_* */ 82 const struct menu_func *function; /* MT_FUNCTION_* */
83 const struct menu_func_param *function_param; /* MT_FUNCTION_*_W_PARAM */
78 const char **strings; /* used with MT_RETURN_ID */ 84 const char **strings; /* used with MT_RETURN_ID */
79 int value; /* MT_RETURN_VALUE */ 85 int value; /* MT_RETURN_VALUE */
80 }; 86 };
@@ -185,31 +191,55 @@ int do_menu(const struct menu_item_ex *menu, int *start_selected,
185 { MT_RETURN_VALUE|MENU_DYNAMIC_DESC, { .value = val}, \ 191 { MT_RETURN_VALUE|MENU_DYNAMIC_DESC, { .value = val}, \
186 {.menu_get_name_and_icon = & name##_}}; 192 {.menu_get_name_and_icon = & name##_}};
187 193
188/* Use this to put a function call into the menu. 194/* Use this to put a function call expecting no arguments into the menu.
189 When the user selects this item the function will be run, 195 When the user selects this item the function will be run,
190 if MENU_FUNC_CHECK_RETVAL is set, the return value 196 if MENU_FUNC_CHECK_RETVAL is set, the return value
191 will be checked, returning 1 will exit do_menu(); 197 will be checked, returning 1 will exit do_menu(); */
192 if MENU_FUNC_USEPARAM is set, param will be passed to the function */ 198#define MENUITEM_FUNCTION(name, flags, str, func, reserved, \
193#define MENUITEM_FUNCTION(name, flags, str, func, param, \
194 callback, icon) \ 199 callback, icon) \
195 static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \ 200 static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \
196 static const struct menu_func name##__ = {{(void*)func}, param}; \ 201 static const struct menu_func name##__ = {(void*)func}; \
197 /* should be const, but recording_settings wont let us do that */ \ 202 /* should be const, but recording_settings wont let us do that */ \
198 const struct menu_item_ex name = \ 203 const struct menu_item_ex name = \
199 { MT_FUNCTION_CALL|MENU_HAS_DESC|flags, \ 204 { MT_FUNCTION_CALL|MENU_HAS_DESC|flags, \
200 { .function = & name##__}, {.callback_and_desc = & name##_}}; 205 { .function = & name##__}, {.callback_and_desc = & name##_}};
201 206
202/* As above, except the text is dynamic */ 207/* As above, except the text is dynamic */
203#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \ 208#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, reserved, \
204 text_callback, voice_callback, \ 209 text_callback, voice_callback, \
205 text_cb_data, callback, icon) \ 210 text_cb_data, callback, icon) \
206 static const struct menu_get_name_and_icon name##_ \ 211 static const struct menu_get_name_and_icon name##_ \
207 = {callback,text_callback,voice_callback,text_cb_data,icon}; \ 212 = {callback,text_callback,voice_callback,text_cb_data,icon}; \
208 static const struct menu_func name##__ = {{(void*)func}, param}; \ 213 static const struct menu_func name##__ = {(void*)func}; \
209 const struct menu_item_ex name = \ 214 const struct menu_item_ex name = \
210 { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \ 215 { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \
211 { .function = & name##__}, {.menu_get_name_and_icon = & name##_}}; 216 { .function = & name##__}, {.menu_get_name_and_icon = & name##_}};
212 217
218/* Use this to put a function call into the menu.
219 When the user selects this item the function will be run,
220 if MENU_FUNC_CHECK_RETVAL is set, the return value
221 will be checked, returning 1 will exit do_menu();
222 param will be passed to the function */
223#define MENUITEM_FUNCTION_W_PARAM(name, flags, str, func, param, \
224 callback, icon) \
225 static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \
226 static const struct menu_func_param name##__ = {{(void*)func}, param}; \
227 /* should be const, but recording_settings wont let us do that */ \
228 const struct menu_item_ex name = \
229 { MT_FUNCTION_CALL_W_PARAM|MENU_HAS_DESC|MENU_FUNC_USEPARAM|flags, \
230 { .function_param = & name##__}, {.callback_and_desc = & name##_}};
231
232/* As above, except the text is dynamic */
233#define MENUITEM_FUNCTION_DYNTEXT_W_PARAM(name, flags, func, param, \
234 text_callback, voice_callback, \
235 text_cb_data, callback, icon) \
236 static const struct menu_get_name_and_icon name##_ \
237 = {callback,text_callback,voice_callback,text_cb_data,icon}; \
238 static const struct menu_func_param name##__ = {{(void*)func}, param}; \
239 const struct menu_item_ex name = \
240 { MT_FUNCTION_CALL_W_PARAM|MENU_DYNAMIC_DESC|flags, \
241 { .function_param = & name##__}, {.menu_get_name_and_icon = & name##_}};
242
213/* Use this to actually create a menu. the ... argument is a list of pointers 243/* Use this to actually create a menu. the ... argument is a list of pointers
214 to any of the above macro'd variables. 244 to any of the above macro'd variables.
215 (It can also have other menus in the list.) */ 245 (It can also have other menus in the list.) */
diff --git a/apps/menus/audiohw_eq_menu.c b/apps/menus/audiohw_eq_menu.c
index 06ab32c151..8bfd2260b0 100644
--- a/apps/menus/audiohw_eq_menu.c
+++ b/apps/menus/audiohw_eq_menu.c
@@ -80,106 +80,106 @@ static int hw_eq_do_band_setting(void *param)
80 return 0; 80 return 0;
81} 81}
82 82
83MENUITEM_FUNCTION_DYNTEXT(hw_eq_band1_gain, MENU_FUNC_USEPARAM, 83MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band1_gain, 0,
84 hw_eq_do_band_setting, 84 hw_eq_do_band_setting,
85 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_GAIN), 85 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_GAIN),
86 hw_eq_get_name, hw_eq_speak_item, 86 hw_eq_get_name, hw_eq_speak_item,
87 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_GAIN), 87 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_GAIN),
88 NULL, Icon_Menu_setting); 88 NULL, Icon_Menu_setting);
89#ifdef AUDIOHW_HAVE_EQ_BAND1_FREQUENCY 89#ifdef AUDIOHW_HAVE_EQ_BAND1_FREQUENCY
90MENUITEM_FUNCTION_DYNTEXT(hw_eq_band1_frequency, MENU_FUNC_USEPARAM, 90MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band1_frequency, 0,
91 hw_eq_do_band_setting, 91 hw_eq_do_band_setting,
92 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_FREQUENCY), 92 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_FREQUENCY),
93 hw_eq_get_name, hw_eq_speak_item, 93 hw_eq_get_name, hw_eq_speak_item,
94 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_FREQUENCY), 94 HW_EQ_IDX(AUDIOHW_EQ_BAND1, AUDIOHW_EQ_FREQUENCY),
95 NULL, Icon_NOICON); 95 NULL, Icon_NOICON);
96#endif 96#endif
97#ifdef AUDIOHW_HAVE_EQ_BAND2 97#ifdef AUDIOHW_HAVE_EQ_BAND2
98MENUITEM_FUNCTION_DYNTEXT(hw_eq_band2_gain, MENU_FUNC_USEPARAM, 98MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band2_gain, 0,
99 hw_eq_do_band_setting, 99 hw_eq_do_band_setting,
100 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_GAIN), 100 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_GAIN),
101 hw_eq_get_name, hw_eq_speak_item, 101 hw_eq_get_name, hw_eq_speak_item,
102 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_GAIN), 102 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_GAIN),
103 NULL, Icon_Menu_setting); 103 NULL, Icon_Menu_setting);
104#ifdef AUDIOHW_HAVE_EQ_BAND2_FREQUENCY 104#ifdef AUDIOHW_HAVE_EQ_BAND2_FREQUENCY
105MENUITEM_FUNCTION_DYNTEXT(hw_eq_band2_frequency, MENU_FUNC_USEPARAM, 105MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band2_frequency, 0,
106 hw_eq_do_band_setting, 106 hw_eq_do_band_setting,
107 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_FREQUENCY), 107 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_FREQUENCY),
108 hw_eq_get_name, hw_eq_speak_item, 108 hw_eq_get_name, hw_eq_speak_item,
109 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_FREQUENCY), 109 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_FREQUENCY),
110 NULL, Icon_NOICON); 110 NULL, Icon_NOICON);
111#endif 111#endif
112#ifdef AUDIOHW_HAVE_EQ_BAND2_WIDTH 112#ifdef AUDIOHW_HAVE_EQ_BAND2_WIDTH
113MENUITEM_FUNCTION_DYNTEXT(hw_eq_band2_width, MENU_FUNC_USEPARAM, 113MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band2_width, 0,
114 hw_eq_do_band_setting, 114 hw_eq_do_band_setting,
115 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_WIDTH), 115 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_WIDTH),
116 hw_eq_get_name, hw_eq_speak_item, 116 hw_eq_get_name, hw_eq_speak_item,
117 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_WIDTH), 117 HW_EQ_IDX(AUDIOHW_EQ_BAND2, AUDIOHW_EQ_WIDTH),
118 NULL, Icon_NOICON); 118 NULL, Icon_NOICON);
119#endif 119#endif
120#endif /* AUDIOHW_HAVE_EQ_BAND2 */ 120#endif /* AUDIOHW_HAVE_EQ_BAND2 */
121#ifdef AUDIOHW_HAVE_EQ_BAND3 121#ifdef AUDIOHW_HAVE_EQ_BAND3
122MENUITEM_FUNCTION_DYNTEXT(hw_eq_band3_gain, MENU_FUNC_USEPARAM, 122MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band3_gain, 0,
123 hw_eq_do_band_setting, 123 hw_eq_do_band_setting,
124 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_GAIN), 124 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_GAIN),
125 hw_eq_get_name, hw_eq_speak_item, 125 hw_eq_get_name, hw_eq_speak_item,
126 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_GAIN), 126 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_GAIN),
127 NULL, Icon_Menu_setting); 127 NULL, Icon_Menu_setting);
128#ifdef AUDIOHW_HAVE_EQ_BAND3_FREQUENCY 128#ifdef AUDIOHW_HAVE_EQ_BAND3_FREQUENCY
129MENUITEM_FUNCTION_DYNTEXT(hw_eq_band3_frequency, MENU_FUNC_USEPARAM, 129MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band3_frequency, 0,
130 hw_eq_do_band_setting, 130 hw_eq_do_band_setting,
131 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_FREQUENCY), 131 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_FREQUENCY),
132 hw_eq_get_name, hw_eq_speak_item, 132 hw_eq_get_name, hw_eq_speak_item,
133 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_FREQUENCY), 133 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_FREQUENCY),
134 NULL, Icon_NOICON); 134 NULL, Icon_NOICON);
135#endif 135#endif
136#ifdef AUDIOHW_HAVE_EQ_BAND3_WIDTH 136#ifdef AUDIOHW_HAVE_EQ_BAND3_WIDTH
137MENUITEM_FUNCTION_DYNTEXT(hw_eq_band3_width, MENU_FUNC_USEPARAM, 137MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band3_width, 0,
138 hw_eq_do_band_setting, 138 hw_eq_do_band_setting,
139 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_WIDTH), 139 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_WIDTH),
140 hw_eq_get_name, hw_eq_speak_item, 140 hw_eq_get_name, hw_eq_speak_item,
141 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_WIDTH), 141 HW_EQ_IDX(AUDIOHW_EQ_BAND3, AUDIOHW_EQ_WIDTH),
142 NULL, Icon_NOICON); 142 NULL, Icon_NOICON);
143#endif 143#endif
144#endif /* AUDIOHW_HAVE_EQ_BAND3 */ 144#endif /* AUDIOHW_HAVE_EQ_BAND3 */
145#ifdef AUDIOHW_HAVE_EQ_BAND4 145#ifdef AUDIOHW_HAVE_EQ_BAND4
146MENUITEM_FUNCTION_DYNTEXT(hw_eq_band4_gain, MENU_FUNC_USEPARAM, 146MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band4_gain, 0,
147 hw_eq_do_band_setting, 147 hw_eq_do_band_setting,
148 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_GAIN), 148 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_GAIN),
149 hw_eq_get_name, hw_eq_speak_item, 149 hw_eq_get_name, hw_eq_speak_item,
150 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_GAIN), 150 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_GAIN),
151 NULL, Icon_Menu_setting); 151 NULL, Icon_Menu_setting);
152#ifdef AUDIOHW_HAVE_EQ_BAND4_FREQUENCY 152#ifdef AUDIOHW_HAVE_EQ_BAND4_FREQUENCY
153MENUITEM_FUNCTION_DYNTEXT(hw_eq_band4_frequency, MENU_FUNC_USEPARAM, 153MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band4_frequency, 0,
154 hw_eq_do_band_setting, 154 hw_eq_do_band_setting,
155 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_FREQUENCY), 155 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_FREQUENCY),
156 hw_eq_get_name, hw_eq_speak_item, 156 hw_eq_get_name, hw_eq_speak_item,
157 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_FREQUENCY), 157 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_FREQUENCY),
158 NULL, Icon_NOICON); 158 NULL, Icon_NOICON);
159#endif 159#endif
160#ifdef AUDIOHW_HAVE_EQ_BAND4_WIDTH 160#ifdef AUDIOHW_HAVE_EQ_BAND4_WIDTH
161MENUITEM_FUNCTION_DYNTEXT(hw_eq_band4_width, MENU_FUNC_USEPARAM, 161MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band4_width, 0,
162 hw_eq_do_band_setting, 162 hw_eq_do_band_setting,
163 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_WIDTH), 163 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_WIDTH),
164 hw_eq_get_name, hw_eq_speak_item, 164 hw_eq_get_name, hw_eq_speak_item,
165 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_WIDTH), 165 HW_EQ_IDX(AUDIOHW_EQ_BAND4, AUDIOHW_EQ_WIDTH),
166 NULL, Icon_NOICON); 166 NULL, Icon_NOICON);
167#endif 167#endif
168#endif /* AUDIOHW_HAVE_EQ_BAND4 */ 168#endif /* AUDIOHW_HAVE_EQ_BAND4 */
169#ifdef AUDIOHW_HAVE_EQ_BAND5 169#ifdef AUDIOHW_HAVE_EQ_BAND5
170MENUITEM_FUNCTION_DYNTEXT(hw_eq_band5_gain, MENU_FUNC_USEPARAM, 170MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band5_gain, 0,
171 hw_eq_do_band_setting, 171 hw_eq_do_band_setting,
172 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_GAIN), 172 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_GAIN),
173 hw_eq_get_name, hw_eq_speak_item, 173 hw_eq_get_name, hw_eq_speak_item,
174 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_GAIN), 174 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_GAIN),
175 NULL, Icon_Menu_setting); 175 NULL, Icon_Menu_setting);
176#ifdef AUDIOHW_HAVE_EQ_BAND5_FREQUENCY 176#ifdef AUDIOHW_HAVE_EQ_BAND5_FREQUENCY
177MENUITEM_FUNCTION_DYNTEXT(hw_eq_band5_frequency, MENU_FUNC_USEPARAM, 177MENUITEM_FUNCTION_DYNTEXT_W_PARAM(hw_eq_band5_frequency, 0,
178 hw_eq_do_band_setting, 178 hw_eq_do_band_setting,
179 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_FREQUENCY), 179 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_FREQUENCY),
180 hw_eq_get_name, hw_eq_speak_item, 180 hw_eq_get_name, hw_eq_speak_item,
181 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_FREQUENCY), 181 HW_EQ_IDX(AUDIOHW_EQ_BAND5, AUDIOHW_EQ_FREQUENCY),
182 NULL, Icon_NOICON); 182 NULL, Icon_NOICON);
183#endif 183#endif
184#endif /* AUDIOHW_HAVE_EQ_BAND5 */ 184#endif /* AUDIOHW_HAVE_EQ_BAND5 */
185 185
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index c25d19e352..b2baf8871d 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -787,7 +787,7 @@ MENUITEM_FUNCTION(eq_graphical, 0, ID2P(LANG_EQUALIZER_GRAPHICAL),
787 Icon_EQ); 787 Icon_EQ);
788MENUITEM_FUNCTION(eq_save, 0, ID2P(LANG_EQUALIZER_SAVE), 788MENUITEM_FUNCTION(eq_save, 0, ID2P(LANG_EQUALIZER_SAVE),
789 eq_save_preset, NULL, NULL, Icon_NOICON); 789 eq_save_preset, NULL, NULL, Icon_NOICON);
790MENUITEM_FUNCTION(eq_browse, MENU_FUNC_USEPARAM, ID2P(LANG_EQUALIZER_BROWSE), 790MENUITEM_FUNCTION_W_PARAM(eq_browse, 0, ID2P(LANG_EQUALIZER_BROWSE),
791 browse_folder, (void*)&eqs, lowlatency_callback, 791 browse_folder, (void*)&eqs, lowlatency_callback,
792 Icon_NOICON); 792 Icon_NOICON);
793 793
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 03873faac9..ce174e1d90 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -90,13 +90,13 @@ static int write_settings_file(void* param)
90 return settings_save_config((intptr_t)param); 90 return settings_save_config((intptr_t)param);
91} 91}
92 92
93MENUITEM_FUNCTION(browse_configs, MENU_FUNC_USEPARAM, ID2P(LANG_CUSTOM_CFG), 93MENUITEM_FUNCTION_W_PARAM(browse_configs, 0, ID2P(LANG_CUSTOM_CFG),
94 browse_folder, (void*)&config, NULL, Icon_NOICON); 94 browse_folder, (void*)&config, NULL, Icon_NOICON);
95MENUITEM_FUNCTION(save_settings_item, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_SETTINGS), 95MENUITEM_FUNCTION_W_PARAM(save_settings_item, 0, ID2P(LANG_SAVE_SETTINGS),
96 write_settings_file, (void*)SETTINGS_SAVE_ALL, NULL, Icon_NOICON); 96 write_settings_file, (void*)SETTINGS_SAVE_ALL, NULL, Icon_NOICON);
97MENUITEM_FUNCTION(save_theme_item, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_THEME), 97MENUITEM_FUNCTION_W_PARAM(save_theme_item, 0, ID2P(LANG_SAVE_THEME),
98 write_settings_file, (void*)SETTINGS_SAVE_THEME, NULL, Icon_NOICON); 98 write_settings_file, (void*)SETTINGS_SAVE_THEME, NULL, Icon_NOICON);
99MENUITEM_FUNCTION(save_sound_item, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_SOUND), 99MENUITEM_FUNCTION_W_PARAM(save_sound_item, 0, ID2P(LANG_SAVE_SOUND),
100 write_settings_file, (void*)SETTINGS_SAVE_SOUND, NULL, Icon_NOICON); 100 write_settings_file, (void*)SETTINGS_SAVE_SOUND, NULL, Icon_NOICON);
101MENUITEM_FUNCTION(reset_settings_item, 0, ID2P(LANG_RESET), 101MENUITEM_FUNCTION(reset_settings_item, 0, ID2P(LANG_RESET),
102 reset_settings, NULL, NULL, Icon_NOICON); 102 reset_settings, NULL, NULL, Icon_NOICON);
diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c
index 981ec74798..fe19aa8d59 100644
--- a/apps/menus/playlist_menu.c
+++ b/apps/menus/playlist_menu.c
@@ -147,7 +147,7 @@ MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST),
147MENUITEM_FUNCTION(view_cur_playlist, 0, 147MENUITEM_FUNCTION(view_cur_playlist, 0,
148 ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), 148 ID2P(LANG_VIEW_DYNAMIC_PLAYLIST),
149 playlist_view_, NULL, NULL, Icon_NOICON); 149 playlist_view_, NULL, NULL, Icon_NOICON);
150MENUITEM_FUNCTION(save_playlist, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), 150MENUITEM_FUNCTION_W_PARAM(save_playlist, 0, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST),
151 save_playlist_screen, NULL, NULL, Icon_NOICON); 151 save_playlist_screen, NULL, NULL, Icon_NOICON);
152MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL); 152MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL);
153static int clear_catalog_directory(void) 153static int clear_catalog_directory(void)
diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c
index 682cecf2b4..b0bdb98569 100644
--- a/apps/menus/radio_menu.c
+++ b/apps/menus/radio_menu.c
@@ -126,7 +126,7 @@ MENUITEM_FUNCTION_DYNTEXT(radio_mode_item, 0,
126 NULL, NULL, Icon_NOICON); 126 NULL, NULL, Icon_NOICON);
127#endif 127#endif
128 128
129MENUITEM_FUNCTION(scan_presets_item, MENU_FUNC_USEPARAM, 129MENUITEM_FUNCTION_W_PARAM(scan_presets_item, 0,
130 ID2P(LANG_FM_SCAN_PRESETS), 130 ID2P(LANG_FM_SCAN_PRESETS),
131 presets_scan, NULL, NULL, Icon_NOICON); 131 presets_scan, NULL, NULL, Icon_NOICON);
132 132
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index c9ff975269..fc450c7921 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -575,7 +575,7 @@ MENUITEM_FUNCTION(rectrigger_item, 0, ID2P(LANG_RECORD_TRIGGER),
575 rectrigger, NULL, NULL, Icon_Menu_setting); 575 rectrigger, NULL, NULL, Icon_Menu_setting);
576 576
577static struct browse_folder_info rec_config_browse = {RECPRESETS_DIR, SHOW_CFG}; 577static struct browse_folder_info rec_config_browse = {RECPRESETS_DIR, SHOW_CFG};
578MENUITEM_FUNCTION(browse_recconfigs, MENU_FUNC_USEPARAM, ID2P(LANG_CUSTOM_CFG), 578MENUITEM_FUNCTION_W_PARAM(browse_recconfigs, 0, ID2P(LANG_CUSTOM_CFG),
579 browse_folder, (void*)&rec_config_browse, NULL, Icon_Config); 579 browse_folder, (void*)&rec_config_browse, NULL, Icon_Config);
580static int write_settings_file(void) 580static int write_settings_file(void)
581{ 581{
@@ -614,5 +614,5 @@ int recording_menu(bool no_source)
614 return retval; 614 return retval;
615}; 615};
616 616
617MENUITEM_FUNCTION(recording_settings, MENU_FUNC_USEPARAM, ID2P(LANG_RECORDING_SETTINGS), 617MENUITEM_FUNCTION_W_PARAM(recording_settings, 0, ID2P(LANG_RECORDING_SETTINGS),
618 recording_menu, 0, NULL, Icon_Recording); 618 recording_menu, 0, NULL, Icon_Recording);
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 460909318a..0b7e55d95b 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -784,7 +784,7 @@ MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON,
784 784
785static struct browse_folder_info langs = { LANG_DIR, SHOW_LNG }; 785static struct browse_folder_info langs = { LANG_DIR, SHOW_LNG };
786 786
787MENUITEM_FUNCTION(browse_langs, MENU_FUNC_USEPARAM, ID2P(LANG_LANGUAGE), 787MENUITEM_FUNCTION_W_PARAM(browse_langs, 0, ID2P(LANG_LANGUAGE),
788 browse_folder, (void*)&langs, NULL, Icon_Language); 788 browse_folder, (void*)&langs, NULL, Icon_Language);
789 789
790MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, 790MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c
index 9c7a174f7f..de81169c66 100644
--- a/apps/menus/theme_menu.c
+++ b/apps/menus/theme_menu.c
@@ -129,17 +129,17 @@ static int reset_color(void)
129 settings_apply_skins(); 129 settings_apply_skins();
130 return 0; 130 return 0;
131} 131}
132MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR), 132MENUITEM_FUNCTION_W_PARAM(set_bg_col, 0, ID2P(LANG_BACKGROUND_COLOR),
133 set_color_func, (void*)COLOR_BG, NULL, Icon_NOICON); 133 set_color_func, (void*)COLOR_BG, NULL, Icon_NOICON);
134MENUITEM_FUNCTION(set_fg_col, MENU_FUNC_USEPARAM, ID2P(LANG_FOREGROUND_COLOR), 134MENUITEM_FUNCTION_W_PARAM(set_fg_col, 0, ID2P(LANG_FOREGROUND_COLOR),
135 set_color_func, (void*)COLOR_FG, NULL, Icon_NOICON); 135 set_color_func, (void*)COLOR_FG, NULL, Icon_NOICON);
136MENUITEM_FUNCTION(set_lss_col, MENU_FUNC_USEPARAM, ID2P(LANG_SELECTOR_START_COLOR), 136MENUITEM_FUNCTION_W_PARAM(set_lss_col, 0, ID2P(LANG_SELECTOR_START_COLOR),
137 set_color_func, (void*)COLOR_LSS, NULL, Icon_NOICON); 137 set_color_func, (void*)COLOR_LSS, NULL, Icon_NOICON);
138MENUITEM_FUNCTION(set_lse_col, MENU_FUNC_USEPARAM, ID2P(LANG_SELECTOR_END_COLOR), 138MENUITEM_FUNCTION_W_PARAM(set_lse_col, 0, ID2P(LANG_SELECTOR_END_COLOR),
139 set_color_func, (void*)COLOR_LSE, NULL, Icon_NOICON); 139 set_color_func, (void*)COLOR_LSE, NULL, Icon_NOICON);
140MENUITEM_FUNCTION(set_lst_col, MENU_FUNC_USEPARAM, ID2P(LANG_SELECTOR_TEXT_COLOR), 140MENUITEM_FUNCTION_W_PARAM(set_lst_col, 0, ID2P(LANG_SELECTOR_TEXT_COLOR),
141 set_color_func, (void*)COLOR_LST, NULL, Icon_NOICON); 141 set_color_func, (void*)COLOR_LST, NULL, Icon_NOICON);
142MENUITEM_FUNCTION(set_sep_col, MENU_FUNC_USEPARAM, ID2P(LANG_LIST_SEPARATOR_COLOR), 142MENUITEM_FUNCTION_W_PARAM(set_sep_col, 0, ID2P(LANG_LIST_SEPARATOR_COLOR),
143 set_color_func, (void*)COLOR_SEP, NULL, Icon_NOICON); 143 set_color_func, (void*)COLOR_SEP, NULL, Icon_NOICON);
144MENUITEM_FUNCTION(reset_colors, 0, ID2P(LANG_RESET_COLORS), 144MENUITEM_FUNCTION(reset_colors, 0, ID2P(LANG_RESET_COLORS),
145 reset_color, NULL, NULL, Icon_NOICON); 145 reset_color, NULL, NULL, Icon_NOICON);
@@ -323,30 +323,30 @@ int browse_folder(void *param)
323 return rockbox_browse(&browse); 323 return rockbox_browse(&browse);
324} 324}
325 325
326MENUITEM_FUNCTION(browse_fonts, MENU_FUNC_USEPARAM, 326MENUITEM_FUNCTION_W_PARAM(browse_fonts, 0,
327 ID2P(LANG_CUSTOM_FONT), 327 ID2P(LANG_CUSTOM_FONT),
328 browse_folder, (void*)&fonts, NULL, Icon_Font); 328 browse_folder, (void*)&fonts, NULL, Icon_Font);
329 329
330MENUITEM_FUNCTION(browse_sbs, MENU_FUNC_USEPARAM, 330MENUITEM_FUNCTION_W_PARAM(browse_sbs, 0,
331 ID2P(LANG_BASE_SKIN), 331 ID2P(LANG_BASE_SKIN),
332 browse_folder, (void*)&sbs, NULL, Icon_Wps); 332 browse_folder, (void*)&sbs, NULL, Icon_Wps);
333#if CONFIG_TUNER 333#if CONFIG_TUNER
334MENUITEM_FUNCTION(browse_fms, MENU_FUNC_USEPARAM, 334MENUITEM_FUNCTION_W_PARAM(browse_fms, 0,
335 ID2P(LANG_RADIOSCREEN), 335 ID2P(LANG_RADIOSCREEN),
336 browse_folder, (void*)&fms, NULL, Icon_Wps); 336 browse_folder, (void*)&fms, NULL, Icon_Wps);
337#endif 337#endif
338MENUITEM_FUNCTION(browse_wps, MENU_FUNC_USEPARAM, 338MENUITEM_FUNCTION_W_PARAM(browse_wps, 0,
339 ID2P(LANG_WHILE_PLAYING), 339 ID2P(LANG_WHILE_PLAYING),
340 browse_folder, (void*)&wps, NULL, Icon_Wps); 340 browse_folder, (void*)&wps, NULL, Icon_Wps);
341#ifdef HAVE_REMOTE_LCD 341#ifdef HAVE_REMOTE_LCD
342MENUITEM_FUNCTION(browse_rwps, MENU_FUNC_USEPARAM, 342MENUITEM_FUNCTION_W_PARAM(browse_rwps, 0,
343 ID2P(LANG_REMOTE_WHILE_PLAYING), 343 ID2P(LANG_REMOTE_WHILE_PLAYING),
344 browse_folder, (void*)&rwps, NULL, Icon_Wps); 344 browse_folder, (void*)&rwps, NULL, Icon_Wps);
345MENUITEM_FUNCTION(browse_rsbs, MENU_FUNC_USEPARAM, 345MENUITEM_FUNCTION_W_PARAM(browse_rsbs, 0,
346 ID2P(LANG_REMOTE_BASE_SKIN), 346 ID2P(LANG_REMOTE_BASE_SKIN),
347 browse_folder, (void*)&rsbs, NULL, Icon_Wps); 347 browse_folder, (void*)&rsbs, NULL, Icon_Wps);
348#if CONFIG_TUNER 348#if CONFIG_TUNER
349MENUITEM_FUNCTION(browse_rfms, MENU_FUNC_USEPARAM, 349MENUITEM_FUNCTION_W_PARAM(browse_rfms, 0,
350 ID2P(LANG_REMOTE_RADIOSCREEN), 350 ID2P(LANG_REMOTE_RADIOSCREEN),
351 browse_folder, (void*)&rfms, NULL, Icon_Wps); 351 browse_folder, (void*)&rfms, NULL, Icon_Wps);
352#endif 352#endif
@@ -373,7 +373,7 @@ static int showicons_callback(int action,
373} 373}
374 374
375MENUITEM_SETTING(show_icons, &global_settings.show_icons, showicons_callback); 375MENUITEM_SETTING(show_icons, &global_settings.show_icons, showicons_callback);
376MENUITEM_FUNCTION(browse_themes, MENU_FUNC_USEPARAM, 376MENUITEM_FUNCTION_W_PARAM(browse_themes, 0,
377 ID2P(LANG_CUSTOM_THEME), 377 ID2P(LANG_CUSTOM_THEME),
378 browse_folder, (void*)&themes, NULL, Icon_Config); 378 browse_folder, (void*)&themes, NULL, Icon_Config);
379MENUITEM_SETTING(cursor_style, &global_settings.cursor_style, NULL); 379MENUITEM_SETTING(cursor_style, &global_settings.cursor_style, NULL);
diff --git a/apps/onplay.c b/apps/onplay.c
index f89c3c9474..9976e5f085 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -626,35 +626,35 @@ static int treeplaylist_callback(int action,
626 struct gui_synclist *this_list); 626 struct gui_synclist *this_list);
627 627
628/* insert items */ 628/* insert items */
629MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), 629MENUITEM_FUNCTION_W_PARAM(i_pl_item, 0, ID2P(LANG_INSERT),
630 add_to_playlist, &addtopl_insert, 630 add_to_playlist, &addtopl_insert,
631 treeplaylist_callback, Icon_Playlist); 631 treeplaylist_callback, Icon_Playlist);
632MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), 632MENUITEM_FUNCTION_W_PARAM(i_first_pl_item, 0, ID2P(LANG_INSERT_FIRST),
633 add_to_playlist, &addtopl_insert_first, 633 add_to_playlist, &addtopl_insert_first,
634 treeplaylist_callback, Icon_Playlist); 634 treeplaylist_callback, Icon_Playlist);
635MENUITEM_FUNCTION(i_last_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_LAST), 635MENUITEM_FUNCTION_W_PARAM(i_last_pl_item, 0, ID2P(LANG_INSERT_LAST),
636 add_to_playlist, &addtopl_insert_last, 636 add_to_playlist, &addtopl_insert_last,
637 treeplaylist_callback, Icon_Playlist); 637 treeplaylist_callback, Icon_Playlist);
638MENUITEM_FUNCTION(i_shuf_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_SHUFFLED), 638MENUITEM_FUNCTION_W_PARAM(i_shuf_pl_item, 0, ID2P(LANG_INSERT_SHUFFLED),
639 add_to_playlist, &addtopl_insert_shuf, 639 add_to_playlist, &addtopl_insert_shuf,
640 treeplaylist_callback, Icon_Playlist); 640 treeplaylist_callback, Icon_Playlist);
641MENUITEM_FUNCTION(i_last_shuf_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_LAST_SHUFFLED), 641MENUITEM_FUNCTION_W_PARAM(i_last_shuf_pl_item, 0, ID2P(LANG_INSERT_LAST_SHUFFLED),
642 add_to_playlist, &addtopl_insert_last_shuf, 642 add_to_playlist, &addtopl_insert_last_shuf,
643 treeplaylist_callback, Icon_Playlist); 643 treeplaylist_callback, Icon_Playlist);
644/* queue items */ 644/* queue items */
645MENUITEM_FUNCTION(q_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_QUEUE), 645MENUITEM_FUNCTION_W_PARAM(q_pl_item, 0, ID2P(LANG_QUEUE),
646 add_to_playlist, &addtopl_queue, 646 add_to_playlist, &addtopl_queue,
647 treeplaylist_callback, Icon_Playlist); 647 treeplaylist_callback, Icon_Playlist);
648MENUITEM_FUNCTION(q_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_QUEUE_FIRST), 648MENUITEM_FUNCTION_W_PARAM(q_first_pl_item, 0, ID2P(LANG_QUEUE_FIRST),
649 add_to_playlist, &addtopl_queue_first, 649 add_to_playlist, &addtopl_queue_first,
650 treeplaylist_callback, Icon_Playlist); 650 treeplaylist_callback, Icon_Playlist);
651MENUITEM_FUNCTION(q_last_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_QUEUE_LAST), 651MENUITEM_FUNCTION_W_PARAM(q_last_pl_item, 0, ID2P(LANG_QUEUE_LAST),
652 add_to_playlist, &addtopl_queue_last, 652 add_to_playlist, &addtopl_queue_last,
653 treeplaylist_callback, Icon_Playlist); 653 treeplaylist_callback, Icon_Playlist);
654MENUITEM_FUNCTION(q_shuf_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_QUEUE_SHUFFLED), 654MENUITEM_FUNCTION_W_PARAM(q_shuf_pl_item, 0, ID2P(LANG_QUEUE_SHUFFLED),
655 add_to_playlist, &addtopl_queue_shuf, 655 add_to_playlist, &addtopl_queue_shuf,
656 treeplaylist_callback, Icon_Playlist); 656 treeplaylist_callback, Icon_Playlist);
657MENUITEM_FUNCTION(q_last_shuf_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_QUEUE_LAST_SHUFFLED), 657MENUITEM_FUNCTION_W_PARAM(q_last_shuf_pl_item, 0, ID2P(LANG_QUEUE_LAST_SHUFFLED),
658 add_to_playlist, &addtopl_queue_last_shuf, 658 add_to_playlist, &addtopl_queue_last_shuf,
659 treeplaylist_callback, Icon_Playlist); 659 treeplaylist_callback, Icon_Playlist);
660 660
@@ -668,11 +668,11 @@ MAKE_ONPLAYMENU(queue_menu, ID2P(LANG_QUEUE_MENU),
668 &q_last_shuf_pl_item); 668 &q_last_shuf_pl_item);
669 669
670/* replace playlist */ 670/* replace playlist */
671MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_PLAY), 671MENUITEM_FUNCTION_W_PARAM(replace_pl_item, 0, ID2P(LANG_PLAY),
672 add_to_playlist, &addtopl_replace, 672 add_to_playlist, &addtopl_replace,
673 treeplaylist_callback, Icon_Playlist); 673 treeplaylist_callback, Icon_Playlist);
674 674
675MENUITEM_FUNCTION(replace_shuf_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_PLAY_SHUFFLED), 675MENUITEM_FUNCTION_W_PARAM(replace_shuf_pl_item, 0, ID2P(LANG_PLAY_SHUFFLED),
676 add_to_playlist, &addtopl_replace_shuffled, 676 add_to_playlist, &addtopl_replace_shuffled,
677 treeplaylist_callback, Icon_Playlist); 677 treeplaylist_callback, Icon_Playlist);
678 678
@@ -726,10 +726,10 @@ static int treeplaylist_callback(int action,
726 if (!(audio_status() & AUDIO_STATUS_PLAY)) 726 if (!(audio_status() & AUDIO_STATUS_PLAY))
727 return ACTION_EXIT_MENUITEM; 727 return ACTION_EXIT_MENUITEM;
728 } 728 }
729 else if ((this_item->flags & MENU_TYPE_MASK) == MT_FUNCTION_CALL && 729 else if ((this_item->flags & MENU_TYPE_MASK) == MT_FUNCTION_CALL_W_PARAM &&
730 this_item->function->function_w_param == add_to_playlist) 730 this_item->function_param->function_w_param == add_to_playlist)
731 { 731 {
732 struct add_to_pl_param *param = this_item->function->param; 732 struct add_to_pl_param *param = this_item->function_param->param;
733 733
734 if (param->queue) 734 if (param->queue)
735 { 735 {
@@ -1580,14 +1580,14 @@ static bool onplay_load_plugin(void *param)
1580 1580
1581MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH), 1581MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH),
1582 list_viewers, NULL, clipboard_callback, Icon_NOICON); 1582 list_viewers, NULL, clipboard_callback, Icon_NOICON);
1583MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), 1583MENUITEM_FUNCTION_W_PARAM(properties_item, 0, ID2P(LANG_PROPERTIES),
1584 onplay_load_plugin, (void *)"properties", 1584 onplay_load_plugin, (void *)"properties",
1585 clipboard_callback, Icon_NOICON); 1585 clipboard_callback, Icon_NOICON);
1586MENUITEM_FUNCTION(track_info_item, MENU_FUNC_USEPARAM, ID2P(LANG_MENU_SHOW_ID3_INFO), 1586MENUITEM_FUNCTION_W_PARAM(track_info_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO),
1587 onplay_load_plugin, (void *)"properties", 1587 onplay_load_plugin, (void *)"properties",
1588 clipboard_callback, Icon_NOICON); 1588 clipboard_callback, Icon_NOICON);
1589#ifdef HAVE_TAGCACHE 1589#ifdef HAVE_TAGCACHE
1590MENUITEM_FUNCTION(pictureflow_item, MENU_FUNC_USEPARAM, ID2P(LANG_ONPLAY_PICTUREFLOW), 1590MENUITEM_FUNCTION_W_PARAM(pictureflow_item, 0, ID2P(LANG_ONPLAY_PICTUREFLOW),
1591 onplay_load_plugin, (void *)"pictureflow", 1591 onplay_load_plugin, (void *)"pictureflow",
1592 clipboard_callback, Icon_NOICON); 1592 clipboard_callback, Icon_NOICON);
1593#endif 1593#endif
@@ -1938,7 +1938,7 @@ static int execute_hotkey(bool is_wps)
1938 const struct hotkey_assignment *this_item = get_hotkey(action); 1938 const struct hotkey_assignment *this_item = get_hotkey(action);
1939 1939
1940 /* run the associated function (with optional param), if any */ 1940 /* run the associated function (with optional param), if any */
1941 const struct menu_func func = this_item->func; 1941 const struct menu_func_param func = this_item->func;
1942 1942
1943 int func_return = ONPLAY_RELOAD_DIR; 1943 int func_return = ONPLAY_RELOAD_DIR;
1944 if (func.function != NULL) 1944 if (func.function != NULL)
diff --git a/apps/onplay.h b/apps/onplay.h
index 98d93b368c..807bfe8cf7 100644
--- a/apps/onplay.h
+++ b/apps/onplay.h
@@ -66,7 +66,7 @@ enum hotkey_flags {
66struct hotkey_assignment { 66struct hotkey_assignment {
67 int action; /* hotkey_action */ 67 int action; /* hotkey_action */
68 int lang_id; /* Language ID */ 68 int lang_id; /* Language ID */
69 struct menu_func func; /* Function to run if this entry is selected */ 69 struct menu_func_param func; /* Function to run if this entry is selected */
70 int16_t return_code; /* What to return after the function is run. */ 70 int16_t return_code; /* What to return after the function is run. */
71 uint16_t flags; /* Flags what context, display options */ 71 uint16_t flags; /* Flags what context, display options */
72}; /* (Pick ONPLAY_FUNC_RETURN to use function's return value) */ 72}; /* (Pick ONPLAY_FUNC_RETURN to use function's return value) */