2015-02-26 16:50:30 +01:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
|
|
|
* Copyright (C) 2016-2017 - Brad Parker
|
2017-08-05 00:37:26 -05:00
|
|
|
* Copyright (C) 2015-2017 - Andrés Suárez
|
2015-02-26 16:50:30 +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/>.
|
|
|
|
*/
|
|
|
|
|
2016-09-01 18:01:41 +02:00
|
|
|
#include <compat/strl.h>
|
2015-02-26 16:50:30 +01:00
|
|
|
#include <file/file_path.h>
|
2016-02-05 13:51:30 +01:00
|
|
|
#include <retro_assert.h>
|
2015-12-26 07:37:44 +01:00
|
|
|
#include <string/stdstring.h>
|
2016-03-20 17:01:15 +01:00
|
|
|
#include <streams/file_stream.h>
|
2016-03-20 14:53:54 +01:00
|
|
|
#include <lists/string_list.h>
|
2015-06-04 22:04:08 +02:00
|
|
|
|
2016-09-08 05:39:08 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2015-12-06 17:55:27 +01:00
|
|
|
#include "../menu_driver.h"
|
2015-06-26 15:28:01 +02:00
|
|
|
#include "../menu_cbs.h"
|
2015-06-08 14:35:58 +02:00
|
|
|
#include "../menu_setting.h"
|
|
|
|
#include "../menu_shader.h"
|
2016-09-15 15:57:25 +02:00
|
|
|
#include "../widgets/menu_dialog.h"
|
2016-12-16 09:07:03 +01:00
|
|
|
#include "../widgets/menu_filebrowser.h"
|
2016-09-15 19:23:32 +02:00
|
|
|
#include "../widgets/menu_input_dialog.h"
|
2016-01-25 05:38:22 +01:00
|
|
|
#include "../menu_content.h"
|
2017-01-09 03:53:55 +01:00
|
|
|
#include "../menu_shader.h"
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-09-06 06:11:44 +02:00
|
|
|
#include "../../core.h"
|
2016-09-01 18:01:41 +02:00
|
|
|
#include "../../configuration.h"
|
2015-12-11 13:56:00 +01:00
|
|
|
#include "../../core_info.h"
|
2016-02-05 19:00:30 +01:00
|
|
|
#include "../../frontend/frontend_driver.h"
|
2015-12-06 22:48:57 +01:00
|
|
|
#include "../../defaults.h"
|
2016-05-09 18:20:52 +02:00
|
|
|
#include "../../managers/cheat_manager.h"
|
2016-02-09 17:12:39 +01:00
|
|
|
#include "../../tasks/tasks_internal.h"
|
2015-06-08 14:35:58 +02:00
|
|
|
#include "../../input/input_remapping.h"
|
2016-09-17 13:40:25 +02:00
|
|
|
#include "../../paths.h"
|
2016-03-21 19:23:45 +01:00
|
|
|
#include "../../retroarch.h"
|
2016-09-01 18:01:41 +02:00
|
|
|
#include "../../verbosity.h"
|
2016-03-23 21:40:41 +07:00
|
|
|
#include "../../lakka.h"
|
2016-09-22 16:44:51 +02:00
|
|
|
#include "../../wifi/wifi_driver.h"
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-09-29 21:07:10 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-09-28 22:45:31 -04:00
|
|
|
#include "../../network/netplay/netplay.h"
|
2016-12-02 22:40:26 -05:00
|
|
|
#include "../../network/netplay/netplay_discovery.h"
|
2016-09-28 22:45:31 -04:00
|
|
|
#endif
|
|
|
|
|
2016-12-17 16:39:28 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ACTION_OK_LOAD_PRESET = 0,
|
|
|
|
ACTION_OK_LOAD_SHADER_PASS,
|
|
|
|
ACTION_OK_LOAD_RECORD_CONFIGFILE,
|
|
|
|
ACTION_OK_LOAD_REMAPPING_FILE,
|
|
|
|
ACTION_OK_LOAD_CHEAT_FILE,
|
|
|
|
ACTION_OK_APPEND_DISK_IMAGE,
|
|
|
|
ACTION_OK_LOAD_CONFIG_FILE,
|
|
|
|
ACTION_OK_LOAD_CORE,
|
|
|
|
ACTION_OK_LOAD_WALLPAPER,
|
|
|
|
ACTION_OK_SET_PATH,
|
2017-01-01 01:44:12 +01:00
|
|
|
ACTION_OK_SET_PATH_AUDIO_FILTER,
|
|
|
|
ACTION_OK_SET_PATH_VIDEO_FILTER,
|
2017-01-01 01:34:28 +01:00
|
|
|
ACTION_OK_SET_PATH_OVERLAY,
|
2016-12-17 16:39:28 +01:00
|
|
|
ACTION_OK_SET_DIRECTORY
|
|
|
|
};
|
|
|
|
|
2017-09-11 03:01:33 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ACTION_OK_REMAP_FILE_SAVE_CORE = 0,
|
|
|
|
ACTION_OK_REMAP_FILE_SAVE_GAME,
|
|
|
|
ACTION_OK_REMAP_FILE_REMOVE_CORE,
|
|
|
|
ACTION_OK_REMAP_FILE_REMOVE_GAME
|
|
|
|
};
|
|
|
|
|
2015-10-11 19:59:14 +02:00
|
|
|
#ifndef BIND_ACTION_OK
|
|
|
|
#define BIND_ACTION_OK(cbs, name) \
|
2016-06-27 21:34:05 +02:00
|
|
|
do { \
|
|
|
|
cbs->action_ok = name; \
|
|
|
|
cbs->action_ok_ident = #name; \
|
|
|
|
} while(0)
|
2015-10-11 19:59:14 +02:00
|
|
|
#endif
|
|
|
|
|
2015-02-26 16:50:30 +01:00
|
|
|
/* FIXME - Global variables, refactor */
|
2016-12-13 00:50:39 +01:00
|
|
|
static char filebrowser_label[PATH_MAX_LENGTH];
|
2016-06-27 21:34:05 +02:00
|
|
|
static char detect_content_path[PATH_MAX_LENGTH];
|
2016-12-04 04:38:58 +01:00
|
|
|
unsigned rpl_entry_selection_ptr = 0;
|
|
|
|
unsigned rdb_entry_start_game_selection_ptr = 0;
|
|
|
|
size_t hack_shader_pass = 0;
|
2015-11-23 11:13:26 -03:00
|
|
|
|
2017-01-17 15:39:14 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-11-16 07:11:00 +01:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
static char *lakka_get_project(void)
|
2016-11-15 10:18:21 +01:00
|
|
|
{
|
2016-11-16 07:17:04 +01:00
|
|
|
size_t len;
|
2017-09-11 03:03:33 +02:00
|
|
|
static char lakka_project[128];
|
2016-11-16 07:17:04 +01:00
|
|
|
FILE *command_file = popen("cat /etc/release | cut -d - -f 1", "r");
|
|
|
|
|
2016-11-15 10:18:21 +01:00
|
|
|
fgets(lakka_project, sizeof(lakka_project), command_file);
|
2016-11-16 07:17:04 +01:00
|
|
|
len = strlen(lakka_project);
|
|
|
|
|
2016-11-15 10:18:21 +01:00
|
|
|
if (len > 0 && lakka_project[len-1] == '\n')
|
|
|
|
lakka_project[--len] = '\0';
|
2016-11-16 07:17:04 +01:00
|
|
|
|
2016-11-15 10:18:21 +01:00
|
|
|
pclose(command_file);
|
|
|
|
return lakka_project;
|
|
|
|
}
|
2016-11-16 07:11:00 +01:00
|
|
|
#endif
|
2016-11-15 10:18:21 +01:00
|
|
|
|
2017-05-15 20:24:12 +02:00
|
|
|
void cb_net_generic_subdir(void *task_data, void *user_data, const char *err);
|
2016-12-17 18:39:18 +01:00
|
|
|
|
|
|
|
/* defined in menu_cbs_deferred_push */
|
2017-05-15 20:24:12 +02:00
|
|
|
void cb_net_generic(void *task_data, void *user_data, const char *err);
|
2016-12-17 18:39:18 +01:00
|
|
|
#endif
|
|
|
|
|
2016-02-12 04:28:09 +01:00
|
|
|
int generic_action_ok_displaylist_push(const char *path,
|
2016-07-09 18:06:50 +02:00
|
|
|
const char *new_path,
|
2015-09-04 13:08:15 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned action_type)
|
|
|
|
{
|
2017-09-10 22:38:03 +02:00
|
|
|
menu_displaylist_info_t info;
|
2016-10-08 19:44:03 +02:00
|
|
|
char tmp[PATH_MAX_LENGTH];
|
2017-09-18 16:35:31 +02:00
|
|
|
char parent_dir[PATH_MAX_LENGTH];
|
2016-07-08 20:47:17 +02:00
|
|
|
enum menu_displaylist_ctl_state dl_type = DISPLAYLIST_NONE;
|
2016-09-25 05:32:16 +02:00
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
|
|
|
const char *info_label = NULL;
|
|
|
|
const char *info_path = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2016-02-10 21:15:23 +01:00
|
|
|
|
2017-09-10 22:38:03 +02:00
|
|
|
menu_displaylist_info_init(&info);
|
|
|
|
|
2017-09-11 00:23:04 +02:00
|
|
|
info.list = menu_stack;
|
|
|
|
|
2017-02-24 02:21:18 +01:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2017-09-11 00:23:04 +02:00
|
|
|
goto end;
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2017-09-11 03:04:55 +02:00
|
|
|
tmp[0] = '\0';
|
2016-10-08 19:44:03 +02:00
|
|
|
|
2016-06-17 16:08:47 +02:00
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
2015-09-04 13:08:15 +02:00
|
|
|
|
|
|
|
switch (action_type)
|
|
|
|
{
|
2016-12-27 00:02:09 +01:00
|
|
|
case ACTION_OK_DL_BROWSE_URL_START:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-09-11 00:23:04 +02:00
|
|
|
info_path = NULL;
|
2016-12-27 00:02:09 +01:00
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_START);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_START;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2017-08-16 00:01:56 +02:00
|
|
|
case ACTION_OK_DL_FAVORITES_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = label;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2017-08-16 03:15:04 +02:00
|
|
|
case ACTION_OK_DL_IMAGES_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = label;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_VIDEO_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = label;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2015-10-23 06:54:33 +02:00
|
|
|
case ACTION_OK_DL_USER_BINDS_LIST:
|
|
|
|
info.type = type;
|
2016-09-25 00:13:33 -04:00
|
|
|
info.directory_ptr = idx;
|
2015-10-23 06:54:33 +02:00
|
|
|
info_path = label;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-23 06:54:33 +02:00
|
|
|
break;
|
2017-05-27 23:56:10 +02:00
|
|
|
case ACTION_OK_DL_MUSIC:
|
|
|
|
if (!string_is_empty(path))
|
|
|
|
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
|
|
|
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_MUSIC);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MUSIC;
|
|
|
|
info_path = path;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
if (menu)
|
|
|
|
{
|
2015-12-10 14:00:28 +01:00
|
|
|
menu_path = menu->scratch2_buf;
|
2015-09-04 13:08:15 +02:00
|
|
|
content_path = menu->scratch_buf;
|
|
|
|
}
|
2016-06-01 04:05:14 +02:00
|
|
|
if (content_path)
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 18:45:11 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE;
|
|
|
|
info_path = path;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-18 18:45:11 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_OPEN_ARCHIVE:
|
|
|
|
if (menu)
|
2015-09-04 13:08:15 +02:00
|
|
|
{
|
2016-06-18 18:45:11 +02:00
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
2015-09-04 13:08:15 +02:00
|
|
|
}
|
2016-06-18 18:45:11 +02:00
|
|
|
if (content_path)
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 18:45:11 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = path;
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_HELP:
|
2016-09-04 22:58:54 +02:00
|
|
|
info_label = label;
|
2016-09-15 16:07:20 +02:00
|
|
|
menu_dialog_push_pending(true, (enum menu_dialog_type)type);
|
2015-09-04 13:08:15 +02:00
|
|
|
dl_type = DISPLAYLIST_HELP;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RPL_ENTRY:
|
|
|
|
strlcpy(menu->deferred_path, label, sizeof(menu->deferred_path));
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS;
|
2015-09-04 13:08:15 +02:00
|
|
|
info.directory_ptr = idx;
|
2017-02-26 10:33:03 +01:00
|
|
|
rpl_entry_selection_ptr = (unsigned)idx;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_AUDIO_DSP_PLUGIN:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_audio_filter;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PASS:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_video_shader;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PARAMETERS:
|
|
|
|
info.type = MENU_SETTING_ACTION;
|
|
|
|
info.directory_ptr = idx;
|
2016-06-17 23:47:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_GENERIC:
|
|
|
|
if (path)
|
|
|
|
strlcpy(menu->deferred_path, path,
|
|
|
|
sizeof(menu->deferred_path));
|
|
|
|
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-06-17 23:47:23 +02:00
|
|
|
info_label = label;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2017-07-30 15:58:46 +02:00
|
|
|
case ACTION_OK_DL_FILE_BROWSER_SELECT_FILE:
|
|
|
|
if (path)
|
|
|
|
strlcpy(menu->deferred_path, path,
|
|
|
|
sizeof(menu->deferred_path));
|
|
|
|
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_label = label;
|
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
|
|
|
break;
|
2016-07-08 22:51:47 +02:00
|
|
|
case ACTION_OK_DL_FILE_BROWSER_SELECT_DIR:
|
|
|
|
if (path)
|
|
|
|
strlcpy(menu->deferred_path, path,
|
|
|
|
sizeof(menu->deferred_path));
|
|
|
|
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_DIR;
|
2016-07-08 22:51:47 +02:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_PUSH_DEFAULT:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-09-25 00:13:33 -04:00
|
|
|
info_path = label;
|
2016-06-17 23:47:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PRESET:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_video_shader;
|
2016-06-17 23:47:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CONTENT_LIST:
|
2016-06-20 15:50:37 +02:00
|
|
|
info.type = FILE_TYPE_DIRECTORY;
|
2015-09-04 13:08:15 +02:00
|
|
|
info.directory_ptr = idx;
|
2016-07-09 18:12:35 +02:00
|
|
|
info_path = new_path;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2016-07-10 03:08:18 +02:00
|
|
|
case ACTION_OK_DL_SCAN_DIR_LIST:
|
2016-12-16 09:07:03 +01:00
|
|
|
filebrowser_set_type(FILEBROWSER_SCAN_DIR);
|
2016-07-10 03:08:18 +02:00
|
|
|
info.type = FILE_TYPE_DIRECTORY;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = new_path;
|
|
|
|
info_label = label;
|
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SCAN_DIR;
|
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_REMAP_FILE:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_input_remapping;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RECORD_CONFIGFILE:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2016-10-01 08:14:03 +02:00
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-10-01 08:15:07 +02:00
|
|
|
info_path = global->record.config_dir;
|
2016-10-01 08:14:03 +02:00
|
|
|
info_label = label;
|
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
|
|
|
}
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2017-08-17 19:07:38 +02:00
|
|
|
filebrowser_set_type(FILEBROWSER_APPEND_IMAGE);
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_menu_content;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-08 22:51:47 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_PLAYLIST_COLLECTION:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = path;
|
2017-10-04 08:26:41 +02:00
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2017-10-04 08:26:41 +02:00
|
|
|
case ACTION_OK_DL_MUSIC_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = label;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_CHEAT_FILE:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.path_cheat_database;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CORE_LIST:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_libretro;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-08 23:14:22 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_CORE;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2016-12-26 06:39:12 +01:00
|
|
|
case ACTION_OK_DL_BROWSE_URL_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_playlist;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
2016-07-08 23:20:48 +02:00
|
|
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_COLLECTION;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RDB_ENTRY:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2016-01-25 18:18:00 +01:00
|
|
|
fill_pathname_join_delim(tmp,
|
2016-06-20 00:31:13 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL),
|
2015-09-07 00:32:01 +02:00
|
|
|
path, '|', sizeof(tmp));
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2015-09-07 00:32:01 +02:00
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = label;
|
|
|
|
info_label = tmp;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RDB_ENTRY_SUBMENU:
|
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_label = label;
|
|
|
|
info_path = path;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2016-11-21 07:26:58 +01:00
|
|
|
case ACTION_OK_DL_CONFIGURATIONS_LIST:
|
2015-09-04 13:08:15 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
if (string_is_empty(settings->paths.directory_menu_config))
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = label;
|
2015-12-26 07:37:44 +01:00
|
|
|
else
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_menu_config;
|
2015-09-07 00:32:01 +02:00
|
|
|
info_label = label;
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE:
|
2016-06-18 18:45:11 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 18:45:11 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE;
|
|
|
|
|
|
|
|
if (!string_is_empty(path))
|
|
|
|
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
2016-07-10 02:26:20 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-18 18:45:11 +02:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 18:45:11 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION;
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2016-06-05 19:04:59 +02:00
|
|
|
if (!string_is_empty(path))
|
|
|
|
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2015-10-25 08:31:55 +01:00
|
|
|
case ACTION_OK_DL_PARENT_DIRECTORY_PUSH:
|
2017-09-18 16:35:31 +02:00
|
|
|
parent_dir[0] = '\0';
|
2017-09-11 03:04:55 +02:00
|
|
|
|
2017-09-18 16:35:31 +02:00
|
|
|
if (path && menu_path)
|
|
|
|
fill_pathname_join(tmp,
|
|
|
|
menu_path, path, sizeof(tmp));
|
2015-10-25 08:31:55 +01:00
|
|
|
|
2017-09-18 16:35:31 +02:00
|
|
|
fill_pathname_parent_dir(parent_dir,
|
|
|
|
tmp, sizeof(parent_dir));
|
|
|
|
fill_pathname_parent_dir(parent_dir,
|
|
|
|
parent_dir, sizeof(parent_dir));
|
2017-09-11 00:23:04 +02:00
|
|
|
|
2017-09-18 16:35:31 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = parent_dir;
|
|
|
|
info_label = menu_label;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-25 08:31:55 +01:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_DIRECTORY_PUSH:
|
2017-09-11 03:09:42 +02:00
|
|
|
if (path && menu_path)
|
|
|
|
fill_pathname_join(tmp,
|
|
|
|
menu_path, path, sizeof(tmp));
|
2017-09-11 00:23:04 +02:00
|
|
|
|
2017-09-11 03:09:42 +02:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
|
|
|
info_label = menu_label;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
|
2017-09-11 00:23:04 +02:00
|
|
|
{
|
|
|
|
char lpl_basename[PATH_MAX_LENGTH];
|
|
|
|
lpl_basename[0] = '\0';
|
|
|
|
filebrowser_clear_type();
|
|
|
|
fill_pathname_join(tmp,
|
|
|
|
settings->paths.path_content_database,
|
|
|
|
path, sizeof(tmp));
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2017-09-11 00:23:04 +02:00
|
|
|
fill_pathname_base_noext(lpl_basename, path, sizeof(lpl_basename));
|
|
|
|
menu_driver_set_thumbnail_system(lpl_basename, sizeof(lpl_basename));
|
2017-05-15 13:05:33 +02:00
|
|
|
|
2017-09-11 00:23:04 +02:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
}
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CURSOR_MANAGER_LIST:
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2017-04-29 00:39:29 +02:00
|
|
|
fill_pathname_join(tmp, settings->paths.directory_cursor,
|
2015-09-07 00:38:23 +02:00
|
|
|
path, sizeof(tmp));
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2015-09-07 00:38:23 +02:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CORE_UPDATER_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2016-04-23 22:31:39 +02:00
|
|
|
case ACTION_OK_DL_THUMBNAILS_UPDATER_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2016-04-23 22:31:39 +02:00
|
|
|
break;
|
2016-07-12 18:29:31 +02:00
|
|
|
case ACTION_OK_DL_CORE_CONTENT_DIRS_SUBDIR_LIST:
|
2017-09-11 03:07:04 +02:00
|
|
|
fill_pathname_join_delim(tmp, path, label, ';',
|
|
|
|
sizeof(tmp));
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_SUBDIR_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_SUBDIR_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-12 18:29:31 +02:00
|
|
|
break;
|
2016-06-21 00:46:55 +02:00
|
|
|
case ACTION_OK_DL_CORE_CONTENT_DIRS_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2016-06-21 00:46:55 +02:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_CORE_CONTENT_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-07 00:38:23 +02:00
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2015-12-25 02:13:50 +07:00
|
|
|
case ACTION_OK_DL_LAKKA_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_LAKKA_LIST;
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-12-25 02:13:50 +07:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
case ACTION_OK_DL_DEFERRED_CORE_LIST:
|
|
|
|
info.directory_ptr = idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_libretro;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DEFERRED_CORE_LIST_SET:
|
2015-09-07 02:02:34 +02:00
|
|
|
info.directory_ptr = idx;
|
2017-02-26 10:33:03 +01:00
|
|
|
rdb_entry_start_game_selection_ptr = (unsigned)idx;
|
2017-04-29 00:39:29 +02:00
|
|
|
info_path = settings->paths.directory_libretro;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 12:56:10 +02:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_LIST_SET);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_LIST_SET;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-09-04 13:08:15 +02:00
|
|
|
break;
|
2015-10-17 15:28:16 +02:00
|
|
|
case ACTION_OK_DL_ACCOUNTS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-17 15:28:16 +02:00
|
|
|
break;
|
2015-10-24 10:31:11 +02:00
|
|
|
case ACTION_OK_DL_INPUT_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-24 10:31:11 +02:00
|
|
|
break;
|
2016-06-16 21:40:13 +02:00
|
|
|
case ACTION_OK_DL_DRIVER_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-16 21:40:13 +02:00
|
|
|
break;
|
2016-06-18 22:17:39 +02:00
|
|
|
case ACTION_OK_DL_CORE_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST);
|
2016-06-18 22:17:39 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-18 22:17:39 +02:00
|
|
|
break;
|
2016-06-17 04:02:26 +02:00
|
|
|
case ACTION_OK_DL_VIDEO_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-17 04:02:26 +02:00
|
|
|
break;
|
2016-11-21 07:26:58 +01:00
|
|
|
case ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST:
|
2016-07-02 10:17:09 +02:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-11-21 07:26:58 +01:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 10:17:09 +02:00
|
|
|
break;
|
2016-07-02 12:03:50 +02:00
|
|
|
case ACTION_OK_DL_SAVING_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_SAVING_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_SAVING_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 12:03:50 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_LOGGING_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LOGGING_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_LOGGING_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 12:03:50 +02:00
|
|
|
break;
|
2016-07-02 13:17:24 +02:00
|
|
|
case ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 13:17:24 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_REWIND_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 13:17:24 +02:00
|
|
|
break;
|
2016-07-02 13:49:05 +02:00
|
|
|
case ACTION_OK_DL_ONSCREEN_DISPLAY_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_DISPLAY_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ONSCREEN_DISPLAY_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 13:49:05 +02:00
|
|
|
break;
|
2016-11-23 14:28:15 +01:00
|
|
|
case ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2016-07-02 13:49:05 +02:00
|
|
|
case ACTION_OK_DL_ONSCREEN_OVERLAY_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 13:49:05 +02:00
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case ACTION_OK_DL_MENU_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
2017-06-20 02:04:23 +02:00
|
|
|
case ACTION_OK_DL_MENU_VIEWS_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_VIEWS_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MENU_VIEWS_SETTINGS_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2017-10-09 08:14:52 +02:00
|
|
|
case ACTION_OK_DL_QUICK_MENU_VIEWS_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_QUICK_MENU_VIEWS_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_QUICK_MENU_VIEWS_SETTINGS_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case ACTION_OK_DL_USER_INTERFACE_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_USER_INTERFACE_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_USER_INTERFACE_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_MENU_FILE_BROWSER_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_FILE_BROWSER_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MENU_FILE_BROWSER_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RETRO_ACHIEVEMENTS_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RETRO_ACHIEVEMENTS_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_RETRO_ACHIEVEMENTS_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_UPDATER_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_UPDATER_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_UPDATER_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_NETWORK_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
2016-09-21 21:58:43 +02:00
|
|
|
case ACTION_OK_DL_WIFI_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-09-21 21:58:43 +02:00
|
|
|
break;
|
2017-06-08 00:19:43 +02:00
|
|
|
case ACTION_OK_DL_NETPLAY:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_NETPLAY;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2016-12-02 22:40:26 -05:00
|
|
|
case ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
2016-08-10 01:46:47 +02:00
|
|
|
case ACTION_OK_DL_LAKKA_SERVICES_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-08-10 01:46:47 +02:00
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case ACTION_OK_DL_USER_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DIRECTORY_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_PRIVACY_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-07-02 20:40:27 +02:00
|
|
|
break;
|
2016-06-17 04:02:26 +02:00
|
|
|
case ACTION_OK_DL_AUDIO_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2016-06-17 04:02:26 +02:00
|
|
|
break;
|
2015-10-25 10:41:53 +01:00
|
|
|
case ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RECORDING_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST;
|
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-25 10:41:53 +01:00
|
|
|
break;
|
2015-10-25 10:25:07 +01:00
|
|
|
case ACTION_OK_DL_PLAYLIST_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-25 10:25:07 +01:00
|
|
|
break;
|
2015-10-17 15:58:59 +02:00
|
|
|
case ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-20 00:31:13 +02:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST;
|
2016-10-08 15:05:31 +02:00
|
|
|
dl_type = DISPLAYLIST_GENERIC;
|
2015-10-17 15:58:59 +02:00
|
|
|
break;
|
2015-09-07 02:43:52 +02:00
|
|
|
case ACTION_OK_DL_CONTENT_SETTINGS:
|
2016-07-10 02:30:07 +02:00
|
|
|
info.list = menu_entries_get_selection_buf_ptr(0);
|
2016-06-20 00:31:13 +02:00
|
|
|
info_path = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS);
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS);
|
2016-06-17 23:47:23 +02:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(menu_stack, info_path, info_label,
|
2016-06-15 14:59:49 +02:00
|
|
|
MENU_ENUM_LABEL_CONTENT_SETTINGS,
|
|
|
|
0, 0, 0);
|
2016-07-08 20:47:17 +02:00
|
|
|
dl_type = DISPLAYLIST_CONTENT_SETTINGS;
|
2015-09-07 02:43:52 +02:00
|
|
|
break;
|
2015-09-04 13:08:15 +02:00
|
|
|
}
|
|
|
|
|
2015-09-07 00:32:01 +02:00
|
|
|
if (info_label)
|
2017-09-28 02:45:03 +02:00
|
|
|
info.label = strdup(info_label);
|
2015-09-07 00:38:23 +02:00
|
|
|
if (info_path)
|
2017-09-28 03:06:54 +02:00
|
|
|
info.path = strdup(info_path);
|
2015-09-04 13:08:15 +02:00
|
|
|
|
2016-02-24 23:19:53 +01:00
|
|
|
if (menu_displaylist_ctl(dl_type, &info))
|
2017-09-11 00:23:04 +02:00
|
|
|
{
|
2017-05-26 20:12:52 +02:00
|
|
|
if (menu_displaylist_process(&info))
|
2017-09-11 00:23:04 +02:00
|
|
|
{
|
|
|
|
menu_displaylist_info_free(&info);
|
2016-02-24 23:19:53 +01:00
|
|
|
return 0;
|
2017-09-11 00:23:04 +02:00
|
|
|
}
|
|
|
|
}
|
2015-10-22 01:38:41 +02:00
|
|
|
|
2017-09-11 00:23:04 +02:00
|
|
|
end:
|
|
|
|
menu_displaylist_info_free(&info);
|
2016-02-24 23:19:53 +01:00
|
|
|
return menu_cbs_exit();
|
2015-09-04 13:08:15 +02:00
|
|
|
}
|
|
|
|
|
2017-05-27 03:51:56 +02:00
|
|
|
/**
|
|
|
|
* menu_content_load_from_playlist:
|
|
|
|
* @playlist : Playlist handle.
|
|
|
|
* @idx : Index in playlist.
|
|
|
|
*
|
|
|
|
* Initializes core and loads content based on playlist entry.
|
|
|
|
**/
|
|
|
|
static bool menu_content_playlist_load(menu_content_ctx_playlist_info_t *info)
|
|
|
|
{
|
|
|
|
const char *path = NULL;
|
|
|
|
playlist_t *playlist = (playlist_t*)info->data;
|
|
|
|
|
|
|
|
if (!playlist)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
playlist_get_index(playlist,
|
|
|
|
info->idx, &path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
if (string_is_empty(path))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
bool valid_path = false;
|
|
|
|
char *path_check = NULL;
|
|
|
|
char *path_tolower = strdup(path);
|
|
|
|
|
|
|
|
for (i = 0; i < strlen(path_tolower); ++i)
|
2017-08-08 12:21:48 +01:00
|
|
|
path_tolower[i] = tolower((unsigned char)path_tolower[i]);
|
2017-05-27 03:51:56 +02:00
|
|
|
|
|
|
|
if (strstr(path_tolower, file_path_str(FILE_PATH_ZIP_EXTENSION)))
|
|
|
|
strstr(path_tolower, file_path_str(FILE_PATH_ZIP_EXTENSION))[4] = '\0';
|
|
|
|
else if (strstr(path_tolower, file_path_str(FILE_PATH_7Z_EXTENSION)))
|
|
|
|
strstr(path_tolower, file_path_str(FILE_PATH_7Z_EXTENSION))[3] = '\0';
|
|
|
|
|
|
|
|
path_check = (char *)
|
|
|
|
calloc(strlen(path_tolower) + 1, sizeof(char));
|
|
|
|
|
|
|
|
strncpy(path_check, path, strlen(path_tolower));
|
|
|
|
|
|
|
|
valid_path = path_is_valid(path_check);
|
|
|
|
|
|
|
|
free(path_tolower);
|
|
|
|
free(path_check);
|
|
|
|
|
|
|
|
if (!valid_path)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* menu_content_find_first_core:
|
|
|
|
* @core_info : Core info list handle.
|
|
|
|
* @dir : Directory. Gets joined with @path.
|
|
|
|
* @path : Path. Gets joined with @dir.
|
|
|
|
* @menu_label : Label identifier of menu setting.
|
|
|
|
* @s : Deferred core path. Will be filled in
|
|
|
|
* by function.
|
|
|
|
* @len : Size of @s.
|
|
|
|
*
|
|
|
|
* Gets deferred core.
|
|
|
|
*
|
|
|
|
* Returns: false if there are multiple deferred cores and a
|
|
|
|
* selection needs to be made from a list, otherwise
|
|
|
|
* returns true and fills in @s with path to core.
|
|
|
|
**/
|
|
|
|
static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info,
|
|
|
|
bool load_content_with_current_core,
|
|
|
|
char *new_core_path, size_t len)
|
|
|
|
{
|
|
|
|
const core_info_t *info = NULL;
|
|
|
|
size_t supported = 0;
|
|
|
|
core_info_list_t *core_info = (core_info_list_t*)def_info->data;
|
|
|
|
const char *default_info_dir = def_info->dir;
|
|
|
|
|
|
|
|
if (!string_is_empty(default_info_dir))
|
|
|
|
{
|
|
|
|
const char *default_info_path = def_info->path;
|
|
|
|
size_t default_info_length = def_info->len;
|
|
|
|
|
|
|
|
if (!string_is_empty(default_info_path))
|
2017-08-13 21:20:22 -04:00
|
|
|
fill_pathname_join(def_info->s,
|
2017-05-27 03:51:56 +02:00
|
|
|
default_info_dir, default_info_path,
|
|
|
|
default_info_length);
|
|
|
|
|
|
|
|
#ifdef HAVE_COMPRESSION
|
|
|
|
if (path_is_compressed_file(default_info_dir))
|
|
|
|
{
|
|
|
|
size_t len = strlen(default_info_dir);
|
|
|
|
/* In case of a compressed archive, we have to join with a hash */
|
|
|
|
/* We are going to write at the position of dir: */
|
|
|
|
retro_assert(len < strlen(def_info->s));
|
|
|
|
def_info->s[len] = '#';
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (core_info)
|
|
|
|
core_info_list_get_supported_cores(core_info,
|
|
|
|
def_info->s, &info,
|
|
|
|
&supported);
|
|
|
|
|
2017-08-13 21:20:22 -04:00
|
|
|
/* We started the menu with 'Load Content', we are
|
2017-05-27 03:51:56 +02:00
|
|
|
* going to use the current core to load this. */
|
|
|
|
if (load_content_with_current_core)
|
|
|
|
{
|
|
|
|
core_info_get_current_core((core_info_t**)&info);
|
|
|
|
if (info)
|
|
|
|
{
|
2017-08-17 18:53:55 +02:00
|
|
|
#if 0
|
2017-07-09 18:19:56 -05:00
|
|
|
RARCH_LOG("[lobby] use the current core (%s) to load this content...\n",
|
2017-05-27 03:51:56 +02:00
|
|
|
info->path);
|
2017-08-17 18:53:55 +02:00
|
|
|
#endif
|
2017-05-27 03:51:56 +02:00
|
|
|
supported = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* There are multiple deferred cores and a
|
|
|
|
* selection needs to be made from a list, return 0. */
|
|
|
|
if (supported != 1)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (info)
|
|
|
|
strlcpy(new_core_path, info->path, len);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-07-01 10:15:26 +02:00
|
|
|
static int file_load_with_detect_core_wrapper(
|
|
|
|
enum msg_hash_enums enum_label_idx,
|
|
|
|
enum msg_hash_enums enum_idx,
|
|
|
|
size_t idx, size_t entry_idx,
|
2016-01-25 05:58:45 +01:00
|
|
|
const char *path, const char *label,
|
|
|
|
unsigned type, bool is_carchive)
|
2015-05-26 04:52:16 +02:00
|
|
|
{
|
2016-02-04 15:21:42 +01:00
|
|
|
menu_content_ctx_defer_info_t def_info;
|
2016-06-03 04:59:12 +02:00
|
|
|
int ret = 0;
|
2017-09-18 16:22:27 +02:00
|
|
|
char *new_core_path = NULL;
|
2016-06-03 04:59:12 +02:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
core_info_list_t *list = NULL;
|
2015-05-26 04:52:16 +02:00
|
|
|
|
2016-02-10 21:15:23 +01:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-05-26 04:52:16 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
{
|
|
|
|
char *menu_path_new = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
2017-09-18 16:22:27 +02:00
|
|
|
new_core_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
2017-09-12 05:08:56 +02:00
|
|
|
new_core_path[0] = menu_path_new[0] = '\0';
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu_path_new, menu_path, PATH_MAX_LENGTH * sizeof(char));
|
2015-12-11 13:51:17 +01:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
if (string_is_equal(menu_label,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE)))
|
|
|
|
fill_pathname_join(menu_path_new, menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
|
|
|
else if (string_is_equal(menu_label,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN)))
|
|
|
|
fill_pathname_join(menu_path_new, menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char));
|
2016-02-04 15:21:42 +01:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
core_info_get_list(&list);
|
2015-05-26 04:52:16 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
def_info.data = list;
|
|
|
|
def_info.dir = menu_path_new;
|
|
|
|
def_info.path = path;
|
|
|
|
def_info.menu_label = menu_label;
|
|
|
|
def_info.s = menu->deferred_path;
|
|
|
|
def_info.len = sizeof(menu->deferred_path);
|
2017-09-11 06:31:44 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
if (menu_content_find_first_core(&def_info, false, new_core_path,
|
|
|
|
PATH_MAX_LENGTH * sizeof(char)))
|
|
|
|
ret = -1;
|
2015-06-07 23:26:29 +02:00
|
|
|
|
2015-09-05 17:17:26 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
if ( !is_carchive && !string_is_empty(path)
|
|
|
|
&& !string_is_empty(menu_path_new))
|
|
|
|
fill_pathname_join(detect_content_path,
|
|
|
|
menu_path_new, path,
|
|
|
|
sizeof(detect_content_path));
|
2017-04-27 01:23:04 +02:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
free(menu_path_new);
|
2017-02-21 04:31:03 +01:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
if (enum_label_idx == MENU_ENUM_LABEL_COLLECTION)
|
2017-09-18 15:57:05 +02:00
|
|
|
{
|
|
|
|
free(new_core_path);
|
2017-09-12 05:08:56 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL,
|
|
|
|
NULL, 0, idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST_SET);
|
2017-09-18 15:57:05 +02:00
|
|
|
}
|
2017-02-21 04:31:03 +01:00
|
|
|
|
2017-09-12 05:08:56 +02:00
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case -1:
|
|
|
|
{
|
|
|
|
content_ctx_info_t content_info;
|
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
|
|
|
|
|
|
|
if (!task_push_load_content_with_new_core_from_menu(
|
|
|
|
new_core_path, def_info.s,
|
|
|
|
&content_info,
|
|
|
|
CORE_TYPE_PLAIN,
|
|
|
|
NULL, NULL))
|
2017-09-12 05:09:56 +02:00
|
|
|
{
|
|
|
|
free(new_core_path);
|
2017-09-12 05:08:56 +02:00
|
|
|
return -1;
|
2017-09-12 05:09:56 +02:00
|
|
|
}
|
2017-09-12 05:08:56 +02:00
|
|
|
|
2017-09-18 15:57:05 +02:00
|
|
|
ret = 0;
|
|
|
|
break;
|
2017-09-12 05:08:56 +02:00
|
|
|
}
|
|
|
|
case 0:
|
2017-09-18 15:57:05 +02:00
|
|
|
ret = generic_action_ok_displaylist_push(path, NULL, label, type,
|
2017-09-12 05:08:56 +02:00
|
|
|
idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);
|
2017-09-18 15:57:05 +02:00
|
|
|
break;
|
2017-09-12 05:08:56 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2015-05-26 04:52:16 +02:00
|
|
|
}
|
|
|
|
|
2017-09-18 15:57:05 +02:00
|
|
|
free(new_core_path);
|
2015-05-26 04:52:16 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-06-08 20:29:45 +02:00
|
|
|
static int action_ok_file_load_with_detect_core_carchive(
|
|
|
|
const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-08 20:29:45 +02:00
|
|
|
{
|
2015-06-22 19:48:49 +02:00
|
|
|
fill_pathname_join_delim(detect_content_path, detect_content_path, path,
|
|
|
|
'#', sizeof(detect_content_path));
|
2015-06-08 20:29:45 +02:00
|
|
|
|
2016-01-25 05:58:45 +01:00
|
|
|
type = 0;
|
|
|
|
label = NULL;
|
|
|
|
|
2016-07-01 10:15:26 +02:00
|
|
|
return file_load_with_detect_core_wrapper(MSG_UNKNOWN,
|
|
|
|
MSG_UNKNOWN, idx, entry_idx,
|
|
|
|
path, label, type, true);
|
2015-06-08 20:29:45 +02:00
|
|
|
}
|
|
|
|
|
2015-06-08 18:35:14 +02:00
|
|
|
static int action_ok_file_load_with_detect_core(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-08 18:35:14 +02:00
|
|
|
{
|
|
|
|
|
2016-01-25 05:58:45 +01:00
|
|
|
type = 0;
|
|
|
|
label = NULL;
|
|
|
|
|
2017-08-13 07:14:10 +02:00
|
|
|
return file_load_with_detect_core_wrapper(
|
|
|
|
MSG_UNKNOWN,
|
2016-07-01 10:15:26 +02:00
|
|
|
MSG_UNKNOWN, idx, entry_idx,
|
|
|
|
path, label, type, false);
|
|
|
|
}
|
|
|
|
|
2016-12-17 16:39:28 +01:00
|
|
|
static int action_ok_file_load_with_detect_core_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
type = 0;
|
|
|
|
label = NULL;
|
|
|
|
|
|
|
|
return file_load_with_detect_core_wrapper(
|
|
|
|
MENU_ENUM_LABEL_COLLECTION,
|
|
|
|
MSG_UNKNOWN, idx, entry_idx,
|
|
|
|
path, label, type, false);
|
|
|
|
}
|
|
|
|
|
2017-08-11 02:51:09 +02:00
|
|
|
static int set_path_generic(const char *label, const char *action_path)
|
|
|
|
{
|
2017-08-15 05:30:57 +02:00
|
|
|
rarch_setting_t *setting = menu_setting_find(label);
|
2017-08-11 02:51:09 +02:00
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
|
|
|
setting_set_with_string_representation(
|
|
|
|
setting, action_path);
|
|
|
|
return menu_setting_generic(setting, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-26 06:35:53 +01:00
|
|
|
static int generic_action_ok_command(enum event_command cmd)
|
|
|
|
{
|
|
|
|
if (!command_event(cmd, NULL))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-12-17 16:39:28 +01:00
|
|
|
static int generic_action_ok(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned id, enum msg_hash_enums flush_id)
|
|
|
|
{
|
|
|
|
char action_path[PATH_MAX_LENGTH];
|
|
|
|
unsigned flush_type = 0;
|
|
|
|
int ret = 0;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *flush_char = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
menu_entries_get_last_stack(&menu_path,
|
|
|
|
&menu_label, NULL, &enum_idx, NULL);
|
|
|
|
|
|
|
|
action_path[0] = '\0';
|
|
|
|
|
|
|
|
if (!string_is_empty(path))
|
|
|
|
fill_pathname_join(action_path,
|
|
|
|
menu_path, path, sizeof(action_path));
|
|
|
|
else
|
|
|
|
strlcpy(action_path, menu_path, sizeof(action_path));
|
|
|
|
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case ACTION_OK_LOAD_WALLPAPER:
|
2017-01-07 09:57:38 +01:00
|
|
|
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST);
|
2016-12-17 16:39:28 +01:00
|
|
|
if (path_file_exists(action_path))
|
|
|
|
{
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2017-04-29 00:39:29 +02:00
|
|
|
strlcpy(settings->paths.path_menu_wallpaper,
|
|
|
|
action_path, sizeof(settings->paths.path_menu_wallpaper));
|
2017-01-23 18:30:17 +01:00
|
|
|
|
|
|
|
if (path_file_exists(action_path))
|
|
|
|
task_push_image_load(action_path,
|
|
|
|
menu_display_handle_wallpaper_upload, NULL);
|
2016-12-17 16:39:28 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACTION_OK_LOAD_CORE:
|
|
|
|
{
|
2017-04-27 01:23:04 +02:00
|
|
|
content_ctx_info_t content_info;
|
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
2017-02-21 04:07:40 +01:00
|
|
|
|
|
|
|
flush_type = MENU_SETTINGS;
|
|
|
|
|
2017-02-21 16:53:02 +01:00
|
|
|
if (!task_push_load_new_core(
|
2017-02-21 04:07:40 +01:00
|
|
|
action_path, NULL,
|
|
|
|
&content_info,
|
|
|
|
CORE_TYPE_PLAIN,
|
|
|
|
NULL, NULL))
|
|
|
|
{
|
2016-12-17 16:39:28 +01:00
|
|
|
#ifndef HAVE_DYNAMIC
|
2017-02-21 04:07:40 +01:00
|
|
|
ret = -1;
|
2016-12-17 16:39:28 +01:00
|
|
|
#endif
|
2017-02-21 04:07:40 +01:00
|
|
|
}
|
2016-12-17 16:39:28 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACTION_OK_LOAD_CONFIG_FILE:
|
|
|
|
{
|
2017-01-24 18:08:26 +01:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
flush_type = MENU_SETTINGS;
|
|
|
|
|
|
|
|
menu_display_set_msg_force(true);
|
|
|
|
|
2017-04-28 13:43:47 +02:00
|
|
|
if (config_replace(settings->bools.config_save_on_exit, action_path))
|
2017-01-24 18:08:26 +01:00
|
|
|
{
|
|
|
|
bool pending_push = false;
|
2017-05-17 04:57:43 +02:00
|
|
|
menu_driver_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
2017-01-24 18:08:26 +01:00
|
|
|
ret = -1;
|
|
|
|
}
|
2016-12-17 16:39:28 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
case ACTION_OK_LOAD_PRESET:
|
|
|
|
{
|
2017-01-09 03:53:55 +01:00
|
|
|
struct video_shader *shader = menu_shader_get();
|
2016-12-17 16:39:28 +01:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
|
|
|
menu_shader_manager_set_preset(shader,
|
|
|
|
video_shader_parse_type(action_path, RARCH_SHADER_NONE),
|
|
|
|
action_path);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACTION_OK_LOAD_SHADER_PASS:
|
|
|
|
{
|
2017-02-26 21:46:19 +01:00
|
|
|
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass((unsigned)hack_shader_pass);
|
2017-02-26 10:39:15 +01:00
|
|
|
flush_char = msg_hash_to_str((enum msg_hash_enums)flush_id);
|
2016-12-17 16:39:28 +01:00
|
|
|
strlcpy(
|
2017-01-09 20:42:15 +01:00
|
|
|
shader_pass->source.path,
|
2016-12-17 16:39:28 +01:00
|
|
|
action_path,
|
2017-01-09 20:42:15 +01:00
|
|
|
sizeof(shader_pass->source.path));
|
|
|
|
video_shader_resolve_parameters(NULL, menu_shader_get());
|
2016-12-17 16:39:28 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case ACTION_OK_LOAD_RECORD_CONFIGFILE:
|
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
|
|
|
strlcpy(global->record.config, action_path,
|
|
|
|
sizeof(global->record.config));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACTION_OK_LOAD_REMAPPING_FILE:
|
|
|
|
{
|
|
|
|
config_file_t *conf = config_file_new(action_path);
|
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
|
|
|
|
|
|
|
if (conf)
|
|
|
|
input_remapping_load_file(conf, action_path);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACTION_OK_LOAD_CHEAT_FILE:
|
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
|
|
|
cheat_manager_free();
|
|
|
|
|
|
|
|
if (!cheat_manager_load(action_path))
|
|
|
|
goto error;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_APPEND_DISK_IMAGE:
|
|
|
|
flush_type = MENU_SETTINGS;
|
|
|
|
command_event(CMD_EVENT_DISK_APPEND_IMAGE, action_path);
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-12-17 16:39:28 +01:00
|
|
|
break;
|
|
|
|
case ACTION_OK_SET_DIRECTORY:
|
2017-01-01 01:31:10 +01:00
|
|
|
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST);
|
2017-08-11 02:51:09 +02:00
|
|
|
ret = set_path_generic(filebrowser_label, action_path);
|
2016-12-17 16:39:28 +01:00
|
|
|
break;
|
2017-01-01 01:44:12 +01:00
|
|
|
case ACTION_OK_SET_PATH_VIDEO_FILTER:
|
|
|
|
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST);
|
2017-09-06 09:51:29 +08:00
|
|
|
ret = set_path_generic(menu_label, action_path);
|
2017-01-01 01:44:12 +01:00
|
|
|
break;
|
|
|
|
case ACTION_OK_SET_PATH_AUDIO_FILTER:
|
|
|
|
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST);
|
2017-08-11 02:51:09 +02:00
|
|
|
ret = set_path_generic(menu_label, action_path);
|
2017-01-01 01:44:12 +01:00
|
|
|
break;
|
2017-01-01 01:34:28 +01:00
|
|
|
case ACTION_OK_SET_PATH_OVERLAY:
|
|
|
|
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ONSCREEN_OVERLAY_SETTINGS_LIST);
|
2017-08-11 02:51:09 +02:00
|
|
|
ret = set_path_generic(menu_label, action_path);
|
2017-01-01 01:34:28 +01:00
|
|
|
break;
|
2016-12-17 16:39:28 +01:00
|
|
|
case ACTION_OK_SET_PATH:
|
|
|
|
flush_type = MENU_SETTINGS;
|
2017-08-11 02:51:09 +02:00
|
|
|
ret = set_path_generic(menu_label, action_path);
|
2016-12-17 16:39:28 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_entries_flush_stack(flush_char, flush_type);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
error:
|
|
|
|
return menu_cbs_exit();
|
|
|
|
}
|
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
static int default_action_ok_load_content_with_core_from_menu(const char *_path, unsigned _type)
|
|
|
|
{
|
|
|
|
content_ctx_info_t content_info;
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
2017-11-26 22:58:36 +01:00
|
|
|
if (!task_push_load_content_with_core_from_menu(_path, &content_info, (enum rarch_core_type)_type, NULL, NULL))
|
2017-11-26 07:29:19 +01:00
|
|
|
return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-26 07:35:06 +01:00
|
|
|
static int default_action_ok_load_content_from_playlist_from_menu(const char *_path, const char *path, const char *entry_label)
|
|
|
|
{
|
|
|
|
content_ctx_info_t content_info;
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
|
|
|
if (!task_push_load_content_from_playlist_from_menu(
|
|
|
|
_path, path, entry_label,
|
|
|
|
&content_info,
|
|
|
|
NULL, NULL))
|
|
|
|
return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
|
2017-08-13 07:14:10 +02:00
|
|
|
#define default_action_ok_set(funcname, _id, _flush) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx, _id, _flush); \
|
2017-01-01 01:44:12 +01:00
|
|
|
}
|
|
|
|
|
2017-08-13 07:14:10 +02:00
|
|
|
default_action_ok_set(action_ok_set_path_audiofilter, ACTION_OK_SET_PATH_VIDEO_FILTER, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_set_path_videofilter, ACTION_OK_SET_PATH_AUDIO_FILTER, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_set_path_overlay, ACTION_OK_SET_PATH_OVERLAY, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_set_path, ACTION_OK_SET_PATH, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_load_core, ACTION_OK_LOAD_CORE, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_config_load, ACTION_OK_LOAD_CONFIG_FILE, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_disk_image_append, ACTION_OK_APPEND_DISK_IMAGE, MSG_UNKNOWN)
|
|
|
|
default_action_ok_set(action_ok_cheat_file_load, ACTION_OK_LOAD_CHEAT_FILE, MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS)
|
|
|
|
default_action_ok_set(action_ok_record_configfile_load, ACTION_OK_LOAD_RECORD_CONFIGFILE, MENU_ENUM_LABEL_RECORDING_SETTINGS)
|
|
|
|
default_action_ok_set(action_ok_remap_file_load, ACTION_OK_LOAD_REMAPPING_FILE, MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS )
|
|
|
|
default_action_ok_set(action_ok_shader_preset_load, ACTION_OK_LOAD_PRESET , MENU_ENUM_LABEL_SHADER_OPTIONS)
|
|
|
|
default_action_ok_set(action_ok_shader_pass_load, ACTION_OK_LOAD_SHADER_PASS, MENU_ENUM_LABEL_SHADER_OPTIONS)
|
2016-12-17 16:39:28 +01:00
|
|
|
|
|
|
|
static int action_ok_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
char menu_path_new[PATH_MAX_LENGTH];
|
|
|
|
char full_path_new[PATH_MAX_LENGTH];
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
|
|
|
|
|
|
|
menu_path_new[0] = full_path_new[0] = '\0';
|
|
|
|
|
2017-10-01 17:20:01 +02:00
|
|
|
file_list_get_last(menu_stack, &menu_path, &menu_label, NULL, NULL);
|
2016-12-17 16:39:28 +01:00
|
|
|
|
2017-10-04 06:53:47 +02:00
|
|
|
if (!string_is_empty(menu_label))
|
2017-09-28 03:39:35 +02:00
|
|
|
setting = menu_setting_find(menu_label);
|
2016-12-17 16:39:28 +01:00
|
|
|
|
|
|
|
if (setting_get_type(setting) == ST_PATH)
|
|
|
|
return action_ok_set_path(path, label, type, idx, entry_idx);
|
|
|
|
|
2017-10-04 06:53:47 +02:00
|
|
|
if (!string_is_empty(menu_path))
|
2017-09-28 03:37:29 +02:00
|
|
|
strlcpy(menu_path_new, menu_path, sizeof(menu_path_new));
|
2016-12-17 16:39:28 +01:00
|
|
|
|
2017-10-04 06:53:47 +02:00
|
|
|
if (!string_is_empty(menu_label))
|
2016-12-17 16:39:28 +01:00
|
|
|
{
|
2017-09-28 03:39:35 +02:00
|
|
|
if (
|
|
|
|
string_is_equal(menu_label,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE)) ||
|
|
|
|
string_is_equal(menu_label,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN))
|
|
|
|
)
|
|
|
|
{
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
2016-12-17 16:39:28 +01:00
|
|
|
|
2017-09-28 03:39:35 +02:00
|
|
|
fill_pathname_join(menu_path_new,
|
|
|
|
menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
sizeof(menu_path_new));
|
|
|
|
}
|
2016-12-17 16:39:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case FILE_TYPE_IN_CARCHIVE:
|
|
|
|
fill_pathname_join_delim(full_path_new, menu_path_new, path,
|
|
|
|
'#',sizeof(full_path_new));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fill_pathname_join(full_path_new, menu_path_new, path,
|
|
|
|
sizeof(full_path_new));
|
|
|
|
break;
|
|
|
|
}
|
2016-07-01 10:15:26 +02:00
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(full_path_new,
|
|
|
|
CORE_TYPE_PLAIN);
|
2015-06-08 18:35:14 +02:00
|
|
|
}
|
|
|
|
|
2017-11-25 21:18:25 +01:00
|
|
|
|
2016-06-14 22:48:25 +02:00
|
|
|
static int action_ok_playlist_entry_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-10-08 19:44:03 +02:00
|
|
|
menu_content_ctx_playlist_info_t playlist_info;
|
|
|
|
char new_core_path[PATH_MAX_LENGTH];
|
2017-04-27 01:23:04 +02:00
|
|
|
size_t selection_ptr = 0;
|
|
|
|
bool playlist_initialized = false;
|
|
|
|
playlist_t *playlist = NULL;
|
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_label = NULL;
|
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
|
|
|
playlist_t *tmp_playlist = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
2016-06-14 22:48:25 +02:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
|
2016-10-08 19:44:03 +02:00
|
|
|
new_core_path[0] = '\0';
|
|
|
|
|
2016-06-14 22:48:25 +02:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
{
|
|
|
|
tmp_playlist = playlist_init(
|
|
|
|
menu->db_playlist_file, COLLECTION_SIZE);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
return menu_cbs_exit();
|
2016-06-19 22:28:55 +02:00
|
|
|
playlist_initialized = true;
|
2016-06-14 22:48:25 +02:00
|
|
|
}
|
|
|
|
|
2016-12-04 04:38:58 +01:00
|
|
|
playlist = tmp_playlist;
|
2016-06-14 22:48:25 +02:00
|
|
|
selection_ptr = entry_idx;
|
|
|
|
|
|
|
|
playlist_get_index(playlist, selection_ptr,
|
2016-09-25 00:13:33 -04:00
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
|
|
|
|
|
2016-12-18 16:01:00 +01:00
|
|
|
/* Is the core path / name of the playlist entry not yet filled in? */
|
2016-09-25 00:13:33 -04:00
|
|
|
if ( string_is_equal(core_path, file_path_str(FILE_PATH_DETECT))
|
2016-07-01 04:58:56 +02:00
|
|
|
&& string_is_equal(core_name, file_path_str(FILE_PATH_DETECT)))
|
2016-06-14 22:48:25 +02:00
|
|
|
{
|
|
|
|
core_info_ctx_find_t core_info;
|
|
|
|
const char *entry_path = NULL;
|
2016-09-25 00:13:33 -04:00
|
|
|
const char *path_base =
|
2016-07-01 05:42:53 +02:00
|
|
|
path_basename(menu->db_playlist_file);
|
2016-09-25 00:13:33 -04:00
|
|
|
bool found_associated_core =
|
2016-07-01 15:55:36 +02:00
|
|
|
menu_content_playlist_find_associated_core(
|
2016-06-14 22:48:25 +02:00
|
|
|
path_base, new_core_path, sizeof(new_core_path));
|
|
|
|
|
2016-12-04 04:38:58 +01:00
|
|
|
core_info.inf = NULL;
|
|
|
|
core_info.path = new_core_path;
|
2016-06-14 22:48:25 +02:00
|
|
|
|
2016-07-09 21:50:20 +02:00
|
|
|
if (!core_info_find(&core_info, new_core_path))
|
2016-06-14 22:48:25 +02:00
|
|
|
found_associated_core = false;
|
|
|
|
|
|
|
|
if (!found_associated_core)
|
2016-06-19 22:28:55 +02:00
|
|
|
{
|
2017-01-14 18:17:41 +01:00
|
|
|
/* TODO: figure out if this should refer to the inner or outer entry_path */
|
|
|
|
/* TODO: make sure there's only one entry_path in this function */
|
2016-07-01 10:15:26 +02:00
|
|
|
int ret = action_ok_file_load_with_detect_core_collection(entry_path,
|
2016-06-14 22:48:25 +02:00
|
|
|
label, type, selection_ptr, entry_idx);
|
2016-06-19 22:28:55 +02:00
|
|
|
if (playlist_initialized)
|
|
|
|
playlist_free(tmp_playlist);
|
|
|
|
return ret;
|
|
|
|
}
|
2016-06-14 22:48:25 +02:00
|
|
|
|
2017-11-25 21:52:30 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
2017-11-25 22:54:42 +01:00
|
|
|
command_playlist_update_write(tmp_playlist,
|
2016-06-14 22:48:25 +02:00
|
|
|
selection_ptr,
|
2017-11-25 21:51:32 +01:00
|
|
|
core_info.inf->display_name,
|
2017-01-14 18:17:41 +01:00
|
|
|
NULL,
|
2017-11-25 21:45:28 +01:00
|
|
|
new_core_path);
|
2016-06-14 22:48:25 +02:00
|
|
|
}
|
2016-07-09 22:15:24 +02:00
|
|
|
else
|
|
|
|
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
2016-06-14 22:48:25 +02:00
|
|
|
|
|
|
|
playlist_info.data = playlist;
|
2017-02-26 10:33:03 +01:00
|
|
|
playlist_info.idx = (unsigned)selection_ptr;
|
2016-06-14 22:48:25 +02:00
|
|
|
|
2016-07-01 15:55:36 +02:00
|
|
|
if (!menu_content_playlist_load(&playlist_info))
|
2016-12-15 12:18:26 +01:00
|
|
|
{
|
2017-11-25 21:54:30 +01:00
|
|
|
runloop_msg_queue_push(
|
|
|
|
"File could not be loaded from playlist.\n",
|
|
|
|
1, 100, true);
|
2016-06-15 19:16:27 +02:00
|
|
|
return menu_cbs_exit();
|
2016-12-15 12:18:26 +01:00
|
|
|
}
|
2016-06-14 22:48:25 +02:00
|
|
|
|
2016-06-30 18:25:19 +02:00
|
|
|
playlist_get_index(playlist,
|
|
|
|
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
2017-11-26 07:35:06 +01:00
|
|
|
return default_action_ok_load_content_from_playlist_from_menu(new_core_path, path, entry_label);
|
2016-06-14 22:48:25 +02:00
|
|
|
}
|
|
|
|
|
2015-05-17 18:18:17 +02:00
|
|
|
static int action_ok_playlist_entry(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-02-04 15:00:38 +01:00
|
|
|
menu_content_ctx_playlist_info_t playlist_info;
|
2017-11-26 05:07:35 +01:00
|
|
|
char new_core_path[PATH_MAX_LENGTH];
|
2017-04-27 01:23:04 +02:00
|
|
|
size_t selection_ptr = 0;
|
|
|
|
playlist_t *playlist = g_defaults.content_history;
|
|
|
|
const char *entry_path = NULL;
|
2017-11-08 19:41:13 -08:00
|
|
|
const char *entry_label = NULL;
|
2017-04-27 01:23:04 +02:00
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
2017-11-26 05:07:35 +01:00
|
|
|
new_core_path[0] = '\0';
|
|
|
|
|
2016-02-10 21:15:23 +01:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
selection_ptr = entry_idx;
|
|
|
|
|
|
|
|
playlist_get_index(playlist, selection_ptr,
|
2017-11-08 19:41:13 -08:00
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
|
2016-07-01 18:28:27 +02:00
|
|
|
|
2016-09-25 00:13:33 -04:00
|
|
|
if ( string_is_equal(core_path, file_path_str(FILE_PATH_DETECT))
|
2016-07-01 18:28:27 +02:00
|
|
|
&& string_is_equal(core_name, file_path_str(FILE_PATH_DETECT)))
|
2015-05-26 01:58:52 +02:00
|
|
|
{
|
2016-07-01 18:28:27 +02:00
|
|
|
core_info_ctx_find_t core_info;
|
|
|
|
const char *entry_path = NULL;
|
2017-01-14 18:17:41 +01:00
|
|
|
const char *path_base =
|
2016-07-01 18:28:27 +02:00
|
|
|
path_basename(menu->db_playlist_file);
|
2017-11-26 05:07:35 +01:00
|
|
|
bool found_associated_core =
|
2016-07-01 18:28:27 +02:00
|
|
|
menu_content_playlist_find_associated_core(
|
|
|
|
path_base, new_core_path, sizeof(new_core_path));
|
2015-12-11 12:44:58 +01:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
core_info.inf = NULL;
|
|
|
|
core_info.path = new_core_path;
|
2015-06-06 15:28:16 +02:00
|
|
|
|
2016-07-09 21:50:20 +02:00
|
|
|
if (!core_info_find(&core_info, new_core_path))
|
2016-07-01 18:28:27 +02:00
|
|
|
found_associated_core = false;
|
2015-05-26 04:27:21 +02:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
if (!found_associated_core)
|
2017-01-14 18:17:41 +01:00
|
|
|
/* TODO: figure out if this should refer to the inner or outer entry_path */
|
|
|
|
/* TODO: make sure there's only one entry_path in this function */
|
|
|
|
return action_ok_file_load_with_detect_core(entry_path,
|
2016-07-01 18:28:27 +02:00
|
|
|
label, type, selection_ptr, entry_idx);
|
|
|
|
|
2017-11-25 22:54:42 +01:00
|
|
|
command_playlist_update_write(NULL,
|
2017-11-25 21:45:28 +01:00
|
|
|
selection_ptr,
|
2017-11-25 21:51:32 +01:00
|
|
|
core_info.inf->display_name,
|
2017-01-14 18:17:41 +01:00
|
|
|
NULL,
|
2017-11-25 21:40:29 +01:00
|
|
|
new_core_path);
|
2015-05-26 01:58:52 +02:00
|
|
|
}
|
2017-11-26 05:07:35 +01:00
|
|
|
else
|
|
|
|
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
2015-05-26 01:58:52 +02:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
playlist_info.data = playlist;
|
2017-02-26 10:33:03 +01:00
|
|
|
playlist_info.idx = (unsigned)selection_ptr;
|
2016-07-01 18:28:27 +02:00
|
|
|
|
|
|
|
if (!menu_content_playlist_load(&playlist_info))
|
2016-12-15 12:18:26 +01:00
|
|
|
{
|
2017-09-11 03:01:33 +02:00
|
|
|
runloop_msg_queue_push(
|
|
|
|
"File could not be loaded from playlist.\n",
|
|
|
|
1, 100, true);
|
2016-07-01 18:28:27 +02:00
|
|
|
return menu_cbs_exit();
|
2016-12-15 12:18:26 +01:00
|
|
|
}
|
2016-07-01 18:28:27 +02:00
|
|
|
|
|
|
|
playlist_get_index(playlist,
|
2017-09-11 03:01:33 +02:00
|
|
|
playlist_info.idx, &path, NULL, NULL, NULL,
|
|
|
|
NULL, NULL);
|
2016-07-01 18:28:27 +02:00
|
|
|
|
2017-11-26 07:35:06 +01:00
|
|
|
return default_action_ok_load_content_from_playlist_from_menu(new_core_path, path, entry_label);
|
2016-07-01 18:28:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_playlist_entry_start_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
menu_content_ctx_playlist_info_t playlist_info;
|
2017-04-27 01:23:04 +02:00
|
|
|
size_t selection_ptr = 0;
|
|
|
|
bool playlist_initialized = false;
|
|
|
|
playlist_t *playlist = NULL;
|
|
|
|
const char *entry_path = NULL;
|
2017-11-08 19:41:13 -08:00
|
|
|
const char *entry_label = NULL;
|
2017-04-27 01:23:04 +02:00
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
|
|
|
playlist_t *tmp_playlist = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
2015-05-26 01:58:52 +02:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
2015-06-06 15:28:16 +02:00
|
|
|
{
|
2016-07-01 18:28:27 +02:00
|
|
|
tmp_playlist = playlist_init(
|
|
|
|
menu->db_playlist_file, COLLECTION_SIZE);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
return menu_cbs_exit();
|
|
|
|
playlist_initialized = true;
|
2015-06-06 15:28:16 +02:00
|
|
|
}
|
2015-05-26 01:58:52 +02:00
|
|
|
|
2016-07-01 18:28:27 +02:00
|
|
|
playlist = tmp_playlist;
|
|
|
|
selection_ptr = rdb_entry_start_game_selection_ptr;
|
|
|
|
|
2016-05-16 09:07:44 +02:00
|
|
|
playlist_get_index(playlist, selection_ptr,
|
2017-11-08 19:41:13 -08:00
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
|
2015-05-26 04:52:16 +02:00
|
|
|
|
2016-09-25 00:13:33 -04:00
|
|
|
if ( string_is_equal(core_path, file_path_str(FILE_PATH_DETECT))
|
2016-06-30 19:09:22 +02:00
|
|
|
&& string_is_equal(core_name, file_path_str(FILE_PATH_DETECT)))
|
2015-10-31 16:27:48 +01:00
|
|
|
{
|
2016-02-07 02:50:16 +01:00
|
|
|
core_info_ctx_find_t core_info;
|
2016-10-08 19:44:03 +02:00
|
|
|
char new_core_path[PATH_MAX_LENGTH];
|
2016-05-27 04:31:02 +02:00
|
|
|
const char *entry_path = NULL;
|
2016-09-25 00:13:33 -04:00
|
|
|
const char *path_base =
|
2016-07-01 05:17:04 +02:00
|
|
|
path_basename(menu->db_playlist_file);
|
2016-10-08 19:44:03 +02:00
|
|
|
bool found_associated_core = false;
|
|
|
|
|
2017-11-25 21:51:32 +01:00
|
|
|
new_core_path[0] = '\0';
|
2016-10-08 19:44:03 +02:00
|
|
|
|
2017-08-13 21:20:22 -04:00
|
|
|
found_associated_core =
|
2016-07-01 15:55:36 +02:00
|
|
|
menu_content_playlist_find_associated_core(
|
2015-10-31 17:44:42 +01:00
|
|
|
path_base, new_core_path, sizeof(new_core_path));
|
|
|
|
|
2016-07-01 05:17:04 +02:00
|
|
|
core_info.inf = NULL;
|
|
|
|
core_info.path = new_core_path;
|
2015-12-11 13:51:17 +01:00
|
|
|
|
2016-07-09 21:50:20 +02:00
|
|
|
if (!core_info_find(&core_info, new_core_path))
|
2015-10-31 17:44:42 +01:00
|
|
|
found_associated_core = false;
|
|
|
|
|
2016-01-25 18:11:26 +01:00
|
|
|
if (!found_associated_core)
|
2016-06-19 22:30:57 +02:00
|
|
|
{
|
2017-01-14 18:17:41 +01:00
|
|
|
/* TODO: figure out if this should refer to the inner or outer entry_path */
|
|
|
|
/* TODO: make sure there's only one entry_path in this function */
|
|
|
|
int ret = action_ok_file_load_with_detect_core(entry_path,
|
2016-01-25 18:18:00 +01:00
|
|
|
label, type, selection_ptr, entry_idx);
|
2016-06-19 22:30:57 +02:00
|
|
|
if (playlist_initialized)
|
|
|
|
playlist_free(tmp_playlist);
|
|
|
|
return ret;
|
|
|
|
}
|
2016-01-25 18:11:26 +01:00
|
|
|
|
2017-11-25 21:52:30 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
2017-11-25 22:54:42 +01:00
|
|
|
command_playlist_update_write(
|
2017-11-25 21:52:30 +01:00
|
|
|
tmp_playlist,
|
2016-01-25 18:11:26 +01:00
|
|
|
selection_ptr,
|
2017-11-25 21:51:32 +01:00
|
|
|
core_info.inf->display_name,
|
2017-01-14 18:17:41 +01:00
|
|
|
NULL,
|
2017-11-25 21:45:28 +01:00
|
|
|
new_core_path);
|
2015-10-31 16:27:48 +01:00
|
|
|
}
|
2015-05-26 04:52:16 +02:00
|
|
|
|
2016-02-04 15:00:38 +01:00
|
|
|
playlist_info.data = playlist;
|
2017-02-26 10:33:03 +01:00
|
|
|
playlist_info.idx = (unsigned)selection_ptr;
|
2016-02-04 15:00:38 +01:00
|
|
|
|
2016-07-01 15:55:36 +02:00
|
|
|
if (!menu_content_playlist_load(&playlist_info))
|
2016-12-15 12:18:26 +01:00
|
|
|
{
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
|
2016-06-15 19:16:27 +02:00
|
|
|
return menu_cbs_exit();
|
2016-12-15 12:18:26 +01:00
|
|
|
}
|
2015-05-26 01:58:52 +02:00
|
|
|
|
2016-06-30 18:25:19 +02:00
|
|
|
playlist_get_index(playlist,
|
|
|
|
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
2017-11-26 07:35:06 +01:00
|
|
|
return default_action_ok_load_content_from_playlist_from_menu(core_path, path, entry_label);
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2017-01-07 09:39:54 +01:00
|
|
|
static int action_ok_lookup_setting(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return menu_setting_set(type, label, MENU_ACTION_OK, false);
|
|
|
|
}
|
2015-09-02 18:38:45 +02:00
|
|
|
|
2017-05-27 21:03:17 +02:00
|
|
|
static int action_ok_audio_add_to_mixer(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
const char *entry_path = NULL;
|
|
|
|
playlist_t *tmp_playlist = NULL;
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
playlist_get_index(tmp_playlist, entry_idx,
|
|
|
|
&entry_path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
if(path_file_exists(entry_path))
|
|
|
|
task_push_audio_mixer_load(entry_path,
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-05-27 23:56:10 +02:00
|
|
|
static int action_ok_audio_add_to_mixer_and_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
char combined_path[PATH_MAX_LENGTH];
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
2017-05-28 19:06:15 +02:00
|
|
|
combined_path[0] = '\0';
|
|
|
|
|
2017-05-27 23:56:10 +02:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
|
|
|
|
fill_pathname_join(combined_path, menu->scratch2_buf,
|
|
|
|
menu->scratch_buf, sizeof(combined_path));
|
|
|
|
|
2017-11-25 22:59:47 +01:00
|
|
|
command_playlist_push_write(
|
2017-11-25 21:40:29 +01:00
|
|
|
g_defaults.music_history,
|
2017-05-27 23:56:10 +02:00
|
|
|
combined_path,
|
|
|
|
NULL,
|
|
|
|
"builtin",
|
2017-11-25 22:59:47 +01:00
|
|
|
"musicplayer");
|
2017-05-27 23:56:10 +02:00
|
|
|
|
|
|
|
if(path_file_exists(combined_path))
|
|
|
|
task_push_audio_mixer_load(combined_path,
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-01-07 09:39:54 +01:00
|
|
|
static int action_ok_menu_wallpaper(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-05-19 01:50:15 +02:00
|
|
|
filebrowser_set_type(FILEBROWSER_SELECT_IMAGE);
|
2017-01-07 09:39:54 +01:00
|
|
|
return action_ok_lookup_setting(path, label, type, idx, entry_idx);
|
|
|
|
}
|
2015-09-04 23:11:04 +02:00
|
|
|
|
2017-05-19 04:44:10 +02:00
|
|
|
static int action_ok_menu_font(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
filebrowser_set_type(FILEBROWSER_SELECT_FONT);
|
|
|
|
return action_ok_lookup_setting(path, label, type, idx, entry_idx);
|
|
|
|
}
|
|
|
|
|
2015-09-04 22:48:20 +02:00
|
|
|
static int action_ok_menu_wallpaper_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-01-07 18:13:52 +01:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2017-01-07 09:53:39 +01:00
|
|
|
filebrowser_clear_type();
|
2017-01-07 18:13:52 +01:00
|
|
|
|
2017-04-28 21:03:04 +02:00
|
|
|
settings->uints.menu_xmb_shader_pipeline = XMB_SHADER_PIPELINE_WALLPAPER;
|
2015-09-04 22:48:20 +02:00
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-20 00:31:13 +02:00
|
|
|
ACTION_OK_LOAD_WALLPAPER, MSG_UNKNOWN);
|
2015-09-04 22:48:20 +02:00
|
|
|
}
|
|
|
|
|
2016-11-06 13:05:28 +01:00
|
|
|
int generic_action_ok_help(const char *path,
|
2015-11-08 18:52:04 +01:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
2016-09-15 16:07:20 +02:00
|
|
|
enum msg_hash_enums id, enum menu_dialog_type id2)
|
2015-11-08 18:52:04 +01:00
|
|
|
{
|
2016-06-20 00:31:13 +02:00
|
|
|
const char *lbl = msg_hash_to_str(id);
|
2016-02-10 21:15:23 +01:00
|
|
|
|
2016-09-04 22:58:54 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL, lbl, id2, idx,
|
2015-11-08 18:52:04 +01:00
|
|
|
entry_idx, ACTION_OK_DL_HELP);
|
|
|
|
}
|
|
|
|
|
2016-12-27 00:02:09 +01:00
|
|
|
|
2016-09-15 21:08:54 +02:00
|
|
|
static void menu_input_st_cheat_cb(void *userdata, const char *str)
|
|
|
|
{
|
|
|
|
(void)userdata;
|
|
|
|
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
unsigned cheat_index = menu_input_dialog_get_kb_type()
|
|
|
|
- MENU_SETTINGS_CHEAT_BEGIN;
|
|
|
|
cheat_manager_set_code(cheat_index, str);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2016-09-23 13:16:27 +02:00
|
|
|
static void menu_input_wifi_cb(void *userdata, const char *passphrase)
|
|
|
|
{
|
2016-09-23 14:45:07 +02:00
|
|
|
unsigned idx = menu_input_dialog_get_kb_idx();
|
|
|
|
|
|
|
|
driver_wifi_connect_ssid(idx, passphrase);
|
2016-09-23 13:16:27 +02:00
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2017-08-14 20:07:43 +02:00
|
|
|
static void menu_input_st_string_cb_rename_entry(void *userdata,
|
|
|
|
const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
const char *label = menu_input_dialog_get_buffer();
|
|
|
|
|
|
|
|
if (!string_is_empty(label))
|
2017-11-25 22:54:42 +01:00
|
|
|
command_playlist_update_write(NULL,
|
2017-11-25 21:45:28 +01:00
|
|
|
menu_input_dialog_get_kb_idx(),
|
2017-11-25 21:35:00 +01:00
|
|
|
NULL,
|
|
|
|
label,
|
|
|
|
NULL);
|
2017-08-14 20:07:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2017-10-11 11:30:53 +02:00
|
|
|
static void menu_input_st_string_cb_disable_kiosk_mode(void *userdata,
|
|
|
|
const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
const char *label = menu_input_dialog_get_buffer();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
|
|
|
if (string_is_equal(label, settings->paths.kiosk_mode_password))
|
|
|
|
{
|
|
|
|
settings->bools.kiosk_mode_enable = false;
|
|
|
|
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_OK),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_NOK),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2017-09-26 14:41:07 +02:00
|
|
|
static void menu_input_st_string_cb_enable_settings(void *userdata,
|
|
|
|
const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
const char *label = menu_input_dialog_get_buffer();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
|
|
|
if (string_is_equal(label, settings->paths.menu_xmb_show_settings_password))
|
|
|
|
{
|
|
|
|
settings->bools.menu_xmb_show_settings = true;
|
|
|
|
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_INPUT_ENABLE_SETTINGS_PASSWORD_OK),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_INPUT_ENABLE_SETTINGS_PASSWORD_NOK),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2016-07-01 05:42:53 +02:00
|
|
|
static void menu_input_st_string_cb_save_preset(void *userdata,
|
|
|
|
const char *str)
|
2016-06-14 22:16:07 +02:00
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
2016-09-15 19:07:30 +02:00
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
bool ret = false;
|
|
|
|
const char *label = menu_input_dialog_get_label_buffer();
|
2016-06-14 22:16:07 +02:00
|
|
|
|
|
|
|
if (!string_is_empty(label))
|
|
|
|
setting = menu_setting_find(label);
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
2016-08-29 03:07:20 +02:00
|
|
|
setting_set_with_string_representation(setting, str);
|
2016-06-14 22:16:07 +02:00
|
|
|
menu_setting_generic(setting, false);
|
|
|
|
}
|
|
|
|
else if (!string_is_empty(label))
|
2016-07-27 18:31:49 -05:00
|
|
|
ret = menu_shader_manager_save_preset(str, false, false);
|
|
|
|
|
|
|
|
if(ret)
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-27 18:31:49 -05:00
|
|
|
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
|
|
|
1, 100, true);
|
|
|
|
else
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-27 18:31:49 -05:00
|
|
|
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
|
|
|
|
1, 100, true);
|
2016-06-14 22:16:07 +02:00
|
|
|
}
|
|
|
|
|
2016-09-15 17:07:52 +02:00
|
|
|
menu_input_dialog_end();
|
2016-06-14 22:16:07 +02:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:03:34 +01:00
|
|
|
static void menu_input_st_string_cb_cheat_file_save_as(
|
|
|
|
void *userdata, const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
const char *label = menu_input_dialog_get_label_buffer();
|
|
|
|
|
|
|
|
if (!string_is_empty(label))
|
|
|
|
setting = menu_setting_find(label);
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
|
|
|
setting_set_with_string_representation(setting, str);
|
|
|
|
menu_setting_generic(setting, false);
|
|
|
|
}
|
|
|
|
else if (!string_is_empty(label))
|
|
|
|
cheat_manager_save(str, settings->paths.path_cheat_database);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_dialog_end();
|
|
|
|
}
|
|
|
|
|
2017-11-26 06:12:51 +01:00
|
|
|
#define default_action_dialog_start(funcname, _label_setting, _idx, _cb) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
menu_input_ctx_line_t line; \
|
|
|
|
line.label = label; \
|
|
|
|
line.label_setting = _label_setting; \
|
|
|
|
line.type = type; \
|
|
|
|
line.idx = (_idx); \
|
|
|
|
line.cb = _cb; \
|
|
|
|
if (!menu_input_dialog_start(&line)) \
|
|
|
|
return -1; \
|
|
|
|
return 0; \
|
2017-11-26 06:03:34 +01:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:12:51 +01:00
|
|
|
default_action_dialog_start(action_ok_shader_preset_save_as,
|
|
|
|
msg_hash_to_str(MSG_INPUT_PRESET_FILENAME),
|
|
|
|
(unsigned)idx,
|
|
|
|
menu_input_st_string_cb_save_preset)
|
|
|
|
default_action_dialog_start(action_ok_enable_settings,
|
|
|
|
msg_hash_to_str(MSG_INPUT_ENABLE_SETTINGS_PASSWORD),
|
|
|
|
(unsigned)entry_idx,
|
|
|
|
menu_input_st_string_cb_enable_settings)
|
|
|
|
default_action_dialog_start(action_ok_wifi,
|
|
|
|
"Passphrase",
|
|
|
|
(unsigned)idx,
|
|
|
|
menu_input_wifi_cb)
|
|
|
|
default_action_dialog_start(action_ok_cheat_file_save_as,
|
|
|
|
msg_hash_to_str(MSG_INPUT_CHEAT_FILENAME),
|
|
|
|
(unsigned)idx,
|
|
|
|
menu_input_st_string_cb_cheat_file_save_as)
|
|
|
|
default_action_dialog_start(action_ok_cheat,
|
|
|
|
msg_hash_to_str(MSG_INPUT_CHEAT),
|
|
|
|
(unsigned)idx,
|
|
|
|
menu_input_st_cheat_cb)
|
|
|
|
default_action_dialog_start(action_ok_disable_kiosk_mode,
|
|
|
|
msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD),
|
|
|
|
(unsigned)entry_idx,
|
|
|
|
menu_input_st_string_cb_disable_kiosk_mode)
|
|
|
|
default_action_dialog_start(action_ok_rename_entry,
|
|
|
|
msg_hash_to_str(MSG_INPUT_RENAME_ENTRY),
|
|
|
|
(unsigned)entry_idx,
|
|
|
|
menu_input_st_string_cb_rename_entry)
|
2017-11-26 06:03:34 +01:00
|
|
|
|
2016-07-27 18:07:19 -05:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ACTION_OK_SHADER_PRESET_SAVE_CORE = 0,
|
|
|
|
ACTION_OK_SHADER_PRESET_SAVE_GAME
|
|
|
|
};
|
|
|
|
|
|
|
|
static int generic_action_ok_shader_preset_save(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned action_type)
|
|
|
|
{
|
2016-10-08 19:47:26 +02:00
|
|
|
char directory[PATH_MAX_LENGTH];
|
|
|
|
char file[PATH_MAX_LENGTH];
|
|
|
|
char tmp[PATH_MAX_LENGTH];
|
2016-09-06 07:08:25 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2017-05-30 01:44:49 +02:00
|
|
|
const char *core_name = NULL;
|
2017-04-23 16:41:26 +02:00
|
|
|
rarch_system_info_t *info = runloop_get_system_info();
|
2016-09-06 08:38:26 +02:00
|
|
|
|
2016-10-08 19:47:26 +02:00
|
|
|
directory[0] = file[0] = tmp[0] = '\0';
|
|
|
|
|
2017-05-30 01:44:49 +02:00
|
|
|
if (info)
|
|
|
|
core_name = info->info.library_name;
|
|
|
|
|
2016-07-27 18:07:19 -05:00
|
|
|
if (!string_is_empty(core_name))
|
|
|
|
{
|
|
|
|
fill_pathname_join(
|
|
|
|
tmp,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.directory_video_shader,
|
2016-07-27 18:07:19 -05:00
|
|
|
"presets",
|
|
|
|
sizeof(tmp));
|
|
|
|
fill_pathname_join(
|
|
|
|
directory,
|
|
|
|
tmp,
|
|
|
|
core_name,
|
|
|
|
sizeof(directory));
|
|
|
|
}
|
|
|
|
if(!path_file_exists(directory))
|
|
|
|
path_mkdir(directory);
|
|
|
|
|
|
|
|
switch (action_type)
|
|
|
|
{
|
|
|
|
case ACTION_OK_SHADER_PRESET_SAVE_CORE:
|
2016-09-24 16:58:02 +02:00
|
|
|
if (!string_is_empty(core_name))
|
|
|
|
fill_pathname_join(file, directory, core_name, sizeof(file));
|
2016-07-27 18:07:19 -05:00
|
|
|
break;
|
|
|
|
case ACTION_OK_SHADER_PRESET_SAVE_GAME:
|
|
|
|
{
|
2016-12-17 12:55:38 +01:00
|
|
|
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
2016-07-27 18:07:19 -05:00
|
|
|
fill_pathname_join(file, directory, game_name, sizeof(file));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(menu_shader_manager_save_preset(file, false, true))
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-27 18:11:58 -05:00
|
|
|
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
2016-07-27 18:07:19 -05:00
|
|
|
1, 100, true);
|
|
|
|
else
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-27 18:11:58 -05:00
|
|
|
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
|
2016-07-27 18:07:19 -05:00
|
|
|
1, 100, true);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_shader_preset_save_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_shader_preset_save(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_SHADER_PRESET_SAVE_CORE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_shader_preset_save_game(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_shader_preset_save(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_SHADER_PRESET_SAVE_GAME);
|
|
|
|
}
|
|
|
|
|
2016-06-14 22:16:07 +02:00
|
|
|
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2017-08-05 00:37:26 -05:00
|
|
|
static int generic_action_ok_remap_file_operation(const char *path,
|
2015-09-04 21:59:04 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned action_type)
|
2015-04-06 18:47:58 -05:00
|
|
|
{
|
2016-10-08 19:47:26 +02:00
|
|
|
char directory[PATH_MAX_LENGTH];
|
|
|
|
char file[PATH_MAX_LENGTH];
|
2016-09-06 07:08:25 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2017-05-30 01:44:49 +02:00
|
|
|
const char *core_name = NULL;
|
2017-04-23 16:41:26 +02:00
|
|
|
rarch_system_info_t *info = runloop_get_system_info();
|
2016-09-06 08:38:26 +02:00
|
|
|
|
2016-10-08 19:47:26 +02:00
|
|
|
directory[0] = file[0] = '\0';
|
|
|
|
|
2017-05-30 01:44:49 +02:00
|
|
|
if (info)
|
|
|
|
core_name = info->info.library_name;
|
|
|
|
|
2016-06-29 12:13:40 +02:00
|
|
|
if (!string_is_empty(core_name))
|
|
|
|
fill_pathname_join(
|
|
|
|
directory,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.directory_input_remapping,
|
2016-06-29 12:13:40 +02:00
|
|
|
core_name,
|
|
|
|
sizeof(directory));
|
2015-09-04 21:59:04 +02:00
|
|
|
|
|
|
|
switch (action_type)
|
|
|
|
{
|
|
|
|
case ACTION_OK_REMAP_FILE_SAVE_CORE:
|
2017-08-05 00:37:26 -05:00
|
|
|
case ACTION_OK_REMAP_FILE_REMOVE_CORE:
|
2016-11-21 15:37:40 +01:00
|
|
|
if (!string_is_empty(core_name))
|
|
|
|
fill_pathname_join(file, core_name, core_name, sizeof(file));
|
2015-09-04 21:59:04 +02:00
|
|
|
break;
|
|
|
|
case ACTION_OK_REMAP_FILE_SAVE_GAME:
|
2017-08-05 00:37:26 -05:00
|
|
|
case ACTION_OK_REMAP_FILE_REMOVE_GAME:
|
2016-11-21 15:37:40 +01:00
|
|
|
if (!string_is_empty(core_name))
|
2016-09-23 02:04:25 +02:00
|
|
|
fill_pathname_join(file, core_name,
|
2016-12-17 12:55:38 +01:00
|
|
|
path_basename(path_get(RARCH_PATH_BASENAME)), sizeof(file));
|
2015-09-04 21:59:04 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-04-07 22:51:31 -05:00
|
|
|
|
2015-04-06 18:47:58 -05:00
|
|
|
if(!path_file_exists(directory))
|
|
|
|
path_mkdir(directory);
|
2015-04-07 22:51:31 -05:00
|
|
|
|
2017-08-05 00:37:26 -05:00
|
|
|
if (action_type < ACTION_OK_REMAP_FILE_REMOVE_CORE)
|
|
|
|
{
|
|
|
|
if(input_remapping_save_file(file))
|
|
|
|
{
|
|
|
|
if (action_type == ACTION_OK_REMAP_FILE_SAVE_CORE)
|
|
|
|
rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
2017-09-11 22:49:39 -05:00
|
|
|
else if (action_type == ACTION_OK_REMAP_FILE_SAVE_GAME)
|
2017-08-05 00:37:26 -05:00
|
|
|
rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
|
|
|
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_REMAP_FILE_SAVED_SUCCESSFULLY),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_ERROR_SAVING_REMAP_FILE),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
2015-04-07 22:40:42 -05:00
|
|
|
else
|
2017-08-05 00:37:26 -05:00
|
|
|
{
|
|
|
|
if(input_remapping_remove_file(file))
|
|
|
|
{
|
2017-09-11 22:49:39 -05:00
|
|
|
if (action_type == ACTION_OK_REMAP_FILE_REMOVE_CORE &&
|
|
|
|
rarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL))
|
|
|
|
{
|
2017-08-05 00:37:26 -05:00
|
|
|
rarch_ctl(RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, NULL);
|
2017-09-11 22:49:39 -05:00
|
|
|
input_remapping_set_defaults(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (action_type == ACTION_OK_REMAP_FILE_REMOVE_GAME &&
|
|
|
|
rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL))
|
|
|
|
{
|
2017-08-05 00:37:26 -05:00
|
|
|
rarch_ctl(RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE, NULL);
|
2017-09-11 22:49:39 -05:00
|
|
|
input_remapping_set_defaults(true);
|
|
|
|
}
|
2015-04-07 22:51:31 -05:00
|
|
|
|
2017-08-05 00:37:26 -05:00
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_REMAP_FILE_REMOVED_SUCCESSFULLY),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MSG_ERROR_REMOVING_REMAP_FILE),
|
|
|
|
1, 100, true);
|
|
|
|
}
|
2015-04-06 18:47:58 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-09-04 21:59:04 +02:00
|
|
|
static int action_ok_remap_file_save_core(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-04-06 18:47:58 -05:00
|
|
|
{
|
2017-08-05 00:37:26 -05:00
|
|
|
return generic_action_ok_remap_file_operation(path, label, type,
|
2015-09-04 21:59:04 +02:00
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_CORE);
|
|
|
|
}
|
2015-04-07 22:51:31 -05:00
|
|
|
|
2015-09-04 21:59:04 +02:00
|
|
|
static int action_ok_remap_file_save_game(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-08-05 00:37:26 -05:00
|
|
|
return generic_action_ok_remap_file_operation(path, label, type,
|
2015-09-04 21:59:04 +02:00
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_GAME);
|
2015-04-06 18:47:58 -05:00
|
|
|
}
|
|
|
|
|
2017-08-05 00:37:26 -05:00
|
|
|
static int action_ok_remap_file_remove_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_remap_file_operation(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_REMOVE_CORE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_remap_file_remove_game(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_remap_file_operation(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_REMOVE_GAME);
|
|
|
|
}
|
|
|
|
|
2015-08-05 09:41:02 +02:00
|
|
|
int action_ok_path_use_directory(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2016-06-17 15:33:42 +02:00
|
|
|
return generic_action_ok(NULL, label, type, idx, entry_idx,
|
2016-06-20 00:31:13 +02:00
|
|
|
ACTION_OK_SET_DIRECTORY, MSG_UNKNOWN);
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2015-11-24 01:12:50 +01:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2015-07-04 02:07:18 +02:00
|
|
|
static int action_ok_scan_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return action_scan_file(path, label, type, idx);
|
|
|
|
}
|
|
|
|
|
2015-07-04 01:51:41 +02:00
|
|
|
static int action_ok_path_scan_directory(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return action_scan_directory(NULL, label, type, idx);
|
|
|
|
}
|
2015-11-24 01:12:50 +01:00
|
|
|
#endif
|
2015-07-04 01:51:41 +02:00
|
|
|
|
2015-05-26 06:28:16 +02:00
|
|
|
static int action_ok_core_deferred_set(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-05-26 06:28:16 +02:00
|
|
|
{
|
2017-11-25 21:35:00 +01:00
|
|
|
char core_display_name[PATH_MAX_LENGTH];
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2015-12-11 12:46:08 +01:00
|
|
|
|
2017-11-25 21:35:00 +01:00
|
|
|
core_display_name[0] = '\0';
|
|
|
|
|
|
|
|
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
2017-11-25 22:54:42 +01:00
|
|
|
command_playlist_update_write(NULL,
|
2017-11-25 21:45:28 +01:00
|
|
|
rdb_entry_start_game_selection_ptr,
|
2017-11-25 21:35:00 +01:00
|
|
|
core_display_name, NULL, path);
|
2015-05-26 06:28:16 +02:00
|
|
|
|
2016-04-26 00:09:30 +07:00
|
|
|
menu_entries_pop_stack(&selection, 0, 1);
|
2017-04-23 14:31:49 +02:00
|
|
|
menu_navigation_set_selection(selection);
|
2015-05-26 06:28:16 +02:00
|
|
|
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-05-26 06:28:16 +02:00
|
|
|
}
|
|
|
|
|
2016-06-20 19:54:04 +02:00
|
|
|
static int action_ok_deferred_list_stub(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-06-15 18:07:00 +02:00
|
|
|
static int action_ok_load_core_deferred(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2017-04-27 01:23:04 +02:00
|
|
|
content_ctx_info_t content_info;
|
2016-05-16 16:25:16 +02:00
|
|
|
menu_handle_t *menu = NULL;
|
2017-04-27 01:23:04 +02:00
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
|
|
|
|
2016-02-10 21:15:23 +01:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2017-02-21 18:36:38 +01:00
|
|
|
if (!task_push_load_content_with_new_core_from_menu(
|
2017-02-21 04:31:03 +01:00
|
|
|
path, menu->deferred_path,
|
|
|
|
&content_info,
|
|
|
|
CORE_TYPE_PLAIN,
|
|
|
|
NULL, NULL))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:23:14 +01:00
|
|
|
#define default_action_ok_start_builtin_core(funcname, _id) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
content_ctx_info_t content_info; \
|
|
|
|
content_info.argc = 0; \
|
|
|
|
content_info.argv = NULL; \
|
|
|
|
content_info.args = NULL; \
|
|
|
|
content_info.environ_get = NULL; \
|
|
|
|
if (!task_push_start_builtin_core(&content_info, _id, NULL, NULL)) \
|
|
|
|
return -1; \
|
|
|
|
return 0; \
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:23:14 +01:00
|
|
|
default_action_ok_start_builtin_core(action_ok_start_net_retropad_core, CORE_TYPE_NETRETROPAD)
|
|
|
|
default_action_ok_start_builtin_core(action_ok_start_video_processor_core, CORE_TYPE_VIDEO_PROCESSOR)
|
2017-05-28 18:33:44 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_FFMPEG
|
2016-06-20 19:54:04 +02:00
|
|
|
static int action_ok_file_load_ffmpeg(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-23 06:44:29 +02:00
|
|
|
{
|
2016-10-09 09:23:00 +02:00
|
|
|
char new_path[PATH_MAX_LENGTH];
|
2016-06-02 20:49:25 +02:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2017-11-26 07:29:19 +01:00
|
|
|
|
2017-10-01 17:20:01 +02:00
|
|
|
file_list_get_last(menu_stack, &menu_path, NULL, NULL, NULL);
|
2015-06-23 06:44:29 +02:00
|
|
|
|
2016-10-09 09:23:00 +02:00
|
|
|
new_path[0] = '\0';
|
|
|
|
|
2017-10-04 06:53:47 +02:00
|
|
|
if (!string_is_empty(menu_path))
|
2017-09-28 03:39:35 +02:00
|
|
|
fill_pathname_join(new_path, menu_path, path,
|
|
|
|
sizeof(new_path));
|
2017-02-21 18:36:38 +01:00
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(new_path, CORE_TYPE_FFMPEG);
|
2015-09-02 00:42:45 +02:00
|
|
|
}
|
2017-05-28 18:33:44 +02:00
|
|
|
#endif
|
2017-05-27 23:56:10 +02:00
|
|
|
|
|
|
|
static int action_ok_audio_run(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
char combined_path[PATH_MAX_LENGTH];
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
2017-05-29 02:30:04 +02:00
|
|
|
combined_path[0] = '\0';
|
|
|
|
|
2017-05-27 23:56:10 +02:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
|
|
|
|
fill_pathname_join(combined_path, menu->scratch2_buf,
|
|
|
|
menu->scratch_buf, sizeof(combined_path));
|
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(combined_path, CORE_TYPE_FFMPEG);
|
2017-05-27 23:56:10 +02:00
|
|
|
}
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2015-06-28 17:21:32 +02:00
|
|
|
static int action_ok_file_load_imageviewer(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-10-26 06:23:05 +02:00
|
|
|
char fullpath[PATH_MAX_LENGTH];
|
2016-06-20 19:54:04 +02:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2017-10-01 17:20:01 +02:00
|
|
|
|
|
|
|
file_list_get_last(menu_stack, &menu_path, NULL, NULL, NULL);
|
2016-06-20 19:54:04 +02:00
|
|
|
|
2016-10-26 06:23:05 +02:00
|
|
|
fullpath[0] = '\0';
|
|
|
|
|
2017-10-04 06:53:47 +02:00
|
|
|
if (!string_is_empty(menu_path))
|
2017-09-28 03:39:35 +02:00
|
|
|
fill_pathname_join(fullpath, menu_path, path,
|
|
|
|
sizeof(fullpath));
|
2017-02-21 18:36:38 +01:00
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(fullpath, CORE_TYPE_IMAGEVIEWER);
|
2015-06-28 17:21:32 +02:00
|
|
|
}
|
|
|
|
|
2016-12-12 21:24:06 +01:00
|
|
|
static int action_ok_file_load_current_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(detect_content_path, CORE_TYPE_PLAIN);
|
2016-12-12 21:24:06 +01:00
|
|
|
}
|
|
|
|
|
2016-06-20 19:54:04 +02:00
|
|
|
static int action_ok_file_load_detect_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-04-27 01:23:04 +02:00
|
|
|
content_ctx_info_t content_info;
|
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
2017-02-21 04:31:03 +01:00
|
|
|
|
2017-02-21 18:36:38 +01:00
|
|
|
if (!task_push_load_content_with_new_core_from_menu(
|
2017-02-21 04:31:03 +01:00
|
|
|
path, detect_content_path,
|
|
|
|
&content_info,
|
|
|
|
CORE_TYPE_FFMPEG,
|
|
|
|
NULL, NULL))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
2016-06-20 19:54:04 +02:00
|
|
|
}
|
|
|
|
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2015-05-17 18:18:17 +02:00
|
|
|
static int action_ok_load_state(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2016-05-09 20:51:53 +02:00
|
|
|
if (generic_action_ok_command(CMD_EVENT_LOAD_STATE) == -1)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2016-05-09 20:51:53 +02:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-06-02 23:33:52 -05:00
|
|
|
}
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-06-04 14:34:06 -05:00
|
|
|
static int action_ok_save_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
if (generic_action_ok_command(CMD_EVENT_SAVE_STATE) == -1)
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
|
|
|
}
|
|
|
|
|
2016-06-02 23:33:52 -05:00
|
|
|
static int action_ok_undo_load_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
if (generic_action_ok_command(CMD_EVENT_UNDO_LOAD_STATE) == -1)
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
|
|
|
}
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-06-04 14:34:06 -05:00
|
|
|
static int action_ok_undo_save_state(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2016-06-04 14:34:06 -05:00
|
|
|
if (generic_action_ok_command(CMD_EVENT_UNDO_SAVE_STATE) == -1)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2016-05-09 20:51:53 +02:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2016-02-03 15:50:51 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-10-30 03:27:43 +01:00
|
|
|
|
2016-05-11 21:22:45 +02:00
|
|
|
#ifdef HAVE_ZLIB
|
2016-02-03 15:50:51 +01:00
|
|
|
static void cb_decompressed(void *task_data, void *user_data, const char *err)
|
|
|
|
{
|
|
|
|
decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
|
|
|
|
|
|
|
|
if (dec && !err)
|
|
|
|
{
|
2017-02-26 10:33:03 +01:00
|
|
|
unsigned type_hash = (unsigned)(uintptr_t)user_data;
|
2016-06-29 17:07:18 +02:00
|
|
|
|
2016-04-23 22:31:39 +02:00
|
|
|
switch (type_hash)
|
|
|
|
{
|
|
|
|
case CB_CORE_UPDATER_DOWNLOAD:
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_CORE_INFO_INIT);
|
2016-04-23 22:31:39 +02:00
|
|
|
break;
|
|
|
|
case CB_UPDATE_ASSETS:
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_REINIT);
|
2016-04-23 22:31:39 +02:00
|
|
|
break;
|
|
|
|
}
|
2016-02-03 15:50:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
RARCH_ERR("%s", err);
|
|
|
|
|
|
|
|
if (dec)
|
|
|
|
{
|
|
|
|
if (path_file_exists(dec->source_file))
|
2017-10-14 23:13:24 -04:00
|
|
|
path_file_remove(dec->source_file);
|
2016-02-03 15:50:51 +01:00
|
|
|
|
|
|
|
free(dec->source_file);
|
|
|
|
free(dec);
|
|
|
|
}
|
|
|
|
}
|
2016-05-11 21:22:45 +02:00
|
|
|
#endif
|
2016-02-03 15:50:51 +01:00
|
|
|
|
2016-06-21 04:09:13 +02:00
|
|
|
static int generic_action_ok_network(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
enum msg_hash_enums enum_idx)
|
|
|
|
{
|
2016-10-08 19:47:26 +02:00
|
|
|
char url_path[PATH_MAX_LENGTH];
|
2016-06-21 04:09:13 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
unsigned type_id2 = 0;
|
2016-07-11 19:33:07 +02:00
|
|
|
menu_file_transfer_t *transf = NULL;
|
2016-06-21 04:09:13 +02:00
|
|
|
const char *url_label = NULL;
|
|
|
|
retro_task_callback_t callback = NULL;
|
|
|
|
bool refresh = true;
|
2016-07-12 05:22:24 +02:00
|
|
|
bool suppress_msg = false;
|
2016-06-21 04:09:13 +02:00
|
|
|
|
2016-10-08 19:47:26 +02:00
|
|
|
url_path[0] = '\0';
|
|
|
|
|
2016-06-21 04:09:13 +02:00
|
|
|
switch (enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST:
|
2016-10-15 12:55:23 +02:00
|
|
|
|
2017-04-29 00:39:29 +02:00
|
|
|
if (string_is_empty(settings->paths.network_buildbot_assets_url))
|
2016-10-15 12:55:23 +02:00
|
|
|
return menu_cbs_exit();
|
|
|
|
|
2017-04-29 00:39:29 +02:00
|
|
|
fill_pathname_join(url_path,
|
|
|
|
settings->paths.network_buildbot_assets_url,
|
2016-06-21 04:09:13 +02:00
|
|
|
"cores/.index-dirs", sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
|
|
|
|
callback = cb_net_generic;
|
2016-07-12 05:22:24 +02:00
|
|
|
suppress_msg = true;
|
2016-06-21 04:09:13 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST:
|
2016-06-21 05:13:43 +02:00
|
|
|
fill_pathname_join(url_path, path,
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL), sizeof(url_path));
|
2016-06-21 04:09:13 +02:00
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_LIST;
|
|
|
|
callback = cb_net_generic;
|
2016-07-12 05:22:24 +02:00
|
|
|
suppress_msg = true;
|
2016-06-21 04:09:13 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST:
|
2016-10-15 12:55:23 +02:00
|
|
|
|
2017-04-29 00:39:29 +02:00
|
|
|
if (string_is_empty(settings->paths.network_buildbot_url))
|
2016-10-15 12:55:23 +02:00
|
|
|
return menu_cbs_exit();
|
|
|
|
|
2017-04-29 00:39:29 +02:00
|
|
|
fill_pathname_join(url_path, settings->paths.network_buildbot_url,
|
2016-06-21 04:09:13 +02:00
|
|
|
file_path_str(FILE_PATH_INDEX_EXTENDED_URL), sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_UPDATER_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:
|
|
|
|
fill_pathname_join(url_path,
|
|
|
|
file_path_str(FILE_PATH_CORE_THUMBNAILS_URL),
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL), sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_LIST:
|
|
|
|
/* TODO unhardcode this path */
|
2016-09-25 00:13:33 -04:00
|
|
|
fill_pathname_join(url_path,
|
2016-06-21 04:09:13 +02:00
|
|
|
file_path_str(FILE_PATH_LAKKA_URL),
|
2016-11-15 10:18:21 +01:00
|
|
|
lakka_get_project(), sizeof(url_path));
|
2016-06-21 04:09:13 +02:00
|
|
|
fill_pathname_join(url_path, url_path,
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL),
|
|
|
|
sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_LAKKA_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2017-08-13 21:20:22 -04:00
|
|
|
|
2016-10-15 12:55:23 +02:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
|
|
|
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_NETWORK_INIT);
|
2016-06-21 04:09:13 +02:00
|
|
|
|
2016-07-11 19:33:07 +02:00
|
|
|
transf = (menu_file_transfer_t*)calloc(1, sizeof(*transf));
|
|
|
|
strlcpy(transf->path, url_path, sizeof(transf->path));
|
|
|
|
|
2016-07-12 05:22:24 +02:00
|
|
|
task_push_http_transfer(url_path, suppress_msg, url_label, callback, transf);
|
2016-06-21 04:09:13 +02:00
|
|
|
|
2016-07-09 18:06:50 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL,
|
2016-06-21 04:09:13 +02:00
|
|
|
label, type, idx, entry_idx, type_id2);
|
|
|
|
}
|
|
|
|
|
2017-11-26 06:49:58 +01:00
|
|
|
#define default_action_ok_list(funcname, _id) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx, _id); \
|
2016-06-21 04:09:13 +02:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:49:58 +01:00
|
|
|
default_action_ok_list(action_ok_core_content_list, MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST)
|
|
|
|
default_action_ok_list(action_ok_core_content_dirs_list, MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST)
|
|
|
|
default_action_ok_list(action_ok_core_updater_list, MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST)
|
|
|
|
default_action_ok_list(action_ok_thumbnails_updater_list, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST)
|
|
|
|
default_action_ok_list(action_ok_lakka_list, MENU_ENUM_LABEL_CB_LAKKA_LIST)
|
2016-06-21 04:09:13 +02:00
|
|
|
|
|
|
|
static void cb_generic_dir_download(void *task_data,
|
|
|
|
void *user_data, const char *err)
|
|
|
|
{
|
|
|
|
menu_file_transfer_t *transf = (menu_file_transfer_t*)user_data;
|
|
|
|
|
2017-01-03 12:00:45 -05:00
|
|
|
if (transf)
|
|
|
|
{
|
|
|
|
generic_action_ok_network(transf->path, transf->path, 0, 0, 0,
|
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST);
|
|
|
|
|
|
|
|
free(transf);
|
|
|
|
}
|
2016-06-21 04:09:13 +02:00
|
|
|
}
|
|
|
|
|
2016-02-03 15:50:51 +01:00
|
|
|
/* expects http_transfer_t*, menu_file_transfer_t* */
|
|
|
|
static void cb_generic_download(void *task_data,
|
|
|
|
void *user_data, const char *err)
|
|
|
|
{
|
2016-10-08 19:47:26 +02:00
|
|
|
char output_path[PATH_MAX_LENGTH];
|
2017-03-21 23:53:39 -05:00
|
|
|
bool extract = true;
|
2016-02-03 15:50:51 +01:00
|
|
|
const char *dir_path = NULL;
|
|
|
|
menu_file_transfer_t *transf = (menu_file_transfer_t*)user_data;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
|
|
|
|
|
|
|
if (!data || !data->data | !transf)
|
|
|
|
goto finish;
|
|
|
|
|
2016-10-08 19:47:26 +02:00
|
|
|
output_path[0] = '\0';
|
|
|
|
|
2016-02-03 15:50:51 +01:00
|
|
|
/* we have to determine dir_path at the time of writting or else
|
|
|
|
* we'd run into races when the user changes the setting during an
|
|
|
|
* http transfer. */
|
2016-06-18 18:29:55 +02:00
|
|
|
switch (transf->enum_idx)
|
2016-02-03 15:50:51 +01:00
|
|
|
{
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_thumbnails;
|
2016-04-23 22:31:39 +02:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_libretro;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_core_assets;
|
2017-04-28 13:43:47 +02:00
|
|
|
extract = settings->bools.network_buildbot_auto_extract_archive;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.path_libretro_info;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_ASSETS:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_assets;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_autoconfig;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_DATABASES:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.path_content_database;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.directory_overlay;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CHEATS:
|
2017-04-29 00:39:29 +02:00
|
|
|
dir_path = settings->paths.path_cheat_database;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG:
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL:
|
2016-10-08 15:16:01 -05:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG:
|
2016-12-14 16:33:54 +01:00
|
|
|
{
|
|
|
|
static char shaderdir[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *dirname = NULL;
|
|
|
|
|
|
|
|
if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG)
|
|
|
|
dirname = "shaders_cg";
|
|
|
|
else if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL)
|
|
|
|
dirname = "shaders_glsl";
|
|
|
|
else if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG)
|
|
|
|
dirname = "shaders_slang";
|
|
|
|
|
|
|
|
fill_pathname_join(shaderdir,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.directory_video_shader,
|
2016-12-14 16:33:54 +01:00
|
|
|
dirname,
|
|
|
|
sizeof(shaderdir));
|
|
|
|
|
|
|
|
if (!path_file_exists(shaderdir) && !path_mkdir(shaderdir))
|
2016-02-03 15:50:51 +01:00
|
|
|
goto finish;
|
|
|
|
|
2016-12-14 16:33:54 +01:00
|
|
|
dir_path = shaderdir;
|
|
|
|
}
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD:
|
2016-03-23 21:40:41 +07:00
|
|
|
dir_path = LAKKA_UPDATE_DIR;
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
|
|
|
default:
|
2016-06-18 18:29:55 +02:00
|
|
|
RARCH_WARN("Unknown transfer type '%s' bailing out.\n",
|
2016-06-20 00:31:13 +02:00
|
|
|
msg_hash_to_str(transf->enum_idx));
|
2016-02-03 15:50:51 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-06-29 12:13:40 +02:00
|
|
|
if (!string_is_empty(dir_path))
|
|
|
|
fill_pathname_join(output_path, dir_path,
|
|
|
|
transf->path, sizeof(output_path));
|
2016-02-03 15:50:51 +01:00
|
|
|
|
|
|
|
/* Make sure the directory exists */
|
2016-12-17 11:54:46 +01:00
|
|
|
path_basedir_wrapper(output_path);
|
2016-06-29 12:13:40 +02:00
|
|
|
|
2016-02-03 15:50:51 +01:00
|
|
|
if (!path_mkdir(output_path))
|
|
|
|
{
|
2016-07-01 05:42:53 +02:00
|
|
|
err = msg_hash_to_str(MSG_FAILED_TO_CREATE_THE_DIRECTORY);
|
2016-02-03 15:50:51 +01:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2016-06-05 19:04:59 +02:00
|
|
|
if (!string_is_empty(dir_path))
|
|
|
|
fill_pathname_join(output_path, dir_path,
|
|
|
|
transf->path, sizeof(output_path));
|
2016-02-03 15:50:51 +01:00
|
|
|
|
2016-10-13 15:04:26 -04:00
|
|
|
#ifdef HAVE_COMPRESSION
|
|
|
|
if (path_is_compressed_file(output_path))
|
2016-05-05 09:45:56 +10:00
|
|
|
{
|
2016-05-27 18:14:47 +02:00
|
|
|
if (task_check_decompress(output_path))
|
2016-05-05 09:45:56 +10:00
|
|
|
{
|
2016-07-01 05:42:53 +02:00
|
|
|
err = msg_hash_to_str(MSG_DECOMPRESSION_ALREADY_IN_PROGRESS);
|
2016-05-05 09:45:56 +10:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-03-24 04:09:25 +01:00
|
|
|
if (!filestream_write_file(output_path, data->data, data->len))
|
2016-02-03 15:50:51 +01:00
|
|
|
{
|
|
|
|
err = "Write failed.";
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2016-10-30 03:27:43 +01:00
|
|
|
#if defined(HAVE_COMPRESSION) && defined(HAVE_ZLIB)
|
2017-03-21 23:53:39 -05:00
|
|
|
if (!extract)
|
2016-02-03 15:50:51 +01:00
|
|
|
goto finish;
|
|
|
|
|
2016-10-13 15:04:26 -04:00
|
|
|
if (path_is_compressed_file(output_path))
|
2016-02-03 15:50:51 +01:00
|
|
|
{
|
2016-07-01 05:42:53 +02:00
|
|
|
if (!task_push_decompress(output_path, dir_path,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
cb_decompressed, (void*)(uintptr_t)
|
|
|
|
msg_hash_calculate(msg_hash_to_str(transf->enum_idx))))
|
2016-05-04 15:21:48 +10:00
|
|
|
{
|
2016-07-01 05:42:53 +02:00
|
|
|
err = msg_hash_to_str(MSG_DECOMPRESSION_FAILED);
|
2016-05-04 15:21:48 +10:00
|
|
|
goto finish;
|
|
|
|
}
|
2016-02-03 15:50:51 +01:00
|
|
|
}
|
|
|
|
#else
|
2016-06-18 18:29:55 +02:00
|
|
|
switch (transf->enum_idx)
|
2016-04-23 22:31:39 +02:00
|
|
|
{
|
2016-06-18 18:29:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD:
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_CORE_INFO_INIT);
|
2016-04-23 22:31:39 +02:00
|
|
|
break;
|
2016-06-18 18:29:55 +02:00
|
|
|
default:
|
|
|
|
break;
|
2016-04-23 22:31:39 +02:00
|
|
|
}
|
2016-02-03 15:50:51 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
finish:
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
RARCH_ERR("Download of '%s' failed: %s\n",
|
|
|
|
(transf ? transf->path: "unknown"), err);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
if (data->data)
|
|
|
|
free(data->data);
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (transf)
|
|
|
|
free(transf);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-06-21 02:24:10 +02:00
|
|
|
|
2015-06-24 15:56:49 +02:00
|
|
|
static int action_ok_download_generic(const char *path,
|
2016-06-21 05:21:19 +02:00
|
|
|
const char *label, const char *menu_label,
|
|
|
|
unsigned type, size_t idx, size_t entry_idx,
|
2016-06-20 00:31:13 +02:00
|
|
|
enum msg_hash_enums enum_idx)
|
2015-06-24 15:56:49 +02:00
|
|
|
{
|
2015-09-03 23:50:18 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-10-08 19:47:26 +02:00
|
|
|
char s[PATH_MAX_LENGTH];
|
|
|
|
char s3[PATH_MAX_LENGTH];
|
2016-01-25 18:19:19 +01:00
|
|
|
menu_file_transfer_t *transf = NULL;
|
|
|
|
settings_t *settings = config_get_ptr();
|
2016-07-12 23:33:51 +02:00
|
|
|
bool suppress_msg = false;
|
2016-06-21 04:09:13 +02:00
|
|
|
retro_task_callback_t cb = cb_generic_download;
|
2015-03-14 16:12:20 +01:00
|
|
|
|
2016-10-08 19:47:26 +02:00
|
|
|
s[0] = s3[0] = '\0';
|
|
|
|
|
2016-07-01 05:17:04 +02:00
|
|
|
fill_pathname_join(s,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.network_buildbot_assets_url,
|
2015-06-24 17:34:07 +02:00
|
|
|
"frontend", sizeof(s));
|
2016-06-18 18:23:09 +02:00
|
|
|
|
|
|
|
switch (enum_idx)
|
|
|
|
{
|
2016-06-21 01:40:55 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_DOWNLOAD_URL:
|
2016-07-12 23:33:51 +02:00
|
|
|
suppress_msg = true;
|
2016-06-21 01:40:55 +02:00
|
|
|
fill_pathname_join(s, label,
|
|
|
|
path, sizeof(s));
|
2016-06-27 21:15:26 +02:00
|
|
|
path = s;
|
2016-06-21 04:09:13 +02:00
|
|
|
cb = cb_generic_dir_download;
|
|
|
|
break;
|
2016-06-18 18:23:09 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD:
|
2016-07-13 04:25:09 +02:00
|
|
|
{
|
|
|
|
struct string_list *str_list = string_split(menu_label, ";");
|
|
|
|
strlcpy(s, str_list->elems[0].data, sizeof(s));
|
|
|
|
string_list_free(str_list);
|
|
|
|
}
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD:
|
2015-12-25 02:13:50 +07:00
|
|
|
#ifdef HAVE_LAKKA
|
2016-06-18 18:23:09 +02:00
|
|
|
/* TODO unhardcode this path*/
|
2016-06-20 21:03:54 +02:00
|
|
|
fill_pathname_join(s, file_path_str(FILE_PATH_LAKKA_URL),
|
2016-11-15 10:18:21 +01:00
|
|
|
lakka_get_project(), sizeof(s));
|
2015-12-25 02:13:50 +07:00
|
|
|
#endif
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_ASSETS:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_ASSETS_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_AUTOCONFIG_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_CORE_INFO_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CHEATS:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_CHEATS_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_OVERLAYS_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_DATABASES:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_DATABASE_RDB_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_SHADERS_GLSL_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
2016-10-08 15:16:01 -05:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG:
|
|
|
|
path = file_path_str(FILE_PATH_SHADERS_SLANG_ZIP);
|
|
|
|
break;
|
2016-06-18 18:23:09 +02:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG:
|
2016-06-20 21:03:54 +02:00
|
|
|
path = file_path_str(FILE_PATH_SHADERS_CG_ZIP);
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD:
|
2016-06-20 21:03:54 +02:00
|
|
|
strlcpy(s, file_path_str(FILE_PATH_CORE_THUMBNAILS_URL), sizeof(s));
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
default:
|
2017-04-29 00:39:29 +02:00
|
|
|
strlcpy(s, settings->paths.network_buildbot_url, sizeof(s));
|
2016-06-18 18:23:09 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-06-24 17:34:07 +02:00
|
|
|
|
2015-10-28 17:02:38 +01:00
|
|
|
fill_pathname_join(s3, s, path, sizeof(s3));
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2016-06-18 18:29:55 +02:00
|
|
|
transf = (menu_file_transfer_t*)calloc(1, sizeof(*transf));
|
|
|
|
transf->enum_idx = enum_idx;
|
2015-11-23 11:13:26 -03:00
|
|
|
strlcpy(transf->path, path, sizeof(transf->path));
|
2015-06-24 16:17:29 +02:00
|
|
|
|
2016-07-12 23:33:51 +02:00
|
|
|
task_push_http_transfer(s3, suppress_msg, msg_hash_to_str(enum_idx), cb, transf);
|
2015-09-03 23:50:18 +02:00
|
|
|
#endif
|
2015-06-24 15:56:49 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2015-07-04 04:01:35 +02:00
|
|
|
static int action_ok_core_content_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 05:21:19 +02:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
|
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
|
|
|
|
2016-07-01 05:17:04 +02:00
|
|
|
return action_ok_download_generic(path, label,
|
|
|
|
menu_path, type, idx, entry_idx,
|
2016-06-18 18:23:09 +02:00
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD);
|
2015-07-04 04:01:35 +02:00
|
|
|
}
|
|
|
|
|
2017-11-26 07:04:05 +01:00
|
|
|
#define default_action_ok_download(funcname, _id) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,_id); \
|
|
|
|
}
|
|
|
|
|
|
|
|
default_action_ok_download(action_ok_core_content_thumbnails, MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD)
|
|
|
|
default_action_ok_download(action_ok_thumbnails_updater_download, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_DOWNLOAD)
|
|
|
|
default_action_ok_download(action_ok_download_url, MENU_ENUM_LABEL_CB_DOWNLOAD_URL)
|
|
|
|
default_action_ok_download(action_ok_core_updater_download, MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD)
|
|
|
|
default_action_ok_download(action_ok_lakka_download, MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD)
|
|
|
|
default_action_ok_download(action_ok_update_assets, MENU_ENUM_LABEL_CB_UPDATE_ASSETS)
|
|
|
|
default_action_ok_download(action_ok_update_core_info_files, MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES)
|
|
|
|
default_action_ok_download(action_ok_update_overlays, MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS)
|
|
|
|
default_action_ok_download(action_ok_update_shaders_cg, MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG)
|
|
|
|
default_action_ok_download(action_ok_update_shaders_glsl, MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL)
|
|
|
|
default_action_ok_download(action_ok_update_shaders_slang, MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG)
|
|
|
|
default_action_ok_download(action_ok_update_databases, MENU_ENUM_LABEL_CB_UPDATE_DATABASES)
|
|
|
|
default_action_ok_download(action_ok_update_cheats, MENU_ENUM_LABEL_CB_UPDATE_CHEATS)
|
|
|
|
default_action_ok_download(action_ok_update_autoconfig_profiles, MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES)
|
2015-09-03 23:38:07 +02:00
|
|
|
|
2016-01-26 02:21:03 +01:00
|
|
|
/* creates folder and core options stub file for subsequent runs */
|
|
|
|
static int action_ok_option_create(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-10-09 09:23:00 +02:00
|
|
|
char game_path[PATH_MAX_LENGTH];
|
2016-06-03 04:59:12 +02:00
|
|
|
config_file_t *conf = NULL;
|
2016-01-26 02:21:03 +01:00
|
|
|
|
2016-10-09 09:23:00 +02:00
|
|
|
game_path[0] = '\0';
|
|
|
|
|
2016-05-09 07:09:26 +02:00
|
|
|
if (!retroarch_validate_game_options(game_path, sizeof(game_path), true))
|
2016-01-26 02:21:03 +01:00
|
|
|
{
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-01 05:42:53 +02:00
|
|
|
msg_hash_to_str(MSG_ERROR_SAVING_CORE_OPTIONS_FILE),
|
2016-01-25 18:14:14 +01:00
|
|
|
1, 100, true);
|
2016-01-26 02:21:03 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-01-31 01:54:12 -05:00
|
|
|
conf = config_file_new(game_path);
|
|
|
|
|
|
|
|
if (!conf)
|
|
|
|
{
|
|
|
|
conf = config_file_new(NULL);
|
|
|
|
if (!conf)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(config_file_write(conf, game_path))
|
|
|
|
{
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-07-01 05:42:53 +02:00
|
|
|
msg_hash_to_str(MSG_CORE_OPTIONS_FILE_CREATED_SUCCESSFULLY),
|
2016-01-26 02:21:03 +01:00
|
|
|
1, 100, true);
|
2016-09-29 07:40:14 +02:00
|
|
|
path_set(RARCH_PATH_CORE_OPTIONS, game_path);
|
2016-01-31 01:54:12 -05:00
|
|
|
}
|
2016-01-31 02:16:55 -05:00
|
|
|
config_file_free(conf);
|
2016-01-26 02:21:03 +01:00
|
|
|
|
2015-11-15 22:09:39 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-10-21 18:55:00 +07:00
|
|
|
int action_ok_close_content(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
/* This line resets the navigation pointer so the active entry will be "Run" */
|
|
|
|
menu_navigation_set_selection(0);
|
|
|
|
return generic_action_ok_command(CMD_EVENT_UNLOAD_CORE);
|
|
|
|
}
|
|
|
|
|
2017-08-13 06:57:32 +02:00
|
|
|
#define default_action_ok_cmd_func(func_name, cmd) \
|
|
|
|
int (func_name)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return generic_action_ok_command(cmd); \
|
2015-09-04 13:08:15 +02:00
|
|
|
}
|
2015-09-04 00:27:55 +02:00
|
|
|
|
2017-11-26 07:17:31 +01:00
|
|
|
default_action_ok_cmd_func(action_ok_cheat_apply_changes,CMD_EVENT_CHEATS_APPLY)
|
2017-08-13 06:57:32 +02:00
|
|
|
default_action_ok_cmd_func(action_ok_quit, CMD_EVENT_QUIT)
|
|
|
|
default_action_ok_cmd_func(action_ok_save_new_config, CMD_EVENT_MENU_SAVE_CONFIG)
|
|
|
|
default_action_ok_cmd_func(action_ok_resume_content, CMD_EVENT_RESUME)
|
|
|
|
default_action_ok_cmd_func(action_ok_restart_content, CMD_EVENT_RESET)
|
|
|
|
default_action_ok_cmd_func(action_ok_screenshot, CMD_EVENT_TAKE_SCREENSHOT)
|
|
|
|
default_action_ok_cmd_func(action_ok_disk_cycle_tray_status, CMD_EVENT_DISK_EJECT_TOGGLE )
|
|
|
|
default_action_ok_cmd_func(action_ok_shader_apply_changes, CMD_EVENT_SHADERS_APPLY_CHANGES )
|
2017-11-16 15:41:37 +01:00
|
|
|
|
|
|
|
static int action_ok_add_to_favorites(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
void *new_path = (void*)path_get(RARCH_PATH_CONTENT);
|
|
|
|
if (!command_event(CMD_EVENT_ADD_TO_FAVORITES, new_path))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_add_to_favorites_playlist(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
const char *tmp_path = NULL;
|
|
|
|
playlist_t *tmp_playlist = NULL;
|
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
playlist_get_index(tmp_playlist,
|
|
|
|
rpl_entry_selection_ptr, &tmp_path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
if (!command_event(CMD_EVENT_ADD_TO_FAVORITES, (void*)tmp_path))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return 0;
|
|
|
|
}
|
2015-09-04 00:27:55 +02:00
|
|
|
|
2017-08-14 20:07:43 +02:00
|
|
|
|
2016-08-29 01:17:02 +02:00
|
|
|
static int action_ok_delete_entry(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-08-29 17:09:45 +02:00
|
|
|
size_t new_selection_ptr;
|
2017-08-14 02:49:55 +02:00
|
|
|
playlist_t *playlist = NULL;
|
|
|
|
char *conf_path = NULL;
|
|
|
|
char *def_conf_path = NULL;
|
|
|
|
char *def_conf_music_path = NULL;
|
2017-07-01 03:38:36 +02:00
|
|
|
#ifdef HAVE_FFMPEG
|
2017-08-14 02:49:55 +02:00
|
|
|
char *def_conf_video_path = NULL;
|
2017-07-01 03:38:36 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2017-08-14 02:49:55 +02:00
|
|
|
char *def_conf_img_path = NULL;
|
2017-07-01 03:38:36 +02:00
|
|
|
#endif
|
2016-08-29 01:17:02 +02:00
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
|
|
|
|
|
2017-08-14 02:49:55 +02:00
|
|
|
conf_path = playlist_get_conf_path(playlist);
|
|
|
|
def_conf_path = playlist_get_conf_path(g_defaults.content_history);
|
|
|
|
def_conf_music_path = playlist_get_conf_path(g_defaults.music_history);
|
|
|
|
#ifdef HAVE_FFMPEG
|
|
|
|
def_conf_video_path = playlist_get_conf_path(g_defaults.video_history);
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
|
|
|
def_conf_img_path = playlist_get_conf_path(g_defaults.image_history);
|
|
|
|
#endif
|
|
|
|
|
2017-07-01 03:38:36 +02:00
|
|
|
if (string_is_equal(conf_path, def_conf_path))
|
2016-08-29 02:39:02 +02:00
|
|
|
playlist = g_defaults.content_history;
|
2017-07-01 03:38:36 +02:00
|
|
|
else if (string_is_equal(conf_path, def_conf_music_path))
|
2016-08-29 02:22:05 +02:00
|
|
|
playlist = g_defaults.music_history;
|
2017-05-28 00:09:08 +02:00
|
|
|
#ifdef HAVE_FFMPEG
|
2017-07-01 03:38:36 +02:00
|
|
|
else if (string_is_equal(conf_path, def_conf_video_path))
|
2016-08-29 02:22:05 +02:00
|
|
|
playlist = g_defaults.video_history;
|
2016-08-29 02:39:02 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IMAGEVIEWER
|
2017-07-01 03:38:36 +02:00
|
|
|
else if (string_is_equal(conf_path, def_conf_img_path))
|
2016-08-29 02:22:05 +02:00
|
|
|
playlist = g_defaults.image_history;
|
2016-08-29 02:39:02 +02:00
|
|
|
#endif
|
|
|
|
|
2017-11-25 23:39:31 +01:00
|
|
|
if (playlist)
|
|
|
|
{
|
|
|
|
playlist_delete_index(playlist, rpl_entry_selection_ptr);
|
|
|
|
playlist_write_file(playlist);
|
|
|
|
}
|
2016-08-29 01:17:02 +02:00
|
|
|
|
2017-04-23 14:31:49 +02:00
|
|
|
new_selection_ptr = menu_navigation_get_selection();
|
2016-08-29 01:46:58 +02:00
|
|
|
menu_entries_pop_stack(&new_selection_ptr, 0, 1);
|
2017-04-23 14:31:49 +02:00
|
|
|
menu_navigation_set_selection(new_selection_ptr);
|
2016-08-29 01:46:58 +02:00
|
|
|
|
2016-08-29 01:17:02 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-09-26 14:41:07 +02:00
|
|
|
|
2015-09-04 00:44:09 +02:00
|
|
|
static int action_ok_rdb_entry_submenu(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
union string_list_elem_attr attr;
|
2016-10-08 19:44:03 +02:00
|
|
|
char new_label[PATH_MAX_LENGTH];
|
|
|
|
char new_path[PATH_MAX_LENGTH];
|
2016-06-03 04:59:12 +02:00
|
|
|
int ret = -1;
|
2015-09-04 00:44:09 +02:00
|
|
|
char *rdb = NULL;
|
|
|
|
int len = 0;
|
|
|
|
struct string_list *str_list = NULL;
|
|
|
|
struct string_list *str_list2 = NULL;
|
|
|
|
|
2015-10-17 17:56:19 +02:00
|
|
|
if (!label)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-09-04 00:44:09 +02:00
|
|
|
|
2016-10-08 19:44:03 +02:00
|
|
|
new_label[0] = new_path[0] = '\0';
|
|
|
|
|
2015-09-04 00:44:09 +02:00
|
|
|
str_list = string_split(label, "|");
|
|
|
|
|
|
|
|
if (!str_list)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
str_list2 = string_list_new();
|
|
|
|
if (!str_list2)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
/* element 0 : label
|
|
|
|
* element 1 : value
|
|
|
|
* element 2 : database path
|
|
|
|
*/
|
|
|
|
|
|
|
|
attr.i = 0;
|
|
|
|
|
|
|
|
len += strlen(str_list->elems[1].data) + 1;
|
|
|
|
string_list_append(str_list2, str_list->elems[1].data, attr);
|
|
|
|
|
|
|
|
len += strlen(str_list->elems[2].data) + 1;
|
|
|
|
string_list_append(str_list2, str_list->elems[2].data, attr);
|
|
|
|
|
|
|
|
rdb = (char*)calloc(len, sizeof(char));
|
|
|
|
|
|
|
|
if (!rdb)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
string_list_join_concat(rdb, len, str_list2, "|");
|
|
|
|
strlcpy(new_path, rdb, sizeof(new_path));
|
|
|
|
|
2016-09-25 00:13:33 -04:00
|
|
|
fill_pathname_join_delim(new_label,
|
2016-06-20 00:31:13 +02:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST),
|
2015-09-04 00:44:09 +02:00
|
|
|
str_list->elems[0].data, '_',
|
|
|
|
sizeof(new_label));
|
|
|
|
|
2016-07-09 18:06:50 +02:00
|
|
|
ret = generic_action_ok_displaylist_push(new_path, NULL,
|
2015-09-04 00:44:09 +02:00
|
|
|
new_label, type, idx, entry_idx,
|
|
|
|
ACTION_OK_DL_RDB_ENTRY_SUBMENU);
|
|
|
|
|
|
|
|
end:
|
2016-02-10 20:01:38 +01:00
|
|
|
if (rdb)
|
|
|
|
free(rdb);
|
2015-09-04 00:44:09 +02:00
|
|
|
if (str_list)
|
|
|
|
string_list_free(str_list);
|
|
|
|
if (str_list2)
|
|
|
|
string_list_free(str_list2);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-09-03 22:56:30 +02:00
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
extern size_t hack_shader_pass;
|
|
|
|
#endif
|
|
|
|
|
2017-08-13 06:36:53 +02:00
|
|
|
#define default_action_ok_func(func_name, lbl) \
|
|
|
|
int (func_name)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx, entry_idx, lbl); \
|
|
|
|
}
|
|
|
|
|
|
|
|
default_action_ok_func(action_ok_browse_url_start, ACTION_OK_DL_BROWSE_URL_START)
|
2017-08-16 00:01:56 +02:00
|
|
|
default_action_ok_func(action_ok_goto_favorites, ACTION_OK_DL_FAVORITES_LIST)
|
2017-08-16 03:15:04 +02:00
|
|
|
default_action_ok_func(action_ok_goto_images, ACTION_OK_DL_IMAGES_LIST)
|
|
|
|
default_action_ok_func(action_ok_goto_video, ACTION_OK_DL_VIDEO_LIST)
|
|
|
|
default_action_ok_func(action_ok_goto_music, ACTION_OK_DL_MUSIC_LIST)
|
2017-08-13 06:36:53 +02:00
|
|
|
default_action_ok_func(action_ok_shader_parameters, ACTION_OK_DL_SHADER_PARAMETERS)
|
|
|
|
default_action_ok_func(action_ok_parent_directory_push, ACTION_OK_DL_PARENT_DIRECTORY_PUSH)
|
|
|
|
default_action_ok_func(action_ok_directory_push, ACTION_OK_DL_DIRECTORY_PUSH)
|
|
|
|
default_action_ok_func(action_ok_configurations_list, ACTION_OK_DL_CONFIGURATIONS_LIST)
|
|
|
|
default_action_ok_func(action_ok_saving_list, ACTION_OK_DL_SAVING_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_network_list, ACTION_OK_DL_NETWORK_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_database_manager_list, ACTION_OK_DL_DATABASE_MANAGER_LIST)
|
|
|
|
default_action_ok_func(action_ok_wifi_list, ACTION_OK_DL_WIFI_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_cursor_manager_list, ACTION_OK_DL_CURSOR_MANAGER_LIST)
|
|
|
|
default_action_ok_func(action_ok_compressed_archive_push, ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH)
|
|
|
|
default_action_ok_func(action_ok_compressed_archive_push_detect_core, ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE)
|
|
|
|
default_action_ok_func(action_ok_logging_list, ACTION_OK_DL_LOGGING_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_frame_throttle_list, ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_rewind_list, ACTION_OK_DL_REWIND_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_onscreen_display_list, ACTION_OK_DL_ONSCREEN_DISPLAY_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_onscreen_notifications_list, ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_onscreen_overlay_list, ACTION_OK_DL_ONSCREEN_OVERLAY_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_menu_list, ACTION_OK_DL_MENU_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_menu_views_list, ACTION_OK_DL_MENU_VIEWS_SETTINGS_LIST)
|
2017-10-09 08:14:52 +02:00
|
|
|
default_action_ok_func(action_ok_quick_menu_views_list, ACTION_OK_DL_QUICK_MENU_VIEWS_SETTINGS_LIST)
|
2017-08-13 06:36:53 +02:00
|
|
|
default_action_ok_func(action_ok_user_interface_list, ACTION_OK_DL_USER_INTERFACE_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_menu_file_browser_list, ACTION_OK_DL_MENU_FILE_BROWSER_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_retro_achievements_list, ACTION_OK_DL_RETRO_ACHIEVEMENTS_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_updater_list, ACTION_OK_DL_UPDATER_SETTINGS_LIST)
|
2017-08-13 06:49:51 +02:00
|
|
|
default_action_ok_func(action_ok_lakka_services, ACTION_OK_DL_LAKKA_SERVICES_LIST)
|
|
|
|
default_action_ok_func(action_ok_user_list, ACTION_OK_DL_USER_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_netplay_sublist, ACTION_OK_DL_NETPLAY)
|
|
|
|
default_action_ok_func(action_ok_directory_list, ACTION_OK_DL_DIRECTORY_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_privacy_list, ACTION_OK_DL_PRIVACY_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_rdb_entry, ACTION_OK_DL_RDB_ENTRY)
|
|
|
|
default_action_ok_func(action_ok_browse_url_list, ACTION_OK_DL_BROWSE_URL_LIST)
|
|
|
|
default_action_ok_func(action_ok_core_list, ACTION_OK_DL_CORE_LIST)
|
|
|
|
default_action_ok_func(action_ok_cheat_file, ACTION_OK_DL_CHEAT_FILE)
|
|
|
|
default_action_ok_func(action_ok_playlist_collection, ACTION_OK_DL_PLAYLIST_COLLECTION)
|
|
|
|
default_action_ok_func(action_ok_disk_image_append_list, ACTION_OK_DL_DISK_IMAGE_APPEND_LIST)
|
|
|
|
default_action_ok_func(action_ok_record_configfile, ACTION_OK_DL_RECORD_CONFIGFILE)
|
|
|
|
default_action_ok_func(action_ok_remap_file, ACTION_OK_DL_REMAP_FILE)
|
|
|
|
default_action_ok_func(action_ok_shader_preset, ACTION_OK_DL_SHADER_PRESET)
|
|
|
|
default_action_ok_func(action_ok_push_generic_list, ACTION_OK_DL_GENERIC)
|
|
|
|
default_action_ok_func(action_ok_audio_dsp_plugin, ACTION_OK_DL_AUDIO_DSP_PLUGIN)
|
|
|
|
default_action_ok_func(action_ok_rpl_entry, ACTION_OK_DL_RPL_ENTRY)
|
|
|
|
default_action_ok_func(action_ok_open_archive_detect_core, ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE)
|
|
|
|
default_action_ok_func(action_ok_file_load_music, ACTION_OK_DL_MUSIC)
|
|
|
|
default_action_ok_func(action_ok_push_accounts_list, ACTION_OK_DL_ACCOUNTS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_driver_settings_list, ACTION_OK_DL_DRIVER_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_video_settings_list, ACTION_OK_DL_VIDEO_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_configuration_settings_list, ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_core_settings_list, ACTION_OK_DL_CORE_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_audio_settings_list, ACTION_OK_DL_AUDIO_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_input_settings_list, ACTION_OK_DL_INPUT_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_recording_settings_list, ACTION_OK_DL_RECORDING_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_playlist_settings_list, ACTION_OK_DL_PLAYLIST_SETTINGS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_input_hotkey_binds_list, ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_user_binds_list, ACTION_OK_DL_USER_BINDS_LIST)
|
|
|
|
default_action_ok_func(action_ok_push_accounts_cheevos_list, ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST)
|
|
|
|
default_action_ok_func(action_ok_open_archive, ACTION_OK_DL_OPEN_ARCHIVE)
|
2016-12-27 00:02:09 +01:00
|
|
|
|
2015-09-03 22:56:30 +02:00
|
|
|
static int action_ok_shader_pass(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
hack_shader_pass = type - MENU_SETTINGS_SHADER_PASS_0;
|
2016-07-09 18:06:50 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
2015-09-03 22:56:30 +02:00
|
|
|
entry_idx, ACTION_OK_DL_SHADER_PASS);
|
|
|
|
}
|
|
|
|
|
2017-01-19 23:44:10 -05:00
|
|
|
static int action_ok_netplay_connect_room(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-01-20 15:13:38 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-08-10 23:14:03 +02:00
|
|
|
char tmp_hostname[4115];
|
2017-01-20 15:13:38 -05:00
|
|
|
|
2017-01-22 21:19:39 +01:00
|
|
|
tmp_hostname[0] = '\0';
|
|
|
|
|
2017-01-20 15:13:38 -05:00
|
|
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_NETPLAY_DEINIT);
|
2017-01-20 15:13:38 -05:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
|
|
|
|
2017-05-27 12:59:34 -05:00
|
|
|
if (netplay_room_list[idx - 3].host_method == NETPLAY_HOST_METHOD_MITM)
|
2017-03-04 21:36:44 -05:00
|
|
|
{
|
|
|
|
snprintf(tmp_hostname,
|
|
|
|
sizeof(tmp_hostname),
|
2017-05-21 22:48:30 -05:00
|
|
|
"%s|%d",
|
2017-05-27 12:59:34 -05:00
|
|
|
netplay_room_list[idx - 3].mitm_address,
|
|
|
|
netplay_room_list[idx - 3].mitm_port);
|
2017-03-04 21:36:44 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(tmp_hostname,
|
|
|
|
sizeof(tmp_hostname),
|
2017-05-21 22:48:30 -05:00
|
|
|
"%s|%d",
|
2017-05-27 12:59:34 -05:00
|
|
|
netplay_room_list[idx - 3].address,
|
|
|
|
netplay_room_list[idx - 3].port);
|
2017-03-04 21:36:44 -05:00
|
|
|
}
|
2017-01-22 21:19:39 +01:00
|
|
|
|
2017-08-17 18:53:55 +02:00
|
|
|
#if 0
|
2017-08-13 21:20:22 -04:00
|
|
|
RARCH_LOG("[lobby] connecting to: %s with game: %s/%08x\n",
|
2017-01-23 19:58:25 -05:00
|
|
|
tmp_hostname,
|
2017-05-27 12:59:34 -05:00
|
|
|
netplay_room_list[idx - 3].gamename,
|
|
|
|
netplay_room_list[idx - 3].gamecrc);
|
2017-08-17 18:53:55 +02:00
|
|
|
#endif
|
2017-01-22 21:19:39 +01:00
|
|
|
|
2017-05-27 12:59:34 -05:00
|
|
|
task_push_netplay_crc_scan(netplay_room_list[idx - 3].gamecrc,
|
|
|
|
netplay_room_list[idx - 3].gamename,
|
|
|
|
tmp_hostname, netplay_room_list[idx - 3].corename);
|
2017-01-20 15:13:38 -05:00
|
|
|
|
|
|
|
#else
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
#endif
|
2017-01-19 23:44:10 -05:00
|
|
|
return 0;
|
|
|
|
}
|
2017-01-20 15:13:38 -05:00
|
|
|
|
2016-09-22 16:44:51 +02:00
|
|
|
|
2016-12-02 22:40:26 -05:00
|
|
|
static int action_ok_netplay_lan_scan(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-12-03 00:03:29 -05:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-01-22 21:19:39 +01:00
|
|
|
struct netplay_host_list *hosts = NULL;
|
|
|
|
struct netplay_host *host = NULL;
|
2016-12-02 22:40:26 -05:00
|
|
|
|
|
|
|
/* Figure out what host we're connecting to */
|
|
|
|
if (!netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &hosts))
|
|
|
|
return -1;
|
|
|
|
if (entry_idx >= hosts->size)
|
|
|
|
return -1;
|
|
|
|
host = &hosts->hosts[entry_idx];
|
|
|
|
|
|
|
|
/* Enable Netplay client mode */
|
|
|
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_NETPLAY_DEINIT);
|
2016-12-02 22:40:26 -05:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
|
|
|
|
|
|
|
/* Enable Netplay */
|
2017-08-13 00:55:47 +02:00
|
|
|
if (command_event(CMD_EVENT_NETPLAY_INIT_DIRECT, (void *) host))
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-12-03 00:03:29 -05:00
|
|
|
#endif
|
2017-08-13 00:55:47 +02:00
|
|
|
return -1;
|
2016-12-26 06:39:12 +01:00
|
|
|
}
|
|
|
|
|
2017-11-26 07:10:18 +01:00
|
|
|
#define default_action_ok_dl_push(funcname, _fbid, _id, _path) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
settings_t *settings = config_get_ptr(); \
|
|
|
|
(void)settings; \
|
|
|
|
filebrowser_set_type(_fbid); \
|
|
|
|
return generic_action_ok_displaylist_push(path, _path, label, type, idx, entry_idx, _id); \
|
2015-09-03 23:22:16 +02:00
|
|
|
}
|
|
|
|
|
2017-11-26 07:10:18 +01:00
|
|
|
default_action_ok_dl_push(action_ok_content_collection_list, FILEBROWSER_SELECT_COLLECTION, ACTION_OK_DL_CONTENT_COLLECTION_LIST, NULL)
|
|
|
|
default_action_ok_dl_push(action_ok_push_content_list, FILEBROWSER_SELECT_FILE, ACTION_OK_DL_CONTENT_LIST, settings->paths.directory_menu_content)
|
|
|
|
default_action_ok_dl_push(action_ok_push_scan_file, FILEBROWSER_SCAN_FILE, ACTION_OK_DL_CONTENT_LIST, settings->paths.directory_menu_content)
|
2016-12-22 20:49:25 +01:00
|
|
|
|
2017-01-22 21:19:39 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-05-15 19:45:23 -05:00
|
|
|
struct netplay_host_list *lan_hosts;
|
|
|
|
int lan_room_count;
|
2017-08-16 05:45:51 +02:00
|
|
|
|
2017-05-15 19:25:56 -05:00
|
|
|
void netplay_refresh_rooms_menu(file_list_t *list)
|
|
|
|
{
|
2017-08-10 23:14:03 +02:00
|
|
|
char s[4115];
|
2017-05-15 19:45:23 -05:00
|
|
|
int i = 0;
|
|
|
|
|
2017-05-16 00:34:28 -05:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, list);
|
|
|
|
|
|
|
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL) &&
|
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_SERVER, NULL))
|
|
|
|
{
|
|
|
|
menu_entries_append_enum(list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_DISABLE_HOST),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_DISCONNECT),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
}
|
|
|
|
else if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL) &&
|
|
|
|
!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_SERVER, NULL) &&
|
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_CONNECTED, NULL))
|
|
|
|
{
|
|
|
|
menu_entries_append_enum(list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_DISCONNECT),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
menu_entries_append_enum(list,
|
2017-05-27 12:59:34 -05:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
2017-05-16 00:34:28 -05:00
|
|
|
}
|
|
|
|
|
2017-05-27 12:59:34 -05:00
|
|
|
menu_entries_append_enum(list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
|
2017-05-16 00:34:28 -05:00
|
|
|
menu_entries_append_enum(list,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_REFRESH_ROOMS),
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_REFRESH_ROOMS),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_REFRESH_ROOMS,
|
|
|
|
MENU_SETTING_ACTION, 0, 0);
|
|
|
|
|
2017-05-15 19:25:56 -05:00
|
|
|
if (netplay_room_count != 0)
|
|
|
|
{
|
|
|
|
for (i = 0; i < netplay_room_count; i++)
|
|
|
|
{
|
2017-07-29 02:24:11 +00:00
|
|
|
char country[PATH_MAX_LENGTH] = {0};
|
|
|
|
|
|
|
|
if (*netplay_room_list[i].country)
|
|
|
|
{
|
|
|
|
strlcat(country, " (", sizeof(country));
|
|
|
|
strlcat(country, netplay_room_list[i].country, sizeof(country));
|
|
|
|
strlcat(country, ")", sizeof(country));
|
|
|
|
}
|
|
|
|
|
2017-05-15 19:25:56 -05:00
|
|
|
/* Uncomment this to debug mismatched room parameters*/
|
|
|
|
#if 0
|
2017-07-09 18:19:56 -05:00
|
|
|
RARCH_LOG("[lobby] room Data: %d\n"
|
2017-05-15 19:25:56 -05:00
|
|
|
"Nickname: %s\n"
|
|
|
|
"Address: %s\n"
|
|
|
|
"Port: %d\n"
|
|
|
|
"Core: %s\n"
|
|
|
|
"Core Version: %s\n"
|
|
|
|
"Game: %s\n"
|
|
|
|
"Game CRC: %08x\n"
|
|
|
|
"Timestamp: %d\n", room_data->elems[j + 6].data,
|
|
|
|
netplay_room_list[i].nickname,
|
|
|
|
netplay_room_list[i].address,
|
|
|
|
netplay_room_list[i].port,
|
|
|
|
netplay_room_list[i].corename,
|
|
|
|
netplay_room_list[i].coreversion,
|
|
|
|
netplay_room_list[i].gamename,
|
|
|
|
netplay_room_list[i].gamecrc,
|
|
|
|
netplay_room_list[i].timestamp);
|
|
|
|
#endif
|
2017-08-15 20:20:24 -05:00
|
|
|
|
2017-07-29 02:24:11 +00:00
|
|
|
snprintf(s, sizeof(s), "%s: %s%s",
|
|
|
|
netplay_room_list[i].lan ? "Local" :
|
|
|
|
(netplay_room_list[i].host_method == NETPLAY_HOST_METHOD_MITM ?
|
2017-07-24 20:52:27 -05:00
|
|
|
"Internet (relay)" : "Internet (direct)"),
|
2017-07-29 02:24:11 +00:00
|
|
|
netplay_room_list[i].nickname, country);
|
2017-07-09 18:19:56 -05:00
|
|
|
|
2017-05-15 19:25:56 -05:00
|
|
|
menu_entries_append_enum(list,
|
|
|
|
s,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM),
|
|
|
|
MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM,
|
2017-08-15 20:20:24 -05:00
|
|
|
MENU_SETTINGS_NETPLAY_ROOMS_START + i, 0, 0);
|
2017-05-15 19:25:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
netplay_rooms_free();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-17 07:23:16 +02:00
|
|
|
#ifndef INET6_ADDRSTRLEN
|
|
|
|
#define INET6_ADDRSTRLEN 46
|
|
|
|
#endif
|
|
|
|
|
2017-01-19 00:52:53 -05:00
|
|
|
static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const char *err)
|
|
|
|
{
|
2017-03-05 22:42:33 +01:00
|
|
|
const char *path = NULL;
|
|
|
|
const char *label = NULL;
|
|
|
|
unsigned menu_type = 0;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
|
2017-01-19 00:52:53 -05:00
|
|
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
|
|
|
|
2017-03-05 22:42:33 +01:00
|
|
|
menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL);
|
|
|
|
|
|
|
|
/* Don't push the results if we left the netplay menu */
|
2017-05-25 17:35:14 +02:00
|
|
|
if (!string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB))
|
|
|
|
&& !string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY)))
|
2017-03-05 22:42:33 +01:00
|
|
|
return;
|
|
|
|
|
2017-01-19 00:52:53 -05:00
|
|
|
if (!data || err)
|
|
|
|
goto finish;
|
|
|
|
|
2017-05-26 07:05:52 +01:00
|
|
|
data->data = (char*)realloc(data->data, data->len + 1);
|
2017-05-23 16:14:25 +01:00
|
|
|
data->data[data->len] = '\0';
|
2017-01-19 00:52:53 -05:00
|
|
|
|
2017-05-23 16:14:25 +01:00
|
|
|
if (!strstr(data->data, file_path_str(FILE_PATH_NETPLAY_ROOM_LIST_URL)))
|
2017-01-19 00:52:53 -05:00
|
|
|
{
|
2017-05-23 16:14:25 +01:00
|
|
|
if (string_is_empty(data->data))
|
2017-01-19 08:56:56 -05:00
|
|
|
netplay_room_count = 0;
|
2017-01-19 00:52:53 -05:00
|
|
|
else
|
|
|
|
{
|
2017-01-22 21:24:57 +01:00
|
|
|
char s[PATH_MAX_LENGTH];
|
2017-11-18 22:43:47 -05:00
|
|
|
unsigned i = 0;
|
|
|
|
unsigned j = 0;
|
2017-11-20 17:54:13 +01:00
|
|
|
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
|
|
|
|
2017-11-19 15:50:01 -05:00
|
|
|
lan_room_count = 0;
|
2017-02-27 19:00:43 -05:00
|
|
|
|
2017-11-19 15:50:01 -05:00
|
|
|
#ifndef RARCH_CONSOLE
|
2017-02-28 09:52:33 +01:00
|
|
|
netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &lan_hosts);
|
2017-02-27 21:24:34 -05:00
|
|
|
if (lan_hosts)
|
2017-11-19 15:50:01 -05:00
|
|
|
lan_room_count = (int)lan_hosts->size;
|
|
|
|
#endif
|
2017-01-22 21:19:39 +01:00
|
|
|
|
2017-05-23 16:14:25 +01:00
|
|
|
netplay_rooms_parse(data->data);
|
2017-01-19 00:52:53 -05:00
|
|
|
|
2017-01-22 12:33:14 -05:00
|
|
|
if (netplay_room_list)
|
|
|
|
free(netplay_room_list);
|
|
|
|
|
2017-02-28 10:28:49 +01:00
|
|
|
/* TODO/FIXME - right now, a LAN and non-LAN netplay session might appear
|
|
|
|
* in the same list. If both entries are available, we want to show only
|
|
|
|
* the LAN one. */
|
|
|
|
|
2017-03-04 01:31:24 -05:00
|
|
|
netplay_room_count = netplay_rooms_get_count();
|
2017-02-28 10:16:36 +01:00
|
|
|
netplay_room_list = (struct netplay_room*)
|
2017-02-28 10:27:34 +01:00
|
|
|
calloc(netplay_room_count + lan_room_count,
|
|
|
|
sizeof(struct netplay_room));
|
2017-01-19 00:52:53 -05:00
|
|
|
|
2017-11-26 22:43:58 +01:00
|
|
|
for (i = 0; i < (unsigned)netplay_room_count; i++)
|
2017-05-15 19:25:56 -05:00
|
|
|
memcpy(&netplay_room_list[i], netplay_room_get(i), sizeof(netplay_room_list[i]));
|
2017-02-27 19:00:43 -05:00
|
|
|
|
2017-02-27 21:44:11 -05:00
|
|
|
if (lan_room_count != 0)
|
2017-02-27 19:00:43 -05:00
|
|
|
{
|
2017-11-26 22:43:58 +01:00
|
|
|
for (i = netplay_room_count; i < (unsigned)(netplay_room_count + lan_room_count); i++)
|
2017-02-27 21:24:34 -05:00
|
|
|
{
|
2017-11-25 05:53:56 +01:00
|
|
|
struct netplay_host *host = &lan_hosts->hosts[j++];
|
2017-02-28 09:52:33 +01:00
|
|
|
|
2017-02-27 21:24:34 -05:00
|
|
|
strlcpy(netplay_room_list[i].nickname,
|
|
|
|
host->nick,
|
|
|
|
sizeof(netplay_room_list[i].nickname));
|
2017-02-28 09:52:33 +01:00
|
|
|
|
2017-11-18 22:43:47 -05:00
|
|
|
strlcpy(netplay_room_list[i].address, host->address, INET6_ADDRSTRLEN);
|
2017-02-28 09:52:33 +01:00
|
|
|
|
2017-02-27 21:24:34 -05:00
|
|
|
strlcpy(netplay_room_list[i].corename,
|
|
|
|
host->core,
|
|
|
|
sizeof(netplay_room_list[i].corename));
|
2017-07-29 02:24:11 +00:00
|
|
|
strlcpy(netplay_room_list[i].retroarch_version,
|
2017-07-24 21:13:28 -05:00
|
|
|
host->retroarch_version,
|
2017-07-29 02:24:11 +00:00
|
|
|
sizeof(netplay_room_list[i].retroarch_version));
|
2017-02-27 21:24:34 -05:00
|
|
|
strlcpy(netplay_room_list[i].coreversion,
|
|
|
|
host->core_version,
|
|
|
|
sizeof(netplay_room_list[i].coreversion));
|
|
|
|
strlcpy(netplay_room_list[i].gamename,
|
|
|
|
host->content,
|
2017-04-29 22:07:01 +02:00
|
|
|
sizeof(netplay_room_list[i].gamename));
|
2017-02-27 21:24:34 -05:00
|
|
|
|
2017-11-18 22:43:47 -05:00
|
|
|
netplay_room_list[i].port = host->port;
|
2017-02-28 09:52:33 +01:00
|
|
|
netplay_room_list[i].gamecrc = host->content_crc;
|
2017-02-27 21:24:34 -05:00
|
|
|
netplay_room_list[i].timestamp = 0;
|
2017-05-15 19:45:23 -05:00
|
|
|
netplay_room_list[i].lan = true;
|
2017-02-27 21:24:34 -05:00
|
|
|
|
2017-02-28 09:52:33 +01:00
|
|
|
snprintf(s, sizeof(s),
|
2017-07-09 18:19:56 -05:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME),
|
2017-02-27 21:24:34 -05:00
|
|
|
netplay_room_list[i].nickname);
|
|
|
|
}
|
2017-02-28 11:10:17 -05:00
|
|
|
netplay_room_count += lan_room_count;
|
2017-02-27 19:00:43 -05:00
|
|
|
}
|
2017-11-20 17:54:13 +01:00
|
|
|
netplay_refresh_rooms_menu(list);
|
2017-01-19 00:52:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-23 16:14:25 +01:00
|
|
|
finish:
|
|
|
|
|
2017-01-19 00:52:53 -05:00
|
|
|
if (err)
|
|
|
|
RARCH_ERR("%s: %s\n", msg_hash_to_str(MSG_DOWNLOAD_FAILED), err);
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
if (data->data)
|
|
|
|
free(data->data);
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (user_data)
|
|
|
|
free(user_data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-05-27 00:50:14 +02:00
|
|
|
static void netplay_lan_scan_callback(void *task_data,
|
|
|
|
void *user_data, const char *error)
|
|
|
|
{
|
|
|
|
struct netplay_host_list *netplay_hosts = NULL;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
unsigned menu_type = 0;
|
|
|
|
const char *label = NULL;
|
|
|
|
const char *path = NULL;
|
|
|
|
|
|
|
|
menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL);
|
|
|
|
|
|
|
|
/* Don't push the results if we left the LAN scan menu */
|
|
|
|
if (!string_is_equal(label,
|
|
|
|
msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!netplay_discovery_driver_ctl(
|
|
|
|
RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES,
|
|
|
|
(void *) &netplay_hosts))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (netplay_hosts->size > 0)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
file_list_t *file_list = menu_entries_get_selection_buf_ptr(0);
|
|
|
|
|
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list);
|
|
|
|
|
|
|
|
for (i = 0; i < netplay_hosts->size; i++)
|
|
|
|
{
|
|
|
|
struct netplay_host *host = &netplay_hosts->hosts[i];
|
|
|
|
menu_entries_append_enum(file_list,
|
|
|
|
host->nick,
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_CONNECT_TO),
|
|
|
|
MENU_ENUM_LABEL_NETPLAY_CONNECT_TO,
|
|
|
|
MENU_NETPLAY_LAN_SCAN, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-05-15 02:08:59 +02:00
|
|
|
|
2017-01-19 00:52:53 -05:00
|
|
|
static int action_ok_push_netplay_refresh_rooms(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-03-04 01:31:24 -05:00
|
|
|
char url [2048] = "http://newlobby.libretro.com/list/";
|
2017-11-19 15:50:01 -05:00
|
|
|
#ifndef RARCH_CONSOLE
|
2017-05-15 02:08:59 +02:00
|
|
|
task_push_netplay_lan_scan(netplay_lan_scan_callback);
|
2017-11-19 15:50:01 -05:00
|
|
|
#endif
|
2017-01-19 00:52:53 -05:00
|
|
|
task_push_http_transfer(url, true, NULL, netplay_refresh_rooms_cb, NULL);
|
|
|
|
return 0;
|
|
|
|
}
|
2017-01-22 21:19:39 +01:00
|
|
|
#endif
|
2017-01-19 00:52:53 -05:00
|
|
|
|
|
|
|
|
2016-07-10 03:08:18 +02:00
|
|
|
static int action_ok_scan_directory_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
settings_t *settings = config_get_ptr();
|
2017-01-07 09:39:54 +01:00
|
|
|
|
|
|
|
filebrowser_clear_type();
|
2016-07-10 03:08:18 +02:00
|
|
|
return generic_action_ok_displaylist_push(path,
|
2017-04-29 00:39:29 +02:00
|
|
|
settings->paths.directory_menu_content, label, type, idx,
|
2016-07-10 03:08:18 +02:00
|
|
|
entry_idx, ACTION_OK_DL_SCAN_DIR_LIST);
|
|
|
|
}
|
|
|
|
|
2016-12-13 00:50:39 +01:00
|
|
|
static int action_ok_push_random_dir(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, path,
|
2016-12-13 01:06:28 +01:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
2016-12-13 00:50:39 +01:00
|
|
|
type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
|
|
|
}
|
|
|
|
|
2015-09-03 23:22:16 +02:00
|
|
|
static int action_ok_push_downloads_dir(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-07-09 18:12:35 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2016-12-16 09:07:03 +01:00
|
|
|
|
2017-05-15 13:05:33 +02:00
|
|
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
2017-11-26 07:17:31 +01:00
|
|
|
return generic_action_ok_displaylist_push(path,
|
|
|
|
settings->paths.directory_core_assets,
|
2016-12-13 01:06:28 +01:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
2016-07-09 18:12:35 +02:00
|
|
|
type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
2015-09-03 23:22:16 +02:00
|
|
|
}
|
|
|
|
|
2016-07-08 22:51:47 +02:00
|
|
|
int action_ok_push_filebrowser_list_dir_select(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-05-19 02:39:33 +02:00
|
|
|
filebrowser_set_type(FILEBROWSER_SELECT_DIR);
|
2016-12-13 00:50:39 +01:00
|
|
|
strlcpy(filebrowser_label, label, sizeof(filebrowser_label));
|
2016-07-09 18:06:50 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
2016-07-08 22:51:47 +02:00
|
|
|
entry_idx, ACTION_OK_DL_FILE_BROWSER_SELECT_DIR);
|
|
|
|
}
|
|
|
|
|
2017-07-30 15:58:46 +02:00
|
|
|
int action_ok_push_filebrowser_list_file_select(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
|
|
|
strlcpy(filebrowser_label, label, sizeof(filebrowser_label));
|
|
|
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_FILE_BROWSER_SELECT_DIR);
|
|
|
|
}
|
|
|
|
|
2015-09-03 23:14:50 +02:00
|
|
|
static int action_ok_push_default(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-01-07 09:39:54 +01:00
|
|
|
filebrowser_clear_type();
|
2016-07-09 18:06:50 +02:00
|
|
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
2015-09-03 23:14:50 +02:00
|
|
|
entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
|
|
|
|
}
|
|
|
|
|
2016-01-24 01:51:05 +01:00
|
|
|
static int action_ok_start_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-04-27 01:23:04 +02:00
|
|
|
content_ctx_info_t content_info;
|
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-11-26 18:33:05 -05:00
|
|
|
path_clear(RARCH_PATH_BASENAME);
|
2017-02-21 16:50:39 +01:00
|
|
|
if (!task_push_start_current_core(&content_info))
|
2017-02-21 03:54:34 +01:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2016-05-27 19:18:46 +02:00
|
|
|
|
2015-07-14 12:49:54 +02:00
|
|
|
static int action_ok_load_archive(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-16 16:25:16 +02:00
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
2016-02-10 21:15:23 +01:00
|
|
|
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2016-02-10 21:15:23 +01:00
|
|
|
|
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
2015-07-14 12:49:54 +02:00
|
|
|
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_LOAD_CORE);
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-11-26 07:29:19 +01:00
|
|
|
return default_action_ok_load_content_with_core_from_menu(
|
2017-02-21 18:36:38 +01:00
|
|
|
detect_content_path,
|
2017-11-26 07:29:19 +01:00
|
|
|
CORE_TYPE_PLAIN);
|
2015-07-14 12:49:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_load_archive_detect_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-02-04 15:21:42 +01:00
|
|
|
menu_content_ctx_defer_info_t def_info;
|
2016-06-15 18:52:27 +02:00
|
|
|
int ret = 0;
|
|
|
|
core_info_list_t *list = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
2017-09-09 22:10:19 +02:00
|
|
|
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
|
|
|
char *new_core_path = (char*)
|
|
|
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-08-13 06:49:51 +02:00
|
|
|
new_core_path[0] = '\0';
|
2016-10-08 19:47:26 +02:00
|
|
|
|
2016-02-10 21:15:23 +01:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2017-09-09 22:10:19 +02:00
|
|
|
{
|
|
|
|
free(new_core_path);
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2017-09-09 22:10:19 +02:00
|
|
|
}
|
2015-07-14 12:49:54 +02:00
|
|
|
|
2017-04-23 14:31:49 +02:00
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
2016-02-10 21:15:23 +01:00
|
|
|
|
2016-05-09 18:11:17 +02:00
|
|
|
core_info_get_list(&list);
|
2015-12-11 13:51:17 +01:00
|
|
|
|
2016-02-04 15:21:42 +01:00
|
|
|
def_info.data = list;
|
|
|
|
def_info.dir = menu_path;
|
|
|
|
def_info.path = content_path;
|
|
|
|
def_info.menu_label = label;
|
|
|
|
def_info.s = menu->deferred_path;
|
|
|
|
def_info.len = sizeof(menu->deferred_path);
|
|
|
|
|
2016-07-01 05:17:04 +02:00
|
|
|
if (menu_content_find_first_core(&def_info, false,
|
2017-09-09 22:10:19 +02:00
|
|
|
new_core_path, path_size))
|
2016-02-04 15:21:42 +01:00
|
|
|
ret = -1;
|
2015-07-14 12:49:54 +02:00
|
|
|
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case -1:
|
2017-02-21 04:31:03 +01:00
|
|
|
{
|
2017-04-27 01:23:04 +02:00
|
|
|
content_ctx_info_t content_info;
|
|
|
|
|
|
|
|
content_info.argc = 0;
|
|
|
|
content_info.argv = NULL;
|
|
|
|
content_info.args = NULL;
|
|
|
|
content_info.environ_get = NULL;
|
2017-02-21 04:31:03 +01:00
|
|
|
|
2017-02-21 18:36:38 +01:00
|
|
|
if (!task_push_load_content_with_new_core_from_menu(
|
2017-02-21 04:31:03 +01:00
|
|
|
new_core_path, def_info.s,
|
|
|
|
&content_info,
|
|
|
|
CORE_TYPE_PLAIN,
|
|
|
|
NULL, NULL))
|
2017-09-09 22:10:19 +02:00
|
|
|
{
|
|
|
|
free(new_core_path);
|
2017-02-21 04:31:03 +01:00
|
|
|
return -1;
|
2017-09-09 22:10:19 +02:00
|
|
|
}
|
2017-02-21 04:31:03 +01:00
|
|
|
}
|
2017-09-09 22:10:19 +02:00
|
|
|
ret = 0;
|
|
|
|
break;
|
2015-07-14 12:49:54 +02:00
|
|
|
case 0:
|
2017-08-13 00:55:47 +02:00
|
|
|
idx = menu_navigation_get_selection();
|
2017-09-09 22:10:19 +02:00
|
|
|
ret = generic_action_ok_displaylist_push(path, NULL,
|
2017-08-13 00:55:47 +02:00
|
|
|
label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);
|
2017-09-09 22:10:19 +02:00
|
|
|
break;
|
2015-09-07 02:46:47 +02:00
|
|
|
default:
|
2015-07-14 12:49:54 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-09-09 22:10:19 +02:00
|
|
|
free(new_core_path);
|
2015-07-14 12:49:54 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2017-11-26 06:57:05 +01:00
|
|
|
#define default_action_ok_help(funcname, _id, _id2) \
|
|
|
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
|
|
|
{ \
|
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx, _id, _id2); \
|
2015-07-18 14:01:37 +02:00
|
|
|
}
|
|
|
|
|
2017-11-26 06:57:05 +01:00
|
|
|
default_action_ok_help(action_ok_help_audio_video_troubleshooting, MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING, MENU_DIALOG_HELP_AUDIO_VIDEO_TROUBLESHOOTING)
|
|
|
|
default_action_ok_help(action_ok_help, MENU_ENUM_LABEL_HELP, MENU_DIALOG_WELCOME)
|
|
|
|
default_action_ok_help(action_ok_help_controls, MENU_ENUM_LABEL_HELP_CONTROLS, MENU_DIALOG_HELP_CONTROLS)
|
|
|
|
default_action_ok_help(action_ok_help_what_is_a_core, MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE, MENU_DIALOG_HELP_WHAT_IS_A_CORE)
|
|
|
|
default_action_ok_help(action_ok_help_scanning_content, MENU_ENUM_LABEL_HELP_SCANNING_CONTENT, MENU_DIALOG_HELP_SCANNING_CONTENT)
|
|
|
|
default_action_ok_help(action_ok_help_change_virtual_gamepad, MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD, MENU_DIALOG_HELP_CHANGE_VIRTUAL_GAMEPAD)
|
|
|
|
default_action_ok_help(action_ok_help_load_content, MENU_ENUM_LABEL_HELP_LOADING_CONTENT, MENU_DIALOG_HELP_LOADING_CONTENT)
|
2015-02-26 16:50:30 +01:00
|
|
|
|
2015-05-17 18:18:17 +02:00
|
|
|
static int action_ok_video_resolution(const char *path,
|
2015-06-10 23:11:40 +02:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2015-09-05 17:17:26 +02:00
|
|
|
unsigned width = 0;
|
|
|
|
unsigned height = 0;
|
|
|
|
|
2015-03-22 18:38:11 +01:00
|
|
|
if (video_driver_get_video_output_size(&width, &height))
|
2015-07-06 00:29:51 -05:00
|
|
|
{
|
2016-10-08 19:47:26 +02:00
|
|
|
char msg[PATH_MAX_LENGTH];
|
|
|
|
|
|
|
|
msg[0] = '\0';
|
|
|
|
|
2017-08-09 04:17:32 +02:00
|
|
|
#if defined(__CELLOS_LV2__) || defined(_WIN32)
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_REINIT);
|
2015-11-21 08:39:46 +01:00
|
|
|
#endif
|
2015-11-21 08:56:24 +01:00
|
|
|
video_driver_set_video_mode(width, height, true);
|
2016-02-12 16:58:59 -05:00
|
|
|
#ifdef GEKKO
|
|
|
|
if (width == 0 || height == 0)
|
|
|
|
strlcpy(msg, "Applying: DEFAULT", sizeof(msg));
|
|
|
|
else
|
|
|
|
#endif
|
2016-07-01 05:51:27 +02:00
|
|
|
snprintf(msg, sizeof(msg),
|
2016-09-25 00:13:33 -04:00
|
|
|
"Applying: %dx%d\n START to reset",
|
2016-07-01 05:51:27 +02:00
|
|
|
width, height);
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(msg, 1, 100, true);
|
2015-07-06 00:29:51 -05:00
|
|
|
}
|
2015-03-03 21:57:09 +01:00
|
|
|
|
2015-02-26 16:50:30 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-09-28 22:45:31 -04:00
|
|
|
static int action_ok_netplay_enable_host(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-09-29 21:07:10 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-01-25 15:51:57 +01:00
|
|
|
bool contentless = false;
|
|
|
|
bool is_inited = false;
|
|
|
|
|
|
|
|
content_get_status(&contentless, &is_inited);
|
|
|
|
|
2016-09-28 22:45:31 -04:00
|
|
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_NETPLAY_DEINIT);
|
2016-10-03 17:40:14 -04:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_SERVER, NULL);
|
|
|
|
|
2016-09-28 22:45:31 -04:00
|
|
|
/* If we haven't yet started, this will load on its own */
|
2017-01-25 15:51:57 +01:00
|
|
|
if (!is_inited)
|
2016-09-29 13:13:50 -04:00
|
|
|
{
|
2016-12-22 23:36:11 +01:00
|
|
|
runloop_msg_queue_push(
|
2016-12-25 00:38:18 -05:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_START_WHEN_LOADED),
|
2016-09-29 13:13:50 -04:00
|
|
|
1, 480, true);
|
2016-09-28 22:45:31 -04:00
|
|
|
return 0;
|
2016-09-29 13:13:50 -04:00
|
|
|
}
|
2016-09-28 22:45:31 -04:00
|
|
|
|
|
|
|
/* Enable Netplay itself */
|
2017-08-13 00:55:47 +02:00
|
|
|
if (command_event(CMD_EVENT_NETPLAY_INIT, NULL))
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-09-29 13:13:50 -04:00
|
|
|
#endif
|
2017-08-13 00:55:47 +02:00
|
|
|
return -1;
|
2016-09-28 22:45:31 -04:00
|
|
|
}
|
|
|
|
|
2017-01-05 08:18:17 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-12-27 16:41:27 -05:00
|
|
|
static void action_ok_netplay_enable_client_hostname_cb(
|
|
|
|
void *ignore, const char *hostname)
|
|
|
|
{
|
2017-03-13 21:05:00 -04:00
|
|
|
|
|
|
|
if (hostname && hostname[0])
|
|
|
|
{
|
2017-09-11 03:01:33 +02:00
|
|
|
bool contentless = false;
|
|
|
|
bool is_inited = false;
|
|
|
|
char *tmp_hostname = strdup(hostname);
|
|
|
|
|
|
|
|
content_get_status(&contentless, &is_inited);
|
|
|
|
|
2017-05-27 12:59:34 -05:00
|
|
|
if (!is_inited)
|
|
|
|
{
|
2017-09-11 03:01:33 +02:00
|
|
|
command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED,
|
|
|
|
(void*)tmp_hostname);
|
2017-05-27 12:59:34 -05:00
|
|
|
runloop_msg_queue_push(
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_START_WHEN_LOADED),
|
|
|
|
1, 480, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-11 03:01:33 +02:00
|
|
|
command_event(CMD_EVENT_NETPLAY_INIT_DIRECT,
|
|
|
|
(void*)tmp_hostname);
|
2017-05-27 12:59:34 -05:00
|
|
|
generic_action_ok_command(CMD_EVENT_RESUME);
|
|
|
|
}
|
2017-09-11 03:01:33 +02:00
|
|
|
|
|
|
|
free(tmp_hostname);
|
2017-03-13 21:05:00 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
menu_input_dialog_end();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-12-27 16:41:27 -05:00
|
|
|
menu_input_dialog_end();
|
2017-05-15 04:31:40 +02:00
|
|
|
rarch_menu_running_finished();
|
2016-12-27 16:41:27 -05:00
|
|
|
}
|
2017-01-05 08:18:17 +01:00
|
|
|
#endif
|
2016-12-27 16:41:27 -05:00
|
|
|
|
2016-09-28 22:45:31 -04:00
|
|
|
static int action_ok_netplay_enable_client(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-09-29 21:07:10 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-06-10 12:52:45 +02:00
|
|
|
menu_input_ctx_line_t line;
|
2016-09-28 23:18:34 -04:00
|
|
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_NETPLAY_DEINIT);
|
2016-10-03 17:40:14 -04:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
|
|
|
|
2017-11-26 06:03:34 +01:00
|
|
|
line.label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS);
|
2017-05-27 12:59:34 -05:00
|
|
|
line.label_setting = "no_setting";
|
2017-11-26 06:03:34 +01:00
|
|
|
line.type = 0;
|
|
|
|
line.idx = 0;
|
|
|
|
line.cb = action_ok_netplay_enable_client_hostname_cb;
|
|
|
|
|
2017-08-13 00:55:47 +02:00
|
|
|
if (menu_input_dialog_start(&line))
|
|
|
|
return 0;
|
2016-09-29 13:13:50 -04:00
|
|
|
#endif
|
2017-08-13 00:55:47 +02:00
|
|
|
return -1;
|
2016-09-28 22:45:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_netplay_disconnect(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-09-29 21:07:10 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-08-06 14:03:09 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2016-09-28 23:18:34 -04:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_DISCONNECT, NULL);
|
2016-10-30 14:41:19 -04:00
|
|
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_DISABLE, NULL);
|
2017-07-10 21:51:56 -05:00
|
|
|
|
2017-08-13 21:20:22 -04:00
|
|
|
/* Re-enable rewind if it was enabled
|
2017-07-10 21:51:56 -05:00
|
|
|
TODO: Add a setting for these tweaks */
|
|
|
|
if (settings->bools.rewind_enable)
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_REWIND_INIT);
|
2017-07-10 22:44:16 -05:00
|
|
|
if (settings->uints.autosave_interval != 0)
|
2017-11-26 06:35:53 +01:00
|
|
|
generic_action_ok_command(CMD_EVENT_AUTOSAVE_INIT);
|
2016-09-28 23:18:34 -04:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-09-29 13:13:50 -04:00
|
|
|
|
|
|
|
#else
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
#endif
|
2016-09-28 22:45:31 -04:00
|
|
|
}
|
|
|
|
|
2017-08-03 18:38:30 -04:00
|
|
|
static int action_ok_core_delete(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2017-11-26 07:17:31 +01:00
|
|
|
const char *path_core = path_get(RARCH_PATH_CORE);
|
|
|
|
char *core_path = !string_is_empty(path_core)
|
|
|
|
? strdup(path_core) : NULL;
|
|
|
|
|
|
|
|
if (!core_path)
|
|
|
|
return 0;
|
2017-08-03 18:38:30 -04:00
|
|
|
|
|
|
|
generic_action_ok_command(CMD_EVENT_UNLOAD_CORE);
|
|
|
|
menu_entries_flush_stack(0, 0);
|
|
|
|
|
2017-10-14 23:13:24 -04:00
|
|
|
if (path_file_remove(core_path) != 0) { }
|
2017-08-03 18:38:30 -04:00
|
|
|
|
|
|
|
free(core_path);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-07-01 19:01:25 +02:00
|
|
|
static int is_rdb_entry(enum msg_hash_enums enum_idx)
|
2015-06-05 12:16:14 +02:00
|
|
|
{
|
2016-07-01 19:01:25 +02:00
|
|
|
switch (enum_idx)
|
2015-06-05 12:16:14 +02:00
|
|
|
{
|
2016-07-01 19:01:25 +02:00
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_PUBLISHER:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_DEVELOPER:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_ORIGIN:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_FRANCHISE:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_ENHANCEMENT_HW:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_ESRB_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_BBFC_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_ELSPA_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_PEGI_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_CERO_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_EDGE_MAGAZINE_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_EDGE_MAGAZINE_ISSUE:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_FAMITSU_MAGAZINE_RATING:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_MONTH:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_YEAR:
|
|
|
|
case MENU_ENUM_LABEL_RDB_ENTRY_MAX_USERS:
|
2015-06-05 12:16:14 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
2016-07-01 20:18:51 +02:00
|
|
|
const char *label, uint32_t hash)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2016-07-01 19:01:25 +02:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN && is_rdb_entry(cbs->enum_idx) == 0)
|
2015-06-07 18:14:48 +02:00
|
|
|
{
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rdb_entry_submenu);
|
2015-06-07 18:14:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-07-01 20:18:51 +02:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-10-23 06:54:33 +02:00
|
|
|
{
|
2017-08-13 00:39:11 +02:00
|
|
|
const char *str = msg_hash_to_str(cbs->enum_idx);
|
2016-07-01 20:18:51 +02:00
|
|
|
|
2017-08-13 00:39:11 +02:00
|
|
|
if (str && strstr(str, "input_binds_list"))
|
2016-07-01 20:18:51 +02:00
|
|
|
{
|
2017-08-13 00:39:11 +02:00
|
|
|
unsigned i;
|
2016-12-14 16:33:54 +01:00
|
|
|
|
2017-08-13 00:39:11 +02:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
|
|
|
unsigned first_char = atoi(&str[0]);
|
2016-12-14 16:33:54 +01:00
|
|
|
|
2017-08-13 00:39:11 +02:00
|
|
|
if (first_char != ((i+1)))
|
|
|
|
continue;
|
2016-12-14 16:33:54 +01:00
|
|
|
|
2017-08-13 00:39:11 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_user_binds_list);
|
|
|
|
return 0;
|
|
|
|
}
|
2016-07-01 20:18:51 +02:00
|
|
|
}
|
2015-10-23 06:54:33 +02:00
|
|
|
}
|
|
|
|
|
2015-10-11 13:16:38 +02:00
|
|
|
if (menu_setting_get_browser_selection_type(cbs->setting) == ST_DIR)
|
2015-06-07 18:14:48 +02:00
|
|
|
{
|
2016-07-08 22:51:47 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_filebrowser_list_dir_select);
|
2015-06-07 18:14:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-06-20 00:31:13 +02:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2016-06-16 17:50:53 +02:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
2017-05-27 23:56:10 +02:00
|
|
|
case MENU_ENUM_LABEL_RUN_MUSIC:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_run);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ADD_TO_MIXER_AND_COLLECTION:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_add_to_mixer_and_collection);
|
|
|
|
break;
|
2017-05-27 21:03:17 +02:00
|
|
|
case MENU_ENUM_LABEL_ADD_TO_MIXER:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_add_to_mixer);
|
|
|
|
break;
|
2017-01-07 09:39:54 +01:00
|
|
|
case MENU_ENUM_LABEL_MENU_WALLPAPER:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_wallpaper);
|
|
|
|
break;
|
2017-05-19 04:44:10 +02:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_FONT_PATH:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_font);
|
|
|
|
break;
|
2017-08-16 00:01:56 +02:00
|
|
|
case MENU_ENUM_LABEL_GOTO_FAVORITES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_goto_favorites);
|
|
|
|
break;
|
2017-08-16 03:15:04 +02:00
|
|
|
case MENU_ENUM_LABEL_GOTO_MUSIC:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_goto_music);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_GOTO_IMAGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_goto_images);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_GOTO_VIDEO:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_goto_video);
|
|
|
|
break;
|
2016-12-27 00:02:09 +01:00
|
|
|
case MENU_ENUM_LABEL_BROWSE_START:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_browse_url_start);
|
|
|
|
break;
|
2016-07-26 12:08:04 +02:00
|
|
|
case MENU_ENUM_LABEL_FILE_BROWSER_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_core);
|
|
|
|
break;
|
2016-07-26 09:28:06 +02:00
|
|
|
case MENU_ENUM_LABEL_FILE_BROWSER_CORE_SELECT_FROM_COLLECTION:
|
2016-12-13 06:32:46 +01:00
|
|
|
case MENU_ENUM_LABEL_FILE_BROWSER_CORE_SELECT_FROM_COLLECTION_CURRENT_CORE:
|
2017-11-26 06:23:14 +01:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_deferred_set);
|
2016-12-13 06:32:46 +01:00
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_START_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_start_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_START_NET_RETROPAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_start_net_retropad_core);
|
|
|
|
break;
|
2016-07-28 20:35:05 +02:00
|
|
|
case MENU_ENUM_LABEL_START_VIDEO_PROCESSOR:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_start_video_processor_core);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_OPEN_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOAD_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOAD_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CUSTOM_BIND_ALL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
|
|
|
break;
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_SAVE_STATE:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_save_state);
|
|
|
|
break;
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_LOAD_STATE:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_state);
|
|
|
|
break;
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_UNDO_LOAD_STATE:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_undo_load_state);
|
|
|
|
break;
|
2016-06-17 22:36:13 +02:00
|
|
|
case MENU_ENUM_LABEL_UNDO_SAVE_STATE:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_undo_save_state);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RESUME_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_resume_content);
|
|
|
|
break;
|
2017-11-16 15:41:37 +01:00
|
|
|
case MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_add_to_favorites_playlist);
|
|
|
|
break;
|
2017-08-14 00:29:38 +02:00
|
|
|
case MENU_ENUM_LABEL_ADD_TO_FAVORITES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_add_to_favorites);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_RESTART_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_restart_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_TAKE_SCREENSHOT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_screenshot);
|
|
|
|
break;
|
2017-10-02 22:17:44 +02:00
|
|
|
case MENU_ENUM_LABEL_RENAME_ENTRY:
|
2017-08-14 20:07:43 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rename_entry);
|
2017-08-14 19:40:25 +02:00
|
|
|
break;
|
2016-08-29 01:17:02 +02:00
|
|
|
case MENU_ENUM_LABEL_DELETE_ENTRY:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_delete_entry);
|
|
|
|
break;
|
2017-10-11 11:30:53 +02:00
|
|
|
case MENU_ENUM_LABEL_MENU_DISABLE_KIOSK_MODE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disable_kiosk_mode);
|
|
|
|
break;
|
2017-09-26 14:41:07 +02:00
|
|
|
case MENU_ENUM_LABEL_XMB_MAIN_MENU_ENABLE_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_enable_settings);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_QUIT_RETROARCH:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_quit);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CLOSE_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_close_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SAVE_NEW_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_save_new_config);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_CONTROLS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_controls);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_what_is_a_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_change_virtual_gamepad);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_audio_video_troubleshooting);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_SCANNING_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_scanning_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_LOADING_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_load_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PASS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_dsp_plugin);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RECORD_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile);
|
|
|
|
break;
|
2015-09-04 20:11:46 +02:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOAD_CORE_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_list);
|
|
|
|
break;
|
2016-06-21 00:54:14 +02:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOAD_CORE_CONTENT_DIRS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_dirs_list);
|
|
|
|
break;
|
2016-06-18 03:12:32 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_UPDATER_LIST:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_updater_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_LAKKA:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_list);
|
|
|
|
break;
|
2015-09-04 20:11:46 +02:00
|
|
|
#endif
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_parameters);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ACCOUNTS_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_INPUT_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_input_settings_list);
|
|
|
|
break;
|
2016-06-16 21:40:13 +02:00
|
|
|
case MENU_ENUM_LABEL_DRIVER_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_driver_settings_list);
|
|
|
|
break;
|
2016-06-17 04:02:26 +02:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_video_settings_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_audio_settings_list);
|
|
|
|
break;
|
2016-06-18 22:17:39 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_core_settings_list);
|
|
|
|
break;
|
2016-11-21 07:26:58 +01:00
|
|
|
case MENU_ENUM_LABEL_CONFIGURATION_SETTINGS:
|
2016-07-02 10:17:09 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_configuration_settings_list);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_PLAYLIST_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_playlist_settings_list);
|
|
|
|
break;
|
2016-10-08 15:05:31 +02:00
|
|
|
case MENU_ENUM_LABEL_RECORDING_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_recording_settings_list);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_INPUT_HOTKEY_BINDS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_input_hotkey_binds_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_cheevos_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SHADER_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_NETWORK_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
|
2016-11-05 16:55:57 -05:00
|
|
|
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE:
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_DISK_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_FRONTEND_COUNTERS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_COUNTERS:
|
|
|
|
case MENU_ENUM_LABEL_MANAGEMENT:
|
|
|
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
2016-09-28 22:45:31 -04:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY:
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
|
|
|
|
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
|
2016-11-21 07:26:58 +01:00
|
|
|
case MENU_ENUM_LABEL_CONFIGURATIONS_LIST:
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_HELP_LIST:
|
|
|
|
case MENU_ENUM_LABEL_INFORMATION_LIST:
|
|
|
|
case MENU_ENUM_LABEL_CONTENT_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
|
|
|
break;
|
2017-07-30 15:58:46 +02:00
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_SPECIAL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_filebrowser_list_file_select);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_SCAN_DIRECTORY:
|
2016-07-10 03:08:18 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_scan_directory_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SCAN_FILE:
|
2016-12-22 20:49:25 +01:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_scan_file);
|
|
|
|
break;
|
2017-01-22 21:27:36 +01:00
|
|
|
#ifdef HAVE_NETWORKING
|
2017-01-19 00:52:53 -05:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY_REFRESH_ROOMS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_netplay_refresh_rooms);
|
|
|
|
break;
|
2017-01-22 21:27:36 +01:00
|
|
|
#endif
|
2016-12-13 01:06:28 +01:00
|
|
|
case MENU_ENUM_LABEL_FAVORITES:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_content_list);
|
|
|
|
break;
|
2016-12-13 00:50:39 +01:00
|
|
|
case MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_random_dir);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_downloads_dir);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DETECT_CORE_LIST_OK:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_detect_core);
|
|
|
|
break;
|
2016-12-12 21:24:06 +01:00
|
|
|
case MENU_ENUM_LABEL_DETECT_CORE_LIST_OK_CURRENT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_current_core);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
|
|
|
|
case MENU_ENUM_LABEL_CURSOR_MANAGER_LIST:
|
|
|
|
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_generic_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SHADER_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_as);
|
|
|
|
break;
|
2016-07-27 18:07:19 -05:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_game);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_core);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_game);
|
|
|
|
break;
|
2017-08-05 00:37:26 -05:00
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_remove_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_remove_game);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_content_collection_list);
|
|
|
|
break;
|
2016-12-26 06:39:12 +01:00
|
|
|
case MENU_ENUM_LABEL_BROWSE_URL_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_browse_url_list);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DISK_IMAGE_APPEND:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append_list);
|
|
|
|
break;
|
2016-11-21 07:26:58 +01:00
|
|
|
case MENU_ENUM_LABEL_CONFIGURATIONS:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_configurations_list);
|
|
|
|
break;
|
2016-07-02 12:03:50 +02:00
|
|
|
case MENU_ENUM_LABEL_SAVING_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_saving_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOGGING_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_logging_list);
|
|
|
|
break;
|
2016-07-02 13:17:24 +02:00
|
|
|
case MENU_ENUM_LABEL_FRAME_THROTTLE_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_frame_throttle_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REWIND_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_rewind_list);
|
|
|
|
break;
|
2016-07-02 13:49:05 +02:00
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_DISPLAY_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_onscreen_display_list);
|
|
|
|
break;
|
2016-11-23 14:28:15 +01:00
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_onscreen_notifications_list);
|
|
|
|
break;
|
2016-07-02 13:49:05 +02:00
|
|
|
case MENU_ENUM_LABEL_ONSCREEN_OVERLAY_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_onscreen_overlay_list);
|
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case MENU_ENUM_LABEL_MENU_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_list);
|
|
|
|
break;
|
2017-06-20 02:04:23 +02:00
|
|
|
case MENU_ENUM_LABEL_MENU_VIEWS_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_views_list);
|
|
|
|
break;
|
2017-10-09 08:14:52 +02:00
|
|
|
case MENU_ENUM_LABEL_QUICK_MENU_VIEWS_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_quick_menu_views_list);
|
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case MENU_ENUM_LABEL_USER_INTERFACE_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_user_interface_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_file_browser_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RETRO_ACHIEVEMENTS_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_retro_achievements_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATER_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_updater_list);
|
|
|
|
break;
|
2016-09-21 21:58:43 +02:00
|
|
|
case MENU_ENUM_LABEL_WIFI_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_wifi_list);
|
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case MENU_ENUM_LABEL_NETWORK_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_network_list);
|
|
|
|
break;
|
2017-01-19 23:44:10 -05:00
|
|
|
case MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_connect_room);
|
|
|
|
break;
|
2016-08-10 01:46:47 +02:00
|
|
|
case MENU_ENUM_LABEL_LAKKA_SERVICES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_services);
|
|
|
|
break;
|
2017-06-08 00:19:43 +02:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_sublist);
|
|
|
|
break;
|
2016-07-02 20:40:27 +02:00
|
|
|
case MENU_ENUM_LABEL_USER_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_user_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DIRECTORY_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_directory_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_PRIVACY_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_privacy_list);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_SCREEN_RESOLUTION:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_video_resolution);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_ASSETS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_assets);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CORE_INFO_FILES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_core_info_files);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_OVERLAYS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_overlays);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_DATABASES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_databases);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_GLSL_SHADERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_shaders_glsl);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CG_SHADERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_shaders_cg);
|
|
|
|
break;
|
2016-10-08 15:16:01 -05:00
|
|
|
case MENU_ENUM_LABEL_UPDATE_SLANG_SHADERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_shaders_slang);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
case MENU_ENUM_LABEL_UPDATE_CHEATS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_cheats);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_AUTOCONFIG_PROFILES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_autoconfig_profiles);
|
|
|
|
break;
|
2016-09-28 22:45:31 -04:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_enable_host);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_enable_client);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_NETPLAY_DISCONNECT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_disconnect);
|
|
|
|
break;
|
2017-08-03 18:38:30 -04:00
|
|
|
case MENU_ENUM_LABEL_CORE_DELETE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_delete);
|
|
|
|
break;
|
2016-06-16 17:50:53 +02:00
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_OPEN_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_LOAD_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_LOAD_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PASS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_AUDIO_DSP_PLUGIN:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_dsp_plugin);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RECORD_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile);
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
case MENU_LABEL_UPDATE_LAKKA:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_list);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_parameters);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_ACCOUNTS_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_cheevos_list);
|
|
|
|
break;
|
2016-12-13 01:06:28 +01:00
|
|
|
case MENU_LABEL_FAVORITES:
|
2016-06-16 17:50:53 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_content_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_downloads_dir);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DETECT_CORE_LIST_OK:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SHADER_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_FILE_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_SAVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_SAVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_game);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DISK_IMAGE_APPEND:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SCREEN_RESOLUTION:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_video_resolution);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|
|
|
|
|
2015-06-05 11:48:25 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
2015-06-05 13:17:44 +02:00
|
|
|
uint32_t label_hash, uint32_t menu_label_hash, unsigned type)
|
2015-06-05 11:48:25 +02:00
|
|
|
{
|
2015-06-07 17:16:21 +02:00
|
|
|
if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
|
|
|
|
type == MENU_SETTINGS_CUSTOM_BIND)
|
2015-10-11 19:59:14 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
2015-10-11 19:59:14 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, NULL);
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
2015-10-11 19:59:14 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, NULL);
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_CHEAT_END)
|
2015-10-11 19:59:14 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat);
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
else
|
2015-02-26 16:50:30 +01:00
|
|
|
{
|
2015-06-07 17:16:21 +02:00
|
|
|
switch (type)
|
|
|
|
{
|
2015-06-25 09:15:34 +02:00
|
|
|
case MENU_SETTING_ACTION_CORE_DISK_OPTIONS:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
2015-06-25 09:15:34 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PLAYLIST_ENTRY:
|
2016-06-14 22:48:25 +02:00
|
|
|
if (label_hash == MENU_LABEL_COLLECTION)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_entry_collection);
|
|
|
|
}
|
2016-07-01 18:28:27 +02:00
|
|
|
else if (label_hash == MENU_LABEL_RDB_ENTRY_START_CONTENT)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_entry_start_content);
|
|
|
|
}
|
2016-06-14 22:48:25 +02:00
|
|
|
else
|
2016-07-01 18:28:27 +02:00
|
|
|
{
|
2016-06-14 22:48:25 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_entry);
|
2016-07-01 18:28:27 +02:00
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RPL_ENTRY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rpl_entry);
|
2015-07-23 19:44:59 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PLAYLIST_COLLECTION:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_collection);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CONTENTLIST_ENTRY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_generic_list);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CHEAT:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RECORD_CONFIG:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_REMAP:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_SHADER_PRESET:
|
2016-07-09 17:28:33 +02:00
|
|
|
/* TODO/FIXME - handle scan case */
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_SHADER:
|
2016-07-09 17:28:33 +02:00
|
|
|
/* TODO/FIXME - handle scan case */
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_IMAGE:
|
2016-07-09 17:28:33 +02:00
|
|
|
/* TODO/FIXME - handle scan case */
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_wallpaper_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_USE_DIRECTORY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_path_use_directory);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2015-11-24 01:12:50 +01:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_SCAN_DIRECTORY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_path_scan_directory);
|
2015-07-04 01:51:41 +02:00
|
|
|
break;
|
2015-11-24 01:12:50 +01:00
|
|
|
#endif
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CONFIG:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_config_load);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PARENT_DIRECTORY:
|
2015-10-25 08:31:55 +01:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_parent_directory_push);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DIRECTORY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_directory_push);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CARCHIVE:
|
2017-08-17 18:53:55 +02:00
|
|
|
if (filebrowser_get_type() == FILEBROWSER_SCAN_FILE)
|
2015-07-04 01:51:41 +02:00
|
|
|
{
|
2016-09-25 00:13:33 -04:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2017-08-17 18:53:55 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_scan_file);
|
2016-09-25 00:13:33 -04:00
|
|
|
#endif
|
2017-08-17 18:53:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_FAVORITES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_compressed_archive_push_detect_core);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_compressed_archive_push);
|
|
|
|
break;
|
|
|
|
}
|
2015-07-04 01:51:41 +02:00
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CORE:
|
2016-06-27 21:34:05 +02:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-06-07 17:16:21 +02:00
|
|
|
{
|
2016-06-18 19:07:51 +02:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_CORE_UPDATER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
|
|
|
break;
|
2016-06-20 00:31:13 +02:00
|
|
|
case MSG_UNKNOWN:
|
2016-06-18 19:07:51 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_core_deferred);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_LIST_SET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_deferred_set);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_core);
|
|
|
|
break;
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE_CONTENT:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_download);
|
2015-07-04 04:01:35 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT:
|
2016-04-23 22:31:39 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_thumbnails);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_updater_download);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-21 01:40:55 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_URL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_download_url);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_THUMBNAIL:
|
2016-04-23 22:31:39 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_download);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_LAKKA:
|
2015-12-25 02:13:50 +07:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_download);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE_INFO:
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RDB:
|
2015-06-05 10:50:16 +02:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
2015-06-07 17:16:21 +02:00
|
|
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
2015-06-05 10:50:16 +02:00
|
|
|
break;
|
2015-06-07 17:16:21 +02:00
|
|
|
case MENU_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
case MENU_VALUE_HORIZONTAL_MENU:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_database_manager_list);
|
2015-06-05 10:50:16 +02:00
|
|
|
break;
|
2015-06-07 17:16:21 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_RDB_ENTRY:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rdb_entry);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-09-22 16:44:51 +02:00
|
|
|
case MENU_WIFI:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_wifi);
|
|
|
|
break;
|
2016-12-02 22:40:26 -05:00
|
|
|
case MENU_NETPLAY_LAN_SCAN:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_netplay_lan_scan);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CURSOR:
|
2015-06-07 17:16:21 +02:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_CURSOR_MANAGER_LIST:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_cursor_manager_list);
|
2015-06-05 10:50:16 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_VIDEOFILTER:
|
2017-01-01 01:44:12 +01:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_set_path_videofilter);
|
|
|
|
break;
|
|
|
|
case FILE_TYPE_FONT:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_set_path);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2017-01-01 01:34:28 +01:00
|
|
|
case FILE_TYPE_OVERLAY:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_set_path_overlay);
|
|
|
|
break;
|
2017-01-01 01:44:12 +01:00
|
|
|
case FILE_TYPE_AUDIOFILTER:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_set_path_audiofilter);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_IN_CARCHIVE:
|
|
|
|
case FILE_TYPE_PLAIN:
|
2017-08-17 18:53:55 +02:00
|
|
|
if (filebrowser_get_type() == FILEBROWSER_SCAN_FILE)
|
2015-06-07 17:16:21 +02:00
|
|
|
{
|
2015-11-24 01:18:00 +01:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2017-08-17 18:53:55 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_scan_file);
|
2015-11-24 01:12:50 +01:00
|
|
|
#endif
|
2017-08-17 18:53:55 +02:00
|
|
|
}
|
|
|
|
else if (cbs->enum_idx != MSG_UNKNOWN)
|
|
|
|
{
|
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
2016-07-03 10:56:41 +02:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
2016-12-13 01:06:28 +01:00
|
|
|
case MENU_ENUM_LABEL_FAVORITES:
|
2016-07-03 10:56:41 +02:00
|
|
|
case MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE:
|
2015-06-08 20:29:45 +02:00
|
|
|
#ifdef HAVE_COMPRESSION
|
2016-07-03 10:56:41 +02:00
|
|
|
if (type == FILE_TYPE_IN_CARCHIVE)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core_carchive);
|
|
|
|
}
|
|
|
|
else
|
2015-06-08 20:29:45 +02:00
|
|
|
#endif
|
2017-08-17 19:07:38 +02:00
|
|
|
if (filebrowser_get_type() == FILEBROWSER_APPEND_IMAGE)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append);
|
|
|
|
}
|
|
|
|
else
|
2016-07-03 10:56:41 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
2016-12-13 01:06:28 +01:00
|
|
|
case MENU_LABEL_FAVORITES:
|
2016-07-03 10:56:41 +02:00
|
|
|
case MENU_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE:
|
|
|
|
#ifdef HAVE_COMPRESSION
|
|
|
|
if (type == FILE_TYPE_IN_CARCHIVE)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core_carchive);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
2017-08-17 19:07:38 +02:00
|
|
|
if (filebrowser_get_type() == FILEBROWSER_APPEND_IMAGE)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append);
|
|
|
|
}
|
|
|
|
else
|
2016-07-03 10:56:41 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load);
|
|
|
|
break;
|
|
|
|
}
|
2015-06-07 17:16:21 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_MOVIE:
|
2015-06-23 06:44:29 +02:00
|
|
|
#ifdef HAVE_FFMPEG
|
2016-07-09 17:28:33 +02:00
|
|
|
/* TODO/FIXME - handle scan case */
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_ffmpeg);
|
2015-06-23 06:44:29 +02:00
|
|
|
#endif
|
|
|
|
break;
|
2017-05-27 23:56:10 +02:00
|
|
|
case FILE_TYPE_MUSIC:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_music);
|
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_IMAGEVIEWER:
|
2016-07-09 17:28:33 +02:00
|
|
|
/* TODO/FIXME - handle scan case */
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_imageviewer);
|
2015-06-28 17:21:32 +02:00
|
|
|
break;
|
2016-12-12 16:20:43 +01:00
|
|
|
case FILE_TYPE_DIRECT_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load);
|
|
|
|
break;
|
2015-06-07 17:16:21 +02:00
|
|
|
case MENU_SETTINGS:
|
|
|
|
case MENU_SETTING_GROUP:
|
|
|
|
case MENU_SETTING_SUBGROUP:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
|
|
|
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_CYCLE_TRAY_STATUS:
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_cycle_tray_status);
|
2015-06-07 17:16:21 +02:00
|
|
|
break;
|
2015-11-15 22:09:39 -05:00
|
|
|
case MENU_SETTINGS_CORE_OPTION_CREATE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_option_create);
|
|
|
|
break;
|
2015-06-07 17:16:21 +02:00
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
2015-06-05 11:48:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
2015-06-05 11:48:25 +02:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
2015-06-05 13:17:44 +02:00
|
|
|
uint32_t label_hash, uint32_t menu_label_hash)
|
2015-06-05 11:48:25 +02:00
|
|
|
{
|
2015-06-07 18:36:10 +02:00
|
|
|
if (!cbs)
|
|
|
|
return -1;
|
2015-06-05 11:48:25 +02:00
|
|
|
|
2015-10-11 19:59:14 +02:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
2015-06-05 11:48:25 +02:00
|
|
|
|
2016-07-01 20:18:51 +02:00
|
|
|
if (menu_cbs_init_bind_ok_compare_label(cbs, label, label_hash) == 0)
|
2015-06-07 18:36:10 +02:00
|
|
|
return 0;
|
2015-06-05 11:48:25 +02:00
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
if (menu_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type) == 0)
|
2015-06-07 18:36:10 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -1;
|
2015-02-26 16:50:30 +01:00
|
|
|
}
|