Refactor menu_cbs_get_value.c
This commit is contained in:
parent
71f4ff6b84
commit
e7d2e7ebcb
|
@ -1590,54 +1590,67 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
|
||||||
static int menu_cbs_init_bind_get_string_representation_compare_type(
|
static int menu_cbs_init_bind_get_string_representation_compare_type(
|
||||||
menu_file_list_cbs_t *cbs, unsigned type)
|
menu_file_list_cbs_t *cbs, unsigned type)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_AUDIOMIXER
|
unsigned i;
|
||||||
if (type >= MENU_SETTINGS_AUDIO_MIXER_STREAM_BEGIN
|
typedef struct info_range_list
|
||||||
&& type <= MENU_SETTINGS_AUDIO_MIXER_STREAM_END)
|
|
||||||
{
|
{
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
unsigned min;
|
||||||
menu_action_setting_audio_mixer_stream_name);
|
unsigned max;
|
||||||
|
void (*cb)(file_list_t* list,
|
||||||
|
unsigned *w, unsigned type, unsigned i,
|
||||||
|
const char *label, char *s, size_t len,
|
||||||
|
const char *path,
|
||||||
|
char *path_buf, size_t path_buf_size);
|
||||||
|
} info_range_list_t;
|
||||||
|
|
||||||
|
info_range_list_t info_list[] = {
|
||||||
|
#ifdef HAVE_AUDIOMIXER
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_AUDIO_MIXER_STREAM_BEGIN,
|
||||||
|
MENU_SETTINGS_AUDIO_MIXER_STREAM_END,
|
||||||
|
menu_action_setting_audio_mixer_stream_name
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_BEGIN,
|
||||||
|
MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_END,
|
||||||
|
menu_action_setting_audio_mixer_stream_volume
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_INPUT_DESC_BEGIN,
|
||||||
|
MENU_SETTINGS_INPUT_DESC_END,
|
||||||
|
menu_action_setting_disp_set_label_input_desc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_CHEAT_BEGIN,
|
||||||
|
MENU_SETTINGS_CHEAT_END,
|
||||||
|
menu_action_setting_disp_set_label_cheat
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_PERF_COUNTERS_BEGIN,
|
||||||
|
MENU_SETTINGS_PERF_COUNTERS_END,
|
||||||
|
menu_action_setting_disp_set_label_perf_counters
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN,
|
||||||
|
MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END,
|
||||||
|
menu_action_setting_disp_set_label_libretro_perf_counters
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN,
|
||||||
|
MENU_SETTINGS_INPUT_DESC_KBD_END,
|
||||||
|
menu_action_setting_disp_set_label_input_desc_kbd
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(info_list); i++)
|
||||||
|
{
|
||||||
|
if (type >= info_list[i].min && type <= info_list[i].max)
|
||||||
|
{
|
||||||
|
BIND_ACTION_GET_VALUE(cbs, info_list[i].cb);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (type >= MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_audio_mixer_stream_volume);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
|
||||||
if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_disp_set_label_input_desc);
|
|
||||||
}
|
|
||||||
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_CHEAT_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_disp_set_label_cheat);
|
|
||||||
}
|
|
||||||
else if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_PERF_COUNTERS_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_disp_set_label_perf_counters);
|
|
||||||
}
|
|
||||||
else if (type >= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_disp_set_label_libretro_perf_counters);
|
|
||||||
}
|
|
||||||
else if (type >= MENU_SETTINGS_INPUT_DESC_KBD_BEGIN
|
|
||||||
&& type <= MENU_SETTINGS_INPUT_DESC_KBD_END)
|
|
||||||
{
|
|
||||||
BIND_ACTION_GET_VALUE(cbs,
|
|
||||||
menu_action_setting_disp_set_label_input_desc_kbd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MENU_SETTINGS_CORE_OPTION_CREATE:
|
case MENU_SETTINGS_CORE_OPTION_CREATE:
|
||||||
|
@ -1777,7 +1790,6 @@ static int menu_cbs_init_bind_get_string_representation_compare_type(
|
||||||
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
|
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue