From 6001fc65c1ded3f68aed04c3b2cf9e30426362a0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 1 Jan 2017 01:44:12 +0100 Subject: [PATCH] Properly go back to top level settings when selecting a video filter or audio filter --- menu/cbs/menu_cbs_ok.c | 50 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 7bc6f12598..197b99da04 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -75,6 +75,8 @@ enum ACTION_OK_LOAD_CORE, ACTION_OK_LOAD_WALLPAPER, ACTION_OK_SET_PATH, + ACTION_OK_SET_PATH_AUDIO_FILTER, + ACTION_OK_SET_PATH_VIDEO_FILTER, ACTION_OK_SET_PATH_OVERLAY, ACTION_OK_SET_DIRECTORY }; @@ -1152,6 +1154,32 @@ static int generic_action_ok(const char *path, } } break; + case ACTION_OK_SET_PATH_VIDEO_FILTER: + flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST); + { + rarch_setting_t *setting = menu_setting_find(menu_label); + + if (setting) + { + setting_set_with_string_representation( + setting, action_path); + ret = menu_setting_generic(setting, false); + } + } + break; + case ACTION_OK_SET_PATH_AUDIO_FILTER: + flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST); + { + rarch_setting_t *setting = menu_setting_find(menu_label); + + if (setting) + { + setting_set_with_string_representation( + setting, action_path); + ret = menu_setting_generic(setting, false); + } + } + break; case ACTION_OK_SET_PATH_OVERLAY: flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST); { @@ -1191,6 +1219,20 @@ error: return menu_cbs_exit(); } +static int action_ok_set_path_videofilter(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok(path, label, type, idx, entry_idx, + ACTION_OK_SET_PATH_VIDEO_FILTER, MSG_UNKNOWN); +} + +static int action_ok_set_path_audiofilter(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok(path, label, type, idx, entry_idx, + ACTION_OK_SET_PATH_AUDIO_FILTER, MSG_UNKNOWN); +} + static int action_ok_set_path_overlay(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -4395,14 +4437,18 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs, break; } break; - case FILE_TYPE_FONT: - case FILE_TYPE_AUDIOFILTER: case FILE_TYPE_VIDEOFILTER: + BIND_ACTION_OK(cbs, action_ok_set_path_videofilter); + break; + case FILE_TYPE_FONT: BIND_ACTION_OK(cbs, action_ok_set_path); break; case FILE_TYPE_OVERLAY: BIND_ACTION_OK(cbs, action_ok_set_path_overlay); break; + case FILE_TYPE_AUDIOFILTER: + BIND_ACTION_OK(cbs, action_ok_set_path_audiofilter); + break; case FILE_TYPE_IN_CARCHIVE: case FILE_TYPE_PLAIN: if (cbs->enum_idx != MSG_UNKNOWN)