mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
commit
e222d62f6c
@ -531,6 +531,10 @@ ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
database_info.o \
|
||||
tasks/task_database.o \
|
||||
tasks/task_database_cue.o
|
||||
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
OBJ += menu/menu_explore.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
@ -541,7 +545,8 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
|
||||
endif
|
||||
|
||||
# MinGW requires this for some reason, even though the include paths are relative to the source
|
||||
# MinGW requires this for some reason,
|
||||
# even though the include paths are relative to the source
|
||||
INCLUDE_DIRS += -Ideps/mbedtls
|
||||
|
||||
OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \
|
||||
|
@ -573,6 +573,7 @@ static const bool rgui_shadows = false;
|
||||
static const unsigned rgui_particle_effect = RGUI_PARTICLE_EFFECT_NONE;
|
||||
#define DEFAULT_RGUI_PARTICLE_EFFECT_SPEED 1.0f
|
||||
static const bool rgui_extended_ascii = false;
|
||||
#define DEFAULT_RGUI_SWITCH_ICONS true
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1057,6 +1058,8 @@ static const int default_content_favorites_size = 200;
|
||||
|
||||
#define DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH false
|
||||
|
||||
#define DEFAULT_PLAYLIST_PORTABLE_PATHS false
|
||||
|
||||
/* Show Menu start-up screen on boot. */
|
||||
#define DEFAULT_MENU_SHOW_START_SCREEN true
|
||||
|
||||
|
@ -1635,6 +1635,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("rgui_inline_thumbnails", &settings->bools.menu_rgui_inline_thumbnails, true, rgui_inline_thumbnails, false);
|
||||
SETTING_BOOL("rgui_swap_thumbnails", &settings->bools.menu_rgui_swap_thumbnails, true, rgui_swap_thumbnails, false);
|
||||
SETTING_BOOL("rgui_extended_ascii", &settings->bools.menu_rgui_extended_ascii, true, rgui_extended_ascii, false);
|
||||
SETTING_BOOL("rgui_switch_icons", &settings->bools.menu_rgui_switch_icons, true, DEFAULT_RGUI_SWITCH_ICONS, false);
|
||||
#endif
|
||||
#ifdef HAVE_XMB
|
||||
SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, DEFAULT_XMB_SHADOWS_ENABLE, false);
|
||||
@ -1722,6 +1723,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("playlist_show_sublabels", &settings->bools.playlist_show_sublabels, true, DEFAULT_PLAYLIST_SHOW_SUBLABELS, false);
|
||||
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false);
|
||||
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false);
|
||||
SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false);
|
||||
|
||||
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false);
|
||||
SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, vibrate_on_keypress, false);
|
||||
|
@ -219,6 +219,7 @@ typedef struct settings
|
||||
bool menu_rgui_inline_thumbnails;
|
||||
bool menu_rgui_swap_thumbnails;
|
||||
bool menu_rgui_extended_ascii;
|
||||
bool menu_rgui_switch_icons;
|
||||
bool menu_xmb_shadows_enable;
|
||||
bool menu_xmb_vertical_thumbnails;
|
||||
bool menu_content_show_settings;
|
||||
@ -404,6 +405,7 @@ typedef struct settings
|
||||
bool playlist_sort_alphabetical;
|
||||
bool playlist_show_sublabels;
|
||||
bool playlist_fuzzy_archive_match;
|
||||
bool playlist_portable_paths;
|
||||
|
||||
bool quit_press_twice;
|
||||
bool vibrate_on_keypress;
|
||||
|
47
core_info.c
47
core_info.c
@ -873,6 +873,53 @@ void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
|
||||
*num_infos = supported;
|
||||
}
|
||||
|
||||
/*
|
||||
* Matches core path A and B "base" filename (ignoring everything after _libretro)
|
||||
*
|
||||
* Ex:
|
||||
* snes9x_libretro.dll and snes9x_libretro_android.so are matched
|
||||
* snes9x__2005_libretro.dll and snes9x_libretro_android.so are NOT matched
|
||||
*/
|
||||
bool core_info_core_file_id_is_equal(const char* core_path_a, const char* core_path_b)
|
||||
{
|
||||
const char *core_path_basename_a = NULL;
|
||||
const char *extension_pos = NULL;
|
||||
const char *underscore_pos = NULL;
|
||||
|
||||
if (!core_path_a || !core_path_b)
|
||||
return false;
|
||||
|
||||
core_path_basename_a = path_basename(core_path_a);
|
||||
|
||||
if (core_path_basename_a)
|
||||
{
|
||||
extension_pos = strrchr(core_path_basename_a, '.');
|
||||
|
||||
if (extension_pos)
|
||||
{
|
||||
/* Remove extension */
|
||||
*((char*)extension_pos) = '\0';
|
||||
|
||||
underscore_pos = strrchr(core_path_basename_a, '_');
|
||||
|
||||
/* Restore extension */
|
||||
*((char*)extension_pos) = '.';
|
||||
|
||||
if (underscore_pos)
|
||||
{
|
||||
size_t core_base_file_id_length = underscore_pos - core_path_basename_a;
|
||||
const char* core_path_basename_b = path_basename(core_path_b);
|
||||
|
||||
if (string_starts_with_size(core_path_basename_a, core_path_basename_b,
|
||||
core_base_file_id_length))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void core_info_get_name(const char *path, char *s, size_t len,
|
||||
const char *path_info, const char *dir_cores,
|
||||
const char *exts, bool dir_show_hidden_files,
|
||||
|
@ -220,6 +220,8 @@ bool core_info_get_core_lock(const char *core_path, bool validate_path);
|
||||
|
||||
core_info_state_t *coreinfo_get_ptr(void);
|
||||
|
||||
bool core_info_core_file_id_is_equal(const char* core_path_a, const char* core_path_b);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* CORE_INFO_H_ */
|
||||
|
@ -294,6 +294,19 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
}
|
||||
|
||||
if (menu_driver_is_alive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if ((hook == APTHOOK_ONSUSPEND) || (hook == APTHOOK_ONSLEEP))
|
||||
{
|
||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||
}
|
||||
else if ((hook == APTHOOK_ONRESTORE) || (hook == APTHOOK_ONWAKEUP))
|
||||
{
|
||||
command_event(CMD_EVENT_AUDIO_START, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void ctr_vsync_hook(ctr_video_t* ctr)
|
||||
|
@ -1349,6 +1349,9 @@ MENU
|
||||
#include "../menu/cbs/menu_cbs_down.c"
|
||||
#include "../menu/cbs/menu_cbs_contentlist_switch.c"
|
||||
#include "../menu/menu_displaylist.c"
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
#include "../menu/menu_explore.c"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBNX)
|
||||
|
@ -330,10 +330,9 @@ static const char *ds3_get_name(void *data) { return "Sony DualShock 3"; }
|
||||
static int16_t ds3_button(void *data, uint16_t joykey)
|
||||
{
|
||||
ds3_instance_t *pad = (ds3_instance_t *)data;
|
||||
if (joykey < 31)
|
||||
if (pad)
|
||||
return (pad->buttons & (1 << joykey));
|
||||
return 0;
|
||||
if (!pad || joykey > 31)
|
||||
return 0;
|
||||
return pad->buttons & (1 << joykey);
|
||||
}
|
||||
|
||||
pad_connection_interface_t ds3_pad_connection = {
|
||||
|
@ -328,10 +328,9 @@ static const char *wiiu_gca_get_name(void *data)
|
||||
static int16_t wiiu_gca_button(void *data, uint16_t joykey)
|
||||
{
|
||||
gca_pad_t *pad = (gca_pad_t *)data;
|
||||
if (joykey < 31)
|
||||
if (pad)
|
||||
return pad->buttons & (1 << joykey);
|
||||
return 0;
|
||||
if(!pad || joykey > 31)
|
||||
return 0;
|
||||
return pad->buttons & (1 << joykey);
|
||||
}
|
||||
|
||||
pad_connection_interface_t wiiu_gca_pad_connection = {
|
||||
|
@ -50,6 +50,14 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_CONFIGURATIONS_LIST,
|
||||
"configurations_list"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_EXPLORE_TAB,
|
||||
"explore_tab"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_EXPLORE_ITEM,
|
||||
"explore_item"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_ADD_TAB,
|
||||
"add_tab"
|
||||
@ -3898,6 +3906,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_MENU_RGUI_EXTENDED_ASCII,
|
||||
"rgui_extended_ascii"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_MENU_RGUI_SWITCH_ICONS,
|
||||
"rgui_switch_icons"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_CONTENT_SHOW_REWIND,
|
||||
"menu_show_rewind_settings"
|
||||
@ -4304,6 +4316,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE,
|
||||
"playlist_sublabel_last_played_style"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS,
|
||||
"playlist_portable_paths"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_HELP_SEND_DEBUG_INFO,
|
||||
"help_send_debug_info"
|
||||
|
@ -40,6 +40,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_NETPLAY_TAB,
|
||||
"Netplay"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_EXPLORE_TAB,
|
||||
"Explore"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_ADD_TAB,
|
||||
"Import Content"
|
||||
@ -4915,6 +4919,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_LIST,
|
||||
"Perform maintenance tasks on playlists."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_PORTABLE_PATHS,
|
||||
"Portable Playlists"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS,
|
||||
"When enabled, and 'File Browser' directory is also selected, the current value of parameter 'File Browser' is saved in the playlist. When the playlist is loaded on another system where the same option is enabled, the value of parameter 'File Browser' is compared with the playlist value; if different, the playlist entries' paths are automatically fixed."
|
||||
)
|
||||
|
||||
/* Settings > Playlists > Playlist Management */
|
||||
|
||||
@ -7632,6 +7644,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_RGUI_EXTENDED_ASCII,
|
||||
"Enable display of non-standard ASCII characters. Required for compatibility with certain non-English Western languages. Has a moderate performance impact."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_RGUI_SWITCH_ICONS,
|
||||
"Show Switch Icons"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_RGUI_SWITCH_ICONS,
|
||||
"Use icons instead of ON/OFF text to represent 'toggle switch' menu settings entries."
|
||||
)
|
||||
|
||||
/* RGUI: Settings Options */
|
||||
|
||||
|
@ -872,6 +872,7 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_SUBSYSTEM_ADD:
|
||||
case MENU_ENUM_LABEL_SUBSYSTEM_LOAD:
|
||||
case MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM:
|
||||
case MENU_ENUM_LABEL_EXPLORE_ITEM:
|
||||
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_SHADER_SCALE_PASS:
|
||||
|
@ -2076,6 +2076,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
content_path[0] = '\0';
|
||||
content_label[0] = '\0';
|
||||
@ -6360,6 +6361,7 @@ static int action_ok_manual_content_scan_start(const char *path,
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
task_push_manual_content_scan(&playlist_config, directory_playlist);
|
||||
return 0;
|
||||
@ -7133,6 +7135,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
||||
{MENU_ENUM_LABEL_SCREEN_RESOLUTION, action_ok_video_resolution},
|
||||
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_DEFAULT_CORE, action_ok_playlist_default_core},
|
||||
{MENU_ENUM_LABEL_CORE_MANAGER_LIST, action_ok_push_core_manager_list},
|
||||
{MENU_ENUM_LABEL_EXPLORE_TAB, action_ok_push_default},
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ok_list); i++)
|
||||
|
@ -994,6 +994,7 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_SUBSYSTEM_ADD:
|
||||
case MENU_ENUM_LABEL_SUBSYSTEM_LOAD:
|
||||
case MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM:
|
||||
case MENU_ENUM_LABEL_EXPLORE_ITEM:
|
||||
BIND_ACTION_RIGHT(cbs, action_right_mainmenu);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_SHADER_SCALE_PASS:
|
||||
|
@ -851,8 +851,10 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_sort_alphabetical,
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_fuzzy_archive_match, MENU_ENUM_SUBLABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_use_old_format, MENU_ENUM_SUBLABEL_PLAYLIST_USE_OLD_FORMAT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_compression, MENU_ENUM_SUBLABEL_PLAYLIST_COMPRESSION)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_portable_paths, MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_full_width_layout, MENU_ENUM_SUBLABEL_MENU_RGUI_FULL_WIDTH_LAYOUT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_extended_ascii, MENU_ENUM_SUBLABEL_MENU_RGUI_EXTENDED_ASCII)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_switch_icons, MENU_ENUM_SUBLABEL_MENU_RGUI_SWITCH_ICONS)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_thumbnails_updater_list, MENU_ENUM_SUBLABEL_THUMBNAILS_UPDATER_LIST)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_pl_thumbnails_updater_list, MENU_ENUM_SUBLABEL_PL_THUMBNAILS_UPDATER_LIST)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_help_send_debug_info, MENU_ENUM_SUBLABEL_HELP_SEND_DEBUG_INFO)
|
||||
@ -3814,6 +3816,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_fuzzy_archive_match);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_portable_paths);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_old_format);
|
||||
break;
|
||||
@ -3826,6 +3831,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_MENU_RGUI_EXTENDED_ASCII:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_rgui_extended_ascii);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_RGUI_SWITCH_ICONS:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_rgui_switch_icons);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_updater_list);
|
||||
break;
|
||||
|
@ -745,6 +745,7 @@ static int action_get_title_group_settings(const char *path, const char *label,
|
||||
{MENU_ENUM_LABEL_SETTINGS_TAB, MENU_ENUM_LABEL_VALUE_SETTINGS_TAB } ,
|
||||
{MENU_ENUM_LABEL_PLAYLISTS_TAB, MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB} ,
|
||||
{MENU_ENUM_LABEL_ADD_TAB, MENU_ENUM_LABEL_VALUE_ADD_TAB } ,
|
||||
{MENU_ENUM_LABEL_EXPLORE_TAB, MENU_ENUM_LABEL_VALUE_EXPLORE_TAB } ,
|
||||
{MENU_ENUM_LABEL_NETPLAY_TAB, MENU_ENUM_LABEL_VALUE_NETPLAY_TAB } ,
|
||||
{MENU_ENUM_LABEL_HORIZONTAL_MENU, MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU },
|
||||
};
|
||||
|
@ -9157,6 +9157,7 @@ static void materialui_list_insert(
|
||||
case FILE_TYPE_CORE:
|
||||
case MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS:
|
||||
case MENU_SETTING_ACTION_CORE_LOCK:
|
||||
case MENU_EXPLORE_TAB:
|
||||
node->icon_texture_index = MUI_TEXTURE_CORES;
|
||||
node->has_icon = true;
|
||||
break;
|
||||
|
@ -196,6 +196,10 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable)
|
||||
ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_ADD;
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_EXPLORE;
|
||||
#endif
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
gfx_display_set_width(width);
|
||||
|
@ -46,7 +46,12 @@ enum msg_hash_enums ozone_system_tabs_value[OZONE_SYSTEM_TAB_LAST] = {
|
||||
#ifdef HAVE_NETWORKING
|
||||
MENU_ENUM_LABEL_VALUE_NETPLAY_TAB,
|
||||
#endif
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
MENU_ENUM_LABEL_VALUE_ADD_TAB,
|
||||
MENU_ENUM_LABEL_VALUE_EXPLORE_TAB
|
||||
#else
|
||||
MENU_ENUM_LABEL_VALUE_ADD_TAB
|
||||
#endif
|
||||
};
|
||||
|
||||
enum menu_settings_type ozone_system_tabs_type[OZONE_SYSTEM_TAB_LAST] = {
|
||||
@ -64,7 +69,12 @@ enum menu_settings_type ozone_system_tabs_type[OZONE_SYSTEM_TAB_LAST] = {
|
||||
#ifdef HAVE_NETWORKING
|
||||
MENU_NETPLAY_TAB,
|
||||
#endif
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
MENU_ADD_TAB,
|
||||
MENU_EXPLORE_TAB
|
||||
#else
|
||||
MENU_ADD_TAB
|
||||
#endif
|
||||
};
|
||||
|
||||
enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST] = {
|
||||
@ -82,7 +92,12 @@ enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST] = {
|
||||
#ifdef HAVE_NETWORKING
|
||||
MENU_ENUM_LABEL_NETPLAY_TAB,
|
||||
#endif
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
MENU_ENUM_LABEL_ADD_TAB,
|
||||
MENU_ENUM_LABEL_EXPLORE_TAB
|
||||
#else
|
||||
MENU_ENUM_LABEL_ADD_TAB
|
||||
#endif
|
||||
};
|
||||
|
||||
unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST] = {
|
||||
@ -1006,6 +1021,9 @@ bool ozone_is_playlist(ozone_handle_t *ozone, bool depth)
|
||||
case OZONE_SYSTEM_TAB_ADD:
|
||||
#ifdef HAVE_NETWORKING
|
||||
case OZONE_SYSTEM_TAB_NETPLAY:
|
||||
#endif
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
case OZONE_SYSTEM_TAB_EXPLORE:
|
||||
#endif
|
||||
is_playlist = false;
|
||||
break;
|
||||
|
@ -39,6 +39,7 @@ enum
|
||||
OZONE_SYSTEM_TAB_NETPLAY,
|
||||
#endif
|
||||
OZONE_SYSTEM_TAB_ADD,
|
||||
OZONE_SYSTEM_TAB_EXPLORE,
|
||||
|
||||
/* End of this enum - use the last one to determine num of possible tabs */
|
||||
OZONE_SYSTEM_TAB_LAST
|
||||
|
@ -165,6 +165,7 @@ uintptr_t ozone_entries_icon_get_texture(ozone_handle_t *ozone,
|
||||
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
|
||||
case MENU_ENUM_LABEL_UPDATE_CORE_INFO_FILES:
|
||||
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INFO];
|
||||
case MENU_ENUM_LABEL_EXPLORE_TAB:
|
||||
case MENU_ENUM_LABEL_UPDATE_DATABASES:
|
||||
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
|
||||
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_RDB];
|
||||
|
@ -550,6 +550,20 @@ typedef struct
|
||||
float d;
|
||||
} rgui_particle_t;
|
||||
|
||||
/* Defines all possible entry value types
|
||||
* > Note: These are not necessarily 'values',
|
||||
* but they correspond to the object drawn in
|
||||
* the 'value' location when rendering
|
||||
* menu lists */
|
||||
enum rgui_entry_value_type
|
||||
{
|
||||
RGUI_ENTRY_VALUE_NONE = 0,
|
||||
RGUI_ENTRY_VALUE_TEXT,
|
||||
RGUI_ENTRY_VALUE_SWITCH_ON,
|
||||
RGUI_ENTRY_VALUE_SWITCH_OFF,
|
||||
RGUI_ENTRY_VALUE_CHECKMARK
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool bg_modified;
|
||||
@ -625,7 +639,13 @@ enum rgui_symbol_type
|
||||
RGUI_SYMBOL_BATTERY_60,
|
||||
RGUI_SYMBOL_BATTERY_40,
|
||||
RGUI_SYMBOL_BATTERY_20,
|
||||
RGUI_SYMBOL_CHECKMARK
|
||||
RGUI_SYMBOL_CHECKMARK,
|
||||
RGUI_SYMBOL_SWITCH_ON_LEFT,
|
||||
RGUI_SYMBOL_SWITCH_ON_CENTRE,
|
||||
RGUI_SYMBOL_SWITCH_ON_RIGHT,
|
||||
RGUI_SYMBOL_SWITCH_OFF_LEFT,
|
||||
RGUI_SYMBOL_SWITCH_OFF_CENTRE,
|
||||
RGUI_SYMBOL_SWITCH_OFF_RIGHT
|
||||
};
|
||||
|
||||
/* All custom symbols must have dimensions
|
||||
@ -789,6 +809,78 @@ static const uint8_t rgui_symbol_data_checkmark[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 1, 1, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_on_left[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
0, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_on_centre[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 0,
|
||||
1, 1, 1, 1, 0,
|
||||
1, 1, 1, 1, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_on_right[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
0, 1, 1, 1, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_off_left[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 0, 0, 0, 1,
|
||||
0, 1, 1, 1, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_off_centre[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 1,
|
||||
0, 1, 0, 0, 0,
|
||||
0, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
static const uint8_t rgui_symbol_data_switch_off_right[FONT_WIDTH * FONT_HEIGHT] = {
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 0,
|
||||
0, 0, 0, 0, 1,
|
||||
1, 1, 1, 1, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, /* Baseline */
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
|
||||
/* ==============================
|
||||
* Custom Symbols (glyphs) END
|
||||
* ============================== */
|
||||
@ -2638,6 +2730,18 @@ static const uint8_t *rgui_get_symbol_data(enum rgui_symbol_type symbol)
|
||||
return rgui_symbol_data_battery_20;
|
||||
case RGUI_SYMBOL_CHECKMARK:
|
||||
return rgui_symbol_data_checkmark;
|
||||
case RGUI_SYMBOL_SWITCH_ON_LEFT:
|
||||
return rgui_symbol_data_switch_on_left;
|
||||
case RGUI_SYMBOL_SWITCH_ON_CENTRE:
|
||||
return rgui_symbol_data_switch_on_centre;
|
||||
case RGUI_SYMBOL_SWITCH_ON_RIGHT:
|
||||
return rgui_symbol_data_switch_on_right;
|
||||
case RGUI_SYMBOL_SWITCH_OFF_LEFT:
|
||||
return rgui_symbol_data_switch_off_left;
|
||||
case RGUI_SYMBOL_SWITCH_OFF_CENTRE:
|
||||
return rgui_symbol_data_switch_off_centre;
|
||||
case RGUI_SYMBOL_SWITCH_OFF_RIGHT:
|
||||
return rgui_symbol_data_switch_off_right;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -3228,6 +3332,58 @@ static void rgui_render_osk(
|
||||
}
|
||||
}
|
||||
|
||||
static void rgui_render_toggle_switch(unsigned fb_width, int x, int y,
|
||||
bool on, uint16_t color, uint16_t shadow_color)
|
||||
{
|
||||
int x_current = x;
|
||||
|
||||
/* Toggle switch is just 3 adjacent symbols
|
||||
* > Note that we indent the left/right symbols
|
||||
* by 1 pixel, to avoid the gap that is normally
|
||||
* present between symbols/characters */
|
||||
blit_symbol(fb_width, x_current + 1, y,
|
||||
on ? RGUI_SYMBOL_SWITCH_ON_LEFT : RGUI_SYMBOL_SWITCH_OFF_LEFT,
|
||||
color, shadow_color);
|
||||
x_current += FONT_WIDTH_STRIDE;
|
||||
|
||||
blit_symbol(fb_width, x_current, y,
|
||||
on ? RGUI_SYMBOL_SWITCH_ON_CENTRE : RGUI_SYMBOL_SWITCH_OFF_CENTRE,
|
||||
color, shadow_color);
|
||||
x_current += FONT_WIDTH_STRIDE;
|
||||
|
||||
blit_symbol(fb_width, x_current - 1, y,
|
||||
on ? RGUI_SYMBOL_SWITCH_ON_RIGHT : RGUI_SYMBOL_SWITCH_OFF_RIGHT,
|
||||
color, shadow_color);
|
||||
}
|
||||
|
||||
static enum rgui_entry_value_type rgui_get_entry_value_type(
|
||||
const char *entry_value, bool entry_checked,
|
||||
bool switch_icons_enabled)
|
||||
{
|
||||
enum rgui_entry_value_type value_type = RGUI_ENTRY_VALUE_NONE;
|
||||
|
||||
if (!string_is_empty(entry_value))
|
||||
{
|
||||
value_type = RGUI_ENTRY_VALUE_TEXT;
|
||||
|
||||
if (switch_icons_enabled)
|
||||
{
|
||||
/* Toggle switch off */
|
||||
if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) ||
|
||||
string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||
value_type = RGUI_ENTRY_VALUE_SWITCH_OFF;
|
||||
/* Toggle switch on */
|
||||
else if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) ||
|
||||
string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON)))
|
||||
value_type = RGUI_ENTRY_VALUE_SWITCH_ON;
|
||||
}
|
||||
}
|
||||
else if (entry_checked)
|
||||
value_type = RGUI_ENTRY_VALUE_CHECKMARK;
|
||||
|
||||
return value_type;
|
||||
}
|
||||
|
||||
#if defined(GEKKO)
|
||||
/* Need to forward declare this for the Wii build
|
||||
* (I'm not going to reorder the functions and mess
|
||||
@ -3262,6 +3418,7 @@ static void rgui_render(void *data,
|
||||
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
|
||||
bool rgui_swap_thumbnails = settings->bools.menu_rgui_swap_thumbnails;
|
||||
bool rgui_full_width_layout = settings->bools.menu_rgui_full_width_layout;
|
||||
bool rgui_switch_icons = settings->bools.menu_rgui_switch_icons;
|
||||
bool menu_show_sublabels = settings->bools.menu_show_sublabels;
|
||||
bool video_fullscreen = settings->bools.video_fullscreen;
|
||||
bool menu_mouse_enable = settings->bools.menu_mouse_enable;
|
||||
@ -3656,12 +3813,13 @@ static void rgui_render(void *data,
|
||||
char entry_title_buf[255];
|
||||
char type_str_buf[255];
|
||||
menu_entry_t entry;
|
||||
const char *entry_label = NULL;
|
||||
const char *entry_value = NULL;
|
||||
size_t entry_title_max_len = 0;
|
||||
unsigned entry_value_len = 0;
|
||||
bool entry_selected = (i == selection);
|
||||
uint16_t entry_color = entry_selected ?
|
||||
const char *entry_label = NULL;
|
||||
const char *entry_value = NULL;
|
||||
size_t entry_title_max_len = 0;
|
||||
unsigned entry_value_len = 0;
|
||||
enum rgui_entry_value_type entry_value_type = RGUI_ENTRY_VALUE_NONE;
|
||||
bool entry_selected = (i == selection);
|
||||
uint16_t entry_color = entry_selected ?
|
||||
rgui->colors.hover_color : rgui->colors.normal_color;
|
||||
|
||||
if (i > (selection + 100))
|
||||
@ -3721,23 +3879,45 @@ static void rgui_render(void *data,
|
||||
entry_title_max_len -= (thumbnail_width / FONT_WIDTH_STRIDE) + 1;
|
||||
}
|
||||
|
||||
/* Determine whether entry has a value component */
|
||||
if (!string_is_empty(entry_value))
|
||||
{
|
||||
if (rgui_full_width_layout)
|
||||
{
|
||||
/* Resize fields according to actual length of value string */
|
||||
entry_value_len = (unsigned)strlen(entry_value);
|
||||
entry_value_len = (entry_value_len
|
||||
> rgui_term_layout.value_maxlen)
|
||||
? rgui_term_layout.value_maxlen
|
||||
: entry_value_len;
|
||||
}
|
||||
else /* Use classic fixed width layout */
|
||||
entry_value_len = entry.spacing;
|
||||
/* Get 'type' of entry value component */
|
||||
entry_value_type = rgui_get_entry_value_type(
|
||||
entry_value, entry.checked, rgui_switch_icons);
|
||||
|
||||
/* Update width of entry title field */
|
||||
entry_title_max_len -= entry_value_len + 2;
|
||||
switch (entry_value_type)
|
||||
{
|
||||
case RGUI_ENTRY_VALUE_TEXT:
|
||||
/* Resize fields according to actual length
|
||||
* of value string */
|
||||
if (rgui_full_width_layout)
|
||||
{
|
||||
entry_value_len = (unsigned)strlen(entry_value);
|
||||
entry_value_len = (entry_value_len
|
||||
> rgui_term_layout.value_maxlen) ?
|
||||
rgui_term_layout.value_maxlen :
|
||||
entry_value_len;
|
||||
}
|
||||
/* Use classic fixed width layout */
|
||||
else
|
||||
entry_value_len = entry.spacing;
|
||||
|
||||
/* Update width of entry title field */
|
||||
entry_title_max_len -= entry_value_len + 2;
|
||||
break;
|
||||
case RGUI_ENTRY_VALUE_SWITCH_ON:
|
||||
case RGUI_ENTRY_VALUE_SWITCH_OFF:
|
||||
/* Switch icon is 3 characters wide
|
||||
* (if using classic fixed width layout,
|
||||
* set maximum width to ensure icon is
|
||||
* aligned with left hand edge of values
|
||||
* column) */
|
||||
entry_value_len = rgui_full_width_layout ?
|
||||
3 : RGUI_ENTRY_VALUE_MAXLEN;
|
||||
|
||||
/* Update width of entry title field */
|
||||
entry_title_max_len -= entry_value_len + 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Format entry title string */
|
||||
@ -3769,41 +3949,59 @@ static void rgui_render(void *data,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
|
||||
/* Print entry value, if required */
|
||||
if (entry_value_len > 0)
|
||||
switch (entry_value_type)
|
||||
{
|
||||
/* Format entry value string */
|
||||
if (use_smooth_ticker)
|
||||
{
|
||||
ticker_smooth.field_width = entry_value_len * FONT_WIDTH_STRIDE;
|
||||
ticker_smooth.src_str = entry_value;
|
||||
ticker_smooth.dst_str = type_str_buf;
|
||||
ticker_smooth.dst_str_len = sizeof(type_str_buf);
|
||||
ticker_smooth.x_offset = &ticker_x_offset;
|
||||
case RGUI_ENTRY_VALUE_TEXT:
|
||||
/* Format entry value string */
|
||||
if (use_smooth_ticker)
|
||||
{
|
||||
ticker_smooth.field_width = entry_value_len * FONT_WIDTH_STRIDE;
|
||||
ticker_smooth.src_str = entry_value;
|
||||
ticker_smooth.dst_str = type_str_buf;
|
||||
ticker_smooth.dst_str_len = sizeof(type_str_buf);
|
||||
ticker_smooth.x_offset = &ticker_x_offset;
|
||||
|
||||
gfx_animation_ticker_smooth(&ticker_smooth);
|
||||
}
|
||||
else
|
||||
{
|
||||
ticker.s = type_str_buf;
|
||||
ticker.len = entry_value_len;
|
||||
ticker.str = entry_value;
|
||||
gfx_animation_ticker_smooth(&ticker_smooth);
|
||||
}
|
||||
else
|
||||
{
|
||||
ticker.s = type_str_buf;
|
||||
ticker.len = entry_value_len;
|
||||
ticker.str = entry_value;
|
||||
|
||||
gfx_animation_ticker(&ticker);
|
||||
}
|
||||
gfx_animation_ticker(&ticker);
|
||||
}
|
||||
|
||||
/* Print entry value */
|
||||
blit_line(rgui,
|
||||
fb_width,
|
||||
ticker_x_offset + term_end_x - ((entry_value_len + 1) * FONT_WIDTH_STRIDE),
|
||||
y,
|
||||
type_str_buf,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
/* Print entry value */
|
||||
blit_line(rgui,
|
||||
fb_width,
|
||||
ticker_x_offset + term_end_x - ((entry_value_len + 1) * FONT_WIDTH_STRIDE),
|
||||
y,
|
||||
type_str_buf,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
break;
|
||||
case RGUI_ENTRY_VALUE_SWITCH_ON:
|
||||
rgui_render_toggle_switch(fb_width,
|
||||
term_end_x - ((entry_value_len + 1) * FONT_WIDTH_STRIDE), y,
|
||||
true,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
break;
|
||||
case RGUI_ENTRY_VALUE_SWITCH_OFF:
|
||||
rgui_render_toggle_switch(fb_width,
|
||||
term_end_x - ((entry_value_len + 1) * FONT_WIDTH_STRIDE), y,
|
||||
false,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
break;
|
||||
case RGUI_ENTRY_VALUE_CHECKMARK:
|
||||
/* Print marker for currently selected
|
||||
* item in drop-down lists */
|
||||
blit_symbol(fb_width, x + FONT_WIDTH_STRIDE, y,
|
||||
RGUI_SYMBOL_CHECKMARK,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* Print marker for currently selected item in
|
||||
* drop down lists, if required */
|
||||
else if (entry.checked)
|
||||
blit_symbol(fb_width, x + FONT_WIDTH_STRIDE, y, RGUI_SYMBOL_CHECKMARK,
|
||||
entry_color, rgui->colors.shadow_color);
|
||||
|
||||
/* Print selection marker, if required */
|
||||
if (entry_selected)
|
||||
|
@ -249,6 +249,7 @@ enum
|
||||
XMB_SYSTEM_TAB_NETPLAY,
|
||||
#endif
|
||||
XMB_SYSTEM_TAB_ADD,
|
||||
XMB_SYSTEM_TAB_EXPLORE,
|
||||
|
||||
/* End of this enum - use the last one to determine num of possible tabs */
|
||||
XMB_SYSTEM_TAB_MAX_LENGTH
|
||||
@ -339,6 +340,7 @@ typedef struct xmb_handle
|
||||
xmb_node_t history_tab_node;
|
||||
xmb_node_t favorites_tab_node;
|
||||
xmb_node_t add_tab_node;
|
||||
xmb_node_t explore_tab_node;
|
||||
xmb_node_t netplay_tab_node;
|
||||
menu_input_pointer_t pointer;
|
||||
|
||||
@ -1864,6 +1866,8 @@ static xmb_node_t* xmb_get_node(xmb_handle_t *xmb, unsigned i)
|
||||
#endif
|
||||
case XMB_SYSTEM_TAB_ADD:
|
||||
return &xmb->add_tab_node;
|
||||
case XMB_SYSTEM_TAB_EXPLORE:
|
||||
return &xmb->explore_tab_node;
|
||||
default:
|
||||
if (i > xmb->system_tab_end)
|
||||
return xmb_get_userdata_from_horizontal_list(
|
||||
@ -5446,6 +5450,10 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
&& !settings->bools.kiosk_mode_enable)
|
||||
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD;
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_EXPLORE;
|
||||
#endif
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
/* TODO/FIXME - we don't use framebuffer at all
|
||||
@ -5928,6 +5936,10 @@ static void xmb_context_reset_textures(
|
||||
xmb->add_tab_node.alpha = xmb->categories_active_alpha;
|
||||
xmb->add_tab_node.zoom = xmb->categories_active_zoom;
|
||||
|
||||
xmb->explore_tab_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
|
||||
xmb->explore_tab_node.alpha = xmb->categories_active_alpha;
|
||||
xmb->explore_tab_node.zoom = xmb->categories_active_zoom;
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
xmb->netplay_tab_node.icon = xmb->textures.list[XMB_TEXTURE_NETPLAY];
|
||||
xmb->netplay_tab_node.alpha = xmb->categories_active_alpha;
|
||||
@ -6354,6 +6366,12 @@ static void xmb_list_cache(void *data, enum menu_list_type type, unsigned action
|
||||
menu_stack->list[stack_size - 1].type =
|
||||
MENU_ADD_TAB;
|
||||
break;
|
||||
case XMB_SYSTEM_TAB_EXPLORE:
|
||||
menu_stack->list[stack_size - 1].label =
|
||||
strdup(msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB));
|
||||
menu_stack->list[stack_size - 1].type =
|
||||
MENU_EXPLORE_TAB;
|
||||
break;
|
||||
default:
|
||||
menu_stack->list[stack_size - 1].label =
|
||||
strdup(msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU));
|
||||
|
@ -1673,6 +1673,7 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
path_playlist[0] = path_base[0] = query[0] = '\0';
|
||||
|
||||
@ -2314,6 +2315,7 @@ static void menu_displaylist_set_new_playlist(
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
menu->db_playlist_file[0] = '\0';
|
||||
|
||||
@ -3053,62 +3055,70 @@ static unsigned menu_displaylist_parse_playlists(
|
||||
* from the main menu 'Scan Content' entry. Placing
|
||||
* them here as well is unnecessary/ugly duplication */
|
||||
if (settings->bools.menu_content_show_add &&
|
||||
!(string_is_equal(menu_ident, "glui") &&
|
||||
!settings->bools.menu_materialui_show_nav_bar))
|
||||
!(string_is_equal(menu_ident, "glui") &&
|
||||
!settings->bools.menu_materialui_show_nav_bar))
|
||||
{
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY),
|
||||
MENU_ENUM_LABEL_SCAN_DIRECTORY,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY),
|
||||
MENU_ENUM_LABEL_SCAN_DIRECTORY,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_FILE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE),
|
||||
MENU_ENUM_LABEL_SCAN_FILE,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_FILE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE),
|
||||
MENU_ENUM_LABEL_SCAN_FILE,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
#endif
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST),
|
||||
MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST),
|
||||
MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
}
|
||||
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
|
||||
MENU_ENUM_LABEL_GOTO_FAVORITES,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
if (settings->bools.menu_content_show_images)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES),
|
||||
MENU_ENUM_LABEL_GOTO_IMAGES,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_EXPLORE_TAB),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB),
|
||||
MENU_ENUM_LABEL_EXPLORE_TAB,
|
||||
MENU_EXPLORE_TAB, 0, 0))
|
||||
count++;
|
||||
#endif
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
|
||||
MENU_ENUM_LABEL_GOTO_FAVORITES,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
if (settings->bools.menu_content_show_images)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES),
|
||||
MENU_ENUM_LABEL_GOTO_IMAGES,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
|
||||
if (settings->bools.menu_content_show_music)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC),
|
||||
MENU_ENUM_LABEL_GOTO_MUSIC,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
if (settings->bools.menu_content_show_music)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC),
|
||||
MENU_ENUM_LABEL_GOTO_MUSIC,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
|
||||
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
||||
if (settings->bools.menu_content_show_video)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO),
|
||||
MENU_ENUM_LABEL_GOTO_VIDEO,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
if (settings->bools.menu_content_show_video)
|
||||
if (menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO),
|
||||
MENU_ENUM_LABEL_GOTO_VIDEO,
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4357,6 +4367,13 @@ static bool menu_displaylist_push_internal(
|
||||
if (menu_displaylist_ctl(DISPLAYLIST_SCAN_DIRECTORY_LIST, info))
|
||||
return true;
|
||||
}
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB)))
|
||||
{
|
||||
if (menu_displaylist_ctl(DISPLAYLIST_EXPLORE, info))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)))
|
||||
{
|
||||
if (menu_displaylist_ctl(DISPLAYLIST_NETPLAY_ROOM_LIST, info))
|
||||
@ -5130,6 +5147,7 @@ unsigned menu_displaylist_build_list(
|
||||
{MENU_ENUM_LABEL_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG_AGGREGATE, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS, PARSE_ONLY_BOOL, true},
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(build_list); i++)
|
||||
@ -5434,6 +5452,14 @@ unsigned menu_displaylist_build_list(
|
||||
case DISPLAYLIST_SYSTEM_INFO:
|
||||
count = menu_displaylist_parse_system_info(list);
|
||||
break;
|
||||
case DISPLAYLIST_EXPLORE:
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
{
|
||||
unsigned menu_displaylist_explore(file_list_t *list);
|
||||
count = menu_displaylist_explore(list);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case DISPLAYLIST_SCAN_DIRECTORY_LIST:
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
if (menu_entries_append_enum(list,
|
||||
@ -8573,6 +8599,7 @@ unsigned menu_displaylist_build_list(
|
||||
{MENU_ENUM_LABEL_MENU_TICKER_SMOOTH, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_OZONE_SCROLL_CONTENT_METADATA, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_MENU_RGUI_EXTENDED_ASCII, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_MENU_RGUI_SWITCH_ICONS, PARSE_ONLY_BOOL, true},
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(build_list); i++)
|
||||
@ -10785,6 +10812,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||
case DISPLAYLIST_AUDIO_SYNCHRONIZATION_SETTINGS_LIST:
|
||||
case DISPLAYLIST_HELP_SCREEN_LIST:
|
||||
case DISPLAYLIST_INFORMATION_LIST:
|
||||
case DISPLAYLIST_EXPLORE:
|
||||
case DISPLAYLIST_SCAN_DIRECTORY_LIST:
|
||||
case DISPLAYLIST_SYSTEM_INFO:
|
||||
case DISPLAYLIST_BLUETOOTH_SETTINGS_LIST:
|
||||
|
@ -79,6 +79,7 @@ enum menu_displaylist_ctl_state
|
||||
DISPLAYLIST_HORIZONTAL,
|
||||
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
|
||||
DISPLAYLIST_HISTORY,
|
||||
DISPLAYLIST_EXPLORE,
|
||||
DISPLAYLIST_FAVORITES,
|
||||
DISPLAYLIST_PLAYLIST,
|
||||
DISPLAYLIST_VIDEO_HISTORY,
|
||||
|
@ -66,6 +66,7 @@ enum menu_settings_type
|
||||
MENU_VIDEO_TAB,
|
||||
MENU_IMAGES_TAB,
|
||||
MENU_NETPLAY_TAB,
|
||||
MENU_EXPLORE_TAB,
|
||||
MENU_ADD_TAB,
|
||||
MENU_PLAYLISTS_TAB,
|
||||
MENU_SETTING_DROPDOWN_ITEM,
|
||||
@ -473,6 +474,8 @@ void menu_display_handle_wallpaper_upload(retro_task_t *task,
|
||||
void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
void menu_explore_free(void);
|
||||
|
||||
menu_handle_t *menu_driver_get_ptr(void);
|
||||
|
||||
enum action_iterate_type
|
||||
|
1190
menu/menu_explore.c
Normal file
1190
menu/menu_explore.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -13488,6 +13488,21 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_rgui_switch_icons,
|
||||
MENU_ENUM_LABEL_MENU_RGUI_SWITCH_ICONS,
|
||||
MENU_ENUM_LABEL_VALUE_MENU_RGUI_SWITCH_ICONS,
|
||||
DEFAULT_RGUI_SWITCH_ICONS,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
}
|
||||
|
||||
if (string_is_equal(settings->arrays.menu_driver, "xmb"))
|
||||
@ -16251,6 +16266,22 @@ static bool setting_append_list(
|
||||
SD_FLAG_NONE
|
||||
);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.playlist_portable_paths,
|
||||
MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS,
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_PORTABLE_PATHS,
|
||||
DEFAULT_PLAYLIST_PORTABLE_PATHS,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE
|
||||
);
|
||||
|
||||
#ifdef HAVE_OZONE
|
||||
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
{
|
||||
|
@ -1051,6 +1051,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(MENU_RGUI_PARTICLE_EFFECT),
|
||||
MENU_LABEL(MENU_RGUI_PARTICLE_EFFECT_SPEED),
|
||||
MENU_LABEL(MENU_RGUI_EXTENDED_ASCII),
|
||||
MENU_LABEL(MENU_RGUI_SWITCH_ICONS),
|
||||
MENU_LABEL(MENU_LINEAR_FILTER),
|
||||
MENU_LABEL(MENU_HORIZONTAL_ANIMATION),
|
||||
MENU_LABEL(NAVIGATION_WRAPAROUND),
|
||||
@ -1890,6 +1891,9 @@ enum msg_hash_enums
|
||||
MENU_LABEL(SETTINGS_TAB),
|
||||
MENU_LABEL(HISTORY_TAB),
|
||||
MENU_LABEL(FAVORITES_TAB),
|
||||
MENU_ENUM_LABEL_EXPLORE_TAB,
|
||||
MENU_ENUM_LABEL_EXPLORE_ITEM,
|
||||
MENU_ENUM_LABEL_VALUE_EXPLORE_TAB,
|
||||
MENU_LABEL(ADD_TAB),
|
||||
MENU_LABEL(NETPLAY_TAB),
|
||||
MENU_LABEL(PLAYLISTS_TAB),
|
||||
@ -2866,6 +2870,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(PLAYLIST_FUZZY_ARCHIVE_MATCH),
|
||||
MENU_LABEL(PLAYLIST_SUBLABEL_RUNTIME_TYPE),
|
||||
MENU_LABEL(PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE),
|
||||
MENU_LABEL(PLAYLIST_PORTABLE_PATHS),
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV,
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS,
|
||||
|
224
playlist.c
224
playlist.c
@ -34,11 +34,23 @@
|
||||
#include "playlist.h"
|
||||
#include "verbosity.h"
|
||||
#include "file_path_special.h"
|
||||
#include "core_info.h"
|
||||
|
||||
#ifndef PLAYLIST_ENTRIES
|
||||
#define PLAYLIST_ENTRIES 6
|
||||
#endif
|
||||
|
||||
#define WINDOWS_PATH_DELIMITER '\\'
|
||||
#define POSIX_PATH_DELIMITER '/'
|
||||
|
||||
#ifdef _WIN32
|
||||
#define LOCAL_FILE_SYSTEM_PATH_DELIMITER WINDOWS_PATH_DELIMITER
|
||||
#define USING_WINDOWS_FILE_SYSTEM
|
||||
#else
|
||||
#define LOCAL_FILE_SYSTEM_PATH_DELIMITER POSIX_PATH_DELIMITER
|
||||
#define USING_POSIX_FILE_SYSTEM
|
||||
#endif
|
||||
|
||||
struct content_playlist
|
||||
{
|
||||
bool modified;
|
||||
@ -54,6 +66,7 @@ struct content_playlist
|
||||
|
||||
char *default_core_path;
|
||||
char *default_core_name;
|
||||
char *base_content_directory;
|
||||
|
||||
struct playlist_entry *entries;
|
||||
playlist_config_t config;
|
||||
@ -92,6 +105,13 @@ typedef int (playlist_sort_fun_t)(
|
||||
const struct playlist_entry *a,
|
||||
const struct playlist_entry *b);
|
||||
|
||||
/* TODO/FIXME - hack for allowing the explore view to switch
|
||||
* over to a playlist item */
|
||||
void playlist_set_cached(playlist_t* pl)
|
||||
{
|
||||
playlist_cached = pl;
|
||||
}
|
||||
|
||||
/* Convenience function: copies specified playlist
|
||||
* path to specified playlist configuration object */
|
||||
void playlist_config_set_path(playlist_config_t *config, const char *path)
|
||||
@ -105,6 +125,22 @@ void playlist_config_set_path(playlist_config_t *config, const char *path)
|
||||
strlcpy(config->path, path, sizeof(config->path));
|
||||
}
|
||||
|
||||
/* Convenience function: copies base content directory
|
||||
* path to specified playlist configuration object.
|
||||
* Also sets autofix_paths boolean, depending on base content directory value */
|
||||
void playlist_config_set_base_content_directory(playlist_config_t* config, const char* path)
|
||||
{
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
config->autofix_paths = !string_is_empty(path);
|
||||
if (!config->autofix_paths)
|
||||
config->base_content_directory[0] = '\0';
|
||||
else
|
||||
strlcpy(config->base_content_directory, path, sizeof(config->base_content_directory));
|
||||
}
|
||||
|
||||
|
||||
/* Creates a copy of the specified playlist configuration.
|
||||
* Returns false in the event of an error */
|
||||
bool playlist_config_copy(const playlist_config_t *src, playlist_config_t *dst)
|
||||
@ -113,11 +149,13 @@ bool playlist_config_copy(const playlist_config_t *src, playlist_config_t *dst)
|
||||
return false;
|
||||
|
||||
strlcpy(dst->path, src->path, sizeof(dst->path));
|
||||
strlcpy(dst->base_content_directory, src->base_content_directory, sizeof(dst->base_content_directory));
|
||||
|
||||
dst->capacity = src->capacity;
|
||||
dst->old_format = src->old_format;
|
||||
dst->compress = src->compress;
|
||||
dst->fuzzy_archive_match = src->fuzzy_archive_match;
|
||||
dst->autofix_paths = src->autofix_paths;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -133,6 +171,42 @@ playlist_config_t *playlist_get_config(playlist_t *playlist)
|
||||
return &playlist->config;
|
||||
}
|
||||
|
||||
static void path_replace_base_path_and_convert_to_local_file_system(
|
||||
char *out_path, const char *in_path,
|
||||
const char *in_oldrefpath, const char *in_refpath,
|
||||
size_t size)
|
||||
{
|
||||
size_t in_oldrefpath_length = strlen(in_oldrefpath);
|
||||
size_t in_refpath_length = strlen(in_refpath);
|
||||
|
||||
/* If entry path is inside playlist base path,
|
||||
* replace it with new base content directory */
|
||||
if (string_starts_with_size(in_path, in_oldrefpath, in_oldrefpath_length))
|
||||
{
|
||||
memcpy(out_path, in_refpath, in_refpath_length);
|
||||
memcpy(out_path + in_refpath_length, in_path + in_oldrefpath_length,
|
||||
strlen(in_path) - in_oldrefpath_length + 1);
|
||||
|
||||
#ifdef USING_WINDOWS_FILE_SYSTEM
|
||||
/* If we are running under a win fs, '/' characters
|
||||
* are not allowed anywhere. we replace with '\' and
|
||||
* hope for the best... */
|
||||
string_replace_all_chars(out_path,
|
||||
POSIX_PATH_DELIMITER, WINDOWS_PATH_DELIMITER);
|
||||
#endif
|
||||
|
||||
#ifdef USING_POSIX_FILE_SYSTEM
|
||||
/* Under posix fs, we replace '\' characters with '/' */
|
||||
string_replace_all_chars(out_path,
|
||||
WINDOWS_PATH_DELIMITER, POSIX_PATH_DELIMITER);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(out_path, in_path, size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* playlist_path_equal:
|
||||
* @real_path : 'Real' search path, generated by path_resolve_realpath()
|
||||
@ -228,14 +302,15 @@ static bool playlist_path_equal(const char *real_path,
|
||||
|
||||
/**
|
||||
* playlist_core_path_equal:
|
||||
* @real_core_path : 'Real' search path, generated by path_resolve_realpath()
|
||||
* @entry_core_path : Existing playlist entry 'core path' value
|
||||
* @real_core_path : 'Real' search path, generated by path_resolve_realpath()
|
||||
* @entry_core_path : Existing playlist entry 'core path' value
|
||||
* @config : Playlist config parameters
|
||||
*
|
||||
* Returns 'true' if real_core_path matches entry_core_path
|
||||
* (Taking into account relative paths, case insensitive
|
||||
* filesystems)
|
||||
**/
|
||||
static bool playlist_core_path_equal(const char *real_core_path, const char *entry_core_path)
|
||||
static bool playlist_core_path_equal(const char *real_core_path, const char *entry_core_path, const playlist_config_t *config)
|
||||
{
|
||||
char entry_real_core_path[PATH_MAX_LENGTH];
|
||||
|
||||
@ -263,6 +338,10 @@ static bool playlist_core_path_equal(const char *real_core_path, const char *ent
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (config->autofix_paths &&
|
||||
core_info_core_file_id_is_equal(real_core_path, entry_core_path))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -699,7 +778,7 @@ bool playlist_push_runtime(playlist_t *playlist,
|
||||
if (!equal_path)
|
||||
continue;
|
||||
|
||||
if (!playlist_core_path_equal(real_core_path, playlist->entries[i].core_path))
|
||||
if (!playlist_core_path_equal(real_core_path, playlist->entries[i].core_path, &playlist->config))
|
||||
continue;
|
||||
|
||||
/* If top entry, we don't want to push a new entry since
|
||||
@ -882,7 +961,7 @@ bool playlist_push(playlist_t *playlist,
|
||||
if (!equal_path)
|
||||
continue;
|
||||
|
||||
if (!playlist_core_path_equal(real_core_path, playlist->entries[i].core_path))
|
||||
if (!playlist_core_path_equal(real_core_path, playlist->entries[i].core_path, &playlist->config))
|
||||
continue;
|
||||
|
||||
if ( !string_is_empty(entry->subsystem_ident)
|
||||
@ -1480,6 +1559,21 @@ void playlist_write_file(playlist_t *playlist)
|
||||
JSON_Writer_WriteComma(context.writer);
|
||||
json_write_new_line(context.writer);
|
||||
|
||||
if (!string_is_empty(playlist->base_content_directory))
|
||||
{
|
||||
json_write_space(context.writer, 2);
|
||||
JSON_Writer_WriteString(context.writer, "base_content_directory",
|
||||
STRLEN_CONST("base_content_directory"), JSON_UTF8);
|
||||
JSON_Writer_WriteColon(context.writer);
|
||||
json_write_space(context.writer, 1);
|
||||
JSON_Writer_WriteString(context.writer,
|
||||
playlist->base_content_directory,
|
||||
strlen(playlist->base_content_directory),
|
||||
JSON_UTF8);
|
||||
JSON_Writer_WriteComma(context.writer);
|
||||
json_write_new_line(context.writer);
|
||||
}
|
||||
|
||||
uint_str[0] = '\0';
|
||||
snprintf(uint_str, sizeof(uint_str), "%u", playlist->label_display_mode);
|
||||
|
||||
@ -1759,17 +1853,24 @@ void playlist_free(playlist_t *playlist)
|
||||
free(playlist->default_core_name);
|
||||
playlist->default_core_name = NULL;
|
||||
|
||||
for (i = 0; i < playlist->size; i++)
|
||||
if (playlist->base_content_directory != NULL)
|
||||
free(playlist->base_content_directory);
|
||||
playlist->base_content_directory = NULL;
|
||||
|
||||
if (playlist->entries)
|
||||
{
|
||||
struct playlist_entry *entry = &playlist->entries[i];
|
||||
for (i = 0; i < playlist->size; i++)
|
||||
{
|
||||
struct playlist_entry *entry = &playlist->entries[i];
|
||||
|
||||
if (entry)
|
||||
playlist_free_entry(entry);
|
||||
if (entry)
|
||||
playlist_free_entry(entry);
|
||||
}
|
||||
|
||||
free(playlist->entries);
|
||||
playlist->entries = NULL;
|
||||
}
|
||||
|
||||
free(playlist->entries);
|
||||
playlist->entries = NULL;
|
||||
|
||||
free(playlist);
|
||||
}
|
||||
|
||||
@ -2141,6 +2242,9 @@ static JSON_Parser_HandlerResult JSONObjectMemberHandler(JSON_Parser parser, cha
|
||||
pCtx->current_meta_thumbnail_mode_val = &pCtx->playlist->left_thumbnail_mode;
|
||||
else if (string_is_equal(pValue, "sort_mode"))
|
||||
pCtx->current_meta_sort_mode_val = &pCtx->playlist->sort_mode;
|
||||
else if (string_is_equal(pValue, "base_content_directory"))
|
||||
pCtx->current_meta_val = &pCtx->playlist->base_content_directory;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2561,27 +2665,92 @@ playlist_t *playlist_init(const playlist_config_t *config)
|
||||
goto error;
|
||||
|
||||
/* Set initial values */
|
||||
playlist->modified = false;
|
||||
playlist->old_format = false;
|
||||
playlist->compressed = false;
|
||||
playlist->size = 0;
|
||||
playlist->default_core_name = NULL;
|
||||
playlist->default_core_path = NULL;
|
||||
playlist->entries = entries;
|
||||
playlist->label_display_mode = LABEL_DISPLAY_MODE_DEFAULT;
|
||||
playlist->right_thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||
playlist->left_thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||
playlist->sort_mode = PLAYLIST_SORT_MODE_DEFAULT;
|
||||
playlist->modified = false;
|
||||
playlist->old_format = false;
|
||||
playlist->compressed = false;
|
||||
playlist->size = 0;
|
||||
playlist->default_core_name = NULL;
|
||||
playlist->default_core_path = NULL;
|
||||
playlist->base_content_directory = NULL;
|
||||
playlist->entries = entries;
|
||||
playlist->label_display_mode = LABEL_DISPLAY_MODE_DEFAULT;
|
||||
playlist->right_thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||
playlist->left_thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||
playlist->sort_mode = PLAYLIST_SORT_MODE_DEFAULT;
|
||||
|
||||
/* Attempt to read any existing playlist file */
|
||||
playlist_read_file(playlist);
|
||||
|
||||
/* Try auto-fixing paths if enabled, and playlist
|
||||
* base content directory is different */
|
||||
if (playlist->config.autofix_paths &&
|
||||
!string_is_empty(playlist->base_content_directory) &&
|
||||
!string_is_equal(playlist->base_content_directory,
|
||||
playlist->config.base_content_directory))
|
||||
{
|
||||
size_t i;
|
||||
size_t j;
|
||||
char tmp_entry_path[PATH_MAX_LENGTH];
|
||||
|
||||
for (i = 0; i < playlist->size; i++)
|
||||
{
|
||||
struct playlist_entry *entry = &playlist->entries[i];
|
||||
|
||||
if (!entry || string_is_empty(entry->path))
|
||||
continue;
|
||||
|
||||
/* Fix entry path */
|
||||
tmp_entry_path[0] = '\0';
|
||||
path_replace_base_path_and_convert_to_local_file_system(
|
||||
tmp_entry_path, entry->path,
|
||||
playlist->base_content_directory, playlist->config.base_content_directory,
|
||||
sizeof(tmp_entry_path));
|
||||
|
||||
free(entry->path);
|
||||
entry->path = strdup(tmp_entry_path);
|
||||
|
||||
/* Fix subsystem roms paths*/
|
||||
if (entry->subsystem_roms && (entry->subsystem_roms->size > 0))
|
||||
{
|
||||
struct string_list* subsystem_roms_new_paths = string_list_new();
|
||||
union string_list_elem_attr attributes = {0};
|
||||
|
||||
if (!subsystem_roms_new_paths)
|
||||
goto error;
|
||||
|
||||
for (j = 0; j < entry->subsystem_roms->size; j++)
|
||||
{
|
||||
const char *subsystem_rom_path = entry->subsystem_roms->elems[j].data;
|
||||
|
||||
if (string_is_empty(subsystem_rom_path))
|
||||
continue;
|
||||
|
||||
tmp_entry_path[0] = '\0';
|
||||
path_replace_base_path_and_convert_to_local_file_system(
|
||||
tmp_entry_path, subsystem_rom_path,
|
||||
playlist->base_content_directory, playlist->config.base_content_directory,
|
||||
sizeof(tmp_entry_path));
|
||||
string_list_append(subsystem_roms_new_paths, tmp_entry_path, attributes);
|
||||
}
|
||||
|
||||
string_list_free(entry->subsystem_roms);
|
||||
entry->subsystem_roms = subsystem_roms_new_paths;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update playlist base content directory*/
|
||||
free(playlist->base_content_directory);
|
||||
playlist->base_content_directory = strdup(playlist->config.base_content_directory);
|
||||
|
||||
/* Save playlist */
|
||||
playlist->modified = true;
|
||||
playlist_write_file(playlist);
|
||||
}
|
||||
|
||||
return playlist;
|
||||
|
||||
error:
|
||||
if (playlist)
|
||||
free(playlist);
|
||||
|
||||
playlist_free(playlist);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2760,7 +2929,7 @@ bool playlist_entries_are_equal(
|
||||
path_resolve_realpath(real_core_path_a, sizeof(real_core_path_a), true);
|
||||
}
|
||||
|
||||
return playlist_core_path_equal(real_core_path_a, entry_b->core_path);
|
||||
return playlist_core_path_equal(real_core_path_a, entry_b->core_path, config);
|
||||
}
|
||||
|
||||
void playlist_get_crc32(playlist_t *playlist, size_t idx,
|
||||
@ -2993,3 +3162,4 @@ core_info_t *playlist_get_default_core_info(playlist_t* playlist)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -119,16 +119,22 @@ struct playlist_entry
|
||||
typedef struct
|
||||
{
|
||||
char path[PATH_MAX_LENGTH];
|
||||
char base_content_directory[PATH_MAX_LENGTH];
|
||||
size_t capacity;
|
||||
bool old_format;
|
||||
bool compress;
|
||||
bool fuzzy_archive_match;
|
||||
bool autofix_paths;
|
||||
} playlist_config_t;
|
||||
|
||||
/* Convenience function: copies specified playlist
|
||||
* path to specified playlist configuration object */
|
||||
void playlist_config_set_path(playlist_config_t *config, const char *path);
|
||||
|
||||
/* Convenience function: copies base content directory
|
||||
* path to specified playlist configuration object */
|
||||
void playlist_config_set_base_content_directory(playlist_config_t* config, const char* path);
|
||||
|
||||
/* Creates a copy of the specified playlist configuration.
|
||||
* Returns false in the event of an error */
|
||||
bool playlist_config_copy(const playlist_config_t *src, playlist_config_t *dst);
|
||||
@ -345,6 +351,8 @@ core_info_t *playlist_entry_get_core_info(const struct playlist_entry* entry);
|
||||
* default core association */
|
||||
core_info_t *playlist_get_default_core_info(playlist_t* playlist);
|
||||
|
||||
void playlist_set_cached(playlist_t* pl);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -6051,6 +6051,7 @@ bool menu_entries_append_enum(
|
||||
|
||||
if ( enum_idx != MENU_ENUM_LABEL_PLAYLIST_ENTRY
|
||||
&& enum_idx != MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY
|
||||
&& enum_idx != MENU_ENUM_LABEL_EXPLORE_ITEM
|
||||
&& enum_idx != MENU_ENUM_LABEL_RDB_ENTRY)
|
||||
cbs->setting = menu_setting_find_enum(enum_idx);
|
||||
|
||||
@ -7354,6 +7355,9 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
#ifdef HAVE_NETWORKING
|
||||
core_updater_list_free_cached();
|
||||
#endif
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
menu_explore_free();
|
||||
#endif
|
||||
|
||||
if (p_rarch->menu_driver_data)
|
||||
{
|
||||
@ -16002,6 +16006,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
/* don't use relative paths for content, music, video, and image histories */
|
||||
playlist_config_set_base_content_directory(&playlist_config, NULL);
|
||||
|
||||
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
|
||||
|
||||
@ -33410,7 +33416,6 @@ static bool video_driver_get_flags(gfx_ctx_flags_t *flags)
|
||||
gfx_ctx_flags_t video_driver_get_flags_wrapper(void)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
flags.flags = 0;
|
||||
|
||||
if (!video_driver_get_flags(&flags))
|
||||
@ -39625,6 +39630,7 @@ void rarch_favorites_init(void)
|
||||
playlist_config.old_format = settings ? settings->bools.playlist_use_old_format : false;
|
||||
playlist_config.compress = settings ? settings->bools.playlist_compression : false;
|
||||
playlist_config.fuzzy_archive_match = settings ? settings->bools.playlist_fuzzy_archive_match : false;
|
||||
playlist_config_set_base_content_directory(&playlist_config, NULL);
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
@ -1368,11 +1368,13 @@ bool task_push_dbscan(
|
||||
db->playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
db->playlist_config.compress = settings->bools.playlist_compression;
|
||||
db->playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&db->playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
#else
|
||||
db->playlist_config.capacity = COLLECTION_SIZE;
|
||||
db->playlist_config.old_format = false;
|
||||
db->playlist_config.compress = false;
|
||||
db->playlist_config.fuzzy_archive_match = false;
|
||||
playlist_config_set_base_content_directory(&db->playlist_config, NULL);
|
||||
#endif
|
||||
db->show_hidden_files = db_dir_show_hidden_files;
|
||||
db->is_directory = directory;
|
||||
|
@ -437,6 +437,7 @@ bool task_push_netplay_crc_scan(uint32_t crc, char* name,
|
||||
state->playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
state->playlist_config.compress = settings->bools.playlist_compression;
|
||||
state->playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&state->playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
state->content_crc[0] = '\0';
|
||||
state->content_path[0] = '\0';
|
||||
|
@ -391,6 +391,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
/* Assume a blank list means we will manually enter in all fields. */
|
||||
if (files.isEmpty())
|
||||
@ -697,6 +698,7 @@ bool MainWindow::updateCurrentPlaylistEntry(
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
if ( playlistPath.isEmpty() ||
|
||||
contentHash.isEmpty() ||
|
||||
@ -825,6 +827,7 @@ void MainWindow::onPlaylistWidgetContextMenuRequested(const QPoint&)
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
if (selectedItem)
|
||||
{
|
||||
@ -1361,6 +1364,7 @@ void MainWindow::deleteCurrentPlaylistItem()
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
if (isAllPlaylist)
|
||||
return;
|
||||
@ -1408,6 +1412,7 @@ QString MainWindow::getPlaylistDefaultCore(QString dbName)
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
playlistPath[0] = '\0';
|
||||
|
||||
@ -1478,6 +1483,7 @@ void PlaylistModel::getPlaylistItems(QString path)
|
||||
playlist_config.old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_config.compress = settings->bools.playlist_compression;
|
||||
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
|
||||
|
||||
pathArray.append(path);
|
||||
pathData = pathArray.constData();
|
||||
|
Loading…
x
Reference in New Issue
Block a user