Add Playlist Directory path setting

This commit is contained in:
twinaphex 2014-09-15 04:12:27 +02:00
parent 32291bb799
commit 89676e8424
7 changed files with 22 additions and 0 deletions

View File

@ -274,6 +274,8 @@ static void check_defaults_dirs(void)
path_mkdir(g_defaults.audio_filter_dir);
if (*g_defaults.assets_dir)
path_mkdir(g_defaults.assets_dir);
if (*g_defaults.playlist_dir)
path_mkdir(g_defaults.playlist_dir);
if (*g_defaults.core_dir)
path_mkdir(g_defaults.core_dir);
if (*g_defaults.core_info_dir)

View File

@ -80,6 +80,8 @@ static void get_title(const char *label, const char *dir,
snprintf(title, sizeof_title, "DSP FILTER %s", dir);
else if (!strcmp(label, "rgui_browser_directory"))
snprintf(title, sizeof_title, "BROWSER DIR %s", dir);
else if (!strcmp(label, "playlist_directory"))
snprintf(title, sizeof_title, "PLAYLIST DIR %s", dir);
else if (!strcmp(label, "content_directory"))
snprintf(title, sizeof_title, "CONTENT DIR %s", dir);
else if (!strcmp(label, "screenshot_directory"))

View File

@ -444,6 +444,7 @@ unsigned menu_common_type_is(const char *label, unsigned type)
!strcmp(label, "overlay_directory") ||
!strcmp(label, "screenshot_directory") ||
!strcmp(label, "joypad_autoconfig_dir") ||
!strcmp(label, "playlist_directory") ||
!strcmp(label, "extraction_directory") ||
!strcmp(label, "system_directory"))
return MENU_FILE_DIRECTORY;

View File

@ -197,6 +197,7 @@ struct defaults
char sram_dir[PATH_MAX];
char screenshot_dir[PATH_MAX];
char system_dir[PATH_MAX];
char playlist_dir[PATH_MAX];
struct
{
@ -365,6 +366,7 @@ struct settings
char system_directory[PATH_MAX];
char extraction_directory[PATH_MAX];
char playlist_directory[PATH_MAX];
bool rewind_enable;
size_t rewind_buffer_size;

View File

@ -12,6 +12,10 @@
# will be extracted to this directory.
# extraction_directory =
# If set to a directory, the content history playlist will be saved
# to this directory along with any other playlists.
# playlist_directory =
# Automatically saves a savestate at the end of RetroArch's lifetime.
# The path is $SRAM_PATH.auto.
# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set.

View File

@ -452,6 +452,7 @@ void config_set_defaults(void)
*g_settings.input.overlay = '\0';
*g_settings.content_directory = '\0';
*g_settings.assets_directory = '\0';
*g_settings.playlist_directory = '\0';
*g_settings.video.shader_path = '\0';
*g_settings.video.shader_dir = '\0';
*g_settings.video.filter_dir = '\0';
@ -488,6 +489,9 @@ void config_set_defaults(void)
if (*g_defaults.assets_dir)
strlcpy(g_settings.assets_directory,
g_defaults.assets_dir, sizeof(g_settings.assets_directory));
if (*g_defaults.playlist_dir)
strlcpy(g_settings.playlist_directory,
g_defaults.playlist_dir, sizeof(g_settings.playlist_directory));
if (*g_defaults.core_dir)
fill_pathname_expand_special(g_settings.libretro_directory,
g_defaults.core_dir, sizeof(g_settings.libretro_directory));
@ -1067,10 +1071,13 @@ bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_PATH(extraction_directory, "extraction_directory");
CONFIG_GET_PATH(content_directory, "content_directory");
CONFIG_GET_PATH(assets_directory, "assets_directory");
CONFIG_GET_PATH(playlist_directory, "playlist_directory");
if (!strcmp(g_settings.content_directory, "default"))
*g_settings.content_directory = '\0';
if (!strcmp(g_settings.assets_directory, "default"))
*g_settings.assets_directory = '\0';
if (!strcmp(g_settings.playlist_directory, "default"))
*g_settings.playlist_directory = '\0';
#ifdef HAVE_MENU
CONFIG_GET_PATH(menu_content_directory, "rgui_browser_directory");
if (!strcmp(g_settings.menu_content_directory, "default"))
@ -1507,6 +1514,9 @@ bool config_save_file(const char *path)
config_set_path(conf, "assets_directory",
*g_settings.assets_directory ?
g_settings.assets_directory : "default");
config_set_path(conf, "playlist_directory",
*g_settings.playlist_directory ?
g_settings.playlist_directory : "default");
#ifdef HAVE_MENU
config_set_path(conf, "rgui_browser_directory",
*g_settings.menu_content_directory ?

View File

@ -2649,6 +2649,7 @@ rarch_setting_t *setting_data_get_list(void)
#endif
CONFIG_DIR(g_settings.screenshot_directory, "screenshot_directory", "Screenshot Directory", "", "<Content dir>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_DIR(g_settings.input.autoconfig_dir, "joypad_autoconfig_dir", "Joypad Autoconfig Directory", "", "<default>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_DIR(g_settings.playlist_directory, "playlist_directory", "Playlist Directory", "", "<default>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_DIR(g_extern.savefile_dir, "savefile_directory", "Savefile Directory", "", "<Content dir>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler);
CONFIG_DIR(g_extern.savestate_dir, "savestate_directory", "Savestate Directory", "", "<Content dir>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_DIR(g_settings.system_directory, "system_directory", "System Directory", "", "<Content dir>", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)