2018-11-19 12:09:00 +01:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
|
|
|
* Copyright (C) 2014-2017 - Jean-André Santoni
|
2019-02-22 16:31:54 -05:00
|
|
|
* Copyright (C) 2016-2019 - Brad Parker
|
2018-11-19 12:09:00 +01:00
|
|
|
* Copyright (C) 2018 - Alfredo Monclús
|
2020-10-03 17:06:03 +02:00
|
|
|
* Copyright (C) 2018-2020 - natinusala
|
2019-02-12 08:19:07 +01:00
|
|
|
* Copyright (C) 2019 - Patrick Scheurenbrand
|
2018-11-19 12:09:00 +01:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ozone.h"
|
|
|
|
#include "ozone_theme.h"
|
|
|
|
#include "ozone_display.h"
|
|
|
|
#include "ozone_sidebar.h"
|
|
|
|
|
|
|
|
#include <string/stdstring.h>
|
|
|
|
#include <file/file_path.h>
|
2019-07-10 05:39:50 +02:00
|
|
|
#include <formats/image.h>
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-16 15:26:58 +01:00
|
|
|
#include "../../../gfx/gfx_animation.h"
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
#include "../../../configuration.h"
|
|
|
|
|
2020-10-09 20:18:33 +02:00
|
|
|
static const enum msg_hash_enums ozone_system_tabs_value[OZONE_SYSTEM_TAB_LAST] = {
|
2018-11-19 12:09:00 +01:00
|
|
|
MENU_ENUM_LABEL_VALUE_MAIN_MENU,
|
|
|
|
MENU_ENUM_LABEL_VALUE_SETTINGS_TAB,
|
|
|
|
MENU_ENUM_LABEL_VALUE_HISTORY_TAB,
|
|
|
|
MENU_ENUM_LABEL_VALUE_FAVORITES_TAB,
|
|
|
|
MENU_ENUM_LABEL_VALUE_MUSIC_TAB,
|
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
MENU_ENUM_LABEL_VALUE_VIDEO_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
MENU_ENUM_LABEL_VALUE_IMAGES_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
MENU_ENUM_LABEL_VALUE_NETPLAY_TAB,
|
|
|
|
#endif
|
2020-07-28 12:15:05 +02:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2020-07-28 01:53:13 +09:00
|
|
|
MENU_ENUM_LABEL_VALUE_ADD_TAB,
|
|
|
|
MENU_ENUM_LABEL_VALUE_EXPLORE_TAB
|
2020-07-28 12:15:05 +02:00
|
|
|
#else
|
|
|
|
MENU_ENUM_LABEL_VALUE_ADD_TAB
|
|
|
|
#endif
|
2018-11-19 12:09:00 +01:00
|
|
|
};
|
|
|
|
|
2020-10-09 20:18:33 +02:00
|
|
|
static const enum menu_settings_type ozone_system_tabs_type[OZONE_SYSTEM_TAB_LAST] = {
|
2018-11-19 12:09:00 +01:00
|
|
|
MENU_SETTINGS,
|
|
|
|
MENU_SETTINGS_TAB,
|
|
|
|
MENU_HISTORY_TAB,
|
|
|
|
MENU_FAVORITES_TAB,
|
|
|
|
MENU_MUSIC_TAB,
|
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
MENU_VIDEO_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
MENU_IMAGES_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
MENU_NETPLAY_TAB,
|
|
|
|
#endif
|
2020-07-28 12:15:05 +02:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2020-07-28 01:53:13 +09:00
|
|
|
MENU_ADD_TAB,
|
|
|
|
MENU_EXPLORE_TAB
|
2020-07-28 12:15:05 +02:00
|
|
|
#else
|
|
|
|
MENU_ADD_TAB
|
|
|
|
#endif
|
2018-11-19 12:09:00 +01:00
|
|
|
};
|
|
|
|
|
2020-10-09 20:18:33 +02:00
|
|
|
static const enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST] = {
|
2018-11-19 12:09:00 +01:00
|
|
|
MENU_ENUM_LABEL_MAIN_MENU,
|
|
|
|
MENU_ENUM_LABEL_SETTINGS_TAB,
|
|
|
|
MENU_ENUM_LABEL_HISTORY_TAB,
|
|
|
|
MENU_ENUM_LABEL_FAVORITES_TAB,
|
|
|
|
MENU_ENUM_LABEL_MUSIC_TAB,
|
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
MENU_ENUM_LABEL_VIDEO_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
MENU_ENUM_LABEL_IMAGES_TAB,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_TAB,
|
|
|
|
#endif
|
2020-07-28 12:15:05 +02:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2020-07-28 01:53:13 +09:00
|
|
|
MENU_ENUM_LABEL_ADD_TAB,
|
|
|
|
MENU_ENUM_LABEL_EXPLORE_TAB
|
2020-07-28 12:15:05 +02:00
|
|
|
#else
|
|
|
|
MENU_ENUM_LABEL_ADD_TAB
|
|
|
|
#endif
|
2018-11-19 12:09:00 +01:00
|
|
|
};
|
|
|
|
|
2020-10-09 20:18:33 +02:00
|
|
|
static const unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST] = {
|
2018-11-19 12:09:00 +01:00
|
|
|
OZONE_TAB_TEXTURE_MAIN_MENU,
|
|
|
|
OZONE_TAB_TEXTURE_SETTINGS,
|
|
|
|
OZONE_TAB_TEXTURE_HISTORY,
|
|
|
|
OZONE_TAB_TEXTURE_FAVORITES,
|
|
|
|
OZONE_TAB_TEXTURE_MUSIC,
|
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
|
|
|
OZONE_TAB_TEXTURE_VIDEO,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
OZONE_TAB_TEXTURE_IMAGE,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
OZONE_TAB_TEXTURE_NETWORK,
|
|
|
|
#endif
|
|
|
|
OZONE_TAB_TEXTURE_SCAN_CONTENT
|
|
|
|
};
|
|
|
|
|
2020-06-26 17:45:35 +02:00
|
|
|
static void ozone_sidebar_collapse_end(void *userdata)
|
|
|
|
{
|
2020-09-01 07:26:04 +02:00
|
|
|
ozone_handle_t *ozone = (ozone_handle_t*)userdata;
|
2020-06-26 17:45:35 +02:00
|
|
|
|
|
|
|
ozone->sidebar_collapsed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static float ozone_sidebar_get_scroll_y(
|
|
|
|
ozone_handle_t *ozone, unsigned video_height)
|
|
|
|
{
|
2020-10-03 17:06:03 +02:00
|
|
|
float scroll_y =
|
2020-06-26 17:45:35 +02:00
|
|
|
ozone->animations.scroll_y_sidebar;
|
2020-10-03 17:06:03 +02:00
|
|
|
float selected_position_y =
|
2020-06-26 17:45:35 +02:00
|
|
|
ozone_get_selected_sidebar_y_position(ozone);
|
2020-10-03 17:06:03 +02:00
|
|
|
float current_selection_middle_onscreen =
|
|
|
|
ozone->dimensions.header_height
|
|
|
|
+ ozone->dimensions.spacer_1px
|
|
|
|
+ ozone->animations.scroll_y_sidebar
|
|
|
|
+ selected_position_y
|
2020-06-26 17:45:35 +02:00
|
|
|
+ ozone->dimensions.sidebar_entry_height / 2.0f;
|
2020-10-03 17:06:03 +02:00
|
|
|
float bottom_boundary =
|
|
|
|
(float)video_height
|
|
|
|
- (ozone->dimensions.header_height + ozone->dimensions.spacer_1px)
|
2020-06-26 17:45:35 +02:00
|
|
|
- ozone->dimensions.footer_height;
|
|
|
|
float entries_middle = (float)video_height / 2.0f;
|
|
|
|
float entries_height = ozone_get_sidebar_height(ozone);
|
|
|
|
|
|
|
|
if (current_selection_middle_onscreen != entries_middle)
|
|
|
|
scroll_y = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
|
|
|
|
|
|
|
|
if (scroll_y + entries_height < bottom_boundary)
|
|
|
|
scroll_y = bottom_boundary - entries_height - ozone->dimensions.sidebar_padding_vertical;
|
|
|
|
|
|
|
|
if (scroll_y > 0.0f)
|
|
|
|
return 0.0f;
|
|
|
|
return scroll_y;
|
|
|
|
}
|
|
|
|
|
2020-03-09 15:03:21 +01:00
|
|
|
void ozone_draw_sidebar(
|
|
|
|
ozone_handle_t *ozone,
|
2021-03-21 11:03:00 +01:00
|
|
|
gfx_display_t *p_disp,
|
|
|
|
gfx_animation_t *p_anim,
|
2021-03-21 11:46:27 +01:00
|
|
|
settings_t *settings,
|
2020-03-09 15:03:21 +01:00
|
|
|
void *userdata,
|
|
|
|
unsigned video_width,
|
|
|
|
unsigned video_height,
|
|
|
|
bool libretro_running,
|
|
|
|
float menu_framebuffer_opacity
|
|
|
|
)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
size_t y;
|
2019-02-15 09:06:45 -08:00
|
|
|
int entry_width;
|
2018-11-19 12:09:00 +01:00
|
|
|
char console_title[255];
|
2020-06-26 17:45:35 +02:00
|
|
|
unsigned i, sidebar_height;
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_ctx_ticker_t ticker;
|
|
|
|
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
|
2020-10-03 17:06:03 +02:00
|
|
|
static const char* const
|
2020-10-14 02:24:18 +02:00
|
|
|
ticker_spacer = OZONE_TICKER_SPACER;
|
|
|
|
unsigned ticker_x_offset = 0;
|
|
|
|
uint32_t text_alpha = ozone->animations.sidebar_text_alpha
|
2020-06-26 17:45:35 +02:00
|
|
|
* 255.0f;
|
2020-10-14 02:24:18 +02:00
|
|
|
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
|
|
|
|
float scale_factor = ozone->last_scale_factor;
|
2020-02-21 23:57:42 +01:00
|
|
|
enum gfx_animation_ticker_type
|
2020-10-14 02:24:18 +02:00
|
|
|
menu_ticker_type = (enum gfx_animation_ticker_type)
|
2020-06-26 17:45:35 +02:00
|
|
|
settings->uints.menu_ticker_type;
|
2020-10-14 02:24:18 +02:00
|
|
|
unsigned selection_y = 0;
|
|
|
|
unsigned selection_old_y = 0;
|
|
|
|
unsigned horizontal_list_size = 0;
|
2020-09-23 09:32:42 +02:00
|
|
|
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
|
2020-06-07 18:17:53 +02:00
|
|
|
|
2019-02-14 15:10:07 +00:00
|
|
|
/* Initial ticker configuration */
|
2019-08-21 16:32:39 +01:00
|
|
|
if (use_smooth_ticker)
|
|
|
|
{
|
2020-10-14 02:24:18 +02:00
|
|
|
ticker_smooth.idx = p_anim->ticker_pixel_idx;
|
2020-04-08 15:15:39 +01:00
|
|
|
ticker_smooth.font = ozone->fonts.sidebar.font;
|
2019-08-21 16:32:39 +01:00
|
|
|
ticker_smooth.font_scale = 1.0f;
|
2020-02-21 23:57:42 +01:00
|
|
|
ticker_smooth.type_enum = menu_ticker_type;
|
2019-08-21 16:32:39 +01:00
|
|
|
ticker_smooth.spacer = ticker_spacer;
|
|
|
|
ticker_smooth.x_offset = &ticker_x_offset;
|
|
|
|
ticker_smooth.dst_str_width = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-14 02:33:15 +02:00
|
|
|
ticker.idx = p_anim->ticker_idx;
|
2020-02-21 23:57:42 +01:00
|
|
|
ticker.type_enum = menu_ticker_type;
|
2020-02-16 14:01:34 +01:00
|
|
|
ticker.spacer = ticker_spacer;
|
2019-08-21 16:32:39 +01:00
|
|
|
}
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-08-24 10:22:32 +02:00
|
|
|
horizontal_list_size = (unsigned)ozone->horizontal_list.size;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2021-03-25 20:12:34 +01:00
|
|
|
gfx_display_scissor_begin(
|
|
|
|
p_disp,
|
|
|
|
userdata,
|
2020-03-09 00:58:04 +01:00
|
|
|
video_width, video_height,
|
|
|
|
0,
|
|
|
|
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
2020-08-24 10:47:17 +02:00
|
|
|
(unsigned) ozone->dimensions_sidebar_width,
|
2020-03-09 00:58:04 +01:00
|
|
|
video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* Background */
|
2020-03-07 21:42:29 +01:00
|
|
|
sidebar_height = video_height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-03-07 21:42:29 +01:00
|
|
|
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
2020-03-08 23:56:22 +01:00
|
|
|
gfx_display_draw_quad(
|
2021-03-25 20:12:34 +01:00
|
|
|
p_disp,
|
2020-03-08 23:56:22 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset,
|
|
|
|
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
2020-08-24 10:47:17 +02:00
|
|
|
(unsigned)ozone->dimensions_sidebar_width,
|
2020-03-08 23:56:22 +01:00
|
|
|
ozone->dimensions.sidebar_gradient_height,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->theme->sidebar_top_gradient);
|
|
|
|
gfx_display_draw_quad(
|
2021-03-25 20:12:34 +01:00
|
|
|
p_disp,
|
2020-03-08 23:56:22 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset,
|
|
|
|
ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height,
|
2020-08-24 10:47:17 +02:00
|
|
|
(unsigned)ozone->dimensions_sidebar_width,
|
2020-03-08 23:56:22 +01:00
|
|
|
sidebar_height,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->theme->sidebar_background);
|
|
|
|
gfx_display_draw_quad(
|
2021-03-25 20:12:34 +01:00
|
|
|
p_disp,
|
2020-03-08 23:56:22 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset,
|
2020-09-01 07:26:04 +02:00
|
|
|
video_height
|
|
|
|
- ozone->dimensions.footer_height
|
|
|
|
- ozone->dimensions.sidebar_gradient_height
|
|
|
|
- ozone->dimensions.spacer_1px,
|
2020-08-24 10:47:17 +02:00
|
|
|
(unsigned)ozone->dimensions_sidebar_width,
|
2020-09-01 07:26:04 +02:00
|
|
|
ozone->dimensions.sidebar_gradient_height
|
|
|
|
+ ozone->dimensions.spacer_1px,
|
2020-03-08 23:56:22 +01:00
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->theme->sidebar_bottom_gradient);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Tabs */
|
|
|
|
/* y offset computation */
|
2020-02-11 17:02:47 +00:00
|
|
|
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_padding_vertical;
|
2018-11-19 12:09:00 +01:00
|
|
|
for (i = 0; i < ozone->system_tab_end + horizontal_list_size + 1; i++)
|
|
|
|
{
|
|
|
|
if (i == ozone->categories_selection_ptr)
|
|
|
|
{
|
2019-04-08 23:13:39 +02:00
|
|
|
selection_y = (unsigned)y;
|
2018-11-19 12:09:00 +01:00
|
|
|
if (ozone->categories_selection_ptr > ozone->system_tab_end)
|
2020-02-11 17:02:47 +00:00
|
|
|
selection_y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (i == ozone->categories_active_idx_old)
|
|
|
|
{
|
2019-04-08 23:13:39 +02:00
|
|
|
selection_old_y = (unsigned)y;
|
2018-11-19 12:09:00 +01:00
|
|
|
if (ozone->categories_active_idx_old > ozone->system_tab_end)
|
2020-02-11 17:02:47 +00:00
|
|
|
selection_old_y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2019-02-11 21:22:52 +01:00
|
|
|
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2020-08-24 10:47:17 +02:00
|
|
|
entry_width = (unsigned) ozone->dimensions_sidebar_width - ozone->dimensions.sidebar_padding_horizontal * 2;
|
2019-02-11 18:30:31 +01:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Cursor */
|
|
|
|
if (ozone->cursor_in_sidebar)
|
2021-03-21 11:03:00 +01:00
|
|
|
ozone_draw_cursor(
|
|
|
|
ozone,
|
|
|
|
p_disp,
|
2020-03-09 14:53:54 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.spacer_3px,
|
|
|
|
entry_width - ozone->dimensions.spacer_5px,
|
2020-03-26 11:38:30 +00:00
|
|
|
ozone->dimensions.sidebar_entry_height + ozone->dimensions.spacer_1px,
|
|
|
|
selection_y + ozone->animations.scroll_y_sidebar,
|
2020-03-09 14:53:54 +01:00
|
|
|
ozone->animations.cursor_alpha);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (ozone->cursor_in_sidebar_old)
|
2020-03-09 14:53:54 +01:00
|
|
|
ozone_draw_cursor(
|
|
|
|
ozone,
|
2021-03-21 11:03:00 +01:00
|
|
|
p_disp,
|
2020-03-09 14:53:54 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.spacer_3px,
|
2020-10-03 17:06:03 +02:00
|
|
|
entry_width - ozone->dimensions.spacer_5px,
|
|
|
|
ozone->dimensions.sidebar_entry_height + ozone->dimensions.spacer_1px,
|
|
|
|
selection_old_y + ozone->animations.scroll_y_sidebar,
|
|
|
|
1-ozone->animations.cursor_alpha);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* Menu tabs */
|
2020-02-11 17:02:47 +00:00
|
|
|
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_padding_vertical;
|
2020-09-23 09:32:42 +02:00
|
|
|
if (dispctx && dispctx->blend_begin)
|
|
|
|
dispctx->blend_begin(userdata);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2019-02-11 23:15:11 +01:00
|
|
|
for (i = 0; i < (unsigned)(ozone->system_tab_end+1); i++)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
enum msg_hash_enums value_idx;
|
2019-02-27 13:34:42 +01:00
|
|
|
const char *title = NULL;
|
|
|
|
bool selected = (ozone->categories_selection_ptr == i);
|
|
|
|
unsigned icon = ozone_system_tabs_icons[ozone->tabs[i]];
|
|
|
|
|
|
|
|
uint32_t text_color = COLOR_TEXT_ALPHA((selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), text_alpha);
|
2020-10-08 18:19:50 +02:00
|
|
|
float *col = (selected ? ozone->theme->text_selected : ozone->theme->entries_icon);
|
|
|
|
|
|
|
|
if (!col)
|
|
|
|
col = ozone->pure_white;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* Icon */
|
2020-03-09 14:46:23 +01:00
|
|
|
ozone_draw_icon(
|
2021-03-21 11:03:00 +01:00
|
|
|
p_disp,
|
2020-03-09 14:46:23 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
ozone->tab_textures[icon],
|
|
|
|
ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding,
|
|
|
|
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
0,
|
|
|
|
1,
|
2020-10-08 18:19:50 +02:00
|
|
|
col);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
value_idx = ozone_system_tabs_value[ozone->tabs[i]];
|
|
|
|
title = msg_hash_to_str(value_idx);
|
|
|
|
|
|
|
|
/* Text */
|
2019-02-27 13:34:42 +01:00
|
|
|
if (!ozone->sidebar_collapsed)
|
2020-09-01 05:06:21 +02:00
|
|
|
gfx_display_draw_text(
|
|
|
|
ozone->fonts.sidebar.font,
|
|
|
|
title,
|
|
|
|
ozone->sidebar_offset
|
|
|
|
+ ozone->dimensions.sidebar_padding_horizontal
|
|
|
|
+ ozone->dimensions.sidebar_entry_icon_padding * 2
|
|
|
|
+ ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
y + ozone->dimensions.sidebar_entry_height / 2.0f
|
|
|
|
+ ozone->fonts.sidebar.line_centre_offset
|
|
|
|
+ ozone->animations.scroll_y_sidebar,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
text_color,
|
|
|
|
TEXT_ALIGN_LEFT,
|
|
|
|
1.0f,
|
|
|
|
false,
|
|
|
|
1.0f,
|
|
|
|
true);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2019-02-11 21:22:52 +01:00
|
|
|
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2020-09-23 09:32:42 +02:00
|
|
|
if (dispctx && dispctx->blend_end)
|
|
|
|
dispctx->blend_end(userdata);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* Console tabs */
|
|
|
|
if (horizontal_list_size > 0)
|
|
|
|
{
|
2020-03-08 23:56:22 +01:00
|
|
|
gfx_display_draw_quad(
|
2021-03-25 20:12:34 +01:00
|
|
|
p_disp,
|
2020-03-08 23:56:22 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal,
|
|
|
|
y + ozone->animations.scroll_y_sidebar,
|
|
|
|
entry_width,
|
|
|
|
ozone->dimensions.spacer_1px,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->theme->entries_border);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-11 17:02:47 +00:00
|
|
|
y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-09-23 09:32:42 +02:00
|
|
|
if (dispctx && dispctx->blend_begin)
|
|
|
|
dispctx->blend_begin(userdata);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
for (i = 0; i < horizontal_list_size; i++)
|
|
|
|
{
|
|
|
|
bool selected = (ozone->categories_selection_ptr == ozone->system_tab_end + 1 + i);
|
|
|
|
|
2019-02-27 13:34:42 +01:00
|
|
|
uint32_t text_color = COLOR_TEXT_ALPHA((selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), text_alpha);
|
|
|
|
|
2021-01-20 09:04:08 +01:00
|
|
|
ozone_node_t *node = (ozone_node_t*)ozone->horizontal_list.list[i].userdata;
|
2020-10-08 18:19:50 +02:00
|
|
|
float *col = (selected ? ozone->theme->text_selected : ozone->theme->entries_icon);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
goto console_iterate;
|
|
|
|
|
2020-10-08 18:19:50 +02:00
|
|
|
if (!col)
|
|
|
|
col = ozone->pure_white;
|
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Icon */
|
2020-03-09 14:46:23 +01:00
|
|
|
ozone_draw_icon(
|
2021-03-21 11:03:00 +01:00
|
|
|
p_disp,
|
2020-03-09 14:46:23 +01:00
|
|
|
userdata,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
node->icon,
|
|
|
|
ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding,
|
|
|
|
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
0,
|
|
|
|
1,
|
2020-10-08 18:19:50 +02:00
|
|
|
col);
|
2019-02-11 18:30:31 +01:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Text */
|
2019-02-27 13:34:42 +01:00
|
|
|
if (ozone->sidebar_collapsed)
|
|
|
|
goto console_iterate;
|
|
|
|
|
2019-08-21 16:32:39 +01:00
|
|
|
if (use_smooth_ticker)
|
|
|
|
{
|
|
|
|
ticker_smooth.selected = selected;
|
2020-02-17 22:45:13 +01:00
|
|
|
/* TODO/FIXME - undefined behavior reported by ASAN -
|
|
|
|
*-12.549 is outside the range of representable values
|
|
|
|
of type 'unsigned int'
|
|
|
|
* */
|
2020-02-11 17:02:47 +00:00
|
|
|
ticker_smooth.field_width = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40 * scale_factor);
|
2019-08-21 16:32:39 +01:00
|
|
|
ticker_smooth.src_str = node->console_name;
|
|
|
|
ticker_smooth.dst_str = console_title;
|
|
|
|
ticker_smooth.dst_str_len = sizeof(console_title);
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_ticker_smooth(&ticker_smooth);
|
2019-08-21 16:32:39 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-04-08 15:15:39 +01:00
|
|
|
ticker.len = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40 * scale_factor) / ozone->fonts.sidebar.glyph_width;
|
2019-08-21 16:32:39 +01:00
|
|
|
ticker.s = console_title;
|
|
|
|
ticker.selected = selected;
|
|
|
|
ticker.str = node->console_name;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_ticker(&ticker);
|
2019-08-21 16:32:39 +01:00
|
|
|
}
|
|
|
|
|
2020-09-01 05:06:21 +02:00
|
|
|
gfx_display_draw_text(
|
|
|
|
ozone->fonts.sidebar.font,
|
|
|
|
console_title,
|
|
|
|
ticker_x_offset + ozone->sidebar_offset
|
|
|
|
+ ozone->dimensions.sidebar_padding_horizontal
|
|
|
|
+ ozone->dimensions.sidebar_entry_icon_padding * 2
|
|
|
|
+ ozone->dimensions.sidebar_entry_icon_size,
|
|
|
|
y + ozone->dimensions.sidebar_entry_height / 2
|
|
|
|
+ ozone->fonts.sidebar.line_centre_offset
|
|
|
|
+ ozone->animations.scroll_y_sidebar,
|
|
|
|
video_width,
|
|
|
|
video_height,
|
|
|
|
text_color,
|
2020-04-08 15:15:39 +01:00
|
|
|
TEXT_ALIGN_LEFT,
|
2020-09-01 05:06:21 +02:00
|
|
|
1.0f,
|
|
|
|
false,
|
|
|
|
1.0f,
|
|
|
|
true);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
console_iterate:
|
2019-02-11 21:22:52 +01:00
|
|
|
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2020-09-23 09:32:42 +02:00
|
|
|
if (dispctx && dispctx->blend_end)
|
|
|
|
dispctx->blend_end(userdata);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2020-04-08 15:15:39 +01:00
|
|
|
ozone_font_flush(video_width, video_height, &ozone->fonts.sidebar);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-09-28 04:04:16 +02:00
|
|
|
if (dispctx && dispctx->scissor_end)
|
|
|
|
dispctx->scissor_end(userdata,
|
|
|
|
video_width, video_height);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_go_to_sidebar(ozone_handle_t *ozone, settings_t *settings,
|
|
|
|
uintptr_t tag)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
2020-02-16 14:01:34 +01:00
|
|
|
struct gfx_animation_ctx_entry entry;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
ozone->selection_old = ozone->selection;
|
|
|
|
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
|
|
|
|
ozone->cursor_in_sidebar = true;
|
2019-02-03 15:49:35 -08:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Cursor animation */
|
|
|
|
ozone->animations.cursor_alpha = 0.0f;
|
|
|
|
|
2020-06-26 17:45:35 +02:00
|
|
|
entry.cb = NULL;
|
|
|
|
entry.duration = ANIMATION_CURSOR_DURATION;
|
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
entry.subject = &ozone->animations.cursor_alpha;
|
|
|
|
entry.tag = tag;
|
|
|
|
entry.target_value = 1.0f;
|
|
|
|
entry.userdata = NULL;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 18:29:57 +01:00
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
ozone_sidebar_update_collapse(ozone, settings, true);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_leave_sidebar(ozone_handle_t *ozone,
|
|
|
|
settings_t *settings,
|
|
|
|
uintptr_t tag)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
2020-02-16 14:01:34 +01:00
|
|
|
struct gfx_animation_ctx_entry entry;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (ozone->empty_playlist)
|
|
|
|
return;
|
|
|
|
|
2019-03-14 17:31:48 +01:00
|
|
|
ozone_update_content_metadata(ozone);
|
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
ozone->categories_active_idx_old = ozone->categories_selection_ptr;
|
|
|
|
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
|
|
|
|
ozone->cursor_in_sidebar = false;
|
2019-02-03 15:49:35 -08:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Cursor animation */
|
|
|
|
ozone->animations.cursor_alpha = 0.0f;
|
|
|
|
|
2019-02-13 10:32:07 +01:00
|
|
|
entry.cb = NULL;
|
|
|
|
entry.duration = ANIMATION_CURSOR_DURATION;
|
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
entry.subject = &ozone->animations.cursor_alpha;
|
|
|
|
entry.tag = tag;
|
|
|
|
entry.target_value = 1.0f;
|
|
|
|
entry.userdata = NULL;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 18:29:57 +01:00
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
ozone_sidebar_update_collapse(ozone, settings, true);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned ozone_get_selected_sidebar_y_position(ozone_handle_t *ozone)
|
|
|
|
{
|
2019-08-07 17:34:07 -04:00
|
|
|
return ozone->categories_selection_ptr * ozone->dimensions.sidebar_entry_height +
|
|
|
|
(ozone->categories_selection_ptr - 1) * ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.sidebar_padding_vertical +
|
2020-02-11 17:02:47 +00:00
|
|
|
(ozone->categories_selection_ptr > ozone->system_tab_end ? ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px : 0);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned ozone_get_sidebar_height(ozone_handle_t *ozone)
|
|
|
|
{
|
2020-08-24 10:22:32 +02:00
|
|
|
int entries = (int)(ozone->system_tab_end + 1 + (ozone->horizontal_list.size ));
|
2019-02-11 21:22:52 +01:00
|
|
|
return entries * ozone->dimensions.sidebar_entry_height + (entries - 1) * ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.sidebar_padding_vertical +
|
2020-08-24 10:22:32 +02:00
|
|
|
(ozone->horizontal_list.size > 0 ? ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px : 0);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_sidebar_update_collapse(
|
|
|
|
ozone_handle_t *ozone,
|
|
|
|
settings_t *settings,
|
|
|
|
bool allow_animation)
|
2019-02-27 13:34:42 +01:00
|
|
|
{
|
|
|
|
/* Collapse sidebar if needed */
|
2020-02-16 14:01:34 +01:00
|
|
|
struct gfx_animation_ctx_entry entry;
|
|
|
|
bool is_playlist = ozone_is_playlist(ozone, false);
|
2020-06-08 04:09:12 +02:00
|
|
|
uintptr_t tag = (uintptr_t)&ozone->sidebar_collapsed;
|
2020-02-21 23:57:42 +01:00
|
|
|
bool collapse_sidebar = settings->bools.ozone_collapse_sidebar;
|
2019-02-27 13:34:42 +01:00
|
|
|
|
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
entry.tag = tag;
|
|
|
|
entry.userdata = ozone;
|
|
|
|
entry.duration = ANIMATION_CURSOR_DURATION;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_kill_by_tag(&tag);
|
2019-02-27 19:05:22 +01:00
|
|
|
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Collapse it */
|
2020-02-21 23:57:42 +01:00
|
|
|
if (collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))
|
2019-02-27 13:34:42 +01:00
|
|
|
{
|
|
|
|
if (allow_animation)
|
|
|
|
{
|
|
|
|
entry.cb = ozone_sidebar_collapse_end;
|
|
|
|
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Text alpha */
|
2019-02-27 13:34:42 +01:00
|
|
|
entry.subject = &ozone->animations.sidebar_text_alpha;
|
|
|
|
entry.target_value = 0.0f;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 13:34:42 +01:00
|
|
|
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Collapse */
|
2020-08-24 10:47:17 +02:00
|
|
|
entry.subject = &ozone->dimensions_sidebar_width;
|
2019-02-27 13:34:42 +01:00
|
|
|
entry.target_value = ozone->dimensions.sidebar_width_collapsed;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 13:34:42 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-06-26 17:45:35 +02:00
|
|
|
ozone->animations.sidebar_text_alpha = 0.0f;
|
2020-08-24 10:47:17 +02:00
|
|
|
ozone->dimensions_sidebar_width =
|
2020-06-26 17:45:35 +02:00
|
|
|
ozone->dimensions.sidebar_width_collapsed;
|
2020-09-01 07:26:04 +02:00
|
|
|
ozone->sidebar_collapsed = true;
|
2019-02-27 13:34:42 +01:00
|
|
|
}
|
|
|
|
}
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Show it */
|
2020-02-21 23:57:42 +01:00
|
|
|
else if (ozone->cursor_in_sidebar || (!is_playlist && !collapse_sidebar))
|
2019-02-27 13:34:42 +01:00
|
|
|
{
|
|
|
|
if (allow_animation)
|
|
|
|
{
|
|
|
|
ozone->sidebar_collapsed = false;
|
|
|
|
|
|
|
|
entry.cb = NULL;
|
|
|
|
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Text alpha */
|
2019-02-27 13:34:42 +01:00
|
|
|
entry.subject = &ozone->animations.sidebar_text_alpha;
|
|
|
|
entry.target_value = 1.0f;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 13:34:42 +01:00
|
|
|
|
2019-03-13 16:56:40 +01:00
|
|
|
/* Collapse */
|
2020-08-24 10:47:17 +02:00
|
|
|
entry.subject = &ozone->dimensions_sidebar_width;
|
2019-02-27 13:34:42 +01:00
|
|
|
entry.target_value = ozone->dimensions.sidebar_width_normal;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2019-02-27 13:34:42 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ozone->animations.sidebar_text_alpha = 1.0f;
|
2020-08-24 10:47:17 +02:00
|
|
|
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_normal;
|
2019-02-27 15:21:26 +01:00
|
|
|
ozone->sidebar_collapsed = false;
|
2019-02-27 13:34:42 +01:00
|
|
|
}
|
|
|
|
}
|
2019-02-27 18:26:31 +01:00
|
|
|
|
|
|
|
ozone_entries_update_thumbnail_bar(ozone, is_playlist, allow_animation);
|
2019-02-27 13:34:42 +01:00
|
|
|
}
|
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
|
|
|
{
|
|
|
|
unsigned video_info_height;
|
2020-02-16 14:01:34 +01:00
|
|
|
struct gfx_animation_ctx_entry entry;
|
2020-06-08 04:09:12 +02:00
|
|
|
uintptr_t tag = (uintptr_t)ozone;
|
2018-12-16 06:38:56 -08:00
|
|
|
|
|
|
|
video_driver_get_size(NULL, &video_info_height);
|
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
if (ozone->categories_selection_ptr != new_selection)
|
|
|
|
{
|
|
|
|
ozone->categories_active_idx_old = ozone->categories_selection_ptr;
|
|
|
|
ozone->categories_selection_ptr = new_selection;
|
|
|
|
|
|
|
|
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
|
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_kill_by_tag(&tag);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2020-02-21 13:59:42 +00:00
|
|
|
/* ozone->animations.scroll_y_sidebar will be modified
|
|
|
|
* > Set scroll acceleration to zero to minimise
|
|
|
|
* potential conflicts */
|
|
|
|
menu_input_set_pointer_y_accel(0.0f);
|
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
/* Cursor animation */
|
|
|
|
ozone->animations.cursor_alpha = 0.0f;
|
|
|
|
|
2019-02-13 10:32:07 +01:00
|
|
|
entry.cb = NULL;
|
|
|
|
entry.duration = ANIMATION_CURSOR_DURATION;
|
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
entry.subject = &ozone->animations.cursor_alpha;
|
|
|
|
entry.tag = tag;
|
|
|
|
entry.target_value = 1.0f;
|
|
|
|
entry.userdata = NULL;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* Scroll animation */
|
2020-02-11 17:02:47 +00:00
|
|
|
entry.cb = NULL;
|
|
|
|
entry.duration = ANIMATION_CURSOR_DURATION;
|
|
|
|
entry.easing_enum = EASING_OUT_QUAD;
|
|
|
|
entry.subject = &ozone->animations.scroll_y_sidebar;
|
|
|
|
entry.tag = tag;
|
|
|
|
entry.target_value = ozone_sidebar_get_scroll_y(ozone, video_info_height);
|
|
|
|
entry.userdata = NULL;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_push(&entry);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (new_selection > ozone->system_tab_end)
|
|
|
|
ozone_change_tab(ozone, MENU_ENUM_LABEL_HORIZONTAL_MENU, MENU_SETTING_HORIZONTAL_MENU);
|
|
|
|
else
|
|
|
|
ozone_change_tab(ozone, ozone_system_tabs_idx[ozone->tabs[new_selection]], ozone_system_tabs_type[ozone->tabs[new_selection]]);
|
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_refresh_sidebars(
|
|
|
|
ozone_handle_t *ozone,
|
|
|
|
settings_t *settings,
|
|
|
|
unsigned video_height)
|
2020-02-11 17:02:47 +00:00
|
|
|
{
|
2020-06-08 04:09:12 +02:00
|
|
|
uintptr_t collapsed_tag = (uintptr_t)&ozone->sidebar_collapsed;
|
|
|
|
uintptr_t offset_tag = (uintptr_t)&ozone->sidebar_offset;
|
|
|
|
uintptr_t thumbnail_tag = (uintptr_t)&ozone->show_thumbnail_bar;
|
|
|
|
uintptr_t scroll_tag = (uintptr_t)ozone;
|
2020-02-11 17:02:47 +00:00
|
|
|
bool is_playlist = ozone_is_playlist(ozone, false);
|
2020-02-21 23:57:42 +01:00
|
|
|
bool collapse_sidebar = settings->bools.ozone_collapse_sidebar;
|
2020-02-11 17:02:47 +00:00
|
|
|
|
|
|
|
/* Kill any existing animations */
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_kill_by_tag(&collapsed_tag);
|
|
|
|
gfx_animation_kill_by_tag(&offset_tag);
|
|
|
|
gfx_animation_kill_by_tag(&thumbnail_tag);
|
2020-02-11 17:02:47 +00:00
|
|
|
if (ozone->depth == 1)
|
2020-02-16 14:01:34 +01:00
|
|
|
gfx_animation_kill_by_tag(&scroll_tag);
|
2020-02-11 17:02:47 +00:00
|
|
|
|
|
|
|
/* Set sidebar width */
|
2020-02-21 23:57:42 +01:00
|
|
|
if (collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))
|
2020-02-11 17:02:47 +00:00
|
|
|
{
|
|
|
|
ozone->animations.sidebar_text_alpha = 0.0f;
|
2020-08-24 10:47:17 +02:00
|
|
|
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_collapsed;
|
2020-02-11 17:02:47 +00:00
|
|
|
ozone->sidebar_collapsed = true;
|
|
|
|
}
|
2020-02-21 23:57:42 +01:00
|
|
|
else if (ozone->cursor_in_sidebar || (!is_playlist && !collapse_sidebar))
|
2020-02-11 17:02:47 +00:00
|
|
|
{
|
|
|
|
ozone->animations.sidebar_text_alpha = 1.0f;
|
2020-08-24 10:47:17 +02:00
|
|
|
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_normal;
|
2020-02-11 17:02:47 +00:00
|
|
|
ozone->sidebar_collapsed = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set sidebar offset */
|
|
|
|
if (ozone->depth == 1)
|
|
|
|
{
|
|
|
|
ozone->sidebar_offset = 0.0f;
|
|
|
|
ozone->draw_sidebar = true;
|
|
|
|
}
|
|
|
|
else if (ozone->depth > 1)
|
|
|
|
{
|
2020-08-24 10:47:17 +02:00
|
|
|
ozone->sidebar_offset = -ozone->dimensions_sidebar_width;
|
2020-02-11 17:02:47 +00:00
|
|
|
ozone->draw_sidebar = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set thumbnail bar position */
|
|
|
|
if (is_playlist && !ozone->cursor_in_sidebar && ozone->depth == 1)
|
|
|
|
{
|
|
|
|
ozone->animations.thumbnail_bar_position = ozone->dimensions.thumbnail_bar_width;
|
|
|
|
ozone->show_thumbnail_bar = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ozone->animations.thumbnail_bar_position = 0.0f;
|
|
|
|
ozone->show_thumbnail_bar = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If sidebar is on-screen, update scroll position */
|
|
|
|
if (ozone->depth == 1)
|
|
|
|
{
|
|
|
|
ozone->animations.cursor_alpha = 1.0f;
|
|
|
|
ozone->animations.scroll_y_sidebar = ozone_sidebar_get_scroll_y(ozone, video_height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-03 15:49:35 -08:00
|
|
|
void ozone_change_tab(ozone_handle_t *ozone,
|
|
|
|
enum msg_hash_enums tab,
|
2018-11-19 12:09:00 +01:00
|
|
|
enum menu_settings_type type)
|
|
|
|
{
|
2021-03-11 03:37:19 +01:00
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2018-11-19 12:09:00 +01:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2021-03-11 03:37:19 +01:00
|
|
|
size_t stack_size = menu_stack->size;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (menu_stack->list[stack_size - 1].label)
|
|
|
|
free(menu_stack->list[stack_size - 1].label);
|
|
|
|
menu_stack->list[stack_size - 1].label = NULL;
|
2019-02-03 15:49:35 -08:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
menu_stack->list[stack_size - 1].label =
|
|
|
|
strdup(msg_hash_to_str(tab));
|
|
|
|
menu_stack->list[stack_size - 1].type =
|
|
|
|
type;
|
|
|
|
|
2021-03-11 02:58:35 +01:00
|
|
|
ozone_list_cache(ozone, MENU_LIST_HORIZONTAL,
|
|
|
|
MENU_ACTION_LEFT);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2021-03-11 03:49:51 +01:00
|
|
|
menu_driver_deferred_push_content_list(selection_buf);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_init_horizontal_list(ozone_handle_t *ozone,
|
|
|
|
settings_t *settings)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
menu_displaylist_info_t info;
|
2020-05-15 17:26:36 +01:00
|
|
|
size_t list_size;
|
|
|
|
size_t i;
|
|
|
|
const char *dir_playlist = settings->paths.directory_playlist;
|
|
|
|
bool menu_content_show_playlists = settings->bools.menu_content_show_playlists;
|
|
|
|
bool ozone_truncate_playlist_name = settings->bools.ozone_truncate_playlist_name;
|
2020-05-25 11:32:17 +01:00
|
|
|
bool ozone_sort_after_truncate = settings->bools.ozone_sort_after_truncate_playlist_name;
|
2020-05-15 17:26:36 +01:00
|
|
|
|
2018-11-19 12:09:00 +01:00
|
|
|
menu_displaylist_info_init(&info);
|
|
|
|
|
2020-08-24 10:22:32 +02:00
|
|
|
info.list = &ozone->horizontal_list;
|
2020-02-21 23:57:42 +01:00
|
|
|
info.path = strdup(dir_playlist);
|
2018-11-19 12:09:00 +01:00
|
|
|
info.label = strdup(
|
2019-03-17 12:35:30 -04:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB));
|
2019-09-18 18:12:57 +02:00
|
|
|
info.exts = strdup("lpl");
|
2018-11-19 12:09:00 +01:00
|
|
|
info.type_default = FILE_TYPE_PLAIN;
|
2019-03-17 12:35:30 -04:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_PLAYLISTS_TAB;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-02-21 23:57:42 +01:00
|
|
|
if (menu_content_show_playlists && !string_is_empty(info.path))
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
2021-03-21 16:36:36 +01:00
|
|
|
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL,
|
|
|
|
&info, settings))
|
2018-11-19 12:09:00 +01:00
|
|
|
menu_displaylist_process(&info);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_displaylist_info_free(&info);
|
2020-05-15 17:26:36 +01:00
|
|
|
|
|
|
|
/* Loop through list and set console names */
|
|
|
|
list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
|
|
|
|
|
|
|
for (i = 0; i < list_size; i++)
|
|
|
|
{
|
|
|
|
char playlist_file_noext[255];
|
2021-03-10 08:36:59 +01:00
|
|
|
char *console_name = NULL;
|
|
|
|
const char *playlist_file = ozone->horizontal_list.list[i].path;
|
2020-05-15 17:26:36 +01:00
|
|
|
|
|
|
|
playlist_file_noext[0] = '\0';
|
|
|
|
|
|
|
|
if (!playlist_file)
|
|
|
|
{
|
2020-08-24 10:22:32 +02:00
|
|
|
file_list_set_alt_at_offset(&ozone->horizontal_list, i, NULL);
|
2020-05-15 17:26:36 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Remove extension */
|
|
|
|
fill_pathname_base_noext(playlist_file_noext,
|
|
|
|
playlist_file, sizeof(playlist_file_noext));
|
|
|
|
|
|
|
|
console_name = playlist_file_noext;
|
|
|
|
|
|
|
|
/* Truncate playlist names, if required
|
|
|
|
* > Format: "Vendor - Console"
|
|
|
|
Remove everything before the hyphen
|
|
|
|
and the subsequent space */
|
|
|
|
if (ozone_truncate_playlist_name)
|
|
|
|
{
|
|
|
|
bool hyphen_found = false;
|
|
|
|
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
/* Check for "- " */
|
|
|
|
if (*console_name == '\0')
|
|
|
|
break;
|
|
|
|
else if (*console_name == '-' && *(console_name + 1) == ' ')
|
|
|
|
{
|
|
|
|
hyphen_found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
console_name++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hyphen_found)
|
|
|
|
console_name += 2;
|
|
|
|
else
|
|
|
|
console_name = playlist_file_noext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Assign console name to list */
|
2020-08-24 10:22:32 +02:00
|
|
|
file_list_set_alt_at_offset(&ozone->horizontal_list, i, console_name);
|
2020-05-15 17:26:36 +01:00
|
|
|
}
|
|
|
|
|
2020-05-25 11:32:17 +01:00
|
|
|
/* If playlist names were truncated and option is
|
|
|
|
* enabled, re-sort list by console name */
|
|
|
|
if (ozone_truncate_playlist_name &&
|
|
|
|
ozone_sort_after_truncate &&
|
|
|
|
(list_size > 0))
|
2020-08-24 10:22:32 +02:00
|
|
|
file_list_sort_on_alt(&ozone->horizontal_list);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 11:46:27 +01:00
|
|
|
void ozone_refresh_horizontal_list(ozone_handle_t *ozone,
|
|
|
|
settings_t *settings)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
ozone_context_destroy_horizontal_list(ozone);
|
2020-08-24 10:22:32 +02:00
|
|
|
ozone_free_list_nodes(&ozone->horizontal_list, false);
|
|
|
|
file_list_deinitialize(&ozone->horizontal_list);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
|
|
|
|
2020-08-24 10:22:32 +02:00
|
|
|
file_list_initialize(&ozone->horizontal_list);
|
2021-03-21 11:46:27 +01:00
|
|
|
ozone_init_horizontal_list(ozone, settings);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
ozone_context_reset_horizontal_list(ozone);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
|
|
|
{
|
|
|
|
unsigned i;
|
2020-05-15 17:26:36 +01:00
|
|
|
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
for (i = 0; i < list_size; i++)
|
|
|
|
{
|
2020-05-15 17:26:36 +01:00
|
|
|
const char *path = NULL;
|
|
|
|
const char *console_name = NULL;
|
2021-01-20 09:04:08 +01:00
|
|
|
ozone_node_t *node = (ozone_node_t*)ozone->horizontal_list.list[i].userdata;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
{
|
|
|
|
node = ozone_alloc_node();
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-03-10 08:36:59 +01:00
|
|
|
if (!(path = ozone->horizontal_list.list[i].path))
|
2018-11-19 12:09:00 +01:00
|
|
|
continue;
|
2021-03-10 08:36:59 +01:00
|
|
|
if (string_ends_with_size(path, ".lpl",
|
2020-06-25 14:38:06 +02:00
|
|
|
strlen(path), STRLEN_CONST(".lpl")))
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
struct texture_image ti;
|
2020-08-18 12:44:14 +02:00
|
|
|
char sysname[PATH_MAX_LENGTH];
|
|
|
|
char texturepath[PATH_MAX_LENGTH];
|
|
|
|
char content_texturepath[PATH_MAX_LENGTH];
|
|
|
|
char icons_path[PATH_MAX_LENGTH];
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2020-08-18 12:44:14 +02:00
|
|
|
strlcpy(icons_path, ozone->icons_path, sizeof(icons_path));
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
sysname[0] = texturepath[0] = content_texturepath[0] = '\0';
|
|
|
|
|
2020-08-18 12:44:14 +02:00
|
|
|
fill_pathname_base_noext(sysname, path, sizeof(sysname));
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
fill_pathname_join_concat(texturepath, icons_path, sysname,
|
2020-08-18 12:44:14 +02:00
|
|
|
".png", sizeof(texturepath));
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* If the playlist icon doesn't exist return default */
|
|
|
|
|
2019-05-30 12:19:52 +01:00
|
|
|
if (!path_is_valid(texturepath))
|
2021-03-10 05:23:50 +01:00
|
|
|
fill_pathname_join_concat(texturepath, icons_path, "default",
|
|
|
|
".png", sizeof(texturepath));
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
ti.width = 0;
|
|
|
|
ti.height = 0;
|
|
|
|
ti.pixels = NULL;
|
|
|
|
ti.supports_rgba = video_driver_supports_rgba();
|
|
|
|
|
|
|
|
if (image_texture_load(&ti, texturepath))
|
|
|
|
{
|
2020-02-10 13:18:27 +01:00
|
|
|
if (ti.pixels)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
video_driver_texture_unload(&node->icon);
|
|
|
|
video_driver_texture_load(&ti,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &node->icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
image_texture_free(&ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
fill_pathname_join_delim(sysname, sysname,
|
2020-08-18 12:44:14 +02:00
|
|
|
"content.png", '-', sizeof(sysname));
|
|
|
|
strlcat(content_texturepath, icons_path, sizeof(content_texturepath));
|
|
|
|
strlcat(content_texturepath, PATH_DEFAULT_SLASH(), sizeof(content_texturepath));
|
|
|
|
strlcat(content_texturepath, sysname, sizeof(content_texturepath));
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
/* If the content icon doesn't exist return default-content */
|
2019-05-30 12:19:52 +01:00
|
|
|
if (!path_is_valid(content_texturepath))
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
2020-06-25 13:36:01 +02:00
|
|
|
strlcat(icons_path,
|
2020-08-18 12:44:14 +02:00
|
|
|
PATH_DEFAULT_SLASH() "default", sizeof(icons_path));
|
2018-11-19 12:09:00 +01:00
|
|
|
fill_pathname_join_delim(content_texturepath, icons_path,
|
2020-08-18 12:44:14 +02:00
|
|
|
"content.png", '-', sizeof(content_texturepath));
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (image_texture_load(&ti, content_texturepath))
|
|
|
|
{
|
2020-02-10 13:18:27 +01:00
|
|
|
if (ti.pixels)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
video_driver_texture_unload(&node->content_icon);
|
|
|
|
video_driver_texture_load(&ti,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR, &node->content_icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
image_texture_free(&ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Console name */
|
2021-03-10 05:23:50 +01:00
|
|
|
console_name = ozone->horizontal_list.list[i].alt
|
|
|
|
? ozone->horizontal_list.list[i].alt
|
|
|
|
: ozone->horizontal_list.list[i].path;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
2018-11-22 15:45:52 +01:00
|
|
|
if (node->console_name)
|
|
|
|
free(node->console_name);
|
|
|
|
|
2020-05-15 17:26:36 +01:00
|
|
|
/* Note: console_name will *always* be valid here,
|
|
|
|
* but provide a fallback to prevent NULL pointer
|
|
|
|
* dereferencing in case of unknown errors... */
|
2021-03-10 05:23:50 +01:00
|
|
|
if (console_name)
|
|
|
|
node->console_name = strdup(console_name);
|
|
|
|
else
|
|
|
|
node->console_name = strdup(path);
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ozone_context_destroy_horizontal_list(ozone_handle_t *ozone)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
|
|
|
|
|
|
|
for (i = 0; i < list_size; i++)
|
|
|
|
{
|
|
|
|
const char *path = NULL;
|
2021-01-20 09:04:08 +01:00
|
|
|
ozone_node_t *node = (ozone_node_t*)ozone->horizontal_list.list[i].userdata;
|
2018-11-19 12:09:00 +01:00
|
|
|
|
|
|
|
if (!node)
|
|
|
|
continue;
|
|
|
|
|
2021-03-10 08:36:59 +01:00
|
|
|
if (!(path = ozone->horizontal_list.list[i].path))
|
2018-11-19 12:09:00 +01:00
|
|
|
continue;
|
2021-03-10 08:36:59 +01:00
|
|
|
if (string_ends_with_size(path, ".lpl",
|
|
|
|
strlen(path), STRLEN_CONST(".lpl")))
|
|
|
|
{
|
|
|
|
video_driver_texture_unload(&node->icon);
|
|
|
|
video_driver_texture_unload(&node->content_icon);
|
|
|
|
}
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-22 15:45:52 +01:00
|
|
|
bool ozone_is_playlist(ozone_handle_t *ozone, bool depth)
|
2018-11-19 12:09:00 +01:00
|
|
|
{
|
|
|
|
bool is_playlist;
|
|
|
|
|
2019-03-12 11:45:27 +01:00
|
|
|
if (ozone->categories_selection_ptr > ozone->system_tab_end)
|
|
|
|
is_playlist = true;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (ozone->tabs[ozone->categories_selection_ptr])
|
|
|
|
{
|
|
|
|
case OZONE_SYSTEM_TAB_MAIN:
|
|
|
|
case OZONE_SYSTEM_TAB_SETTINGS:
|
|
|
|
case OZONE_SYSTEM_TAB_ADD:
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
case OZONE_SYSTEM_TAB_NETPLAY:
|
|
|
|
#endif
|
2020-07-28 12:15:05 +02:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2020-07-28 01:53:13 +09:00
|
|
|
case OZONE_SYSTEM_TAB_EXPLORE:
|
2020-07-28 12:15:05 +02:00
|
|
|
#endif
|
2019-03-12 11:45:27 +01:00
|
|
|
is_playlist = false;
|
|
|
|
break;
|
|
|
|
case OZONE_SYSTEM_TAB_HISTORY:
|
|
|
|
case OZONE_SYSTEM_TAB_FAVORITES:
|
|
|
|
case OZONE_SYSTEM_TAB_MUSIC:
|
2018-11-19 12:09:00 +01:00
|
|
|
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
2019-03-12 11:45:27 +01:00
|
|
|
case OZONE_SYSTEM_TAB_VIDEO:
|
2018-11-19 12:09:00 +01:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2019-03-12 11:45:27 +01:00
|
|
|
case OZONE_SYSTEM_TAB_IMAGES:
|
2018-11-19 12:09:00 +01:00
|
|
|
#endif
|
2019-03-12 11:45:27 +01:00
|
|
|
default:
|
|
|
|
is_playlist = true;
|
|
|
|
break;
|
|
|
|
}
|
2018-11-19 12:09:00 +01:00
|
|
|
}
|
|
|
|
|
2018-11-22 15:45:52 +01:00
|
|
|
if (depth)
|
|
|
|
return is_playlist && ozone->depth == 1;
|
|
|
|
|
|
|
|
return is_playlist;
|
2018-12-16 06:38:56 -08:00
|
|
|
}
|