mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
Display thumbnails in the Database Manager
This commit is contained in:
parent
63762e8850
commit
17837ec81d
@ -237,6 +237,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
char tmp[PATH_MAX_LENGTH];
|
char tmp[PATH_MAX_LENGTH];
|
||||||
char parent_dir[PATH_MAX_LENGTH];
|
char parent_dir[PATH_MAX_LENGTH];
|
||||||
char action_path[PATH_MAX_LENGTH];
|
char action_path[PATH_MAX_LENGTH];
|
||||||
|
char lpl_basename[PATH_MAX_LENGTH];
|
||||||
enum menu_displaylist_ctl_state dl_type = DISPLAYLIST_NONE;
|
enum menu_displaylist_ctl_state dl_type = DISPLAYLIST_NONE;
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
@ -252,7 +253,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
new_path_tmp[0] = tmp[0] = parent_dir[0] = action_path[0] = '\0';
|
new_path_tmp[0] = tmp[0] = parent_dir[0] = action_path[0] = lpl_basename[0] = '\0';
|
||||||
|
|
||||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
||||||
|
|
||||||
@ -550,6 +551,9 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
settings->paths.path_content_database,
|
settings->paths.path_content_database,
|
||||||
path, sizeof(tmp));
|
path, sizeof(tmp));
|
||||||
|
|
||||||
|
fill_pathname_base_noext(lpl_basename, path, sizeof(lpl_basename));
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_SET_THUMBNAIL_SYSTEM, lpl_basename);
|
||||||
|
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = tmp;
|
info_path = tmp;
|
||||||
info_label = msg_hash_to_str(
|
info_label = msg_hash_to_str(
|
||||||
@ -3432,6 +3436,7 @@ static int action_ok_push_content_list(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
||||||
return generic_action_ok_displaylist_push(path,
|
return generic_action_ok_displaylist_push(path,
|
||||||
settings->paths.directory_menu_content, label, type, idx,
|
settings->paths.directory_menu_content, label, type, idx,
|
||||||
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
||||||
@ -3679,6 +3684,7 @@ static int action_ok_scan_directory_list(const char *path,
|
|||||||
static int action_ok_push_random_dir(const char *path,
|
static int action_ok_push_random_dir(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
||||||
return generic_action_ok_displaylist_push(path, path,
|
return generic_action_ok_displaylist_push(path, path,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
||||||
type, idx,
|
type, idx,
|
||||||
@ -3690,7 +3696,7 @@ static int action_ok_push_downloads_dir(const char *path,
|
|||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
filebrowser_clear_type();
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
||||||
return generic_action_ok_displaylist_push(path, settings->paths.directory_core_assets,
|
return generic_action_ok_displaylist_push(path, settings->paths.directory_core_assets,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
||||||
type, idx,
|
type, idx,
|
||||||
|
@ -2080,6 +2080,8 @@ menu_ctx_driver_t menu_ctx_mui = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
mui_osk_ptr_at_pos,
|
mui_osk_ptr_at_pos,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -540,8 +540,13 @@ menu_ctx_driver_t menu_ctx_nuklear = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
"nuklear",
|
"nuklear",
|
||||||
NULL,
|
NULL, /* environ */
|
||||||
NULL,
|
NULL, /* pointer_tap */
|
||||||
NULL,
|
NULL, /* update_thumbnail_path */
|
||||||
NULL
|
NULL, /* update_thumbnail_image */
|
||||||
|
NULL, /* set_thumbnail_system */
|
||||||
|
NULL, /* set_thumbnail_content */
|
||||||
|
NULL, /* osk_ptr_at_pos */
|
||||||
|
NULL, /* update_savestate_thumbnail_path */
|
||||||
|
NULL, /* update_savestate_thumbnail_image */
|
||||||
};
|
};
|
||||||
|
@ -56,8 +56,13 @@ menu_ctx_driver_t menu_ctx_null = {
|
|||||||
NULL, /* bind_init */
|
NULL, /* bind_init */
|
||||||
NULL, /* load_image */
|
NULL, /* load_image */
|
||||||
"null",
|
"null",
|
||||||
NULL,
|
NULL, /* environ */
|
||||||
NULL,
|
NULL, /* pointer_tap */
|
||||||
NULL, /* update_thumbnail_path */
|
NULL, /* update_thumbnail_path */
|
||||||
NULL, /* update_thumbnail_image */
|
NULL, /* update_thumbnail_image */
|
||||||
|
NULL, /* set_thumbnail_system */
|
||||||
|
NULL, /* set_thumbnail_content */
|
||||||
|
NULL, /* osk_ptr_at_pos */
|
||||||
|
NULL, /* update_savestate_thumbnail_path */
|
||||||
|
NULL, /* update_savestate_thumbnail_image */
|
||||||
};
|
};
|
||||||
|
@ -901,5 +901,10 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
|||||||
rgui_environ,
|
rgui_environ,
|
||||||
rgui_pointer_tap,
|
rgui_pointer_tap,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "../widgets/menu_list.h"
|
#include "../widgets/menu_list.h"
|
||||||
#include "../widgets/menu_input_dialog.h"
|
#include "../widgets/menu_input_dialog.h"
|
||||||
#include "../widgets/menu_osk.h"
|
#include "../widgets/menu_osk.h"
|
||||||
|
#include "../widgets/menu_filebrowser.h"
|
||||||
|
|
||||||
#include "../menu_event.h"
|
#include "../menu_event.h"
|
||||||
|
|
||||||
@ -194,6 +195,8 @@ typedef struct xmb_handle
|
|||||||
float savestate_thumbnail_width;
|
float savestate_thumbnail_width;
|
||||||
float savestate_thumbnail_height;
|
float savestate_thumbnail_height;
|
||||||
char background_file_path[PATH_MAX_LENGTH];
|
char background_file_path[PATH_MAX_LENGTH];
|
||||||
|
char thumbnail_system[PATH_MAX_LENGTH];
|
||||||
|
char thumbnail_content[PATH_MAX_LENGTH];
|
||||||
char thumbnail_file_path[PATH_MAX_LENGTH];
|
char thumbnail_file_path[PATH_MAX_LENGTH];
|
||||||
char savestate_thumbnail_file_path[PATH_MAX_LENGTH];
|
char savestate_thumbnail_file_path[PATH_MAX_LENGTH];
|
||||||
uint64_t frame_count;
|
uint64_t frame_count;
|
||||||
@ -926,7 +929,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (xmb_list_get_selection(xmb) <= XMB_SYSTEM_TAB_SETTINGS)
|
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
||||||
{
|
{
|
||||||
xmb->thumbnail_file_path[0] = '\0';
|
xmb->thumbnail_file_path[0] = '\0';
|
||||||
xmb->thumbnail = 0;
|
xmb->thumbnail = 0;
|
||||||
@ -951,7 +954,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
|
|||||||
fill_pathname_join(
|
fill_pathname_join(
|
||||||
xmb->thumbnail_file_path,
|
xmb->thumbnail_file_path,
|
||||||
settings->paths.directory_thumbnails,
|
settings->paths.directory_thumbnails,
|
||||||
xmb->title_name,
|
xmb->thumbnail_system,
|
||||||
sizeof(xmb->thumbnail_file_path));
|
sizeof(xmb->thumbnail_file_path));
|
||||||
|
|
||||||
fill_pathname_join(xmb->thumbnail_file_path, xmb->thumbnail_file_path,
|
fill_pathname_join(xmb->thumbnail_file_path, xmb->thumbnail_file_path,
|
||||||
@ -962,7 +965,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
|
|||||||
* http://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).zip
|
* http://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).zip
|
||||||
* Replace these characters in the entry name with underscores.
|
* Replace these characters in the entry name with underscores.
|
||||||
*/
|
*/
|
||||||
tmp = strdup(entry.path);
|
tmp = strdup(xmb->thumbnail_content);
|
||||||
|
|
||||||
while((scrub_char_pointer = strpbrk(tmp, "&*/:`<>?\\|")))
|
while((scrub_char_pointer = strpbrk(tmp, "&*/:`<>?\\|")))
|
||||||
*scrub_char_pointer = '_';
|
*scrub_char_pointer = '_';
|
||||||
@ -1050,10 +1053,30 @@ static void xmb_update_thumbnail_image(void *data)
|
|||||||
if (path_file_exists(xmb->thumbnail_file_path))
|
if (path_file_exists(xmb->thumbnail_file_path))
|
||||||
task_push_image_load(xmb->thumbnail_file_path,
|
task_push_image_load(xmb->thumbnail_file_path,
|
||||||
menu_display_handle_thumbnail_upload, NULL);
|
menu_display_handle_thumbnail_upload, NULL);
|
||||||
else if (xmb->depth == 1)
|
else
|
||||||
xmb->thumbnail = 0;
|
xmb->thumbnail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void xmb_set_thumbnail_system(void *data, char* thumbnail_system)
|
||||||
|
{
|
||||||
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||||
|
if (!xmb)
|
||||||
|
return;
|
||||||
|
|
||||||
|
strlcpy(xmb->thumbnail_system,
|
||||||
|
thumbnail_system, sizeof(xmb->thumbnail_system));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void xmb_set_thumbnail_content(void *data, char* thumbnail_content)
|
||||||
|
{
|
||||||
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||||
|
if (!xmb)
|
||||||
|
return;
|
||||||
|
|
||||||
|
strlcpy(xmb->thumbnail_content,
|
||||||
|
thumbnail_content, sizeof(xmb->thumbnail_content));
|
||||||
|
}
|
||||||
|
|
||||||
static void xmb_update_savestate_thumbnail_image(void *data)
|
static void xmb_update_savestate_thumbnail_image(void *data)
|
||||||
{
|
{
|
||||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||||
@ -1070,6 +1093,7 @@ static void xmb_update_savestate_thumbnail_image(void *data)
|
|||||||
static void xmb_selection_pointer_changed(
|
static void xmb_selection_pointer_changed(
|
||||||
xmb_handle_t *xmb, bool allow_animations)
|
xmb_handle_t *xmb, bool allow_animations)
|
||||||
{
|
{
|
||||||
|
menu_entry_t e;
|
||||||
unsigned i, end, height;
|
unsigned i, end, height;
|
||||||
menu_animation_ctx_tag_t tag;
|
menu_animation_ctx_tag_t tag;
|
||||||
size_t num = 0;
|
size_t num = 0;
|
||||||
@ -1083,6 +1107,19 @@ static void xmb_selection_pointer_changed(
|
|||||||
if (!xmb)
|
if (!xmb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
e.path[0] = '\0';
|
||||||
|
e.label[0] = '\0';
|
||||||
|
e.sublabel[0] = '\0';
|
||||||
|
e.value[0] = '\0';
|
||||||
|
e.rich_label[0] = '\0';
|
||||||
|
e.enum_idx = MSG_UNKNOWN;
|
||||||
|
e.entry_idx = 0;
|
||||||
|
e.idx = 0;
|
||||||
|
e.type = 0;
|
||||||
|
e.spacing = 0;
|
||||||
|
|
||||||
|
menu_entry_get(&e, 0, selection, NULL, true);
|
||||||
|
|
||||||
end = (unsigned)menu_entries_get_end();
|
end = (unsigned)menu_entries_get_end();
|
||||||
threshold = xmb->icon.size*10;
|
threshold = xmb->icon.size*10;
|
||||||
|
|
||||||
@ -1115,11 +1152,27 @@ static void xmb_selection_pointer_changed(
|
|||||||
iz = xmb->items.active.zoom;
|
iz = xmb->items.active.zoom;
|
||||||
|
|
||||||
if (!string_is_equal(xmb_thumbnails_ident(),
|
if (!string_is_equal(xmb_thumbnails_ident(),
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
&& (depth == 1 || xmb_list_get_selection(xmb) <= XMB_SYSTEM_TAB_SETTINGS))
|
|
||||||
{
|
{
|
||||||
xmb_update_thumbnail_path(xmb, i);
|
if (xmb_list_get_selection(xmb) > XMB_SYSTEM_TAB_SETTINGS && depth == 1)
|
||||||
xmb_update_thumbnail_image(xmb);
|
{
|
||||||
|
xmb_set_thumbnail_content(xmb, e.path);
|
||||||
|
xmb_update_thumbnail_path(xmb, i);
|
||||||
|
xmb_update_thumbnail_image(xmb);
|
||||||
|
}
|
||||||
|
else if (((e.type == FILE_TYPE_IMAGE || e.type == FILE_TYPE_RDB || e.type == FILE_TYPE_RDB_ENTRY)
|
||||||
|
&& xmb_list_get_selection(xmb) <= XMB_SYSTEM_TAB_SETTINGS))
|
||||||
|
{
|
||||||
|
xmb_set_thumbnail_content(xmb, e.path);
|
||||||
|
xmb_update_thumbnail_path(xmb, i);
|
||||||
|
xmb_update_thumbnail_image(xmb);
|
||||||
|
}
|
||||||
|
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
||||||
|
{
|
||||||
|
xmb_set_thumbnail_content(xmb, "");
|
||||||
|
xmb_update_thumbnail_path(xmb, i);
|
||||||
|
xmb_update_thumbnail_image(xmb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
xmb_update_savestate_thumbnail_path(xmb, i);
|
xmb_update_savestate_thumbnail_path(xmb, i);
|
||||||
xmb_update_savestate_thumbnail_image(xmb);
|
xmb_update_savestate_thumbnail_image(xmb);
|
||||||
@ -1305,7 +1358,12 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
|
|||||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &skip);
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &skip);
|
||||||
|
|
||||||
if (xmb_list_get_selection(xmb) <= XMB_SYSTEM_TAB_SETTINGS)
|
if (xmb_list_get_selection(xmb) <= XMB_SYSTEM_TAB_SETTINGS)
|
||||||
|
{
|
||||||
|
if (xmb->depth < 4)
|
||||||
|
xmb_set_thumbnail_content(xmb, "");
|
||||||
xmb_update_thumbnail_path(xmb, 0);
|
xmb_update_thumbnail_path(xmb, 0);
|
||||||
|
xmb_update_thumbnail_image(xmb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, unsigned i)
|
static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, unsigned i)
|
||||||
@ -1556,6 +1614,7 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb)
|
|||||||
|
|
||||||
static void xmb_list_switch(xmb_handle_t *xmb)
|
static void xmb_list_switch(xmb_handle_t *xmb)
|
||||||
{
|
{
|
||||||
|
menu_entry_t e;
|
||||||
menu_animation_ctx_entry_t entry;
|
menu_animation_ctx_entry_t entry;
|
||||||
int dir = -1;
|
int dir = -1;
|
||||||
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
||||||
@ -1590,6 +1649,21 @@ static void xmb_list_switch(xmb_handle_t *xmb)
|
|||||||
if (!string_is_equal(xmb_thumbnails_ident(),
|
if (!string_is_equal(xmb_thumbnails_ident(),
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
{
|
{
|
||||||
|
e.path[0] = '\0';
|
||||||
|
e.label[0] = '\0';
|
||||||
|
e.sublabel[0] = '\0';
|
||||||
|
e.value[0] = '\0';
|
||||||
|
e.rich_label[0] = '\0';
|
||||||
|
e.enum_idx = MSG_UNKNOWN;
|
||||||
|
e.entry_idx = 0;
|
||||||
|
e.idx = 0;
|
||||||
|
e.type = 0;
|
||||||
|
e.spacing = 0;
|
||||||
|
|
||||||
|
menu_entry_get(&e, 0, selection, NULL, true);
|
||||||
|
|
||||||
|
xmb_set_thumbnail_content(xmb, e.path);
|
||||||
|
|
||||||
xmb_update_thumbnail_path(xmb, 0);
|
xmb_update_thumbnail_path(xmb, 0);
|
||||||
xmb_update_thumbnail_image(xmb);
|
xmb_update_thumbnail_image(xmb);
|
||||||
}
|
}
|
||||||
@ -4131,6 +4205,8 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
|||||||
xmb_pointer_tap,
|
xmb_pointer_tap,
|
||||||
xmb_update_thumbnail_path,
|
xmb_update_thumbnail_path,
|
||||||
xmb_update_thumbnail_image,
|
xmb_update_thumbnail_image,
|
||||||
|
xmb_set_thumbnail_system,
|
||||||
|
xmb_set_thumbnail_content,
|
||||||
xmb_osk_ptr_at_pos,
|
xmb_osk_ptr_at_pos,
|
||||||
xmb_update_savestate_thumbnail_path,
|
xmb_update_savestate_thumbnail_path,
|
||||||
xmb_update_savestate_thumbnail_image
|
xmb_update_savestate_thumbnail_image
|
||||||
|
@ -726,6 +726,8 @@ menu_ctx_driver_t menu_ctx_xui = {
|
|||||||
NULL, /* pointer_tap */
|
NULL, /* pointer_tap */
|
||||||
NULL, /* update_thumbnail_path */
|
NULL, /* update_thumbnail_path */
|
||||||
NULL, /* update_thumbnail_image */
|
NULL, /* update_thumbnail_image */
|
||||||
|
NULL, /* set_thumbnail_system */
|
||||||
|
NULL, /* set_thumbnail_content */
|
||||||
NULL, /* osk_ptr_at_pos */
|
NULL, /* osk_ptr_at_pos */
|
||||||
NULL, /* update_savestate_thumbnail_path */
|
NULL, /* update_savestate_thumbnail_path */
|
||||||
NULL /* update_savestate_thumbnail_image */
|
NULL /* update_savestate_thumbnail_image */
|
||||||
|
@ -1181,8 +1181,13 @@ menu_ctx_driver_t menu_ctx_zarch = {
|
|||||||
NULL,
|
NULL,
|
||||||
zarch_load_image,
|
zarch_load_image,
|
||||||
"zarch",
|
"zarch",
|
||||||
NULL,
|
NULL, /* environ */
|
||||||
NULL,
|
NULL, /* pointer_tap */
|
||||||
NULL,
|
NULL, /* update_thumbnail_path */
|
||||||
NULL
|
NULL, /* update_thumbnail_image */
|
||||||
|
NULL, /* set_thumbnail_system */
|
||||||
|
NULL, /* set_thumbnail_content */
|
||||||
|
NULL, /* osk_ptr_at_pos */
|
||||||
|
NULL, /* update_savestate_thumbnail_path */
|
||||||
|
NULL, /* update_savestate_thumbnail_image */
|
||||||
};
|
};
|
||||||
|
@ -1726,6 +1726,9 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
|
|||||||
|
|
||||||
fill_short_pathname_representation_noext(path_base, info->path,
|
fill_short_pathname_representation_noext(path_base, info->path,
|
||||||
sizeof(path_base));
|
sizeof(path_base));
|
||||||
|
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_SET_THUMBNAIL_SYSTEM, path_base);
|
||||||
|
|
||||||
strlcat(path_base,
|
strlcat(path_base,
|
||||||
file_path_str(FILE_PATH_LPL_EXTENSION),
|
file_path_str(FILE_PATH_LPL_EXTENSION),
|
||||||
sizeof(path_base));
|
sizeof(path_base));
|
||||||
@ -1751,6 +1754,12 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
|
|||||||
|
|
||||||
snprintf(crc_str, sizeof(crc_str), "%08X", db_info_entry->crc32);
|
snprintf(crc_str, sizeof(crc_str), "%08X", db_info_entry->crc32);
|
||||||
|
|
||||||
|
if (db_info_entry->name)
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_SET_THUMBNAIL_CONTENT, db_info_entry->name);
|
||||||
|
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL);
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL);
|
||||||
|
|
||||||
if (playlist)
|
if (playlist)
|
||||||
{
|
{
|
||||||
for (j = 0; j < playlist_size(playlist); j++)
|
for (j = 0; j < playlist_size(playlist); j++)
|
||||||
@ -2634,6 +2643,8 @@ static int menu_displaylist_parse_horizontal_list(
|
|||||||
item->path,
|
item->path,
|
||||||
sizeof(path_playlist));
|
sizeof(path_playlist));
|
||||||
|
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_SET_THUMBNAIL_SYSTEM, lpl_basename);
|
||||||
|
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_INIT, (void*)path_playlist);
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_INIT, (void*)path_playlist);
|
||||||
|
|
||||||
strlcpy(menu->db_playlist_file,
|
strlcpy(menu->db_playlist_file,
|
||||||
|
@ -952,6 +952,24 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
menu_driver_ctx->update_thumbnail_image(menu_userdata);
|
menu_driver_ctx->update_thumbnail_image(menu_userdata);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RARCH_MENU_CTL_SET_THUMBNAIL_SYSTEM:
|
||||||
|
{
|
||||||
|
char *thumbnail_system = (char*)data;
|
||||||
|
|
||||||
|
if (!menu_driver_ctx || !menu_driver_ctx->set_thumbnail_system)
|
||||||
|
return false;
|
||||||
|
menu_driver_ctx->set_thumbnail_system(menu_userdata, thumbnail_system);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RARCH_MENU_CTL_SET_THUMBNAIL_CONTENT:
|
||||||
|
{
|
||||||
|
char *thumbnail_content = (char*)data;
|
||||||
|
|
||||||
|
if (!menu_driver_ctx || !menu_driver_ctx->set_thumbnail_content)
|
||||||
|
return false;
|
||||||
|
menu_driver_ctx->set_thumbnail_content(menu_userdata, thumbnail_content);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH:
|
case RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH:
|
||||||
{
|
{
|
||||||
size_t selection = menu_navigation_get_selection();
|
size_t selection = menu_navigation_get_selection();
|
||||||
|
@ -126,6 +126,8 @@ enum rarch_menu_ctl_state
|
|||||||
RARCH_MENU_CTL_BIND_INIT,
|
RARCH_MENU_CTL_BIND_INIT,
|
||||||
RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH,
|
RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH,
|
||||||
RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE,
|
RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE,
|
||||||
|
RARCH_MENU_CTL_SET_THUMBNAIL_SYSTEM,
|
||||||
|
RARCH_MENU_CTL_SET_THUMBNAIL_CONTENT,
|
||||||
RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH,
|
RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH,
|
||||||
RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE
|
RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE
|
||||||
};
|
};
|
||||||
@ -260,6 +262,8 @@ typedef struct menu_ctx_driver
|
|||||||
menu_entry_t *entry, unsigned action);
|
menu_entry_t *entry, unsigned action);
|
||||||
void (*update_thumbnail_path)(void *data, unsigned i);
|
void (*update_thumbnail_path)(void *data, unsigned i);
|
||||||
void (*update_thumbnail_image)(void *data);
|
void (*update_thumbnail_image)(void *data);
|
||||||
|
void (*set_thumbnail_system)(void *data, char* thumbnail_system);
|
||||||
|
void (*set_thumbnail_content)(void *data, char* thumbnail_content);
|
||||||
int (*osk_ptr_at_pos)(void *data, int x, int y, unsigned width, unsigned height);
|
int (*osk_ptr_at_pos)(void *data, int x, int y, unsigned width, unsigned height);
|
||||||
void (*update_savestate_thumbnail_path)(void *data, unsigned i);
|
void (*update_savestate_thumbnail_path)(void *data, unsigned i);
|
||||||
void (*update_savestate_thumbnail_image)(void *data);
|
void (*update_savestate_thumbnail_image)(void *data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user