Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@

#define DEFAULT_CONTENT_SHOW_SETTINGS true
#define DEFAULT_CONTENT_SHOW_HISTORY true
#define DEFAULT_CONTENT_SHOW_MOST_PLAYED false
#define DEFAULT_CONTENT_SHOW_FAVORITES true
#define DEFAULT_CONTENT_SHOW_FAVORITES_FIRST false
#ifdef HAVE_IMAGEVIEWER
Expand Down Expand Up @@ -1502,6 +1503,9 @@
/* Number of entries that will be kept in content history playlist file. */
#define DEFAULT_CONTENT_HISTORY_SIZE 200

/* Number of entries that will be kept in content most played playlist file. */
#define DEFAULT_CONTENT_MOST_PLAYED_SIZE 200

/* Number of entries that will be kept in content favorites playlist file.
* -1 == 'unlimited' (99999) */
#define DEFAULT_CONTENT_FAVORITES_SIZE 200
Expand Down
18 changes: 18 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ static struct config_path_setting *populate_settings_path(
SETTING_PATH("content_database_path", settings->paths.path_content_database, false, NULL, true);
SETTING_PATH("content_favorites_path", settings->paths.path_content_favorites, false, NULL, true);
SETTING_PATH("content_history_path", settings->paths.path_content_history, false, NULL, true);
SETTING_PATH("content_most_played_path", settings->paths.path_content_most_played, false, NULL, true);
SETTING_PATH("content_image_history_path", settings->paths.path_content_image_history, false, NULL, true);
SETTING_PATH("content_music_history_path", settings->paths.path_content_music_history, false, NULL, true);
SETTING_PATH("content_video_history_path", settings->paths.path_content_video_history, false, NULL, true);
Expand Down Expand Up @@ -2087,6 +2088,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, DEFAULT_CONTENT_SHOW_SETTINGS, false);
SETTING_BOOL("content_show_favorites", &settings->bools.menu_content_show_favorites, true, DEFAULT_CONTENT_SHOW_FAVORITES, false);
SETTING_BOOL("content_show_favorites_first", &settings->bools.menu_content_show_favorites_first, true, DEFAULT_CONTENT_SHOW_FAVORITES_FIRST, false);
SETTING_BOOL("content_show_most_played", &settings->bools.menu_content_show_most_played, true, DEFAULT_CONTENT_SHOW_MOST_PLAYED, false);
#ifdef HAVE_IMAGEVIEWER
SETTING_BOOL("content_show_images", &settings->bools.menu_content_show_images, true, DEFAULT_CONTENT_SHOW_IMAGES, false);
#endif
Expand Down Expand Up @@ -2474,6 +2476,7 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("content_show_netplay", &settings->uints.menu_content_show_netplay, true, DEFAULT_CONTENT_SHOW_NETPLAY, false);
#endif
SETTING_UINT("content_history_size", &settings->uints.content_history_size, true, DEFAULT_CONTENT_HISTORY_SIZE, false);
SETTING_UINT("content_most_played_size", &settings->uints.content_most_played_size, true, DEFAULT_CONTENT_MOST_PLAYED_SIZE, false);
SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE, false);
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME, false);
SETTING_UINT("playlist_show_history_icons", &settings->uints.playlist_show_history_icons, true, DEFAULT_PLAYLIST_SHOW_HISTORY_ICONS, false);
Expand Down Expand Up @@ -3231,6 +3234,7 @@ void config_set_defaults(void *data)
*settings->paths.path_core_options = '\0';
*settings->paths.path_content_favorites = '\0';
*settings->paths.path_content_history = '\0';
*settings->paths.path_content_most_played = '\0';
*settings->paths.path_content_image_history = '\0';
*settings->paths.path_content_music_history = '\0';
*settings->paths.path_content_video_history = '\0';
Expand Down Expand Up @@ -3481,6 +3485,13 @@ void config_set_defaults(void *data)
FILE_PATH_CONTENT_HISTORY,
sizeof(settings->paths.path_content_history));

if (!*settings->paths.path_content_most_played)
fill_pathname_join_special(
settings->paths.path_content_most_played,
new_path,
FILE_PATH_CONTENT_MOST_PLAYED,
sizeof(settings->paths.path_content_most_played));

if (!*settings->paths.path_content_image_history)
strlcpy(settings->paths.directory_content_image_history, "default",
sizeof(settings->paths.directory_content_image_history));
Expand Down Expand Up @@ -4331,6 +4342,13 @@ static bool config_load_file(global_t *global,
FILE_PATH_CONTENT_HISTORY,
sizeof(settings->paths.path_content_history));

if (!*settings->paths.path_content_most_played)
fill_pathname_join_special(
settings->paths.path_content_most_played,
new_path,
FILE_PATH_CONTENT_MOST_PLAYED,
sizeof(settings->paths.path_content_most_played));

if (!*settings->paths.path_content_image_history)
strlcpy(settings->paths.directory_content_image_history, "default",
sizeof(settings->paths.directory_content_image_history));
Expand Down
3 changes: 3 additions & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ typedef struct settings
unsigned bundle_assets_extract_version_current;
unsigned bundle_assets_extract_last_version;
unsigned content_history_size;
unsigned content_most_played_size;
unsigned frontend_log_level;
unsigned libretro_log_level;
unsigned rewind_granularity;
Expand Down Expand Up @@ -648,6 +649,7 @@ typedef struct settings
char path_core_options[PATH_MAX_LENGTH];
char path_content_favorites[PATH_MAX_LENGTH];
char path_content_history[PATH_MAX_LENGTH];
char path_content_most_played[PATH_MAX_LENGTH];
char path_content_image_history[PATH_MAX_LENGTH];
char path_content_music_history[PATH_MAX_LENGTH];
char path_content_video_history[PATH_MAX_LENGTH];
Expand Down Expand Up @@ -892,6 +894,7 @@ typedef struct settings
bool menu_content_show_music;
bool menu_content_show_video;
bool menu_content_show_history;
bool menu_content_show_most_played;
bool menu_content_show_playlists;
bool menu_content_show_playlist_tabs;
bool menu_content_show_explore;
Expand Down
1 change: 1 addition & 0 deletions defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct defaults
#ifndef IS_SALAMANDER
playlist_t *content_history;
playlist_t *content_favorites;
playlist_t *content_most_played;
#ifdef HAVE_IMAGEVIEWER
playlist_t *image_history;
#endif
Expand Down
1 change: 1 addition & 0 deletions file_path_special.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RETRO_BEGIN_DECLS
#define FILE_PATH_AUTOCONFIG_ZIP "autoconfig.zip"
#define FILE_PATH_CONTENT_FAVORITES "content_favorites.lpl"
#define FILE_PATH_CONTENT_HISTORY "content_history.lpl"
#define FILE_PATH_CONTENT_MOST_PLAYED "content_most_played.lpl"
#define FILE_PATH_CONTENT_IMAGE_HISTORY "content_image_history.lpl"
#define FILE_PATH_CONTENT_MUSIC_HISTORY "content_music_history.lpl"
#define FILE_PATH_CONTENT_VIDEO_HISTORY "content_video_history.lpl"
Expand Down
32 changes: 32 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_HISTORY_TAB,
"History"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MOST_PLAYED_TAB,
"Most Played"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_IMAGES_TAB,
"Images"
Expand Down Expand Up @@ -6520,6 +6524,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_SHOW_HISTORY,
"Show the recent history menu."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_MOST_PLAYED,
"Show 'Most Played'"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_SHOW_MOST_PLAYED,
"Show a playtime-ranked playlist when aggregate runtime logging is enabled."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_ADD_ENTRY,
"Show 'Import Content'"
Expand Down Expand Up @@ -7828,6 +7840,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_HISTORY_SIZE,
"Limit the number of entries in recent playlist for games, images, music, and videos."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_MOST_PLAYED_SIZE,
"Most Played Size"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_MOST_PLAYED_SIZE,
"Limit the number of entries in the 'Most Played' playlist."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_FAVORITES_SIZE,
"Favorites Size"
Expand Down Expand Up @@ -10452,6 +10472,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE,
"No History Available"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NO_MOST_PLAYED_AVAILABLE,
"No Most Played Entries Available"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NO_IMAGES_AVAILABLE,
"No Images Available"
Expand Down Expand Up @@ -13624,6 +13648,14 @@ MSG_HASH(
MENU_ENUM_LABEL_HELP_LOAD_CONTENT_HISTORY,
"When content is loaded, content and libretro core combinations are saved to history.\nThe history is saved to a file in the same directory as the RetroArch config file. If no config file was loaded in startup, history will not be saved or loaded, and will not exist in the main menu."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LOAD_MOST_PLAYED,
"Most Played"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_LOAD_MOST_PLAYED,
"Select content from the playtime-ranked playlist."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MULTIMEDIA_SETTINGS,
"Multimedia"
Expand Down
5 changes: 5 additions & 0 deletions menu/cbs/menu_cbs_deferred_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ GENERIC_DEFERRED_PUSH(deferred_push_netplay_sublist, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_content_settings, DISPLAYLIST_CONTENT_SETTINGS)
GENERIC_DEFERRED_PUSH(deferred_push_add_content_list, DISPLAYLIST_ADD_CONTENT_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_history_list, DISPLAYLIST_HISTORY)
GENERIC_DEFERRED_PUSH(deferred_push_most_played_list, DISPLAYLIST_MOST_PLAYED)
GENERIC_DEFERRED_PUSH(deferred_push_database_manager_list, DISPLAYLIST_DATABASES)
GENERIC_DEFERRED_PUSH(deferred_push_content_collection_list, DISPLAYLIST_DATABASE_PLAYLISTS)
GENERIC_DEFERRED_PUSH(deferred_push_configurations_list, DISPLAYLIST_CONFIGURATIONS_LIST)
Expand Down Expand Up @@ -669,6 +670,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST, deferred_push_accounts_list},
{MENU_ENUM_LABEL_CORE_LIST, deferred_push_core_list},
{MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY, deferred_push_history_list},
{MENU_ENUM_LABEL_LOAD_MOST_PLAYED, deferred_push_most_played_list},
{MENU_ENUM_LABEL_SAVESTATE_LIST, deferred_push_savestate_list},
{MENU_ENUM_LABEL_STATE_SLOT_RUN, deferred_push_state_slot_run},
{MENU_ENUM_LABEL_CORE_OPTIONS, deferred_push_core_options},
Expand Down Expand Up @@ -860,6 +862,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_history_list);
break;
case MENU_ENUM_LABEL_LOAD_MOST_PLAYED:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_most_played_list);
break;
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_database_manager_list);
break;
Expand Down
2 changes: 2 additions & 0 deletions menu/cbs/menu_cbs_ok.c
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,7 @@ static int action_ok_playlist_entry_collection(const char *path,
settings_t *settings = config_get_ptr();
bool playlist_sort_alphabetical = settings->bools.playlist_sort_alphabetical;
const char *path_content_history = settings->paths.path_content_history;
const char *path_content_most_played = settings->paths.path_content_most_played;
const char *path_content_image_history = settings->paths.path_content_image_history;
const char *path_content_music_history = settings->paths.path_content_music_history;
const char *path_content_video_history = settings->paths.path_content_video_history;
Expand Down Expand Up @@ -2800,6 +2801,7 @@ static int action_ok_playlist_entry_collection(const char *path,
* the same here - otherwise entry_idx may
* go out of sync... */
bool is_content_history = string_is_equal(menu->db_playlist_file, path_content_history)
|| string_is_equal(menu->db_playlist_file, path_content_most_played)
|| string_is_equal(menu->db_playlist_file, path_content_image_history)
|| string_is_equal(menu->db_playlist_file, path_content_music_history)
|| string_is_equal(menu->db_playlist_file, path_content_video_history);
Expand Down
12 changes: 12 additions & 0 deletions menu/cbs/menu_cbs_sublabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_ctx_scaling, MENU_
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_history_list_enable, MENU_ENUM_SUBLABEL_HISTORY_LIST_ENABLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_history_size, MENU_ENUM_SUBLABEL_CONTENT_HISTORY_SIZE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_most_played_size, MENU_ENUM_SUBLABEL_CONTENT_MOST_PLAYED_SIZE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_favorites_size, MENU_ENUM_SUBLABEL_CONTENT_FAVORITES_SIZE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_unified_controls, MENU_ENUM_SUBLABEL_INPUT_UNIFIED_MENU_CONTROLS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_disable_info_button, MENU_ENUM_SUBLABEL_INPUT_DISABLE_INFO_BUTTON)
Expand Down Expand Up @@ -670,6 +671,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_list, MENU_
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_subsystem_settings, MENU_ENUM_SUBLABEL_SUBSYSTEM_SETTINGS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_special, MENU_ENUM_SUBLABEL_LOAD_CONTENT_SPECIAL)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_load_content_history, MENU_ENUM_SUBLABEL_LOAD_CONTENT_HISTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_load_most_played, MENU_ENUM_SUBLABEL_LOAD_MOST_PLAYED)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_network_information, MENU_ENUM_SUBLABEL_NETWORK_INFORMATION)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_system_information, MENU_ENUM_SUBLABEL_SYSTEM_INFORMATION)
#ifdef HAVE_LAKKA
Expand Down Expand Up @@ -1234,6 +1236,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_netplay_tab,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_settings_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_SETTINGS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_settings_tab_enable_password, MENU_ENUM_SUBLABEL_CONTENT_SHOW_SETTINGS_PASSWORD)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_history_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_HISTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_most_played_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_MOST_PLAYED)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_import_content_entry, MENU_ENUM_SUBLABEL_CONTENT_SHOW_ADD_ENTRY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_playlists_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLISTS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_playlist_tabs, MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLIST_TABS)
Expand Down Expand Up @@ -2833,6 +2836,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CONTENT_SHOW_HISTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_history_tab);
break;
case MENU_ENUM_LABEL_CONTENT_SHOW_MOST_PLAYED:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_most_played_tab);
break;
case MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_settings_tab);
break;
Expand Down Expand Up @@ -4538,6 +4544,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_load_content_history);
break;
case MENU_ENUM_LABEL_LOAD_MOST_PLAYED:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_load_most_played);
break;
case MENU_ENUM_LABEL_START_CORE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_start_core);
break;
Expand Down Expand Up @@ -5522,6 +5531,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_history_size);
break;
case MENU_ENUM_LABEL_CONTENT_MOST_PLAYED_SIZE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_most_played_size);
break;
case MENU_ENUM_LABEL_CONTENT_FAVORITES_SIZE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_favorites_size);
break;
Expand Down
Loading
Loading