diff --git a/config.def.h b/config.def.h index 1e10214dd1..b566f87826 100644 --- a/config.def.h +++ b/config.def.h @@ -78,7 +78,6 @@ static const int crt_switch_resolution_super = 2560; static const int crt_switch_center_adjust = 0; static const bool def_history_list_enable = true; -static const bool def_playlist_entry_remove = true; static const bool def_playlist_entry_rename = true; static const unsigned int def_user_language = 0; @@ -747,6 +746,8 @@ static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISP /* Specifies which runtime record to use on playlist sublabels */ static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE; + +static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABLE_ALL; #endif static const bool scan_without_core_match = false; diff --git a/configuration.c b/configuration.c index 7c3fbae2ac..8eb0a107a9 100644 --- a/configuration.c +++ b/configuration.c @@ -1590,7 +1590,6 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("savestate_auto_load", &settings->bools.savestate_auto_load, true, savestate_auto_load, false); SETTING_BOOL("savestate_thumbnail_enable", &settings->bools.savestate_thumbnail_enable, true, savestate_thumbnail_enable, false); SETTING_BOOL("history_list_enable", &settings->bools.history_list_enable, true, def_history_list_enable, false); - SETTING_BOOL("playlist_entry_remove", &settings->bools.playlist_entry_remove, true, def_playlist_entry_remove, false); SETTING_BOOL("playlist_entry_rename", &settings->bools.playlist_entry_rename, true, def_playlist_entry_rename, false); SETTING_BOOL("game_specific_options", &settings->bools.game_specific_options, true, default_game_specific_options, false); SETTING_BOOL("auto_overrides_enable", &settings->bools.auto_overrides_enable, true, default_auto_overrides_enable, false); @@ -1837,6 +1836,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, #endif #ifdef HAVE_MENU + SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, playlist_entry_remove_enable, false); SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, playlist_show_inline_core_name, false); SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, playlist_sublabel_runtime_type, false); #endif diff --git a/configuration.h b/configuration.h index b4744e8fe1..9e76139d0b 100644 --- a/configuration.h +++ b/configuration.h @@ -276,7 +276,6 @@ typedef struct settings bool set_supports_no_game_enable; bool auto_screenshot_filename; bool history_list_enable; - bool playlist_entry_remove; bool playlist_entry_rename; bool rewind_enable; bool vrr_runloop_enable; @@ -478,6 +477,7 @@ typedef struct settings unsigned menu_rgui_particle_effect; unsigned menu_ticker_type; + unsigned playlist_entry_remove_enable; unsigned playlist_show_inline_core_name; unsigned playlist_sublabel_runtime_type; diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index 8fa0b4239d..b4ca18da1f 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -910,9 +910,11 @@ static uint32_t gfx_ctx_drm_get_flags(void *data) BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT); if (string_is_equal(video_driver_get_ident(), "glcore")) + { #ifdef HAVE_SLANG BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_SLANG); #endif + } else BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL); diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index cb0a32da8e..19dc0c83dc 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -202,7 +202,7 @@ MSG_HASH(MENU_ENUM_LABEL_CONTENT_DATABASE_DIRECTORY, MSG_HASH(MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE, "content_history_size") MSG_HASH(MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, - "playlist_entry_remove") + "playlist_entry_remove_enable") MSG_HASH(MENU_ENUM_LABEL_CONTENT_SETTINGS, "quick_menu") MSG_HASH(MENU_ENUM_LABEL_CORE_ASSETS_DIRECTORY, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 1070fe2c2f..2aa6cb3aa4 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -8627,6 +8627,18 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_NEVER, "Never" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV, + "History & Favorites" + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL, + "All Playlists" + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE, + "OFF" + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_PLAYLIST_SORT_ALPHABETICAL, "Sort playlists alphabetically" diff --git a/menu/menu_defines.h b/menu/menu_defines.h index b3c67ce1ad..8456ee4dc4 100644 --- a/menu/menu_defines.h +++ b/menu/menu_defines.h @@ -349,6 +349,14 @@ enum playlist_inline_core_display_type PLAYLIST_INLINE_CORE_DISPLAY_LAST }; +enum playlist_entry_remove_enable_type +{ + PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV = 0, + PLAYLIST_ENTRY_REMOVE_ENABLE_ALL, + PLAYLIST_ENTRY_REMOVE_ENABLE_NONE, + PLAYLIST_ENTRY_REMOVE_ENABLE_LAST +}; + typedef uintptr_t menu_texture_item; typedef struct menu_display_ctx_clearcolor diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index df572b48fc..feced23a4a 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2042,13 +2042,34 @@ static int menu_displaylist_parse_horizontal_content_actions( MENU_ENUM_LABEL_RENAME_ENTRY, FILE_TYPE_PLAYLIST_ENTRY, 0, idx); - if (settings->bools.playlist_entry_remove && - !settings->bools.kiosk_mode_enable) - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY), - msg_hash_to_str(MENU_ENUM_LABEL_DELETE_ENTRY), - MENU_ENUM_LABEL_DELETE_ENTRY, - MENU_SETTING_ACTION_DELETE_ENTRY, 0, 0); + if (!settings->bools.kiosk_mode_enable) + { + bool remove_entry_enabled = false; + + if (settings->uints.playlist_entry_remove_enable == PLAYLIST_ENTRY_REMOVE_ENABLE_ALL) + remove_entry_enabled = true; + else if (settings->uints.playlist_entry_remove_enable == PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV) + { + char system[PATH_MAX_LENGTH]; + system[0] = '\0'; + + menu_driver_get_thumbnail_system(system, sizeof(system)); + + if (!string_is_empty(system)) + remove_entry_enabled = string_is_equal(system, "history") || + string_is_equal(system, "favorites") || + string_is_equal(system, "images_history") || + string_is_equal(system, "music_history") || + string_is_equal(system, "video_history"); + } + + if (remove_entry_enabled) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY), + msg_hash_to_str(MENU_ENUM_LABEL_DELETE_ENTRY), + MENU_ENUM_LABEL_DELETE_ENTRY, + MENU_SETTING_ACTION_DELETE_ENTRY, 0, 0); + } if (settings->bools.quick_menu_show_add_to_favorites) { @@ -5628,7 +5649,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, {MENU_ENUM_LABEL_HISTORY_LIST_ENABLE, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_PLAYLIST_ENTRY_RENAME, PARSE_ONLY_BOOL}, - {MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, PARSE_ONLY_BOOL}, + {MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_PLAYLIST_SORT_ALPHABETICAL, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_PLAYLIST_SHOW_INLINE_CORE_NAME, PARSE_ONLY_UINT}, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 5f7dd9e89c..3e56029078 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3862,6 +3862,36 @@ static void setting_get_string_representation_uint_playlist_inline_core_display_ } } +static void setting_get_string_representation_uint_playlist_entry_remove_enable( + rarch_setting_t *setting, + char *s, size_t len) +{ + if (!setting) + return; + + switch (*setting->value.target.unsigned_integer) + { + case PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV: + strlcpy(s, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV), + len); + break; + case PLAYLIST_ENTRY_REMOVE_ENABLE_ALL: + strlcpy(s, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL), + len); + break; + case PLAYLIST_ENTRY_REMOVE_ENABLE_NONE: + strlcpy(s, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE), + len); + break; + } +} + #if defined(_3DS) static void setting_get_string_representation_uint_video_3ds_display_mode( rarch_setting_t *setting, @@ -13016,20 +13046,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); - CONFIG_BOOL( + CONFIG_UINT( list, list_info, - &settings->bools.playlist_entry_remove, + &settings->uints.playlist_entry_remove_enable, MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE, - def_playlist_entry_remove, - MENU_ENUM_LABEL_VALUE_OFF, - MENU_ENUM_LABEL_VALUE_ON, + playlist_entry_remove_enable, &group_info, &subgroup_info, parent_group, general_write_handler, - general_read_handler, - SD_FLAG_NONE); + general_read_handler); + (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; + (*list)[list_info->index - 1].get_string_representation = + &setting_get_string_representation_uint_playlist_entry_remove_enable; + menu_settings_list_current_add_range(list, list_info, 0, PLAYLIST_ENTRY_REMOVE_ENABLE_LAST-1, 1, true, true); CONFIG_BOOL( list, list_info, diff --git a/msg_hash.h b/msg_hash.h index e901ee58fd..0b4ed7d3a1 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -2376,6 +2376,10 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS, MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_NEVER, + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV, + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL, + MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE, + MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_CORE, MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_RUNTIME, MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED,