Hook up start button to 'Load Core' - will unload a core

This commit is contained in:
twinaphex 2019-08-24 08:31:07 +02:00
parent 297f2b3050
commit a93b99b919
2 changed files with 17 additions and 1 deletions

View File

@ -1410,7 +1410,7 @@ static int set_path_generic(const char *label, const char *action_path)
return 0; return 0;
} }
static int generic_action_ok_command(enum event_command cmd) int generic_action_ok_command(enum event_command cmd)
{ {
#ifdef HAVE_AUDIOMIXER #ifdef HAVE_AUDIOMIXER
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();

View File

@ -49,6 +49,8 @@
cbs->action_start_ident = #name; cbs->action_start_ident = #name;
#endif #endif
int generic_action_ok_command(enum event_command cmd);
#ifdef HAVE_AUDIOMIXER #ifdef HAVE_AUDIOMIXER
static int action_start_audio_mixer_stream_volume(unsigned type, const char *label) static int action_start_audio_mixer_stream_volume(unsigned type, const char *label)
{ {
@ -323,6 +325,17 @@ static int action_start_video_resolution(unsigned type, const char *label)
return 0; return 0;
} }
static int action_start_load_core(unsigned type, const char *label)
{
int ret = generic_action_ok_command(
CMD_EVENT_UNLOAD_CORE);
bool refresh = false;
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
return 0;
}
static int action_start_lookup_setting(unsigned type, const char *label) static int action_start_lookup_setting(unsigned type, const char *label)
{ {
return menu_setting_set(type, MENU_ACTION_START, false); return menu_setting_set(type, MENU_ACTION_START, false);
@ -334,6 +347,9 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs)
{ {
switch (cbs->enum_idx) switch (cbs->enum_idx)
{ {
case MENU_ENUM_LABEL_CORE_LIST:
BIND_ACTION_START(cbs, action_start_load_core);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET: case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET:
BIND_ACTION_START(cbs, action_start_shader_preset); BIND_ACTION_START(cbs, action_start_shader_preset);
break; break;