Add 'use_output_directory'

This commit is contained in:
twinaphex 2015-04-15 12:42:36 +02:00
parent 3717414e2e
commit 23b9a3ee47
5 changed files with 34 additions and 15 deletions

View File

@ -633,8 +633,8 @@ static void config_set_defaults(void)
if (!global->has_set_ips_pref) if (!global->has_set_ips_pref)
global->ips_pref = false; global->ips_pref = false;
*global->recording.output_dir = '\0'; *global->record.output_dir = '\0';
*global->recording.config_dir = '\0'; *global->record.config_dir = '\0';
*settings->core_options_path = '\0'; *settings->core_options_path = '\0';
*settings->content_history_path = '\0'; *settings->content_history_path = '\0';
@ -1420,8 +1420,8 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_INT_BASE(conf, settings, archive.mode, "archive_mode"); 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_output_directory", global->record.output_dir, sizeof(global->record.output_dir));
config_get_path(conf, "recording_config_directory", global->recording.config_dir, sizeof(global->recording.config_dir)); config_get_path(conf, "recording_config_directory", global->record.config_dir, sizeof(global->record.config_dir));
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
config_get_path(conf, "overlay_directory", global->overlay_dir, sizeof(global->overlay_dir)); config_get_path(conf, "overlay_directory", global->overlay_dir, sizeof(global->overlay_dir));
@ -2176,8 +2176,8 @@ bool config_save_file(const char *path)
config_set_path(conf, "libretro_path", settings->libretro); config_set_path(conf, "libretro_path", settings->libretro);
config_set_path(conf, "core_options_path", settings->core_options_path); 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_output_directory", global->record.output_dir);
config_set_path(conf, "recording_config_directory", global->recording.config_dir); config_set_path(conf, "recording_config_directory", global->record.config_dir);
config_set_bool(conf, "suspend_screensaver_enable", settings->ui.suspend_screensaver_enable); 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_directory", settings->libretro_directory);

View File

@ -330,7 +330,7 @@ static int action_ok_record_configfile(const char *path,
return menu_list_push_stack_refresh( return menu_list_push_stack_refresh(
menu->menu_list, menu->menu_list,
global->recording.config_dir, global->record.config_dir,
label, type, idx); label, type, idx);
} }

View File

@ -15,6 +15,7 @@
*/ */
#include <string.h> #include <string.h>
#include <file/file_path.h>
#include "record_driver.h" #include "record_driver.h"
#include "../driver.h" #include "../driver.h"
@ -183,6 +184,7 @@ bool recording_deinit(void)
**/ **/
bool recording_init(void) bool recording_init(void)
{ {
char recording_file[PATH_MAX_LENGTH];
struct ffemu_params params = {0}; struct ffemu_params params = {0};
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
@ -209,12 +211,19 @@ bool recording_init(void)
(float)global->system.av_info.timing.fps, (float)global->system.av_info.timing.fps,
(float)global->system.av_info.timing.sample_rate); (float)global->system.av_info.timing.sample_rate);
strlcpy(recording_file, global->record.path, sizeof(recording_file));
if (global->record.use_output_dir)
fill_pathname_join(recording_file,
global->record.output_dir,
global->record.path, sizeof(recording_file));
params.out_width = info->geometry.base_width; params.out_width = info->geometry.base_width;
params.out_height = info->geometry.base_height; params.out_height = info->geometry.base_height;
params.fb_width = info->geometry.max_width; params.fb_width = info->geometry.max_width;
params.fb_height = info->geometry.max_height; params.fb_height = info->geometry.max_height;
params.channels = 2; params.channels = 2;
params.filename = global->record.path; params.filename = recording_file;
params.fps = global->system.av_info.timing.fps; params.fps = global->system.av_info.timing.fps;
params.samplerate = global->system.av_info.timing.sample_rate; params.samplerate = global->system.av_info.timing.sample_rate;
params.pix_fmt = (global->system.pix_fmt == RETRO_PIXEL_FORMAT_XRGB8888) ? params.pix_fmt = (global->system.pix_fmt == RETRO_PIXEL_FORMAT_XRGB8888) ?

View File

@ -192,11 +192,6 @@ typedef struct global
unsigned windowed_scale; unsigned windowed_scale;
} pending; } pending;
struct
{
char output_dir[PATH_MAX_LENGTH];
char config_dir[PATH_MAX_LENGTH];
} recording;
struct struct
{ {
@ -348,6 +343,9 @@ typedef struct global
uint8_t *gpu_buffer; uint8_t *gpu_buffer;
size_t gpu_width; size_t gpu_width;
size_t gpu_height; size_t gpu_height;
char output_dir[PATH_MAX_LENGTH];
char config_dir[PATH_MAX_LENGTH];
bool use_output_dir;
} record; } record;
struct struct

View File

@ -3871,6 +3871,18 @@ static bool setting_append_list_recording_options(
general_read_handler); general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT); settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
CONFIG_BOOL(
global->record.use_output_dir,
"record_use_output_dir",
"Use output directory",
false,
"OFF",
"ON",
group_info.name,
subgroup_info.name,
general_write_handler,
general_read_handler);
END_SUB_GROUP(list, list_info); END_SUB_GROUP(list, list_info);
START_SUB_GROUP(list, list_info, "Miscellaneous", group_info.name, subgroup_info); START_SUB_GROUP(list, list_info, "Miscellaneous", group_info.name, subgroup_info);
@ -6107,7 +6119,7 @@ static bool setting_append_list_path_options(
SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION);
CONFIG_DIR( CONFIG_DIR(
global->recording.output_dir, global->record.output_dir,
"recording_output_directory", "recording_output_directory",
"Recording Output Directory", "Recording Output Directory",
"", "",
@ -6122,7 +6134,7 @@ static bool setting_append_list_path_options(
SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION);
CONFIG_DIR( CONFIG_DIR(
global->recording.config_dir, global->record.config_dir,
"recording_config_directory", "recording_config_directory",
"Recording Config Directory", "Recording Config Directory",
"", "",