(Ozone/XMB/RGUI) Explore menu thumbnails (#14365)

This commit is contained in:
sonninnos 2022-08-31 15:42:10 +03:00 committed by GitHub
parent 08fe9be7d1
commit a96c5f77c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 498 additions and 225 deletions

View File

@ -319,9 +319,9 @@ bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data,
return true; return true;
} }
/* Sets current thumbnail content according to the specified label. /* Sets current thumbnail content according to the specified label and optional database name.
* Returns true if content is valid */ * Returns true if content is valid */
bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label) bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label, const char *db_name)
{ {
if (!path_data) if (!path_data)
return false; return false;
@ -354,6 +354,10 @@ bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char
/* Have to set content path to *something*... /* Have to set content path to *something*...
* Just use label value (it doesn't matter) */ * Just use label value (it doesn't matter) */
strlcpy(path_data->content_path, label, sizeof(path_data->content_path)); strlcpy(path_data->content_path, label, sizeof(path_data->content_path));
/* Database name required for Explore thumbnails */
if (!string_is_empty(db_name))
strlcpy(path_data->content_db_name, db_name, sizeof(path_data->content_db_name));
/* Redundant error check... */ /* Redundant error check... */
return !string_is_empty(path_data->content_img); return !string_is_empty(path_data->content_img);

View File

@ -85,9 +85,9 @@ bool gfx_thumbnail_is_enabled(gfx_thumbnail_path_data_t *path_data, enum gfx_thu
* associated database name */ * associated database name */
bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data, const char *system, playlist_t *playlist); bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data, const char *system, playlist_t *playlist);
/* Sets current thumbnail content according to the specified label. /* Sets current thumbnail content according to the specified label and optional database name.
* Returns true if content is valid */ * Returns true if content is valid */
bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label); bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label, const char *db_name);
/* Sets current thumbnail content to the specified image. /* Sets current thumbnail content to the specified image.
* Returns true if content is valid */ * Returns true if content is valid */

View File

@ -4043,9 +4043,11 @@ static void materialui_render_menu_entry_default(
if (!entry->checked) if (!entry->checked)
icon_texture = mui->textures.list[node->icon_texture_index]; icon_texture = mui->textures.list[node->icon_texture_index];
break; break;
#if defined(HAVE_LIBRETRODB)
case MUI_ICON_TYPE_MENU_EXPLORE: case MUI_ICON_TYPE_MENU_EXPLORE:
icon_texture = menu_explore_get_entry_icon(entry_type); icon_texture = menu_explore_get_entry_icon(entry_type);
break; break;
#endif
case MUI_ICON_TYPE_MENU_CONTENTLESS_CORE: case MUI_ICON_TYPE_MENU_CONTENTLESS_CORE:
icon_texture = menu_contentless_cores_get_entry_icon(entry->label); icon_texture = menu_contentless_cores_get_entry_icon(entry->label);
break; break;

View File

@ -456,7 +456,6 @@ struct ozone_handle
size_t categories_selection_ptr; /* active tab id */ size_t categories_selection_ptr; /* active tab id */
size_t categories_active_idx_old; size_t categories_active_idx_old;
size_t playlist_index; size_t playlist_index;
size_t playlist_size;
size_t playlist_collection_offset; size_t playlist_collection_offset;
size_t selection; /* currently selected entry */ size_t selection; /* currently selected entry */
@ -598,6 +597,7 @@ struct ozone_handle
bool messagebox_state_old; bool messagebox_state_old;
bool should_draw_messagebox; bool should_draw_messagebox;
bool first_frame;
bool need_compute; bool need_compute;
bool draw_old_list; bool draw_old_list;
bool has_all_assets; bool has_all_assets;
@ -621,16 +621,15 @@ struct ozone_handle
bool show_fullscreen_thumbnails; bool show_fullscreen_thumbnails;
bool selection_core_is_viewer; bool selection_core_is_viewer;
bool selection_core_is_viewer_real; bool selection_core_is_viewer_real;
bool force_metadata_display; bool force_metadata_display;
bool is_db_manager_list; bool is_db_manager_list;
bool is_explore_list;
bool is_contentless_cores;
bool is_file_list; bool is_file_list;
bool is_quick_menu; bool is_quick_menu;
bool was_quick_menu; bool was_quick_menu;
bool is_state_slot; bool is_state_slot;
bool is_contentless_cores;
bool first_frame;
bool libretro_running; bool libretro_running;
struct struct
@ -3476,7 +3475,7 @@ static void ozone_update_savestate_thumbnail_path(void *data, unsigned i)
ozone->fullscreen_thumbnail_label, ozone->fullscreen_thumbnail_label,
sizeof(ozone->fullscreen_thumbnail_label), sizeof(ozone->fullscreen_thumbnail_label),
ozone->is_quick_menu, ozone->is_quick_menu,
ozone->playlist_index); NULL);
} }
else if (!ozone->is_state_slot) else if (!ozone->is_state_slot)
{ {
@ -3807,7 +3806,7 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone)
ozone->selection_core_is_viewer_real = ozone->selection_core_is_viewer; ozone->selection_core_is_viewer_real = ozone->selection_core_is_viewer;
if ((playlist && (ozone->is_playlist || (ozone->is_quick_menu && !menu_is_running_quick_menu()))) || if ((playlist && (ozone->is_playlist || ozone->is_explore_list || (ozone->is_quick_menu && !menu_is_running_quick_menu()))) ||
(ozone->is_db_manager_list && ozone->depth == 4)) (ozone->is_db_manager_list && ozone->depth == 4))
{ {
size_t _len; size_t _len;
@ -3816,43 +3815,63 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone)
size_t list_size = menu_entries_get_size(); size_t list_size = menu_entries_get_size();
file_list_t *list = menu_entries_get_selection_buf_ptr(0); file_list_t *list = menu_entries_get_selection_buf_ptr(0);
size_t playlist_index = selection; size_t playlist_index = selection;
bool content_runtime_log = settings->bools.content_runtime_log;
bool content_runtime_log_aggr = settings->bools.content_runtime_log_aggregate;
if (ozone->is_quick_menu) if (ozone->is_quick_menu)
{ {
bool content_runtime_log = settings->bools.content_runtime_log; playlist_index = ozone->playlist_index;
bool content_runtime_log_aggr = settings->bools.content_runtime_log_aggregate; list_size = playlist_get_size(playlist);
playlist_index = ozone->playlist_index;
list_size = ozone->playlist_size;
/* Fill play time if applicable */ /* Fill play time if applicable */
if (content_runtime_log || content_runtime_log_aggr) if (content_runtime_log || content_runtime_log_aggr)
playlist_get_index(playlist, playlist_index, &entry); playlist_get_index(playlist, playlist_index, &entry);
} }
#if defined(HAVE_LIBRETRODB)
else if (list &&
(selection < list_size) &&
ozone->is_explore_list)
{
playlist_index = menu_explore_get_entry_playlist_index(list->list[selection].type, &playlist, &entry);
/* Fill play time if applicable */
if (content_runtime_log || content_runtime_log_aggr)
playlist_get_index(playlist, playlist_index, &entry);
/* Corrections */
list_size--;
/* Remember playlist index for metadata */
ozone->playlist_index = playlist_index;
}
#endif
/* Get playlist index corresponding /* Get playlist index corresponding
* to the selected entry */ * to the selected entry */
else if (list && else if (list &&
(selection < list_size) && (selection < list_size) &&
(list->list[selection].type == FILE_TYPE_RPL_ENTRY)) (list->list[selection].type == FILE_TYPE_RPL_ENTRY))
{ {
bool content_runtime_log = settings->bools.content_runtime_log; playlist_index = list->list[selection].entry_idx;
bool content_runtime_log_aggr = settings->bools.content_runtime_log_aggregate;
playlist_index = list->list[selection].entry_idx;
/* Remember playlist index for Quick Menu fullscreen thumbnail title */
ozone->playlist_index = playlist_index;
ozone->playlist_size = list_size;
/* Fill play time if applicable */ /* Fill play time if applicable */
if (content_runtime_log || content_runtime_log_aggr) if (content_runtime_log || content_runtime_log_aggr)
playlist_get_index(playlist, playlist_index, &entry); playlist_get_index(playlist, playlist_index, &entry);
/* Remember playlist index for metadata */
ozone->playlist_index = playlist_index;
} }
/* Fill entry enumeration */ /* Fill entry enumeration */
if (show_entry_idx) if (show_entry_idx)
{ {
snprintf(ozone->selection_entry_enumeration, sizeof(ozone->selection_entry_enumeration), if (ozone->is_explore_list)
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_ENTRY_IDX), snprintf(ozone->selection_entry_enumeration, sizeof(ozone->selection_entry_enumeration),
(unsigned long)(playlist_index + 1), (unsigned long)list_size); msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_ENTRY_IDX),
(unsigned long)(selection), (unsigned long)list_size);
else
snprintf(ozone->selection_entry_enumeration, sizeof(ozone->selection_entry_enumeration),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_ENTRY_IDX),
(unsigned long)(playlist_index + 1), (unsigned long)list_size);
if (!scroll_content_metadata) if (!scroll_content_metadata)
linebreak_after_colon(&ozone->selection_entry_enumeration); linebreak_after_colon(&ozone->selection_entry_enumeration);
@ -3964,7 +3983,7 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone)
strlcpy(tmpstr, ozone->selection_lastplayed, sizeof(tmpstr)); strlcpy(tmpstr, ozone->selection_lastplayed, sizeof(tmpstr));
(ozone->word_wrap)(ozone->selection_lastplayed, (ozone->word_wrap)(ozone->selection_lastplayed,
sizeof(ozone->selection_lastplayed), tmpstr, strlen(tmpstr), 30, 100, 0); sizeof(ozone->selection_lastplayed), tmpstr, strlen(tmpstr), 30, 100, 0);
ozone->selection_lastplayed_lines = ozone_count_lines(ozone->selection_lastplayed); ozone->selection_lastplayed_lines = ozone_count_lines(ozone->selection_lastplayed);
} }
else else
@ -5255,7 +5274,7 @@ border_iterate:
char rich_label[255]; char rich_label[255];
char entry_value_ticker[255]; char entry_value_ticker[255];
char wrapped_sublabel_str[MENU_SUBLABEL_MAX_LENGTH]; char wrapped_sublabel_str[MENU_SUBLABEL_MAX_LENGTH];
uintptr_t tex; uintptr_t texture;
menu_entry_t entry; menu_entry_t entry;
gfx_animation_ctx_ticker_t ticker; gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth; gfx_animation_ctx_ticker_smooth_t ticker_smooth;
@ -5390,12 +5409,11 @@ border_iterate:
} }
/* Icon */ /* Icon */
tex = ozone_entries_icon_get_texture(ozone, texture = ozone_entries_icon_get_texture(ozone,
entry.enum_idx, entry.path, entry.label, entry.type, entry_selected); entry.enum_idx, entry.path, entry.label, entry.type, entry_selected);
if (tex != ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SUBSETTING])
{
uintptr_t texture = tex;
if (texture != ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SUBSETTING])
{
/* Console specific icons */ /* Console specific icons */
if ( entry.type == FILE_TYPE_RPL_ENTRY if ( entry.type == FILE_TYPE_RPL_ENTRY
&& ozone->categories_selection_ptr > ozone->system_tab_end) && ozone->categories_selection_ptr > ozone->system_tab_end)
@ -5892,6 +5910,9 @@ static void ozone_draw_thumbnail_bar(
menu_ticker_type = (enum gfx_animation_ticker_type) menu_ticker_type = (enum gfx_animation_ticker_type)
settings->uints.menu_ticker_type; settings->uints.menu_ticker_type;
bool show_entry_idx = settings->bools.playlist_show_entry_idx; bool show_entry_idx = settings->bools.playlist_show_entry_idx;
bool show_entry_core = !ozone->is_db_manager_list;
bool show_entry_playtime = !ozone->is_db_manager_list;
bool show_entry_last_played = !ozone->is_db_manager_list;
unsigned y = (unsigned)bottom_row_y_position; unsigned y = (unsigned)bottom_row_y_position;
unsigned separator_padding = ozone->dimensions.sidebar_entry_icon_padding*2; unsigned separator_padding = ozone->dimensions.sidebar_entry_icon_padding*2;
unsigned column_x = x_position + separator_padding; unsigned column_x = x_position + separator_padding;
@ -5984,80 +6005,89 @@ static void ozone_draw_thumbnail_bar(
} }
/* Core association */ /* Core association */
ticker_buf[0] = '\0'; if (show_entry_core)
if (use_smooth_ticker)
{ {
ticker_smooth.src_str = ozone->selection_core_name; ticker_buf[0] = '\0';
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_core_name;
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line( if (use_smooth_ticker)
video_width, {
video_height, ticker_smooth.src_str = ozone->selection_core_name;
ozone, gfx_animation_ticker_smooth(&ticker_smooth);
&y, }
ticker_x_offset + column_x, else
ticker_buf, {
text_color, ticker.str = ozone->selection_core_name;
1); gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(
video_width,
video_height,
ozone,
&y,
ticker_x_offset + column_x,
ticker_buf,
text_color,
1);
}
/* Playtime /* Playtime
* Note: It is essentially impossible for this string * Note: It is essentially impossible for this string
* to exceed the width of the sidebar, but since we * to exceed the width of the sidebar, but since we
* are ticker-texting everything else, we include this * are ticker-texting everything else, we include this
* by default */ * by default */
ticker_buf[0] = '\0'; if (show_entry_playtime)
if (use_smooth_ticker)
{ {
ticker_smooth.src_str = ozone->selection_playtime; ticker_buf[0] = '\0';
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_playtime;
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line( if (use_smooth_ticker)
video_width, {
video_height, ticker_smooth.src_str = ozone->selection_playtime;
ozone, gfx_animation_ticker_smooth(&ticker_smooth);
&y, }
ticker_x_offset + column_x, else
ticker_buf, {
text_color, ticker.str = ozone->selection_playtime;
1); gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(
video_width,
video_height,
ozone,
&y,
ticker_x_offset + column_x,
ticker_buf,
text_color,
1);
}
/* Last played */ /* Last played */
ticker_buf[0] = '\0'; if (show_entry_last_played)
if (use_smooth_ticker)
{ {
ticker_smooth.src_str = ozone->selection_lastplayed; ticker_buf[0] = '\0';
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_lastplayed;
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line( if (use_smooth_ticker)
video_width, {
video_height, ticker_smooth.src_str = ozone->selection_lastplayed;
ozone, gfx_animation_ticker_smooth(&ticker_smooth);
&y, }
ticker_x_offset + column_x, else
ticker_buf, {
text_color, ticker.str = ozone->selection_lastplayed;
1); gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(
video_width,
video_height,
ozone,
&y,
ticker_x_offset + column_x,
ticker_buf,
text_color,
1);
}
} }
else else
{ {
@ -6074,37 +6104,40 @@ static void ozone_draw_thumbnail_bar(
ozone_count_lines(ozone->selection_entry_enumeration)); ozone_count_lines(ozone->selection_entry_enumeration));
/* Core association */ /* Core association */
ozone_content_metadata_line( if (show_entry_core)
video_width, ozone_content_metadata_line(
video_height, video_width,
ozone, video_height,
&y, ozone,
column_x, &y,
ozone->selection_core_name, column_x,
text_color, ozone->selection_core_name,
ozone->selection_core_name_lines); text_color,
ozone->selection_core_name_lines);
/* Playtime */ /* Playtime */
ozone_content_metadata_line( if (show_entry_playtime)
video_width, ozone_content_metadata_line(
video_height, video_width,
ozone, video_height,
&y, ozone,
column_x, &y,
ozone->selection_playtime, column_x,
text_color, ozone->selection_playtime,
ozone_count_lines(ozone->selection_playtime)); text_color,
ozone_count_lines(ozone->selection_playtime));
/* Last played */ /* Last played */
ozone_content_metadata_line( if (show_entry_last_played)
video_width, ozone_content_metadata_line(
video_height, video_width,
ozone, video_height,
&y, ozone,
column_x, &y,
ozone->selection_lastplayed, column_x,
text_color, ozone->selection_lastplayed,
ozone->selection_lastplayed_lines); text_color,
ozone->selection_lastplayed_lines);
} }
/* If metadata override is active, display an /* If metadata override is active, display an
@ -6622,7 +6655,7 @@ static void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone)
ozone->fullscreen_thumbnail_label, ozone->fullscreen_thumbnail_label,
sizeof(ozone->fullscreen_thumbnail_label), sizeof(ozone->fullscreen_thumbnail_label),
ozone->is_quick_menu, ozone->is_quick_menu,
ozone->playlist_index) == 0) ozone->title) == 0)
ozone->fullscreen_thumbnail_label[0] = '\0'; ozone->fullscreen_thumbnail_label[0] = '\0';
/* Configure fade in animation */ /* Configure fade in animation */
@ -6654,11 +6687,8 @@ static void ozone_draw_fullscreen_thumbnails(
/* Check whether fullscreen thumbnails are visible */ /* Check whether fullscreen thumbnails are visible */
if (ozone->animations.fullscreen_thumbnail_alpha > 0.0f || ozone->want_fullscreen_thumbnails) if (ozone->animations.fullscreen_thumbnail_alpha > 0.0f || ozone->want_fullscreen_thumbnails)
{ {
/* Note: right thumbnail is drawn at the top gfx_thumbnail_t *right_thumbnail = &ozone->thumbnails.right;
* in the sidebar, so it becomes the *left* gfx_thumbnail_t *left_thumbnail = &ozone->thumbnails.left;
* thumbnail when viewed fullscreen */
gfx_thumbnail_t *right_thumbnail = &ozone->thumbnails.left;
gfx_thumbnail_t *left_thumbnail = &ozone->thumbnails.right;
unsigned width = video_width; unsigned width = video_width;
unsigned height = video_height; unsigned height = video_height;
int view_width = (int)width; int view_width = (int)width;
@ -7048,9 +7078,41 @@ static void ozone_set_thumbnail_content(void *data, const char *s)
menu_entry_get(&entry, 0, selection, NULL, true); menu_entry_get(&entry, 0, selection, NULL, true);
if (!string_is_empty(entry.path)) if (!string_is_empty(entry.path))
gfx_thumbnail_set_content(ozone->thumbnail_path_data, entry.path); gfx_thumbnail_set_content(ozone->thumbnail_path_data, entry.path, NULL);
} }
} }
#if defined(HAVE_LIBRETRODB)
else if (ozone->is_explore_list)
{
/* Explore list */
if (string_is_empty(s))
{
menu_entry_t entry;
const char *db_name;
size_t selection = menu_navigation_get_selection();
MENU_ENTRY_INIT(entry);
entry.label_enabled = false;
entry.rich_label_enabled = false;
entry.value_enabled = false;
entry.sublabel_enabled = false;
menu_entry_get(&entry, 0, selection, NULL, true);
if (!entry.type)
return;
db_name = menu_explore_get_entry_database(entry.type);
if (!string_is_empty(entry.path) && !string_is_empty(db_name))
gfx_thumbnail_set_content(ozone->thumbnail_path_data,
entry.path,
db_name);
ozone->want_thumbnail_bar = ozone->fullscreen_thumbnails_available =
(!string_is_empty(db_name) && menu_explore_get_entry_icon(entry.type));
}
}
#endif
else if (string_is_equal(s, "imageviewer")) else if (string_is_equal(s, "imageviewer"))
{ {
/* Filebrowser image updates */ /* Filebrowser image updates */
@ -7080,7 +7142,7 @@ static void ozone_set_thumbnail_content(void *data, const char *s)
* the sublevels of database manager lists. * the sublevels of database manager lists.
* Showing thumbnails on database entries is a * Showing thumbnails on database entries is a
* pointless nuisance and a waste of CPU cycles, IMHO... */ * pointless nuisance and a waste of CPU cycles, IMHO... */
gfx_thumbnail_set_content(ozone->thumbnail_path_data, s); gfx_thumbnail_set_content(ozone->thumbnail_path_data, s, NULL);
} }
ozone_update_content_metadata(ozone); ozone_update_content_metadata(ozone);
@ -7152,7 +7214,7 @@ static bool INLINE ozone_metadata_override_available(ozone_handle_t *ozone)
* Short circuiting means that in most cases * Short circuiting means that in most cases
* only 'ozone->is_playlist' will be evaluated, * only 'ozone->is_playlist' will be evaluated,
* so this isn't too much of a performance hog... */ * so this isn't too much of a performance hog... */
return ozone->is_playlist return (ozone->is_playlist || ozone->is_explore_list)
&& ozone->show_thumbnail_bar && ozone->show_thumbnail_bar
&& !ozone->selection_core_is_viewer && !ozone->selection_core_is_viewer
&& (ozone->thumbnails.left.status == GFX_THUMBNAIL_STATUS_AVAILABLE || && (ozone->thumbnails.left.status == GFX_THUMBNAIL_STATUS_AVAILABLE ||
@ -7322,6 +7384,11 @@ static void ozone_start_cursor_wiggle(
ozone->cursor_wiggle_state.wiggling = true; ozone->cursor_wiggle_state.wiggling = true;
} }
/* Common thumbnail switch requires FILE_TYPE_RPL_ENTRY,
* which only works with playlists, therefore activate it
* manually for Quick Menu, Explore and Database */
extern int action_switch_thumbnail(const char *path,
const char *label, unsigned type, size_t idx);
static enum menu_action ozone_parse_menu_entry_action( static enum menu_action ozone_parse_menu_entry_action(
ozone_handle_t *ozone, ozone_handle_t *ozone,
@ -7368,7 +7435,7 @@ static enum menu_action ozone_parse_menu_entry_action(
case MENU_ACTION_START: case MENU_ACTION_START:
ozone->cursor_mode = false; ozone->cursor_mode = false;
if (ozone->is_state_slot || if (ozone->is_state_slot ||
(ozone->is_quick_menu && !string_is_empty(ozone->savestate_thumbnail_file_path))) (ozone->is_quick_menu && menu_is_running_quick_menu()))
break; break;
/* If this is a menu with thumbnails and cursor /* If this is a menu with thumbnails and cursor
@ -7391,6 +7458,7 @@ static enum menu_action ozone_parse_menu_entry_action(
break; break;
case MENU_ACTION_SCAN: case MENU_ACTION_SCAN:
ozone->cursor_mode = false; ozone->cursor_mode = false;
ozone->skip_thumbnail_reset = false;
if (ozone->fullscreen_thumbnails_available && if (ozone->fullscreen_thumbnails_available &&
!ozone->show_fullscreen_thumbnails && !ozone->show_fullscreen_thumbnails &&
@ -7401,12 +7469,18 @@ static enum menu_action ozone_parse_menu_entry_action(
ozone->want_fullscreen_thumbnails = true; ozone->want_fullscreen_thumbnails = true;
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
else if (ozone->show_fullscreen_thumbnails && !ozone->is_playlist) else if (ozone->show_fullscreen_thumbnails &&
(ozone->is_state_slot || (ozone->is_quick_menu && menu_is_running_quick_menu())))
{ {
ozone_hide_fullscreen_thumbnails(ozone, true); ozone_hide_fullscreen_thumbnails(ozone, true);
ozone->want_fullscreen_thumbnails = false; ozone->want_fullscreen_thumbnails = false;
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
else if (ozone->is_explore_list || ozone->is_quick_menu || ozone->is_db_manager_list)
{
action_switch_thumbnail(NULL, NULL, 0, 0);
new_action = MENU_ACTION_NOOP;
}
break; break;
case MENU_ACTION_DOWN: case MENU_ACTION_DOWN:
if (ozone->cursor_in_sidebar) if (ozone->cursor_in_sidebar)
@ -7554,7 +7628,7 @@ static enum menu_action ozone_parse_menu_entry_action(
{ {
ozone_hide_fullscreen_thumbnails(ozone, true); ozone_hide_fullscreen_thumbnails(ozone, true);
ozone->want_fullscreen_thumbnails = false; ozone->want_fullscreen_thumbnails = false;
if (!ozone->is_state_slot && !ozone->is_playlist) if (!ozone->is_state_slot && !ozone->is_playlist && !ozone->is_explore_list)
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
break; break;
} }
@ -8040,6 +8114,8 @@ static void ozone_refresh_thumbnail_image(void *data, unsigned i)
if (!ozone) if (!ozone)
return; return;
ozone->skip_thumbnail_reset = false;
/* Refresh metadata */ /* Refresh metadata */
if (!i) if (!i)
ozone_update_content_metadata(ozone); ozone_update_content_metadata(ozone);
@ -8048,8 +8124,8 @@ static void ozone_refresh_thumbnail_image(void *data, unsigned i)
* and we are currently viewing a playlist */ * and we are currently viewing a playlist */
if ((gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || if ((gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) ||
gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) && gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) &&
((ozone->is_playlist && ozone->depth == 1) || ozone->want_thumbnail_bar &&
(ozone->is_quick_menu && ozone->want_thumbnail_bar))) (ozone->is_quick_menu || ozone->is_playlist || ozone->is_explore_list))
ozone_update_thumbnail_image(ozone); ozone_update_thumbnail_image(ozone);
} }
@ -10032,13 +10108,12 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
update_thumbnails = true; update_thumbnails = true;
ozone->skip_thumbnail_reset = false; ozone->skip_thumbnail_reset = false;
} }
/* Database list updates /* Database + Explore list updates */
* (pointless nuisance...) */ else if ((ozone->is_db_manager_list && ozone->depth == 4) ||
else if (ozone->is_db_manager_list && ozone->depth == 4) ozone->is_explore_list)
{ {
ozone_set_thumbnail_content(ozone, ""); ozone_set_thumbnail_content(ozone, "");
update_thumbnails = true; update_thumbnails = true;
ozone->want_thumbnail_bar = true;
ozone->skip_thumbnail_reset = false; ozone->skip_thumbnail_reset = false;
} }
/* Filebrowser image updates */ /* Filebrowser image updates */
@ -10059,7 +10134,7 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
* content + right/left thumbnails * content + right/left thumbnails
* (otherwise last loaded thumbnail will * (otherwise last loaded thumbnail will
* persist, and be shown on the wrong entry) */ * persist, and be shown on the wrong entry) */
gfx_thumbnail_set_content(ozone->thumbnail_path_data, NULL); gfx_thumbnail_set_content(ozone->thumbnail_path_data, NULL, NULL);
ozone_unload_thumbnail_textures(ozone); ozone_unload_thumbnail_textures(ozone);
update_thumbnails = true; update_thumbnails = true;
ozone->want_thumbnail_bar = false; ozone->want_thumbnail_bar = false;
@ -10701,6 +10776,8 @@ static void ozone_populate_entries(void *data,
ozone->fade_direction = new_depth <= ozone->depth; ozone->fade_direction = new_depth <= ozone->depth;
ozone->depth = new_depth; ozone->depth = new_depth;
ozone->is_db_manager_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST)); ozone->is_db_manager_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST));
ozone->is_explore_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_EXPLORE_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB));
ozone->is_file_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES)); ozone->is_file_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES));
ozone->is_quick_menu = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)) || ozone->is_quick_menu = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS)) ||
@ -10718,6 +10795,14 @@ static void ozone_populate_entries(void *data,
ozone->skip_thumbnail_reset = true; ozone->skip_thumbnail_reset = true;
} }
/* Quick Menu under Explore list must also be Quick Menu */
if (ozone->is_explore_list)
{
ozone->is_quick_menu |= menu_is_nonrunning_quick_menu() || menu_is_running_quick_menu();
if (ozone->is_quick_menu)
ozone->is_explore_list = false;
}
/* Determine the first playlist item under "Load Content > Playlists" */ /* Determine the first playlist item under "Load Content > Playlists" */
ozone->playlist_collection_offset = 0; ozone->playlist_collection_offset = 0;
if (settings->uints.menu_content_show_add_entry) if (settings->uints.menu_content_show_add_entry)
@ -10753,7 +10838,30 @@ static void ozone_populate_entries(void *data,
ozone->thumbnails.right.status == GFX_THUMBNAIL_STATUS_MISSING)) ozone->thumbnails.right.status == GFX_THUMBNAIL_STATUS_MISSING))
ozone->skip_thumbnail_reset = true; ozone->skip_thumbnail_reset = true;
if (!ozone->is_quick_menu && !ozone->is_state_slot && !ozone->skip_thumbnail_reset) if (ozone->is_quick_menu)
{
if (menu_is_running_quick_menu())
{
ozone->want_thumbnail_bar = false;
ozone->skip_thumbnail_reset = false;
ozone_update_savestate_thumbnail_path(ozone, menu_navigation_get_selection());
ozone_update_savestate_thumbnail_image(ozone);
}
else if (gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) ||
gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT))
{
ozone->want_thumbnail_bar = true;
ozone->skip_thumbnail_reset = true;
ozone_update_thumbnail_image(ozone);
}
}
else if (ozone->is_explore_list)
{
ozone->want_thumbnail_bar = false;
ozone_set_thumbnail_content(ozone, "");
ozone_update_thumbnail_image(ozone);
}
else if (!ozone->is_state_slot && !ozone->skip_thumbnail_reset)
{ {
if (ozone->is_db_manager_list && ozone->depth == 4) if (ozone->is_db_manager_list && ozone->depth == 4)
ozone->skip_thumbnail_reset = true; ozone->skip_thumbnail_reset = true;
@ -10779,23 +10887,6 @@ static void ozone_populate_entries(void *data,
ozone->want_thumbnail_bar = false; ozone->want_thumbnail_bar = false;
} }
} }
else if (ozone->is_quick_menu)
{
if (menu_is_running_quick_menu())
{
ozone->want_thumbnail_bar = false;
ozone->skip_thumbnail_reset = false;
ozone_update_savestate_thumbnail_path(ozone, menu_navigation_get_selection());
ozone_update_savestate_thumbnail_image(ozone);
}
else if (gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) ||
gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT))
{
ozone->want_thumbnail_bar = true;
ozone->skip_thumbnail_reset = true;
ozone_update_thumbnail_image(ozone);
}
}
if (ozone->skip_thumbnail_reset && if (ozone->skip_thumbnail_reset &&
(gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || (gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) ||
@ -10821,6 +10912,7 @@ static void ozone_populate_entries(void *data,
(ozone->is_db_manager_list && ozone->want_thumbnail_bar && ozone->depth >= 4) || (ozone->is_db_manager_list && ozone->want_thumbnail_bar && ozone->depth >= 4) ||
(ozone->is_quick_menu && ozone->want_thumbnail_bar) || (ozone->is_quick_menu && ozone->want_thumbnail_bar) ||
(ozone->is_file_list && ozone->want_thumbnail_bar) || (ozone->is_file_list && ozone->want_thumbnail_bar) ||
(ozone->is_explore_list && ozone->want_thumbnail_bar) ||
(ozone->is_state_slot); (ozone->is_state_slot);
if (ozone->fullscreen_thumbnails_available != ozone->want_thumbnail_bar) if (ozone->fullscreen_thumbnails_available != ozone->want_thumbnail_bar)

View File

@ -339,6 +339,7 @@ typedef struct
bool shadow_enable; bool shadow_enable;
bool extended_ascii_enable; bool extended_ascii_enable;
bool is_playlist; bool is_playlist;
bool is_explore_list;
bool is_quick_menu; bool is_quick_menu;
bool is_state_slot; bool is_state_slot;
bool entry_has_thumbnail; bool entry_has_thumbnail;
@ -5090,7 +5091,7 @@ static void rgui_render(void *data,
((timedate_x - rgui->term_layout.start_x) / rgui->font_width_stride) - 3 : ((timedate_x - rgui->term_layout.start_x) / rgui->font_width_stride) - 3 :
rgui->term_layout.width - 1; rgui->term_layout.width - 1;
bool show_mini_thumbnails = rgui_inline_thumbnails && bool show_mini_thumbnails = rgui_inline_thumbnails &&
(rgui->is_playlist || (rgui->is_quick_menu && !menu_is_running_quick_menu())); (rgui->is_playlist || rgui->is_explore_list || (rgui->is_quick_menu && !menu_is_running_quick_menu()));
bool show_thumbnail = false; bool show_thumbnail = false;
bool show_left_thumbnail = false; bool show_left_thumbnail = false;
bool show_savestate_thumbnail = (!string_is_empty(rgui->savestate_thumbnail_file_path) && bool show_savestate_thumbnail = (!string_is_empty(rgui->savestate_thumbnail_file_path) &&
@ -6651,7 +6652,7 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load)
/* Update thumbnail content/path */ /* Update thumbnail content/path */
if ((rgui->show_fs_thumbnail || menu_rgui_inline_thumbnails) if ((rgui->show_fs_thumbnail || menu_rgui_inline_thumbnails)
&& (rgui->is_playlist || rgui->is_quick_menu)) && (rgui->is_playlist || rgui->is_explore_list || rgui->is_quick_menu))
{ {
size_t selection = menu_navigation_get_selection(); size_t selection = menu_navigation_get_selection();
size_t list_size = menu_entries_get_size(); size_t list_size = menu_entries_get_size();
@ -6671,25 +6672,65 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load)
playlist_index = list->list[selection].entry_idx; playlist_index = list->list[selection].entry_idx;
rgui->playlist_index = playlist_index; rgui->playlist_index = playlist_index;
} }
}
else if (rgui->is_quick_menu &&
string_is_empty(rgui->savestate_thumbnail_file_path))
{
playlist_valid = true;
playlist_index = rgui->playlist_index;
}
if (gfx_thumbnail_set_content_playlist(rgui->thumbnail_path_data, gfx_thumbnail_set_content_playlist(rgui->thumbnail_path_data,
playlist_valid ? playlist_get_cached() : NULL, playlist_index)) playlist_valid ? playlist_get_cached() : NULL, playlist_index);
{
if (gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT))
has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT);
if (menu_rgui_inline_thumbnails &&
gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT))
has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT) ||
has_thumbnail;
} }
else if (rgui->is_quick_menu)
{
if (string_is_empty(rgui->savestate_thumbnail_file_path))
playlist_valid = true;
playlist_index = rgui->playlist_index;
gfx_thumbnail_set_content_playlist(rgui->thumbnail_path_data,
playlist_valid ? playlist_get_cached() : NULL, playlist_index);
}
#if defined(HAVE_LIBRETRODB)
else if (rgui->is_explore_list)
{
/* Get playlist index corresponding
* to the selected entry */
if (list &&
(selection < list_size))
{
menu_entry_t entry;
const char *db_name;
MENU_ENTRY_INIT(entry);
entry.label_enabled = false;
entry.rich_label_enabled = false;
entry.value_enabled = false;
entry.sublabel_enabled = false;
menu_entry_get(&entry, 0, selection, NULL, true);
if (!entry.type)
return;
db_name = menu_explore_get_entry_database(entry.type);
if (!string_is_empty(entry.path) && !string_is_empty(db_name))
{
playlist_t *playlist = playlist_get_cached();
const struct playlist_entry *playlist_entry = NULL;
size_t playlist_index =
menu_explore_get_entry_playlist_index(list->list[selection].type, &playlist, &playlist_entry);
rgui->playlist_index = playlist_index;
gfx_thumbnail_set_content(rgui->thumbnail_path_data, entry.path, db_name);
}
else
gfx_thumbnail_set_content(rgui->thumbnail_path_data, NULL, NULL);
}
}
#endif
if (gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT))
has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT);
if (menu_rgui_inline_thumbnails && gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT))
has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT) || has_thumbnail;
} }
/* Save state thumbnails */ /* Save state thumbnails */
@ -6724,7 +6765,7 @@ static void rgui_update_thumbnail_image(void *data)
{ {
rgui_t *rgui = (rgui_t*)data; rgui_t *rgui = (rgui_t*)data;
if (rgui->is_playlist) if (rgui->is_playlist || rgui->is_explore_list)
rgui_scan_selected_entry_thumbnail(rgui, true); rgui_scan_selected_entry_thumbnail(rgui, true);
} }
@ -6798,7 +6839,7 @@ static void rgui_refresh_thumbnail_image(void *userdata, unsigned i)
/* Only load thumbnails if currently viewing a /* Only load thumbnails if currently viewing a
* playlist (note that thumbnails are loaded * playlist (note that thumbnails are loaded
* immediately, for an optimal user experience) */ * immediately, for an optimal user experience) */
if (rgui->is_playlist) if (rgui->is_playlist || rgui->is_explore_list || rgui->is_quick_menu)
rgui_scan_selected_entry_thumbnail(rgui, true); rgui_scan_selected_entry_thumbnail(rgui, true);
} }
} }
@ -6944,11 +6985,22 @@ static void rgui_populate_entries(void *data,
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST)); || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST));
rgui->is_explore_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_EXPLORE_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB));
/* Determine whether this is the quick menu */ /* Determine whether this is the quick menu */
rgui->is_quick_menu = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)) || rgui->is_quick_menu = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_LIST)); string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_LIST));
rgui->is_state_slot = string_to_unsigned(path) == MENU_ENUM_LABEL_STATE_SLOT; rgui->is_state_slot = string_to_unsigned(path) == MENU_ENUM_LABEL_STATE_SLOT;
/* Quick Menu under Explore list must also be Quick Menu */
if (rgui->is_explore_list)
{
rgui->is_quick_menu |= menu_is_nonrunning_quick_menu() || menu_is_running_quick_menu();
if (rgui->is_quick_menu)
rgui->is_explore_list = false;
}
/* Set menu title */ /* Set menu title */
menu_entries_get_title(rgui->menu_title, sizeof(rgui->menu_title)); menu_entries_get_title(rgui->menu_title, sizeof(rgui->menu_title));
@ -7520,7 +7572,7 @@ static enum menu_action rgui_parse_menu_entry_action(
rgui_thumbnail_cycle_dupe(rgui); rgui_thumbnail_cycle_dupe(rgui);
rgui_toggle_fs_thumbnail(rgui, config_get_ptr()->bools.menu_rgui_inline_thumbnails); rgui_toggle_fs_thumbnail(rgui, config_get_ptr()->bools.menu_rgui_inline_thumbnails);
if (!rgui->is_state_slot && !rgui->is_playlist) if (!rgui->is_state_slot && !rgui->is_playlist && !rgui->is_explore_list)
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
break; break;
@ -7534,7 +7586,7 @@ static enum menu_action rgui_parse_menu_entry_action(
break; break;
case MENU_ACTION_START: case MENU_ACTION_START:
/* Playlist thumbnail fullscreen toggle */ /* Playlist thumbnail fullscreen toggle */
if (rgui->is_playlist || (rgui->is_quick_menu && !menu_is_running_quick_menu())) if (rgui->is_playlist || rgui->is_explore_list || (rgui->is_quick_menu && !menu_is_running_quick_menu()))
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -7578,7 +7630,7 @@ static enum menu_action rgui_parse_menu_entry_action(
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
/* Playlist thumbnail cycle */ /* Playlist thumbnail cycle */
else if (rgui->is_playlist) else if (rgui->is_playlist || rgui->is_explore_list || rgui->is_quick_menu)
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();

View File

@ -342,7 +342,6 @@ typedef struct xmb_handle
size_t categories_selection_ptr_old; size_t categories_selection_ptr_old;
size_t selection_ptr_old; size_t selection_ptr_old;
size_t fullscreen_thumbnail_selection; size_t fullscreen_thumbnail_selection;
size_t playlist_index;
size_t playlist_collection_offset; size_t playlist_collection_offset;
/* size of the current list */ /* size of the current list */
@ -423,6 +422,7 @@ typedef struct xmb_handle
/* Favorites, History, Images, Music, Videos, user generated */ /* Favorites, History, Images, Music, Videos, user generated */
bool is_playlist; bool is_playlist;
bool is_db_manager_list; bool is_db_manager_list;
bool is_explore_list;
bool is_contentless_cores; bool is_contentless_cores;
/* Load Content file browser */ /* Load Content file browser */
@ -1228,7 +1228,7 @@ static void xmb_update_savestate_thumbnail_path(void *data, unsigned i)
xmb->fullscreen_thumbnail_label, xmb->fullscreen_thumbnail_label,
sizeof(xmb->fullscreen_thumbnail_label), sizeof(xmb->fullscreen_thumbnail_label),
xmb->is_quick_menu, xmb->is_quick_menu,
xmb->playlist_index); NULL);
} }
} }
} }
@ -1382,9 +1382,6 @@ static void xmb_set_thumbnail_content(void *data, const char *s)
playlist_index = list->list[selection].entry_idx; playlist_index = list->list[selection].entry_idx;
} }
/* Remember playlist index for Quick Menu fullscreen thumbnail title */
xmb->playlist_index = playlist_index;
gfx_thumbnail_set_content_playlist(xmb->thumbnail_path_data, gfx_thumbnail_set_content_playlist(xmb->thumbnail_path_data,
playlist_valid ? playlist_get_cached() : NULL, playlist_index); playlist_valid ? playlist_get_cached() : NULL, playlist_index);
xmb->fullscreen_thumbnails_available = true; xmb->fullscreen_thumbnails_available = true;
@ -1407,11 +1404,43 @@ static void xmb_set_thumbnail_content(void *data, const char *s)
if (!string_is_empty(entry.path)) if (!string_is_empty(entry.path))
{ {
gfx_thumbnail_set_content(xmb->thumbnail_path_data, entry.path); gfx_thumbnail_set_content(xmb->thumbnail_path_data, entry.path, NULL);
xmb->fullscreen_thumbnails_available = true; xmb->fullscreen_thumbnails_available = true;
} }
} }
} }
#if defined(HAVE_LIBRETRODB)
else if (xmb->is_explore_list)
{
/* Explore list */
if (string_is_empty(s))
{
menu_entry_t entry;
const char *db_name;
size_t selection = menu_navigation_get_selection();
MENU_ENTRY_INIT(entry);
entry.label_enabled = false;
entry.rich_label_enabled = false;
entry.value_enabled = false;
entry.sublabel_enabled = false;
menu_entry_get(&entry, 0, selection, NULL, true);
if (!entry.type)
return;
db_name = menu_explore_get_entry_database(entry.type);
if (!string_is_empty(entry.path) && !string_is_empty(db_name))
gfx_thumbnail_set_content(xmb->thumbnail_path_data,
entry.path,
db_name);
xmb->fullscreen_thumbnails_available =
(!string_is_empty(db_name) && menu_explore_get_entry_icon(entry.type));
}
}
#endif
else if (string_is_equal(s, "imageviewer")) else if (string_is_equal(s, "imageviewer"))
{ {
/* Filebrowser image updates */ /* Filebrowser image updates */
@ -1445,7 +1474,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s)
* the sublevels of database manager lists. * the sublevels of database manager lists.
* Showing thumbnails on database entries is a * Showing thumbnails on database entries is a
* pointless nuisance and a waste of CPU cycles, IMHO... */ * pointless nuisance and a waste of CPU cycles, IMHO... */
gfx_thumbnail_set_content(xmb->thumbnail_path_data, s); gfx_thumbnail_set_content(xmb->thumbnail_path_data, s, NULL);
xmb->fullscreen_thumbnails_available = true; xmb->fullscreen_thumbnails_available = true;
} }
} }
@ -1549,9 +1578,9 @@ static void xmb_selection_pointer_changed(
xmb_set_thumbnail_content(xmb, NULL); xmb_set_thumbnail_content(xmb, NULL);
update_thumbnails = true; update_thumbnails = true;
} }
/* Database list updates /* Database + Explore list updates */
* (pointless nuisance...) */ else if ((xmb->is_db_manager_list && depth <= 4) ||
else if (xmb->is_db_manager_list && depth <= 4) xmb->is_explore_list)
{ {
xmb_set_thumbnail_content(xmb, NULL); xmb_set_thumbnail_content(xmb, NULL);
update_thumbnails = true; update_thumbnails = true;
@ -1590,7 +1619,7 @@ static void xmb_selection_pointer_changed(
* persist, and be shown on the wrong entry) */ * persist, and be shown on the wrong entry) */
xmb->fullscreen_thumbnails_available = false; xmb->fullscreen_thumbnails_available = false;
xmb->thumbnails.pending = XMB_PENDING_THUMBNAIL_NONE; xmb->thumbnails.pending = XMB_PENDING_THUMBNAIL_NONE;
gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL); gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL, NULL);
gfx_thumbnail_cancel_pending_requests(); gfx_thumbnail_cancel_pending_requests();
gfx_thumbnail_reset(&xmb->thumbnails.right); gfx_thumbnail_reset(&xmb->thumbnails.right);
gfx_thumbnail_reset(&xmb->thumbnails.left); gfx_thumbnail_reset(&xmb->thumbnails.left);
@ -1797,21 +1826,18 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
xmb_system_tab = xmb_get_system_tab(xmb, xmb_system_tab = xmb_get_system_tab(xmb,
(unsigned)xmb->categories_selection_ptr); (unsigned)xmb->categories_selection_ptr);
if (xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS) if (xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS && xmb->depth > xmb->old_depth)
{ {
if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) ||
gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT))
{ {
if (xmb->is_playlist || xmb->is_db_manager_list) if (xmb->is_playlist || xmb->is_db_manager_list)
{ {
if (xmb->is_db_manager_list && xmb->depth < 5) if (!(xmb->is_db_manager_list && xmb->depth > 4))
xmb_unload_thumbnail_textures(xmb); xmb_unload_thumbnail_textures(xmb);
if (!(xmb->is_playlist && xmb->depth == 4 && xmb->old_depth == 5)) xmb_set_thumbnail_content(xmb, NULL);
{ xmb_update_thumbnail_image(xmb);
xmb_set_thumbnail_content(xmb, NULL);
xmb_update_thumbnail_image(xmb);
}
} }
} }
} }
@ -2576,6 +2602,20 @@ static void xmb_populate_entries(void *data,
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_LIST)); string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_LIST));
xmb->is_state_slot = string_to_unsigned(path) == MENU_ENUM_LABEL_STATE_SLOT; xmb->is_state_slot = string_to_unsigned(path) == MENU_ENUM_LABEL_STATE_SLOT;
/* Explore list */
xmb->is_explore_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_EXPLORE_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB));
/* Quick Menu under Explore list must also be Quick Menu */
if (xmb->is_explore_list)
{
xmb->is_quick_menu |= menu_is_nonrunning_quick_menu() || menu_is_running_quick_menu();
if (xmb->is_quick_menu)
xmb->is_explore_list = false;
else
xmb->skip_thumbnail_reset = true;
}
/* Determine the first playlist item under "Load Content > Playlists" */ /* Determine the first playlist item under "Load Content > Playlists" */
xmb->playlist_collection_offset = 0; xmb->playlist_collection_offset = 0;
if (settings->uints.menu_content_show_add_entry) if (settings->uints.menu_content_show_add_entry)
@ -2611,12 +2651,13 @@ static void xmb_populate_entries(void *data,
/* Determine whether to show entry index */ /* Determine whether to show entry index */
/* Update list size & entry index texts */ /* Update list size & entry index texts */
if ((xmb->entry_idx_enabled = show_entry_idx && xmb->is_playlist)) if ((xmb->entry_idx_enabled = show_entry_idx &&
(xmb->is_playlist || (xmb->is_explore_list && xmb->depth > 1))))
{ {
xmb->list_size = menu_entries_get_size(); xmb->list_size = menu_entries_get_size();
snprintf(xmb->entry_index_str, sizeof(xmb->entry_index_str), snprintf(xmb->entry_index_str, sizeof(xmb->entry_index_str),
"%lu/%lu", (unsigned long)menu_navigation_get_selection() + 1, "%lu/%lu", (unsigned long)menu_navigation_get_selection() + 1,
(unsigned long)xmb->list_size); (unsigned long)xmb->list_size);
} }
/* By default, fullscreen thumbnails are only /* By default, fullscreen thumbnails are only
@ -2634,18 +2675,14 @@ static void xmb_populate_entries(void *data,
{ {
xmb->fullscreen_thumbnails_available = true; xmb->fullscreen_thumbnails_available = true;
} }
else if (xmb->is_quick_menu && xmb->depth < 6) else if (xmb->is_quick_menu)
{ {
const char *thumbnail_content_path = NULL; xmb->fullscreen_thumbnails_available = !menu_is_running_quick_menu();
runloop_state_t *runloop_st = runloop_state_get_ptr(); }
gfx_thumbnail_get_content_path(xmb->thumbnail_path_data, &thumbnail_content_path); else if (xmb->is_explore_list)
{
if (xmb->libretro_running) xmb_set_thumbnail_content(xmb, "");
xmb->fullscreen_thumbnails_available = false; xmb_update_thumbnail_image(xmb);
if (!string_is_empty(thumbnail_content_path) &&
!string_is_equal(thumbnail_content_path, runloop_st->runtime_content_path))
xmb->fullscreen_thumbnails_available = true;
} }
/* Hack: XMB gets into complete muddle when /* Hack: XMB gets into complete muddle when
@ -2657,7 +2694,7 @@ static void xmb_populate_entries(void *data,
{ {
xmb->fullscreen_thumbnails_available = false; xmb->fullscreen_thumbnails_available = false;
xmb->thumbnails.pending = XMB_PENDING_THUMBNAIL_NONE; xmb->thumbnails.pending = XMB_PENDING_THUMBNAIL_NONE;
gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL); gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL, NULL);
gfx_thumbnail_cancel_pending_requests(); gfx_thumbnail_cancel_pending_requests();
gfx_thumbnail_reset(&xmb->thumbnails.right); gfx_thumbnail_reset(&xmb->thumbnails.right);
gfx_thumbnail_reset(&xmb->thumbnails.left); gfx_thumbnail_reset(&xmb->thumbnails.left);
@ -4127,7 +4164,7 @@ static void xmb_show_fullscreen_thumbnails(
xmb->fullscreen_thumbnail_label, xmb->fullscreen_thumbnail_label,
sizeof(xmb->fullscreen_thumbnail_label), sizeof(xmb->fullscreen_thumbnail_label),
xmb->is_quick_menu, xmb->is_quick_menu,
xmb->playlist_index) == 0) xmb->title_name) == 0)
xmb->fullscreen_thumbnail_label[0] = '\0'; xmb->fullscreen_thumbnail_label[0] = '\0';
/* Configure fade in animation */ /* Configure fade in animation */
@ -4147,6 +4184,12 @@ static void xmb_show_fullscreen_thumbnails(
xmb->show_fullscreen_thumbnails = true; xmb->show_fullscreen_thumbnails = true;
} }
/* Common thumbnail switch requires FILE_TYPE_RPL_ENTRY,
* which only works with playlists, therefore activate it
* manually for Quick Menu, Explore and Database */
extern int action_switch_thumbnail(const char *path,
const char *label, unsigned type, size_t idx);
static enum menu_action xmb_parse_menu_entry_action( static enum menu_action xmb_parse_menu_entry_action(
xmb_handle_t *xmb, enum menu_action action) xmb_handle_t *xmb, enum menu_action action)
{ {
@ -4190,8 +4233,7 @@ static enum menu_action xmb_parse_menu_entry_action(
break; break;
case MENU_ACTION_START: case MENU_ACTION_START:
if (xmb->is_state_slot || if (xmb->is_state_slot ||
(xmb->is_quick_menu && (xmb->is_quick_menu && menu_is_running_quick_menu()))
(!string_is_empty(xmb->savestate_thumbnail_file_path) || xmb->depth > 2)))
break; break;
/* If this is a menu with thumbnails, attempt /* If this is a menu with thumbnails, attempt
@ -4221,12 +4263,18 @@ static enum menu_action xmb_parse_menu_entry_action(
xmb->want_fullscreen_thumbnails = true; xmb->want_fullscreen_thumbnails = true;
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
else if (xmb->show_fullscreen_thumbnails && !xmb->is_playlist) else if (xmb->show_fullscreen_thumbnails &&
(xmb->is_state_slot || (xmb->is_quick_menu && menu_is_running_quick_menu())))
{ {
xmb_hide_fullscreen_thumbnails(xmb, true); xmb_hide_fullscreen_thumbnails(xmb, true);
xmb->want_fullscreen_thumbnails = false; xmb->want_fullscreen_thumbnails = false;
new_action = MENU_ACTION_NOOP; new_action = MENU_ACTION_NOOP;
} }
else if (xmb->is_explore_list || xmb->is_quick_menu || xmb->is_db_manager_list)
{
action_switch_thumbnail(NULL, NULL, 0, 0);
new_action = MENU_ACTION_NOOP;
}
break; break;
case MENU_ACTION_OK: case MENU_ACTION_OK:
if (xmb->is_state_slot) if (xmb->is_state_slot)
@ -4246,7 +4294,7 @@ static enum menu_action xmb_parse_menu_entry_action(
{ {
xmb_hide_fullscreen_thumbnails(xmb, true); xmb_hide_fullscreen_thumbnails(xmb, true);
xmb->want_fullscreen_thumbnails = false; xmb->want_fullscreen_thumbnails = false;
if (!xmb->is_state_slot && !xmb->is_playlist) if (!xmb->is_state_slot && !xmb->is_playlist && !xmb->is_explore_list)
return MENU_ACTION_NOOP; return MENU_ACTION_NOOP;
} }
break; break;
@ -6902,6 +6950,7 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
(xmb_system_tab < XMB_SYSTEM_TAB_SETTINGS && depth == 4)) && (xmb_system_tab < XMB_SYSTEM_TAB_SETTINGS && depth == 4)) &&
xmb->is_playlist)) xmb->is_playlist))
|| xmb->is_db_manager_list || xmb->is_db_manager_list
|| xmb->is_explore_list
|| xmb->is_file_list || xmb->is_file_list
|| xmb->is_quick_menu) || xmb->is_quick_menu)
xmb_update_thumbnail_image(xmb); xmb_update_thumbnail_image(xmb);

View File

@ -8158,7 +8158,7 @@ bool menu_input_dialog_start(menu_input_ctx_line_t *line)
size_t menu_update_fullscreen_thumbnail_label( size_t menu_update_fullscreen_thumbnail_label(
char *s, size_t len, char *s, size_t len,
bool is_quick_menu, size_t playlist_index) bool is_quick_menu, const char *title)
{ {
menu_entry_t selected_entry; menu_entry_t selected_entry;
const char *thumbnail_label = NULL; const char *thumbnail_label = NULL;
@ -8196,13 +8196,8 @@ size_t menu_update_fullscreen_thumbnail_label(
thumbnail_label = tmpstr; thumbnail_label = tmpstr;
} }
/* > Quick Menu playlist label */ /* > Quick Menu playlist label */
else if (is_quick_menu) else if (is_quick_menu && title)
{ thumbnail_label = title;
const struct playlist_entry *entry = NULL;
playlist_get_index(playlist_get_cached(), playlist_index, &entry);
if (entry)
thumbnail_label = entry->label;
}
else else
thumbnail_label = selected_entry.path; thumbnail_label = selected_entry.path;
@ -8225,3 +8220,16 @@ bool menu_is_running_quick_menu(void)
return string_is_equal(entry.label, "resume_content") || return string_is_equal(entry.label, "resume_content") ||
string_is_equal(entry.label, "state_slot"); string_is_equal(entry.label, "state_slot");
} }
bool menu_is_nonrunning_quick_menu(void)
{
menu_entry_t entry;
MENU_ENTRY_INIT(entry);
entry.path_enabled = false;
entry.value_enabled = false;
entry.sublabel_enabled = false;
menu_entry_get(&entry, 0, 0, NULL, true);
return string_is_equal(entry.label, "collection");
}

View File

@ -663,6 +663,10 @@ typedef struct explore_state explore_state_t;
explore_state_t *menu_explore_build_list(const char *directory_playlist, explore_state_t *menu_explore_build_list(const char *directory_playlist,
const char *directory_database); const char *directory_database);
uintptr_t menu_explore_get_entry_icon(unsigned type); uintptr_t menu_explore_get_entry_icon(unsigned type);
const char *menu_explore_get_entry_database(unsigned type);
ssize_t menu_explore_get_entry_playlist_index(unsigned type,
playlist_t **playlist,
const struct playlist_entry **entry);
void menu_explore_context_init(void); void menu_explore_context_init(void);
void menu_explore_context_deinit(void); void menu_explore_context_deinit(void);
void menu_explore_free_state(explore_state_t *state); void menu_explore_free_state(explore_state_t *state);
@ -1006,9 +1010,10 @@ bool menu_driver_iterate(
size_t menu_update_fullscreen_thumbnail_label( size_t menu_update_fullscreen_thumbnail_label(
char *s, size_t len, char *s, size_t len,
bool is_quick_menu, size_t playlist_index); bool is_quick_menu, const char *title);
bool menu_is_running_quick_menu(void); bool menu_is_running_quick_menu(void);
bool menu_is_nonrunning_quick_menu(void);
extern const menu_ctx_driver_t *menu_ctx_drivers[]; extern const menu_ctx_driver_t *menu_ctx_drivers[];

View File

@ -1279,6 +1279,67 @@ uintptr_t menu_explore_get_entry_icon(unsigned type)
return 0; return 0;
} }
const char *menu_explore_get_entry_database(unsigned type)
{
explore_entry_t* e = NULL;
unsigned i;
if (!explore_state || type < EXPLORE_TYPE_FIRSTITEM)
return 0;
i = (type - EXPLORE_TYPE_FIRSTITEM);
e = &explore_state->entries[i];
if (e < RBUF_END(explore_state->entries))
return e->by[EXPLORE_BY_SYSTEM]->str;
return NULL;
}
ssize_t menu_explore_get_entry_playlist_index(unsigned type,
playlist_t **playlist,
const struct playlist_entry **playlist_entry)
{
explore_entry_t* e = NULL;
playlist_t* p = NULL;
unsigned i;
if (!explore_state || type < EXPLORE_TYPE_FIRSTITEM)
return 0;
i = (type - EXPLORE_TYPE_FIRSTITEM);
e = &explore_state->entries[i];
p = explore_state->playlists[0];
if (e < RBUF_END(explore_state->entries))
{
const struct playlist_entry *entry = NULL;
size_t pi = 0;
size_t j = 0;
playlist_get_index(p, 0, &entry);
while (!string_is_equal(e->playlist_entry->db_name, entry->db_name))
{
p = explore_state->playlists[pi];
playlist_get_index(p, 0, &entry);
pi++;
}
for (j = 0; j < playlist_size(p); j++)
{
playlist_get_index(p, j, &entry);
if (string_is_equal(entry->label, e->playlist_entry->label))
{
*playlist_entry = entry;
*playlist = p;
return j;
}
}
}
return -1;
}
void menu_explore_context_init(void) void menu_explore_context_init(void)
{ {
if (!explore_state) if (!explore_state)