mirror of
https://github.com/libretro/RetroArch
synced 2025-03-14 10:21:46 +00:00
Add playlist random selector (#17441)
* Add playlist random selector * Buildfix attempt * ORBIS buildfix attempt
This commit is contained in:
parent
52320dfaa8
commit
391ba55b81
@ -10452,6 +10452,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CYCLE_THUMBNAILS,
|
||||
"Cycle thumbnails"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_RANDOM_SELECT,
|
||||
"Random select"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK,
|
||||
"Back"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define _LIBRETRO_COMMON_MATH_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@ -187,4 +188,17 @@ static INLINE void convert_yxy_to_rgb(const float* Yxy, float* rgb)
|
||||
rgb[2] = dot_product(xyz_rgb[2], xyz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Picks a random value between a specified range.
|
||||
*
|
||||
* @param \c min unsigned minimum possible value.
|
||||
* @param \c max unsigned maximum possible value.
|
||||
*
|
||||
* @return unsigned random value between \c min and \c max (inclusive).
|
||||
*/
|
||||
static INLINE unsigned random_range(unsigned min, unsigned max)
|
||||
{
|
||||
return (min == max) ? min : (unsigned)((float)rand() / (float)RAND_MAX * (max + 1 - min) + min);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <lists/string_list.h>
|
||||
#include <encodings/utf.h>
|
||||
#include <retro_inline.h>
|
||||
#include <retro_math.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -46,15 +47,17 @@
|
||||
#include "../../gfx/gfx_thumbnail_path.h"
|
||||
#include "../../gfx/gfx_thumbnail.h"
|
||||
|
||||
#include "../../input/input_osk.h"
|
||||
|
||||
#include "../../core_info.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../audio/audio_driver.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#include "../../runtime_file.h"
|
||||
#include "../../file_path_special.h"
|
||||
#include "../../input/input_osk.h"
|
||||
#include "../../list_special.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
#include "../../audio/audio_driver.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
#include "../../cheevos/cheevos_menu.h"
|
||||
@ -543,28 +546,31 @@ enum materialui_handle_flags
|
||||
MUI_FLAG_NEED_COMPUTE = (1 << 1),
|
||||
MUI_FLAG_SHOW_MOUSE = (1 << 2),
|
||||
MUI_FLAG_SHOW_SCREENSAVER = (1 << 3),
|
||||
MUI_FLAG_IS_PLAYLIST_TAB = (1 << 4),
|
||||
MUI_FLAG_IS_PLAYLISTS_TAB = (1 << 4),
|
||||
MUI_FLAG_IS_PLAYLIST = (1 << 5),
|
||||
MUI_FLAG_IS_FILE_LIST = (1 << 6),
|
||||
MUI_FLAG_IS_DROPDOWN_LIST = (1 << 7),
|
||||
MUI_FLAG_IS_CORE_UPDATER_LIST = (1 << 8),
|
||||
MUI_FLAG_LAST_SHOW_NAVBAR = (1 << 9),
|
||||
MUI_FLAG_LAST_AUTO_ROTATE_NAVBAR = (1 << 10),
|
||||
MUI_FLAG_MENU_STACK_FLUSHED = (1 << 11),
|
||||
MUI_FLAG_IS_EXPLORE_LIST = (1 << 6),
|
||||
MUI_FLAG_IS_FILE_LIST = (1 << 7),
|
||||
MUI_FLAG_IS_DROPDOWN_LIST = (1 << 8),
|
||||
MUI_FLAG_IS_CORE_UPDATER_LIST = (1 << 9),
|
||||
MUI_FLAG_LAST_SHOW_NAVBAR = (1 << 10),
|
||||
MUI_FLAG_LAST_AUTO_ROTATE_NAVBAR = (1 << 11),
|
||||
MUI_FLAG_MENU_STACK_FLUSHED = (1 << 12),
|
||||
/* Used to track scroll animations */
|
||||
MUI_FLAG_SCROLL_ANIMATION_ACTIVE = (1 << 12),
|
||||
MUI_FLAG_USE_SMOOTH_TICKER = (1 << 13),
|
||||
MUI_FLAG_TOUCH_FEEDBACK_UPDATE_SELECTION = (1 << 14),
|
||||
MUI_FLAG_PRIMARY_THUMBNAIL_AVAILABLE = (1 << 15),
|
||||
MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED = (1 << 16),
|
||||
MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS = (1 << 17),
|
||||
MUI_FLAG_SHOW_SELECTION_MARKER_SHADOW = (1 << 18),
|
||||
MUI_FLAG_STATUSBAR_ENABLED = (1 << 19),
|
||||
MUI_FLAG_STATUSBAR_CACHED = (1 << 20),
|
||||
MUI_FLAG_SCROLLBAR_ACTIVE = (1 << 21),
|
||||
MUI_FLAG_SCROLLBAR_DRAGGED = (1 << 22),
|
||||
MUI_FLAG_NAVBAR_MENU_NAVIGATION_WRAPPED = (1 << 23),
|
||||
MUI_FLAG_COL_DIVIDER_IS_LIST_BG = (1 << 24)
|
||||
MUI_FLAG_SCROLL_ANIMATION_ACTIVE = (1 << 13),
|
||||
MUI_FLAG_USE_SMOOTH_TICKER = (1 << 14),
|
||||
MUI_FLAG_TOUCH_FEEDBACK_UPDATE_SELECTION = (1 << 15),
|
||||
MUI_FLAG_PRIMARY_THUMBNAIL_AVAILABLE = (1 << 16),
|
||||
MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED = (1 << 17),
|
||||
MUI_FLAG_PRIMARY_THUMBNAIL_BLOCKED = (1 << 18),
|
||||
MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED = (1 << 19),
|
||||
MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS = (1 << 20),
|
||||
MUI_FLAG_SHOW_SELECTION_MARKER_SHADOW = (1 << 21),
|
||||
MUI_FLAG_STATUSBAR_ENABLED = (1 << 22),
|
||||
MUI_FLAG_STATUSBAR_CACHED = (1 << 23),
|
||||
MUI_FLAG_SCROLLBAR_ACTIVE = (1 << 24),
|
||||
MUI_FLAG_SCROLLBAR_DRAGGED = (1 << 25),
|
||||
MUI_FLAG_NAVBAR_MENU_NAVIGATION_WRAPPED = (1 << 26),
|
||||
MUI_FLAG_COL_DIVIDER_IS_LIST_BG = (1 << 27)
|
||||
};
|
||||
|
||||
typedef struct materialui_handle
|
||||
@ -4688,6 +4694,8 @@ static void materialui_render_menu_entry_playlist_dual_icon(
|
||||
const char *entry_label = NULL;
|
||||
float entry_x = (float)x_offset + node->x;
|
||||
float entry_y = (float)header_height - mui->scroll_y + node->y;
|
||||
float entry_center = (!(mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED))
|
||||
? (float)mui->thumbnail_width_max / 2 : 0.0f;
|
||||
int usable_width = (int)node->entry_width - (int)(mui->margin * 2);
|
||||
float thumbnail_y = entry_y + ((float)mui->dip_base_unit_size / 10.0f);
|
||||
float divider_y = thumbnail_y + (float)mui->thumbnail_height_max +
|
||||
@ -4740,13 +4748,14 @@ static void materialui_render_menu_entry_playlist_dual_icon(
|
||||
userdata,
|
||||
video_width,
|
||||
video_height,
|
||||
entry_x + (float)mui->margin,
|
||||
entry_x + (float)mui->margin + entry_center,
|
||||
thumbnail_y,
|
||||
1.0f,
|
||||
&mymat);
|
||||
|
||||
/* > Secondary thumbnail */
|
||||
materialui_draw_thumbnail(
|
||||
if (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||
materialui_draw_thumbnail(
|
||||
mui,
|
||||
&node->thumbnails.secondary,
|
||||
settings,
|
||||
@ -5090,7 +5099,8 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
|
||||
&mymat);
|
||||
|
||||
/* Draw secondary */
|
||||
materialui_draw_thumbnail(
|
||||
if (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||
materialui_draw_thumbnail(
|
||||
mui,
|
||||
secondary_thumbnail,
|
||||
settings,
|
||||
@ -6576,7 +6586,8 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||
show_primary_thumbnail =
|
||||
(primary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING);
|
||||
show_secondary_thumbnail =
|
||||
(mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||
!(mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED)
|
||||
&& (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||
&& (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING);
|
||||
|
||||
if (show_primary_thumbnail)
|
||||
@ -7310,8 +7321,8 @@ static void materialui_set_list_view_type(materialui_handle_t *mui,
|
||||
mui->list_view_type = MUI_LIST_VIEW_PLAYLIST;
|
||||
|
||||
/* Check whether primary thumbnail is enabled */
|
||||
if (gfx_thumbnail_is_enabled(menu_st->thumbnail_path_data,
|
||||
GFX_THUMBNAIL_RIGHT))
|
||||
if ( !(mui->flags & MUI_FLAG_PRIMARY_THUMBNAIL_BLOCKED)
|
||||
&& gfx_thumbnail_is_enabled(menu_st->thumbnail_path_data, GFX_THUMBNAIL_RIGHT))
|
||||
{
|
||||
mui->flags |= MUI_FLAG_PRIMARY_THUMBNAIL_AVAILABLE;
|
||||
/* Get thumbnail view mode based on current
|
||||
@ -7744,6 +7755,12 @@ static bool materialui_force_enable_secondary_thumbnail(
|
||||
static void materialui_set_secondary_thumbnail_enable(materialui_handle_t *mui,
|
||||
struct menu_state *menu_st, settings_t *settings)
|
||||
{
|
||||
if (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED)
|
||||
{
|
||||
mui->flags &= ~MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mui->list_view_type)
|
||||
{
|
||||
case MUI_LIST_VIEW_PLAYLIST_THUMB_LIST_SMALL:
|
||||
@ -8616,17 +8633,17 @@ static void materialui_populate_entries(void *data, const char *path,
|
||||
* (this requires special handling when
|
||||
* scrolling via an alphabet search) */
|
||||
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)))
|
||||
mui->flags |= MUI_FLAG_IS_PLAYLIST_TAB;
|
||||
mui->flags |= MUI_FLAG_IS_PLAYLISTS_TAB;
|
||||
else
|
||||
mui->flags &= ~MUI_FLAG_IS_PLAYLIST_TAB;
|
||||
mui->flags &= ~MUI_FLAG_IS_PLAYLISTS_TAB;
|
||||
|
||||
/* Check whether this is the core updater menu
|
||||
* (this requires special handling when long
|
||||
* pressing an entry) */
|
||||
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST)))
|
||||
mui->flags |= MUI_FLAG_IS_CORE_UPDATER_LIST;
|
||||
mui->flags |= MUI_FLAG_IS_CORE_UPDATER_LIST;
|
||||
else
|
||||
mui->flags &= ~(MUI_FLAG_IS_CORE_UPDATER_LIST);
|
||||
mui->flags &= ~MUI_FLAG_IS_CORE_UPDATER_LIST;
|
||||
|
||||
/* Check whether we are currently viewing a playlist,
|
||||
* file-browser-type list or dropdown list
|
||||
@ -8639,8 +8656,27 @@ static void materialui_populate_entries(void *data, const char *path,
|
||||
|
||||
if ( string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST))
|
||||
|| 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))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST))
|
||||
)
|
||||
{
|
||||
mui->flags |= MUI_FLAG_IS_PLAYLIST;
|
||||
mui->flags &= ~(MUI_FLAG_PRIMARY_THUMBNAIL_BLOCKED
|
||||
| MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED);
|
||||
|
||||
/* Image playlist must block secondary thumbnail
|
||||
* or the same image will be shown twice */
|
||||
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST)))
|
||||
mui->flags |= MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED;
|
||||
|
||||
/* Music and video playlists must block both thumbnails
|
||||
* since there is nothing to show */
|
||||
if ( string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST)))
|
||||
mui->flags |= MUI_FLAG_PRIMARY_THUMBNAIL_BLOCKED | MUI_FLAG_SECONDARY_THUMBNAIL_BLOCKED;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* > All of the following count as a 'file list'
|
||||
@ -8704,6 +8740,30 @@ static void materialui_populate_entries(void *data, const char *path,
|
||||
mui->playlist = playlist_get_cached();
|
||||
}
|
||||
|
||||
#if defined(HAVE_LIBRETRODB)
|
||||
/* Explore list */
|
||||
if ( 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)))
|
||||
mui->flags |= MUI_FLAG_IS_EXPLORE_LIST;
|
||||
else
|
||||
mui->flags &= ~MUI_FLAG_IS_EXPLORE_LIST;
|
||||
|
||||
if (mui->flags & MUI_FLAG_IS_EXPLORE_LIST)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED;
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
/* Quick Menu under Explore list must also be Quick Menu */
|
||||
if ( string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RUN))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RESUME_CONTENT))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_STATE_SLOT))
|
||||
)
|
||||
mui->flags &= ~MUI_FLAG_IS_EXPLORE_LIST;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Update navigation bar tabs
|
||||
* > Note: We do this regardless of whether
|
||||
* the navigation bar is currently shown.
|
||||
@ -8834,7 +8894,7 @@ static int materialui_environ(enum menu_environ_cb type, void *data,
|
||||
/* If we are currently viewing the playlists tab,
|
||||
* the menu must be refreshed (since icon indices
|
||||
* may have changed) */
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLIST_TAB)
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLISTS_TAB)
|
||||
menu_st->flags |= MENU_ST_FLAG_PREVENT_POPULATE
|
||||
| MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
|
||||
}
|
||||
@ -9215,7 +9275,7 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||
* > If this is the playlists tab, an alphabet
|
||||
* search is highly ineffective - instead,
|
||||
* interpret this as a 'left' scroll action */
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLIST_TAB)
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLISTS_TAB)
|
||||
{
|
||||
materialui_auto_select_onscreen_entry(mui, MUI_ONSCREEN_ENTRY_CENTRE);
|
||||
new_action = MENU_ACTION_LEFT;
|
||||
@ -9231,7 +9291,7 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||
* > If this is the playlists tab, an alphabet
|
||||
* search is highly ineffective - instead,
|
||||
* interpret this as a 'right' scroll action */
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLIST_TAB)
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLISTS_TAB)
|
||||
{
|
||||
materialui_auto_select_onscreen_entry(mui, MUI_ONSCREEN_ENTRY_CENTRE);
|
||||
new_action = MENU_ACTION_RIGHT;
|
||||
@ -9244,7 +9304,7 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||
break;
|
||||
case MENU_ACTION_SCAN:
|
||||
/* - If this is a playlist, 'scan' command is used
|
||||
* to cycle current thumbnail view
|
||||
* to randomize current selection
|
||||
* - If this is not a playlist, perform default
|
||||
* 'scan' action *if* current selection is
|
||||
* on screen */
|
||||
@ -9252,12 +9312,79 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLIST)
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLISTS_TAB)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings)
|
||||
materialui_switch_list_view(mui, menu_st, settings);
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_t entry_new;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry_new);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
/* Keep randomizing until selection is a fresh playlist */
|
||||
while (new_selection == selection || entry_new.type != FILE_TYPE_PLAYLIST_COLLECTION)
|
||||
{
|
||||
new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
}
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
if (menu_st->driver_ctx->navigation_set)
|
||||
menu_st->driver_ctx->navigation_set(menu_st->userdata, true);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
else if ((mui->flags & MUI_FLAG_IS_PLAYLIST)
|
||||
|| (mui->flags & MUI_FLAG_IS_EXPLORE_LIST))
|
||||
{
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection_start = 0;
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = selection;
|
||||
|
||||
/* Skip header items (Search Name + Add Additional Filter + Save as View) */
|
||||
if (mui->flags & MUI_FLAG_IS_EXPLORE_LIST)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
if (entry.type == MENU_SETTINGS_LAST + 1)
|
||||
selection_start = 1;
|
||||
else if (entry.type == FILE_TYPE_RDB)
|
||||
selection_start = 2;
|
||||
}
|
||||
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
while (new_selection == selection && selection_start != selection_total - 1)
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
if (menu_st->driver_ctx->navigation_set)
|
||||
menu_st->driver_ctx->navigation_set(menu_st->userdata, true);
|
||||
materialui_auto_select_onscreen_entry(mui, MUI_ONSCREEN_ENTRY_CENTRE);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
}
|
||||
else if (!materialui_entry_onscreen(mui, selection))
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
@ -9313,8 +9440,20 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
|
||||
if ( (mui->flags & MUI_FLAG_IS_PLAYLIST)
|
||||
|| !materialui_entry_onscreen(mui, selection))
|
||||
/* - If this is a playlist, 'info' command is used
|
||||
* to cycle current thumbnail view
|
||||
* - If this is not a playlist, perform default
|
||||
* 'info' action *if* current selection is
|
||||
* on screen */
|
||||
|
||||
if (mui->flags & MUI_FLAG_IS_PLAYLIST)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings)
|
||||
materialui_switch_list_view(mui, menu_st, settings);
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
else if (!materialui_entry_onscreen(mui, selection))
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
break;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -31,9 +31,9 @@
|
||||
#include <file/config_file.h>
|
||||
#include <file/file_path.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include <retro_inline.h>
|
||||
#include <retro_math.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -47,21 +47,22 @@
|
||||
|
||||
#include "../menu_driver.h"
|
||||
#include "../../gfx/gfx_animation.h"
|
||||
|
||||
#include "../../input/input_osk.h"
|
||||
#include "../../gfx/gfx_thumbnail_path.h"
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../file_path_special.h"
|
||||
#include "../../gfx/drivers_font_renderer/bitmap.h"
|
||||
#include "../../input/input_osk.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
|
||||
#include "../../gfx/drivers_font_renderer/bitmap.h"
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
#include "../../gfx/drivers_font_renderer/bitmapfont_10x10.h"
|
||||
#include "../../gfx/drivers_font_renderer/bitmapfont_6x10.h"
|
||||
#endif
|
||||
|
||||
/* Thumbnail additions */
|
||||
#include "../../gfx/gfx_thumbnail_path.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
#include "../../audio/audio_driver.h"
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
/* Required for the Wii build, since we have
|
||||
@ -7153,6 +7154,58 @@ static void rgui_refresh_thumbnail_image(void *userdata, unsigned i)
|
||||
}
|
||||
}
|
||||
|
||||
static void rgui_action_switch_thumbnail(rgui_t *rgui)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings->uints.gfx_thumbnails == 0)
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if (settings->uints.menu_left_thumbnails > 3)
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails, 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
|
||||
if (settings->uints.gfx_thumbnails > 3)
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails, 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
}
|
||||
|
||||
rgui_refresh_thumbnail_image(rgui, 0);
|
||||
}
|
||||
|
||||
static void rgui_update_menu_sublabel(rgui_t *rgui, size_t selection)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
@ -7297,7 +7350,11 @@ static void rgui_populate_entries(
|
||||
/* Check whether we are currently viewing a playlist */
|
||||
if ( string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST))
|
||||
|| 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))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST))
|
||||
)
|
||||
rgui->flags |= RGUI_FLAG_IS_PLAYLIST;
|
||||
else
|
||||
rgui->flags &= ~RGUI_FLAG_IS_PLAYLIST;
|
||||
@ -7307,12 +7364,6 @@ static void rgui_populate_entries(
|
||||
else
|
||||
rgui->flags &= ~RGUI_FLAG_IS_PLAYLISTS_TAB;
|
||||
|
||||
if ( 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)))
|
||||
rgui->flags |= RGUI_FLAG_IS_EXPLORE_LIST;
|
||||
else
|
||||
rgui->flags &= ~RGUI_FLAG_IS_EXPLORE_LIST;
|
||||
|
||||
/* Determine whether this is the quick menu */
|
||||
if ( 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))
|
||||
@ -7326,25 +7377,32 @@ static void rgui_populate_entries(
|
||||
else
|
||||
rgui->flags &= ~RGUI_FLAG_IS_STATE_SLOT;
|
||||
|
||||
#if defined(HAVE_LIBRETRODB)
|
||||
if ( 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)))
|
||||
rgui->flags |= RGUI_FLAG_IS_EXPLORE_LIST;
|
||||
else
|
||||
rgui->flags &= ~RGUI_FLAG_IS_EXPLORE_LIST;
|
||||
|
||||
/* Quick Menu under Explore list must also be Quick Menu */
|
||||
if (rgui->flags & RGUI_FLAG_IS_EXPLORE_LIST)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED
|
||||
| MENU_ENTRY_FLAG_RICH_LABEL_ENABLED;
|
||||
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED;
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
/* Quick Menu under Explore list must also be Quick Menu */
|
||||
if ( string_is_equal(entry.label, "collection")
|
||||
|| (string_is_equal(entry.label, "resume_content")
|
||||
|| string_is_equal(entry.label, "state_slot"))
|
||||
if ( string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RUN))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RESUME_CONTENT))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_STATE_SLOT))
|
||||
)
|
||||
rgui->flags |= RGUI_FLAG_IS_QUICK_MENU;
|
||||
if (rgui->flags & RGUI_FLAG_IS_QUICK_MENU)
|
||||
{
|
||||
rgui->flags |= RGUI_FLAG_IS_QUICK_MENU;
|
||||
rgui->flags &= ~RGUI_FLAG_IS_EXPLORE_LIST;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set menu title */
|
||||
menu_entries_get_title(rgui->menu_title, sizeof(rgui->menu_title));
|
||||
@ -7925,7 +7983,8 @@ static void rgui_thumbnail_cycle_dupe(rgui_t *rgui)
|
||||
}
|
||||
|
||||
static enum menu_action rgui_parse_menu_entry_action(
|
||||
rgui_t *rgui, menu_entry_t *entry,
|
||||
rgui_t *rgui,
|
||||
menu_entry_t *entry,
|
||||
enum menu_action action)
|
||||
{
|
||||
enum menu_action new_action = action;
|
||||
@ -8049,6 +8108,81 @@ static enum menu_action rgui_parse_menu_entry_action(
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_SCAN:
|
||||
if (rgui->flags & RGUI_FLAG_IS_PLAYLISTS_TAB)
|
||||
{
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_t entry_new;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry_new);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
/* Keep randomizing until selection is a fresh playlist */
|
||||
while (new_selection == selection || entry_new.type != FILE_TYPE_PLAYLIST_COLLECTION)
|
||||
{
|
||||
new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
}
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
if (menu_st->driver_ctx->navigation_set)
|
||||
menu_st->driver_ctx->navigation_set(menu_st->userdata, true);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
else if ((rgui->flags & RGUI_FLAG_IS_PLAYLIST)
|
||||
|| (rgui->flags & RGUI_FLAG_IS_EXPLORE_LIST))
|
||||
{
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection_start = 0;
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = selection;
|
||||
|
||||
/* Skip header items (Search Name + Add Additional Filter + Save as View) */
|
||||
if (rgui->flags & RGUI_FLAG_IS_EXPLORE_LIST)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
if (entry.type == MENU_SETTINGS_LAST + 1)
|
||||
selection_start = 1;
|
||||
else if (entry.type == FILE_TYPE_RDB)
|
||||
selection_start = 2;
|
||||
}
|
||||
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
while (new_selection == selection && selection_start != selection_total - 1)
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
if (menu_st->driver_ctx->navigation_set)
|
||||
menu_st->driver_ctx->navigation_set(menu_st->userdata, true);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
/* Save state slot fullscreen toggle */
|
||||
if ( ((rgui->flags & RGUI_FLAG_IS_STATE_SLOT) || (rgui->flags & RGUI_FLAG_IS_QUICK_MENU))
|
||||
&& !string_is_empty(rgui->savestate_thumbnail_file_path))
|
||||
@ -8056,59 +8190,14 @@ static enum menu_action rgui_parse_menu_entry_action(
|
||||
rgui_toggle_fs_thumbnail(rgui, true);
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_SEARCH:
|
||||
/* Playlist thumbnail cycle */
|
||||
else if ((rgui->flags & RGUI_FLAG_IS_PLAYLIST)
|
||||
|| (rgui->flags & RGUI_FLAG_IS_EXPLORE_LIST)
|
||||
|| (rgui->flags & RGUI_FLAG_IS_QUICK_MENU))
|
||||
if ( (rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL)
|
||||
|| ((rgui->flags & RGUI_FLAG_IS_QUICK_MENU) && !menu_is_running_quick_menu()))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings->uints.gfx_thumbnails == 0)
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if (settings->uints.menu_left_thumbnails > 3)
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails, 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
|
||||
if (settings->uints.gfx_thumbnails > 3)
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails, 1);
|
||||
|
||||
if ( (!(rgui->flags & RGUI_FLAG_SHOW_FULLSCREEN_THUMBNAIL))
|
||||
&& (settings->uints.gfx_thumbnails == settings->uints.menu_left_thumbnails))
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails,
|
||||
settings->uints.gfx_thumbnails + 1);
|
||||
}
|
||||
|
||||
rgui_refresh_thumbnail_image(rgui, 0);
|
||||
rgui_action_switch_thumbnail(rgui);
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_INFO:
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <encodings/utf.h>
|
||||
#include <features/features_cpu.h>
|
||||
#include <array/rhmap.h>
|
||||
#include <retro_math.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -48,21 +49,20 @@
|
||||
#include "../../gfx/gfx_thumbnail_path.h"
|
||||
#include "../../gfx/gfx_thumbnail.h"
|
||||
|
||||
#include "../../core_info.h"
|
||||
#include "../../core.h"
|
||||
|
||||
#include "../../input/input_osk.h"
|
||||
|
||||
#include "../../file_path_special.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../audio/audio_driver.h"
|
||||
|
||||
#include "../../content.h"
|
||||
#include "../../core_info.h"
|
||||
#include "../../file_path_special.h"
|
||||
#include "../../input/input_osk.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
#include "../../audio/audio_driver.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
#include "../../cheevos/cheevos_menu.h"
|
||||
#endif
|
||||
#include "../../content.h"
|
||||
|
||||
#define XMB_RIBBON_ROWS 64
|
||||
#define XMB_RIBBON_COLS 64
|
||||
@ -453,6 +453,7 @@ typedef struct xmb_handle
|
||||
|
||||
/* Favorites, History, Images, Music, Videos, user generated */
|
||||
bool is_playlist;
|
||||
bool is_playlist_tab;
|
||||
bool is_playlist_information;
|
||||
bool is_db_manager_list;
|
||||
bool is_explore_list;
|
||||
@ -1150,7 +1151,7 @@ static char *xmb_path_dynamic_wallpaper(xmb_handle_t *xmb)
|
||||
path[0] = '\0';
|
||||
|
||||
/* Do not update wallpaper in "Load Content" playlists and inside playlist items */
|
||||
if ( (xmb->categories_selection_ptr == 0 && depth > 4)
|
||||
if ( (xmb->categories_selection_ptr == XMB_SYSTEM_TAB_MAIN && depth > 4)
|
||||
|| (xmb->categories_selection_ptr > xmb->system_tab_end && depth > 1))
|
||||
{
|
||||
if (string_is_empty(xmb->bg_file_path))
|
||||
@ -3002,6 +3003,8 @@ static void xmb_populate_entries(void *data,
|
||||
&& !string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_INFORMATION))
|
||||
&& !string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL));
|
||||
|
||||
xmb->is_playlist_tab = !xmb->is_playlist && string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB));
|
||||
|
||||
xmb->is_playlist_information =
|
||||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_INFORMATION))
|
||||
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL));
|
||||
@ -3039,31 +3042,29 @@ static void xmb_populate_entries(void *data,
|
||||
|
||||
xmb->is_state_slot = string_to_unsigned(path) == MENU_ENUM_LABEL_STATE_SLOT;
|
||||
|
||||
#if defined(HAVE_LIBRETRODB)
|
||||
/* 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))
|
||||
|| xmb_horizontal_type == MENU_EXPLORE_TAB;
|
||||
|
||||
#if defined(HAVE_LIBRETRODB)
|
||||
if (xmb->is_explore_list)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED
|
||||
| MENU_ENTRY_FLAG_RICH_LABEL_ENABLED;
|
||||
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED;
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
/* Quick Menu under Explore list must also be Quick Menu */
|
||||
xmb->is_quick_menu |= (
|
||||
string_is_equal(entry.label, "collection")
|
||||
|| (string_is_equal(entry.label, "resume_content")
|
||||
|| string_is_equal(entry.label, "state_slot"))
|
||||
);
|
||||
|
||||
if (!menu_explore_is_content_list() || xmb->is_quick_menu)
|
||||
if ( string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RUN))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_RESUME_CONTENT))
|
||||
|| string_is_equal(entry.label, msg_hash_to_str(MENU_ENUM_LABEL_STATE_SLOT))
|
||||
)
|
||||
{
|
||||
xmb->is_quick_menu = true;
|
||||
xmb->is_explore_list = false;
|
||||
}
|
||||
else if (!xmb->is_quick_menu && depth < xmb->old_depth)
|
||||
xmb->skip_thumbnail_reset = true;
|
||||
|
||||
@ -5527,6 +5528,78 @@ static enum menu_action xmb_parse_menu_entry_action(
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_SCAN:
|
||||
if (xmb->is_playlist_tab)
|
||||
{
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_t entry_new;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry_new);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
/* Keep randomizing until selection is a fresh playlist */
|
||||
while (new_selection == selection || entry_new.type != FILE_TYPE_PLAYLIST_COLLECTION)
|
||||
{
|
||||
new_selection = random_range(0, selection_total - 1);
|
||||
menu_entry_get(&entry_new, 0, new_selection, NULL, false);
|
||||
}
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
if (menu_st->driver_ctx->navigation_set)
|
||||
menu_st->driver_ctx->navigation_set(menu_st->userdata, true);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
}
|
||||
else if ((xmb->is_playlist)
|
||||
|| (xmb->is_explore_list))
|
||||
{
|
||||
size_t selection_start = 0;
|
||||
size_t selection_total = menu_st->entries.list ? MENU_LIST_GET_SELECTION(menu_st->entries.list, 0)->size : 0;
|
||||
size_t selection = menu_st->selection_ptr;
|
||||
size_t new_selection = selection;
|
||||
|
||||
/* Skip header items (Search Name + Add Additional Filter + Save as View) */
|
||||
if (xmb->is_explore_list)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
menu_entry_get(&entry, 0, 0, NULL, true);
|
||||
|
||||
if (entry.type == MENU_SETTINGS_LAST + 1)
|
||||
selection_start = 1;
|
||||
else if (entry.type == FILE_TYPE_RDB)
|
||||
selection_start = 2;
|
||||
}
|
||||
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
while (new_selection == selection && selection_start != selection_total - 1)
|
||||
new_selection = random_range(selection_start, selection_total - 1);
|
||||
|
||||
if (new_selection != selection)
|
||||
{
|
||||
menu_st->selection_ptr = new_selection;
|
||||
xmb_selection_pointer_changed(xmb, true);
|
||||
}
|
||||
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (new_selection != selection)
|
||||
audio_driver_mixer_play_scroll_sound(true);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
if ( xmb->fullscreen_thumbnails_available
|
||||
&& !xmb->show_fullscreen_thumbnails
|
||||
&& ( (xmb->is_state_slot)
|
||||
@ -5544,8 +5617,13 @@ static enum menu_action xmb_parse_menu_entry_action(
|
||||
xmb->want_fullscreen_thumbnails = false;
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
else if (xmb->is_explore_list || xmb->is_quick_menu || xmb->is_db_manager_list)
|
||||
break;
|
||||
case MENU_ACTION_SEARCH:
|
||||
/* Playlist thumbnail cycle */
|
||||
if ( (xmb->show_fullscreen_thumbnails)
|
||||
|| ((xmb->is_quick_menu) && !menu_is_running_quick_menu()))
|
||||
{
|
||||
xmb->skip_thumbnail_reset = false;
|
||||
action_switch_thumbnail(NULL, NULL, 0, 0);
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
}
|
||||
|
@ -93,6 +93,9 @@ typedef struct menu_input_ctx_bind
|
||||
extern u32 __nx_applet_type;
|
||||
#endif
|
||||
|
||||
/* Accelerated navigation buttons */
|
||||
#define NAVIGATION_BUTTONS 9
|
||||
|
||||
struct key_desc key_descriptors[RARCH_MAX_KEYS] =
|
||||
{
|
||||
{RETROK_FIRST, "Unmapped"},
|
||||
@ -5240,7 +5243,7 @@ unsigned menu_event(
|
||||
unsigned ok_trigger = ok_current & ~ok_old;
|
||||
static unsigned navigation_initial = 0;
|
||||
unsigned navigation_current = 0;
|
||||
unsigned navigation_buttons[8] =
|
||||
unsigned navigation_buttons[NAVIGATION_BUTTONS] =
|
||||
{
|
||||
RETRO_DEVICE_ID_JOYPAD_UP,
|
||||
RETRO_DEVICE_ID_JOYPAD_DOWN,
|
||||
@ -5249,7 +5252,8 @@ unsigned menu_event(
|
||||
RETRO_DEVICE_ID_JOYPAD_L,
|
||||
RETRO_DEVICE_ID_JOYPAD_R,
|
||||
RETRO_DEVICE_ID_JOYPAD_L2,
|
||||
RETRO_DEVICE_ID_JOYPAD_R2
|
||||
RETRO_DEVICE_ID_JOYPAD_R2,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y
|
||||
};
|
||||
|
||||
ok_old = ok_current;
|
||||
@ -5374,7 +5378,7 @@ unsigned menu_event(
|
||||
}
|
||||
|
||||
/* Accelerate only navigation buttons */
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < NAVIGATION_BUTTONS; i++)
|
||||
{
|
||||
if (BIT256_GET_PTR(p_input, navigation_buttons[i]))
|
||||
navigation_current |= (1 << navigation_buttons[i]);
|
||||
@ -5406,7 +5410,7 @@ unsigned menu_event(
|
||||
if (delay_count >= delay_timer)
|
||||
{
|
||||
uint32_t input_repeat = 0;
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < NAVIGATION_BUTTONS; i++)
|
||||
BIT32_SET(input_repeat, navigation_buttons[i]);
|
||||
|
||||
p_trigger_input->data[0] |= p_input->data[0] & input_repeat;
|
||||
|
@ -2165,6 +2165,7 @@ enum msg_hash_enums
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_SEARCH,
|
||||
MENU_ENUM_LABEL_VALUE_CYCLE_THUMBNAILS,
|
||||
MENU_ENUM_LABEL_VALUE_RANDOM_SELECT,
|
||||
|
||||
MENU_LABEL(DOWNLOAD_CORE_CONTENT),
|
||||
MENU_LABEL(DOWNLOAD_CORE_CONTENT_DIRS),
|
||||
|
Loading…
x
Reference in New Issue
Block a user