From a89f70c4d84b775508e341380fef954f65a40576 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 14 Apr 2015 21:13:54 +0200 Subject: [PATCH] Start adding Recording Settings - stub/unfinished/non-working --- configuration.c | 9 +++++ runloop.h | 5 +++ settings.c | 104 ++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 101 insertions(+), 17 deletions(-) diff --git a/configuration.c b/configuration.c index cacc5c2d1b..4b3fd54712 100644 --- a/configuration.c +++ b/configuration.c @@ -633,6 +633,9 @@ static void config_set_defaults(void) if (!global->has_set_ips_pref) global->ips_pref = false; + *global->recording.output_dir = '\0'; + *global->recording.config_dir = '\0'; + *settings->core_options_path = '\0'; *settings->content_history_path = '\0'; *settings->content_history_directory = '\0'; @@ -1417,6 +1420,9 @@ static bool config_load_file(const char *path, bool set_defaults) CONFIG_GET_INT_BASE(conf, settings, archive.mode, "archive_mode"); + config_get_path(conf, "recording_output_directory", global->recording.output_dir, sizeof(global->recording.output_dir)); + config_get_path(conf, "recording_config_directory", global->recording.config_dir, sizeof(global->recording.config_dir)); + #ifdef HAVE_OVERLAY config_get_path(conf, "overlay_directory", global->overlay_dir, sizeof(global->overlay_dir)); if (!strcmp(global->overlay_dir, "default")) @@ -2170,6 +2176,9 @@ bool config_save_file(const char *path) config_set_path(conf, "libretro_path", settings->libretro); config_set_path(conf, "core_options_path", settings->core_options_path); + config_set_path(conf, "recording_output_directory", global->recording.output_dir); + config_set_path(conf, "recording_config_directory", global->recording.config_dir); + config_set_bool(conf, "suspend_screensaver_enable", settings->ui.suspend_screensaver_enable); config_set_path(conf, "libretro_directory", settings->libretro_directory); config_set_path(conf, "libretro_info_path", settings->libretro_info_path); diff --git a/runloop.h b/runloop.h index 497ac210aa..0619cf91f7 100644 --- a/runloop.h +++ b/runloop.h @@ -192,6 +192,11 @@ typedef struct global unsigned windowed_scale; } pending; + struct + { + char output_dir[PATH_MAX_LENGTH]; + char config_dir[PATH_MAX_LENGTH]; + } recording; struct { diff --git a/settings.c b/settings.c index 4b117418a7..4e5c276afe 100644 --- a/settings.c +++ b/settings.c @@ -3833,8 +3833,48 @@ static bool setting_append_list_recording_options( global_t *global = global_get_ptr(); START_GROUP(group_info, "Recording Settings"); + START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info); + CONFIG_BOOL( + global->record.enable, + "record_enable", + "Record Enable", + false, + "OFF", + "ON", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + + CONFIG_PATH( + global->record.config, + "record_config", + "Record Config", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_list_current_add_values(list, list_info, "cfg"); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_EMPTY); + + CONFIG_STRING( + global->record.path, + "record_path", + "Record Path", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT); + + END_SUB_GROUP(list, list_info); + + START_SUB_GROUP(list, list_info, "Miscellaneous", group_info.name, subgroup_info); + CONFIG_BOOL( settings->video.post_filter_record, "video_post_filter_record", @@ -3846,7 +3886,6 @@ static bool setting_append_list_recording_options( subgroup_info.name, general_write_handler, general_read_handler); - settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); CONFIG_BOOL( settings->video.gpu_record, @@ -3859,7 +3898,6 @@ static bool setting_append_list_recording_options( subgroup_info.name, general_write_handler, general_read_handler); - settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); END_SUB_GROUP(list, list_info); END_GROUP(list, list_info); @@ -5868,21 +5906,6 @@ static bool setting_append_list_path_options( START_GROUP(group_info, "Path Settings"); START_SUB_GROUP(list, list_info, "Paths", group_info.name, subgroup_info); -#ifdef HAVE_MENU - CONFIG_DIR( - settings->menu_content_directory, - "rgui_browser_directory", - "Browser Directory", - "", - "", - group_info.name, - subgroup_info.name, - general_write_handler, - general_read_handler); - settings_data_list_current_add_flags( - list, - list_info, - SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); CONFIG_DIR( settings->core_assets_directory, @@ -5914,6 +5937,23 @@ static bool setting_append_list_path_options( list_info, SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); +#ifdef HAVE_MENU + CONFIG_DIR( + settings->menu_content_directory, + "rgui_browser_directory", + "Browser Directory", + "", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags( + list, + list_info, + SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + + CONFIG_DIR( settings->menu_config_directory, "rgui_config_directory", @@ -6066,6 +6106,36 @@ static bool setting_append_list_path_options( list_info, SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + CONFIG_DIR( + global->recording.output_dir, + "recording_output_directory", + "Recording Output Directory", + "", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags( + list, + list_info, + SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + + CONFIG_DIR( + global->recording.config_dir, + "recording_config_directory", + "Recording Config Directory", + "", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags( + list, + list_info, + SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + #ifdef HAVE_OVERLAY CONFIG_DIR( global->overlay_dir,