Cleanup 'Add to Playlist' (#16495)

pull/16506/head
sonninnos 2024-05-05 13:48:20 +03:00 committed by GitHub
parent 24c378da4e
commit 17b9324a24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 114 additions and 61 deletions

View File

@ -689,6 +689,7 @@
#define DEFAULT_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE true
#define DEFAULT_QUICK_MENU_SHOW_REPLAY false
#define DEFAULT_QUICK_MENU_SHOW_ADD_TO_FAVORITES true
#define DEFAULT_QUICK_MENU_SHOW_ADD_TO_PLAYLIST false
#define DEFAULT_QUICK_MENU_SHOW_START_RECORDING true
#define DEFAULT_QUICK_MENU_SHOW_START_STREAMING true
#define DEFAULT_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION true

View File

@ -1924,6 +1924,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("quick_menu_show_take_screenshot", &settings->bools.quick_menu_show_take_screenshot, true, DEFAULT_QUICK_MENU_SHOW_TAKE_SCREENSHOT, false);
SETTING_BOOL("quick_menu_show_undo_save_load_state", &settings->bools.quick_menu_show_undo_save_load_state, true, DEFAULT_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, false);
SETTING_BOOL("quick_menu_show_add_to_favorites", &settings->bools.quick_menu_show_add_to_favorites, true, DEFAULT_QUICK_MENU_SHOW_ADD_TO_FAVORITES, false);
SETTING_BOOL("quick_menu_show_add_to_playlist", &settings->bools.quick_menu_show_add_to_playlist, true, DEFAULT_QUICK_MENU_SHOW_ADD_TO_PLAYLIST, false);
SETTING_BOOL("quick_menu_show_start_recording", &settings->bools.quick_menu_show_start_recording, true, DEFAULT_QUICK_MENU_SHOW_START_RECORDING, false);
SETTING_BOOL("quick_menu_show_start_streaming", &settings->bools.quick_menu_show_start_streaming, true, DEFAULT_QUICK_MENU_SHOW_START_STREAMING, false);
SETTING_BOOL("quick_menu_show_set_core_association", &settings->bools.quick_menu_show_set_core_association, true, DEFAULT_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION, false);

View File

@ -847,6 +847,7 @@ typedef struct settings
bool quick_menu_show_replay;
bool quick_menu_show_undo_save_load_state;
bool quick_menu_show_add_to_favorites;
bool quick_menu_show_add_to_playlist;
bool quick_menu_show_start_recording;
bool quick_menu_show_start_streaming;
bool quick_menu_show_set_core_association;

View File

@ -5,18 +5,6 @@ MSG_HASH(
)
#endif
MSG_HASH(
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
"playlist_add"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_ADD_TO_PLAYLIST_LIST,
"deferred_add_to_playlist_list"
)
MSG_HASH(
MENU_ENUM_LABEL_ADD_ENTRY_TO_PLAYLIST,
"add_entry_to_playlist"
)
MSG_HASH(
MENU_ENUM_LABEL_ACCOUNTS_CHEEVOS_USERNAME,
"accounts_cheevos_username"
@ -3474,6 +3462,22 @@ MSG_HASH(
MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST,
"favorites_add_playlist"
)
MSG_HASH(
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
"playlist_add"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_ADD_TO_PLAYLIST_LIST,
"deferred_add_to_playlist_list"
)
MSG_HASH(
MENU_ENUM_LABEL_ADD_ENTRY_TO_PLAYLIST,
"add_entry_to_playlist"
)
MSG_HASH(
MENU_ENUM_LABEL_CREATE_NEW_PLAYLIST,
"playlist_create"
)
MSG_HASH(
MENU_ENUM_LABEL_SET_CORE_ASSOCIATION,
"set_core_association"
@ -5222,6 +5226,10 @@ MSG_HASH(
MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES,
"quick_menu_show_add_to_favorites"
)
MSG_HASH(
MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
"quick_menu_show_add_to_playlist"
)
MSG_HASH(
MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_RECORDING,
"quick_menu_show_start_recording"

View File

@ -6654,32 +6654,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES,
"Show the 'Add to Favorites' option."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST,
"Add to Playlist"
MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
"Show 'Add to Playlist'"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_ADD_TO_PLAYLIST,
"Add the content to a playlist."
MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
"Show the 'Add to Playlist' option."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CREATE_NEW_PLAYLIST,
"Create New Playlist"
)
MSG_HASH(
MSG_ADDED_TO_PLAYLIST,
"Added to playlist"
)
MSG_HASH(
MSG_ADD_TO_PLAYLIST_FAILED,
"Failed to add to playlist: playlist full"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CREATE_NEW_PLAYLIST,
"Create a new playlist and add the current entry to it."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION,
"Show 'Set Core Association'"
@ -8860,6 +8842,22 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_ADD_TO_FAVORITES_PLAYLIST,
"Add the content to 'Favorites'."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST,
"Add to Playlist"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_ADD_TO_PLAYLIST,
"Add the content to a playlist."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CREATE_NEW_PLAYLIST,
"Create New Playlist"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CREATE_NEW_PLAYLIST,
"Create a new playlist and add the current entry to it."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SET_CORE_ASSOCIATION,
"Set Core Association"
@ -14085,6 +14083,14 @@ MSG_HASH(
MSG_ADD_TO_FAVORITES_FAILED,
"Failed to add favorite: playlist full"
)
MSG_HASH(
MSG_ADDED_TO_PLAYLIST,
"Added to playlist"
)
MSG_HASH(
MSG_ADD_TO_PLAYLIST_FAILED,
"Failed to add to playlist: playlist full"
)
MSG_HASH(
MSG_SET_CORE_ASSOCIATION,
"Core set: "

View File

@ -965,6 +965,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_delete_entry,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_information, MENU_ENUM_SUBLABEL_INFORMATION)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_run, MENU_ENUM_SUBLABEL_RUN)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_add_to_favorites, MENU_ENUM_SUBLABEL_ADD_TO_FAVORITES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_add_to_playlist, MENU_ENUM_SUBLABEL_ADD_TO_PLAYLIST)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_set_core_association, MENU_ENUM_SUBLABEL_SET_CORE_ASSOCIATION)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_reset_core_association, MENU_ENUM_SUBLABEL_RESET_CORE_ASSOCIATION)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_download_pl_entry_thumbnails, MENU_ENUM_SUBLABEL_DOWNLOAD_PL_ENTRY_THUMBNAILS)
@ -1112,9 +1113,10 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_restart_content,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_close_content, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CLOSE_CONTENT)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_savestate_submenu, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SAVESTATE_SUBMENU)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_save_load_state, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SAVE_LOAD_STATE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_replay, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_REPLAY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_replay, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_REPLAY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_undo_save_load_state, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_add_to_favorites, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_add_to_playlist, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_start_recording, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_START_RECORDING)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_start_streaming, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_START_STREAMING)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_show_set_core_association, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION)
@ -2925,6 +2927,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_add_to_favorites);
break;
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_add_to_playlist);
break;
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_RECORDING:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_start_recording);
break;
@ -3471,6 +3476,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_add_to_favorites);
break;
case MENU_ENUM_LABEL_ADD_TO_PLAYLIST:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_add_to_playlist);
break;
case MENU_ENUM_LABEL_SET_CORE_ASSOCIATION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_set_core_association);
break;

View File

@ -10644,6 +10644,11 @@ static void materialui_list_insert(
node->icon_texture_index = MUI_TEXTURE_ADD_TO_FAVORITES;
node->icon_type = MUI_ICON_TYPE_INTERNAL;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST)))
{
node->icon_texture_index = MUI_TEXTURE_PLAYLIST;
node->icon_type = MUI_ICON_TYPE_INTERNAL;
}
else if ( string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_RENAME_ENTRY))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_RESET_CORE_ASSOCIATION))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_RESET_CORES))
@ -10837,7 +10842,7 @@ static void materialui_list_insert(
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_CONTENT_LIST))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CREATE_NEW_PLAYLIST))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_ADD_NEW_TOP))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_ADD_NEW_BOTTOM))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_ADD_NEW_AFTER))

View File

@ -1763,7 +1763,13 @@ static uintptr_t ozone_entries_icon_get_texture(
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CORE_OPTIONS];
case MENU_ENUM_LABEL_ADD_TO_FAVORITES:
case MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_ADD_FAVORITE];
case MENU_ENUM_LABEL_ADD_TO_PLAYLIST:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_PLAYLIST];
case MENU_ENUM_LABEL_CREATE_NEW_PLAYLIST:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_ADD];
case MENU_ENUM_LABEL_PARENT_DIRECTORY:
case MENU_ENUM_LABEL_UNDO_LOAD_STATE:
case MENU_ENUM_LABEL_UNDO_SAVE_STATE:
@ -1835,7 +1841,6 @@ static uintptr_t ozone_entries_icon_get_texture(
case MENU_ENUM_LABEL_PLAYLISTS_TAB:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_ZIP];
case MENU_ENUM_LABEL_GOTO_FAVORITES:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_FAVORITE];
case MENU_ENUM_LABEL_GOTO_IMAGES:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_IMAGE];

View File

@ -2913,7 +2913,13 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
return xmb->textures.list[XMB_TEXTURE_SETTING];
case MENU_ENUM_LABEL_ADD_TO_FAVORITES:
case MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES:
return xmb->textures.list[XMB_TEXTURE_ADD_FAVORITE];
case MENU_ENUM_LABEL_ADD_TO_PLAYLIST:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST:
return xmb->textures.list[XMB_TEXTURE_PLAYLIST];
case MENU_ENUM_LABEL_CREATE_NEW_PLAYLIST:
return xmb->textures.list[XMB_TEXTURE_ADD];
case MENU_ENUM_LABEL_PARENT_DIRECTORY:
case MENU_ENUM_LABEL_UNDO_LOAD_STATE:
case MENU_ENUM_LABEL_UNDO_SAVE_STATE:
@ -3014,7 +3020,6 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_ENUM_LABEL_PLAYLISTS_TAB:
return xmb->textures.list[XMB_TEXTURE_ZIP];
case MENU_ENUM_LABEL_GOTO_FAVORITES:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES:
return xmb->textures.list[XMB_TEXTURE_FAVORITE];
case MENU_ENUM_LABEL_GOTO_IMAGES:
return xmb->textures.list[XMB_TEXTURE_IMAGE];

View File

@ -3794,12 +3794,15 @@ static int menu_displaylist_parse_load_content_settings(
count++;
}
if ( menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST),
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
if (settings->bools.quick_menu_show_add_to_playlist)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST),
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
}
if (!settings->bools.kiosk_mode_enable)
{
@ -4049,15 +4052,19 @@ static int menu_displaylist_parse_horizontal_content_actions(
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES_PLAYLIST),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST),
MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL);
MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST,
FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL);
}
/* This is to add to playlist */
if (settings->bools.quick_menu_show_add_to_playlist)
{
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST),
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
MENU_SETTING_ACTION, 0, 0, NULL);
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_PLAYLIST),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_PLAYLIST),
MENU_ENUM_LABEL_ADD_TO_PLAYLIST,
MENU_SETTING_ACTION, 0, 0, NULL);
}
if (!settings->bools.kiosk_mode_enable)
{
if (settings->bools.quick_menu_show_set_core_association)
@ -4651,17 +4658,6 @@ static unsigned menu_displaylist_parse_add_to_playlist_list(
/* Not necessary to check for NULL here */
string_list_free(str_list);
/* Add favourites */
if (
settings->bools.quick_menu_show_add_to_favorites
&& settings->bools.menu_content_show_favorites
&& menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_FAVORITES),
MENU_ENUM_LABEL_ADD_TO_FAVORITES, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL)
)
count++;
return count;
}
@ -10957,6 +10953,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_RECORDING, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_STREAMING, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CONTENT_SHOW_OVERLAYS, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY, PARSE_ONLY_BOOL},
#ifdef HAVE_REWIND

View File

@ -20842,6 +20842,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->bools.quick_menu_show_add_to_playlist,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
DEFAULT_QUICK_MENU_SHOW_ADD_TO_PLAYLIST,
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);
CONFIG_BOOL(
list, list_info,
&settings->bools.quick_menu_show_start_recording,

View File

@ -1662,6 +1662,7 @@ enum msg_hash_enums
MENU_LABEL(QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE),
MENU_LABEL(QUICK_MENU_SHOW_REPLAY),
MENU_LABEL(QUICK_MENU_SHOW_ADD_TO_FAVORITES),
MENU_LABEL(QUICK_MENU_SHOW_ADD_TO_PLAYLIST),
MENU_LABEL(QUICK_MENU_SHOW_START_RECORDING),
MENU_LABEL(QUICK_MENU_SHOW_START_STREAMING),
MENU_LABEL(QUICK_MENU_SHOW_SET_CORE_ASSOCIATION),