mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
(Menu) Refactor video_filter_dir/audio_filter_dir settings
This commit is contained in:
parent
98e0c87a45
commit
2f67bc0479
@ -348,10 +348,8 @@ static void menu_common_entries_init(menu_handle_t *menu, unsigned menu_type)
|
||||
file_list_push(menu->selection_buf, "", "libretro_dir_path", MENU_LIBRETRO_DIR_PATH, 0);
|
||||
file_list_push(menu->selection_buf, "", "libretro_info_path", MENU_LIBRETRO_INFO_DIR_PATH, 0);
|
||||
file_list_push(menu->selection_buf, "", "game_history_path", MENU_CONTENT_HISTORY_PATH, 0);
|
||||
#ifdef HAVE_DYLIB
|
||||
file_list_push(menu->selection_buf, "Software Filter Directory", "", MENU_FILTER_DIR_PATH, 0);
|
||||
#endif
|
||||
file_list_push(menu->selection_buf, "DSP Filter Directory", "", MENU_DSP_FILTER_DIR_PATH, 0);
|
||||
file_list_push(menu->selection_buf, "", "video_filter_dir", MENU_FILTER_DIR_PATH, 0);
|
||||
file_list_push(menu->selection_buf, "", "audio_filter_dir", MENU_DSP_FILTER_DIR_PATH, 0);
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
file_list_push(menu->selection_buf, "", "video_shader_dir", MENU_SHADER_DIR_PATH, 0);
|
||||
#endif
|
||||
@ -2387,12 +2385,16 @@ static int menu_common_iterate(unsigned action)
|
||||
}
|
||||
else if (menu_type == MENU_FILTER_DIR_PATH)
|
||||
{
|
||||
strlcpy(g_settings.video.filter_dir, dir, sizeof(g_settings.video.filter_dir));
|
||||
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_filter_dir")))
|
||||
menu_common_setting_set_current_string_dir(current_setting, dir);
|
||||
|
||||
menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS);
|
||||
}
|
||||
else if (menu_type == MENU_DSP_FILTER_DIR_PATH)
|
||||
{
|
||||
strlcpy(g_settings.audio.filter_dir, dir, sizeof(g_settings.audio.filter_dir));
|
||||
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "audio_filter_dir")))
|
||||
menu_common_setting_set_current_string_dir(current_setting, dir);
|
||||
|
||||
menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS);
|
||||
}
|
||||
else if (menu_type == MENU_SYSTEM_DIR_PATH)
|
||||
@ -3539,6 +3541,8 @@ static int menu_common_setting_set(unsigned id, unsigned action, rarch_setting_t
|
||||
case MENU_SYSTEM_DIR_PATH:
|
||||
case MENU_AUTOCONFIG_DIR_PATH:
|
||||
case MENU_EXTRACTION_DIR_PATH:
|
||||
case MENU_FILTER_DIR_PATH:
|
||||
case MENU_DSP_FILTER_DIR_PATH:
|
||||
if (action == MENU_ACTION_START)
|
||||
{
|
||||
*setting->value.string = '\0';
|
||||
@ -3547,14 +3551,6 @@ static int menu_common_setting_set(unsigned id, unsigned action, rarch_setting_t
|
||||
setting->change_handler(setting);
|
||||
}
|
||||
break;
|
||||
case MENU_FILTER_DIR_PATH:
|
||||
if (action == MENU_ACTION_START)
|
||||
*g_settings.video.filter_dir = '\0';
|
||||
break;
|
||||
case MENU_DSP_FILTER_DIR_PATH:
|
||||
if (action == MENU_ACTION_START)
|
||||
*g_settings.audio.filter_dir = '\0';
|
||||
break;
|
||||
case MENU_SETTINGS_DRIVER_VIDEO:
|
||||
if (action == MENU_ACTION_LEFT)
|
||||
find_prev_video_driver();
|
||||
|
@ -994,6 +994,10 @@ static void general_read_handler(const void *data)
|
||||
strlcpy(setting->value.string, g_settings.cheat_settings_path, setting->size);
|
||||
else if (!strcmp(setting->name, "game_history_path"))
|
||||
strlcpy(setting->value.string, g_settings.content_history_path, setting->size);
|
||||
else if (!strcmp(setting->name, "video_filter_dir"))
|
||||
strlcpy(setting->value.string, g_settings.video.filter_dir, setting->size);
|
||||
else if (!strcmp(setting->name, "audio_filter_dir"))
|
||||
strlcpy(setting->value.string, g_settings.audio.filter_dir, setting->size);
|
||||
else if (!strcmp(setting->name, "video_shader_dir"))
|
||||
strlcpy(setting->value.string, g_settings.video.shader_dir, setting->size);
|
||||
else if (!strcmp(setting->name, "video_aspect_ratio_auto"))
|
||||
@ -1325,6 +1329,10 @@ static void general_write_handler(const void *data)
|
||||
strlcpy(g_settings.cheat_settings_path, setting->value.string, sizeof(g_settings.cheat_settings_path));
|
||||
else if (!strcmp(setting->name, "game_history_path"))
|
||||
strlcpy(g_settings.content_history_path, setting->value.string, sizeof(g_settings.content_history_path));
|
||||
else if (!strcmp(setting->name, "video_filter_dir"))
|
||||
strlcpy(g_settings.video.filter_dir, setting->value.string, sizeof(g_settings.video.filter_dir));
|
||||
else if (!strcmp(setting->name, "audio_filter_dir"))
|
||||
strlcpy(g_settings.audio.filter_dir, setting->value.string, sizeof(g_settings.audio.filter_dir));
|
||||
else if (!strcmp(setting->name, "video_shader_dir"))
|
||||
strlcpy(g_settings.video.shader_dir, setting->value.string, sizeof(g_settings.video.shader_dir));
|
||||
else if (!strcmp(setting->name, "video_aspect_ratio_auto"))
|
||||
@ -1726,7 +1734,11 @@ rarch_setting_t* setting_data_get_list(void)
|
||||
CONFIG_PATH(g_settings.cheat_settings_path, "cheat_settings_path", "Cheat Settings", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY)
|
||||
CONFIG_PATH(g_settings.content_history_path, "game_history_path", "Content History Path", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY)
|
||||
|
||||
CONFIG_DIR(g_settings.video.filter_dir, "video_filter_dir", "VideoFilter Directory", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
|
||||
CONFIG_DIR(g_settings.audio.filter_dir, "audio_filter_dir", "AudioFilter Directory", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
|
||||
#ifdef HAVE_DYLIB
|
||||
CONFIG_DIR(g_settings.video.shader_dir, "video_shader_dir", "Shader Directory", g_defaults.shader_dir ? g_defaults.shader_dir : "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
CONFIG_DIR(g_extern.overlay_dir, "overlay_directory", "Overlay Directory", g_defaults.overlay_dir ? g_defaults.overlay_dir : "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user