RetroArch/menu/cbs/menu_cbs_get_value.c

1985 lines
57 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
2017-01-22 12:40:32 +00:00
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <file/file_path.h>
2016-09-01 16:01:41 +00:00
#include <compat/strl.h>
#include <string/stdstring.h>
#include <lists/string_list.h>
2016-09-08 03:39:08 +00:00
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
2015-12-06 16:55:27 +00:00
#include "../menu_driver.h"
2015-09-26 23:10:15 +00:00
#include "../menu_animation.h"
#include "../menu_cbs.h"
#include "../menu_shader.h"
#include "../../tasks/tasks_internal.h"
2016-02-16 03:54:26 +00:00
#include "../../input/input_config.h"
2016-09-06 04:11:44 +00:00
#include "../../core.h"
#include "../../core_info.h"
2016-09-01 16:01:41 +00:00
#include "../../configuration.h"
2016-06-26 08:12:28 +00:00
#include "../../file_path_special.h"
2016-05-09 23:25:47 +00:00
#include "../../managers/core_option_manager.h"
#include "../../managers/cheat_manager.h"
2016-05-10 06:53:14 +00:00
#include "../../performance_counters.h"
#include "../../paths.h"
2017-05-11 07:11:46 +00:00
#include "../../retroarch.h"
#include "../../wifi/wifi_driver.h"
2015-10-11 19:19:18 +00:00
#ifndef BIND_ACTION_GET_VALUE
#define BIND_ACTION_GET_VALUE(cbs, name) \
cbs->action_get_value = name; \
cbs->action_get_value_ident = #name;
#endif
static void menu_action_setting_disp_set_label_cheat_num_passes(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*w = 19;
strlcpy(s2, path, len2);
snprintf(s, len, "%u", cheat_manager_get_buf_size());
}
2016-07-08 16:38:09 +00:00
static void menu_action_setting_disp_set_label_cheevos_locked_entry(
2016-07-08 16:19:10 +00:00
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*w = 19;
strlcpy(s2, path, len2);
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY), len);
2016-07-08 16:38:09 +00:00
}
static void menu_action_setting_disp_set_label_cheevos_unlocked_entry(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*w = 19;
strlcpy(s2, path, len2);
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY), len);
2016-07-08 16:19:10 +00:00
}
static void menu_action_setting_disp_set_label_remap_file_load(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
global_t *global = global_get_ptr();
*w = 19;
strlcpy(s2, path, len2);
if (global)
fill_pathname_base(s, global->name.remapfile,
len);
}
static void menu_action_setting_disp_set_label_configurations(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*w = 19;
strlcpy(s2, path, len2);
2016-09-30 02:43:16 +00:00
if (!path_is_empty(RARCH_PATH_CONFIG))
2016-09-29 06:31:41 +00:00
fill_pathname_base(s, path_get(RARCH_PATH_CONFIG),
2015-06-02 16:31:44 +00:00
len);
else
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT), len);
}
static void menu_action_setting_disp_set_label_shader_filter_pass(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-12-10 18:56:08 +00:00
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(
type - MENU_SETTINGS_SHADER_PASS_FILTER_0);
2015-12-10 18:56:08 +00:00
#endif
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
if (!shader_pass)
return;
2017-01-09 02:14:53 +00:00
switch (shader_pass->filter)
2015-06-21 21:54:57 +00:00
{
case 0:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DONT_CARE),
2015-06-21 21:54:57 +00:00
len);
break;
case 1:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LINEAR),
2015-06-21 21:54:57 +00:00
len);
break;
case 2:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NEAREST),
2015-06-21 21:54:57 +00:00
len);
break;
}
#endif
}
static void menu_action_setting_disp_set_label_filter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-03-20 20:22:38 +00:00
settings_t *settings = config_get_ptr();
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
2017-04-28 22:39:29 +00:00
if (settings && *settings->paths.path_softfilter_plugin)
2015-06-22 17:39:56 +00:00
fill_short_pathname_representation(s,
2017-04-28 22:39:29 +00:00
settings->paths.path_softfilter_plugin, len);
}
static void menu_action_setting_disp_set_label_pipeline(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
*s = '\0';
*w = 19;
2017-04-28 19:03:04 +00:00
switch (settings->uints.menu_xmb_shader_pipeline)
{
2016-07-14 16:40:57 +00:00
case XMB_SHADER_PIPELINE_WALLPAPER:
2016-07-01 03:49:18 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
break;
2016-07-14 16:40:57 +00:00
case XMB_SHADER_PIPELINE_SIMPLE_RIBBON:
2016-10-30 22:14:13 +00:00
strlcpy(s,
2016-07-10 12:35:27 +00:00
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED), len);
break;
2016-07-14 16:40:57 +00:00
case XMB_SHADER_PIPELINE_RIBBON:
2016-10-30 22:14:13 +00:00
strlcpy(s,
2016-07-10 12:35:27 +00:00
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON), len);
break;
case XMB_SHADER_PIPELINE_SIMPLE_SNOW:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SIMPLE_SNOW), len);
break;
case XMB_SHADER_PIPELINE_SNOW:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOW), len);
break;
2017-01-08 02:56:47 +00:00
case XMB_SHADER_PIPELINE_BOKEH:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH), len);
break;
}
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_shader_num_passes(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
snprintf(s, len, "%u", menu_shader_manager_get_amount_passes());
#endif
}
static void menu_action_setting_disp_set_label_shader_pass(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-12-10 18:56:08 +00:00
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(
type - MENU_SETTINGS_SHADER_PASS_0);
2015-12-10 18:56:08 +00:00
#endif
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
if (!shader_pass)
return;
2015-12-10 18:56:08 +00:00
2017-01-09 02:14:53 +00:00
if (!string_is_empty(shader_pass->source.path))
fill_pathname_base(s, shader_pass->source.path, len);
#endif
}
static void menu_action_setting_disp_set_label_shader_default_filter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-03-20 20:22:38 +00:00
settings_t *settings = config_get_ptr();
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
2015-06-21 21:58:50 +00:00
if (!settings)
return;
2017-04-27 22:53:06 +00:00
if (settings->bools.video_smooth)
2016-10-30 22:14:13 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LINEAR), len);
2015-06-21 21:58:50 +00:00
else
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NEAREST), len);
}
static void menu_action_setting_disp_set_label_shader_parameter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2016-02-14 21:13:21 +00:00
video_shader_ctx_t shader_info;
const struct video_shader_parameter *param = NULL;
#endif
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2016-05-08 19:11:27 +00:00
video_shader_driver_get_current_shader(&shader_info);
2016-02-14 21:13:21 +00:00
if (!shader_info.data)
return;
2016-10-30 22:14:13 +00:00
param = &shader_info.data->parameters[type -
2016-07-10 12:35:27 +00:00
MENU_SETTINGS_SHADER_PARAMETER_0];
if (!param)
return;
2015-06-02 16:31:44 +00:00
snprintf(s, len, "%.2f [%.2f %.2f]",
param->current, param->minimum, param->maximum);
#endif
}
static void menu_action_setting_disp_set_label_shader_preset_parameter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
const struct video_shader_parameter *param = menu_shader_manager_get_parameters(
type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0);
#endif
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
if (param)
snprintf(s, len, "%.2f [%.2f %.2f]",
param->current, param->minimum, param->maximum);
#endif
}
static void menu_action_setting_disp_set_label_shader_scale_pass(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-12-10 19:05:00 +00:00
unsigned pass = 0;
unsigned scale_value = 0;
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(
type - MENU_SETTINGS_SHADER_PASS_SCALE_0);
2015-12-10 19:05:00 +00:00
#endif
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
(void)pass;
(void)scale_value;
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
2017-01-09 02:14:53 +00:00
if (!shader_pass)
return;
2017-01-09 02:14:53 +00:00
scale_value = shader_pass->fbo.scale_x;
if (!scale_value)
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DONT_CARE), len);
else
2015-06-02 16:31:44 +00:00
snprintf(s, len, "%ux", scale_value);
#endif
}
static void menu_action_setting_disp_set_label_menu_file_core(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
const char *alt = NULL;
2015-06-02 16:31:44 +00:00
strlcpy(s, "(CORE)", len);
2015-10-18 19:54:20 +00:00
menu_entries_get_at_offset(list, i, NULL,
NULL, NULL, NULL, &alt);
*w = (unsigned)strlen(s);
if (alt)
strlcpy(s2, alt, len2);
}
static void menu_action_setting_disp_set_label_input_desc(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2016-10-27 07:32:07 +00:00
char descriptor[255];
2016-02-22 11:25:41 +00:00
const struct retro_keybind *auto_bind = NULL;
const struct retro_keybind *keybind = NULL;
settings_t *settings = config_get_ptr();
2016-10-30 22:14:13 +00:00
unsigned inp_desc_index_offset =
2016-02-22 11:25:41 +00:00
type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset /
(RARCH_FIRST_CUSTOM_BIND + 4);
unsigned inp_desc_button_index_offset = inp_desc_index_offset -
(inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
2016-02-22 11:25:41 +00:00
unsigned remap_id = 0;
if (!settings)
return;
2016-10-27 07:32:07 +00:00
descriptor[0] = '\0';
2016-10-30 22:14:13 +00:00
2017-04-28 19:03:04 +00:00
remap_id = settings->uints.input_remap_ids
[inp_desc_user][inp_desc_button_index_offset];
2017-04-25 22:24:59 +00:00
keybind = &input_config_binds[inp_desc_user][remap_id];
2016-02-22 11:25:41 +00:00
auto_bind = (const struct retro_keybind*)
input_config_get_bind_auto(inp_desc_user, remap_id);
input_config_get_bind_string(descriptor,
keybind, auto_bind, sizeof(descriptor));
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
{
2016-07-10 12:35:27 +00:00
if(strstr(descriptor, "Auto") && !strstr(descriptor,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)))
2016-10-30 22:14:13 +00:00
strlcpy(s,
descriptor,
len);
else
2017-04-25 16:27:18 +00:00
{
2017-04-25 22:24:59 +00:00
const struct retro_keybind *keyptr = &input_config_binds[inp_desc_user]
[remap_id];
2017-04-25 16:27:18 +00:00
strlcpy(s, msg_hash_to_str(keyptr->enum_idx), len);
}
}
else
2016-10-25 17:57:04 +00:00
{
const char *str = NULL;
switch (remap_id)
{
case 0:
str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X);
break;
case 1:
str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y);
break;
case 2:
str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X);
break;
case 3:
str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y);
break;
}
2016-10-26 01:19:46 +00:00
if (!string_is_empty(str))
strlcpy(s, str, len);
2016-10-25 17:57:04 +00:00
}
*w = 19;
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_cheat(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
unsigned cheat_index = type - MENU_SETTINGS_CHEAT_BEGIN;
if (cheat_index < cheat_manager_get_buf_size())
2015-06-02 16:31:44 +00:00
snprintf(s, len, "%s : (%s)",
2015-12-01 01:49:27 +00:00
(cheat_manager_get_code(cheat_index) != NULL)
2016-10-30 22:14:13 +00:00
? cheat_manager_get_code(cheat_index) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
2016-10-30 22:14:13 +00:00
cheat_manager_get_code_state(cheat_index) ?
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)
);
*w = 19;
strlcpy(s2, path, len2);
}
2015-05-17 17:21:15 +00:00
static void menu_action_setting_disp_set_label_perf_counters_common(
struct retro_perf_counter **counters,
2015-06-02 16:31:44 +00:00
unsigned offset, char *s, size_t len
2015-05-17 17:21:15 +00:00
)
{
if (!counters[offset])
return;
if (!counters[offset]->call_cnt)
return;
2015-06-02 16:31:44 +00:00
snprintf(s, len,
2015-05-17 17:21:15 +00:00
#ifdef _WIN32
"%I64u ticks, %I64u runs.",
#else
"%llu ticks, %llu runs.",
#endif
((unsigned long long)counters[offset]->total /
(unsigned long long)counters[offset]->call_cnt),
(unsigned long long)counters[offset]->call_cnt);
}
static void general_disp_set_label_perf_counters(
struct retro_perf_counter **counters,
unsigned offset,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
char *s2, size_t len2,
const char *path, unsigned *w
)
{
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
2015-05-17 17:21:15 +00:00
menu_action_setting_disp_set_label_perf_counters_common(
2015-06-02 16:31:44 +00:00
counters, offset, s, len);
2015-09-25 21:42:00 +00:00
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
}
static void menu_action_setting_disp_set_label_perf_counters(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
struct retro_perf_counter **counters = retro_get_perf_counter_rarch();
unsigned offset = type - MENU_SETTINGS_PERF_COUNTERS_BEGIN;
general_disp_set_label_perf_counters(counters, offset, s, len,
s2, len, path, w);
}
static void menu_action_setting_disp_set_label_libretro_perf_counters(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
struct retro_perf_counter **counters = retro_get_perf_counter_libretro();
unsigned offset = type - MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN;
general_disp_set_label_perf_counters(counters, offset, s, len,
s2, len, path, w);
}
static void menu_action_setting_disp_set_label_menu_more(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2016-07-16 22:52:56 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MORE), len);
2015-07-09 20:24:48 +00:00
*w = 19;
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_db_entry(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MORE), len);
*w = 10;
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_entry(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*s = '\0';
*w = 8;
strlcpy(s2, path, len2);
}
2015-06-22 20:10:14 +00:00
static void menu_action_setting_disp_set_label_state(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
if (!settings)
return;
2015-06-22 20:10:14 +00:00
strlcpy(s2, path, len2);
*w = 16;
2017-04-28 17:12:48 +00:00
snprintf(s, len, "%d", settings->ints.state_slot);
if (settings->ints.state_slot == -1)
2015-06-22 20:10:14 +00:00
strlcat(s, " (Auto)", len);
}
static void menu_action_setting_disp_set_label_poll_type_behavior(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
if (!settings)
return;
strlcpy(s2, path, len2);
*w = 19;
2017-04-28 19:03:04 +00:00
switch (settings->uints.input_poll_type_behavior)
{
case 0:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_EARLY), len);
break;
case 1:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_NORMAL), len);
break;
case 2:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_LATE), len);
break;
}
}
2016-03-21 19:54:16 +00:00
static void menu_action_setting_disp_set_label_xmb_theme(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
if (!settings)
return;
strlcpy(s2, path, len2);
*w = 19;
2017-04-28 19:03:04 +00:00
switch (settings->uints.menu_xmb_theme)
2016-03-21 19:54:16 +00:00
{
case XMB_ICON_THEME_MONOCHROME:
2016-07-14 22:00:57 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_MONOCHROME), len);
2016-03-21 19:54:16 +00:00
break;
case XMB_ICON_THEME_FLATUI:
2016-07-14 22:00:57 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_FLATUI), len);
2016-03-21 19:54:16 +00:00
break;
case XMB_ICON_THEME_RETROACTIVE:
2016-07-14 22:00:57 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_RETROACTIVE), len);
break;
case XMB_ICON_THEME_PIXEL:
2016-07-14 22:00:57 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_PIXEL), len);
break;
2016-10-31 20:15:33 +00:00
case XMB_ICON_THEME_NEOACTIVE:
2016-10-30 22:14:13 +00:00
strlcpy(s,
2016-10-31 20:15:33 +00:00
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_NEOACTIVE), len);
2016-10-30 22:14:13 +00:00
break;
2016-12-09 05:39:39 +00:00
case XMB_ICON_THEME_SYSTEMATIC:
2016-10-31 20:15:33 +00:00
strlcpy(s,
2016-12-09 05:39:39 +00:00
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_SYSTEMATIC), len);
2016-10-31 20:15:33 +00:00
break;
2017-01-31 02:13:44 +00:00
case XMB_ICON_THEME_DOTART:
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_DOTART), len);
break;
case XMB_ICON_THEME_CUSTOM:
2016-07-14 22:00:57 +00:00
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM), len);
2016-03-21 19:54:16 +00:00
break;
}
}
static void menu_action_setting_disp_set_label_wifi_is_online(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
strlcpy(s2, path, len2);
*w = 19;
if (driver_wifi_ssid_is_online(i))
2016-11-08 00:21:21 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ONLINE), len);
}
static void menu_action_setting_disp_set_label_xmb_menu_color_theme(
2016-04-22 06:47:14 +00:00
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
2016-07-01 03:46:12 +00:00
strlcpy(s2, path, len2);
*w = 19;
2016-04-22 06:47:14 +00:00
if (!settings)
return;
2017-04-28 19:03:04 +00:00
switch (settings->uints.menu_xmb_color_theme)
2016-04-22 06:47:14 +00:00
{
case XMB_THEME_WALLPAPER:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_PLAIN),
len);
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_LEGACY_RED:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_LEGACY_RED),
len);
2016-04-22 06:47:14 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_DARK_PURPLE:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_DARK_PURPLE),
len);
2016-04-22 06:47:14 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_MIDNIGHT_BLUE:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_MIDNIGHT_BLUE),
len);
2016-04-22 06:47:14 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_GOLDEN:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_GOLDEN),
len);
2016-04-22 08:20:08 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_ELECTRIC_BLUE:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_ELECTRIC_BLUE),
len);
2016-04-22 08:20:08 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_APPLE_GREEN:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_APPLE_GREEN),
len);
2016-04-22 08:20:08 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_UNDERSEA:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_UNDERSEA),
len);
2016-04-22 06:47:14 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_VOLCANIC_RED:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_VOLCANIC_RED),
len);
2016-04-22 11:16:31 +00:00
break;
2016-07-14 16:19:59 +00:00
case XMB_THEME_DARK:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_DARK),
len);
break;
2016-04-22 06:47:14 +00:00
}
}
static void menu_action_setting_disp_set_label_materialui_menu_color_theme(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
strlcpy(s2, path, len2);
*w = 19;
if (!settings)
return;
2017-04-28 19:03:04 +00:00
switch (settings->uints.menu_materialui_color_theme)
{
2016-07-10 14:11:03 +00:00
case MATERIALUI_THEME_BLUE:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
2016-07-10 14:11:03 +00:00
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_BLUE), len);
break;
2016-07-10 19:23:57 +00:00
case MATERIALUI_THEME_BLUE_GREY:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_BLUE_GREY), len);
break;
case MATERIALUI_THEME_GREEN:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_GREEN), len);
break;
case MATERIALUI_THEME_RED:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_RED), len);
break;
case MATERIALUI_THEME_YELLOW:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_YELLOW), len);
break;
2016-07-10 14:11:03 +00:00
case MATERIALUI_THEME_DARK_BLUE:
2016-07-10 12:35:27 +00:00
strlcpy(s,
msg_hash_to_str(
2016-07-10 14:11:03 +00:00
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_DARK_BLUE), len);
break;
case MATERIALUI_THEME_NVIDIA_SHIELD:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_NVIDIA_SHIELD), len);
break;
default:
break;
}
}
2016-04-07 18:42:53 +00:00
static void menu_action_setting_disp_set_label_thumbnails(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
if (!settings)
return;
strlcpy(s2, path, len2);
*w = 19;
2016-07-01 14:33:43 +00:00
2017-04-28 19:03:04 +00:00
switch (settings->uints.menu_thumbnails)
2016-04-07 18:42:53 +00:00
{
case 0:
2016-07-01 14:33:43 +00:00
strlcpy(s, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OFF), len);
2016-04-07 18:42:53 +00:00
break;
case 1:
2016-07-01 14:33:43 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_SCREENSHOTS), len);
2016-04-07 18:42:53 +00:00
break;
case 2:
2016-10-30 22:14:13 +00:00
strlcpy(s,
2016-07-01 14:33:43 +00:00
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS), len);
2016-04-07 18:42:53 +00:00
break;
case 3:
2016-07-01 14:33:43 +00:00
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_BOXARTS), len);
2016-04-07 18:42:53 +00:00
break;
}
}
2015-07-09 04:27:17 +00:00
static void menu_action_setting_disp_set_label_menu_toggle_gamepad_combo(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
if (!settings)
return;
strlcpy(s2, path, len2);
2015-07-09 20:24:48 +00:00
*w = 19;
2016-08-02 14:53:08 +00:00
2017-04-28 19:03:04 +00:00
switch (settings->uints.input_menu_toggle_gamepad_combo)
2015-07-09 04:27:17 +00:00
{
2016-08-02 14:53:08 +00:00
case INPUT_TOGGLE_NONE:
2016-07-01 03:49:18 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NONE), len);
2015-07-09 04:27:17 +00:00
break;
2016-08-02 14:53:08 +00:00
case INPUT_TOGGLE_DOWN_Y_L_R:
2016-07-01 03:49:18 +00:00
strlcpy(s, "Down + L1 + R1 + Y", len);
2015-07-09 04:27:17 +00:00
break;
2016-08-02 14:53:08 +00:00
case INPUT_TOGGLE_L3_R3:
2016-07-01 03:49:18 +00:00
strlcpy(s, "L3 + R3", len);
2016-08-02 14:53:08 +00:00
break;
case INPUT_TOGGLE_L1_R1_START_SELECT:
strlcpy(s, "L1 + R1 + Start + Select", len);
break;
case INPUT_TOGGLE_START_SELECT:
2016-07-01 03:49:18 +00:00
strlcpy(s, "Start + Select", len);
2015-07-09 04:27:17 +00:00
break;
}
}
static void menu_action_setting_disp_set_label_menu_disk_index(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-12-10 21:30:25 +00:00
unsigned images = 0, current = 0;
struct retro_disk_control_callback *control = NULL;
2017-04-23 14:41:26 +00:00
rarch_system_info_t *system = runloop_get_system_info();
if (!system)
return;
2016-03-04 19:00:49 +00:00
control = &system->disk_control_cb;
if (!control)
return;
*w = 19;
2015-06-02 16:31:44 +00:00
*s = '\0';
strlcpy(s2, path, len2);
if (!control->get_num_images)
return;
if (!control->get_image_index)
return;
images = control->get_num_images();
current = control->get_image_index();
if (current >= images)
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_DISK), len);
else
2015-06-02 16:31:44 +00:00
snprintf(s, len, "%u", current + 1);
}
static void menu_action_setting_disp_set_label_menu_input_keyboard_gamepad_mapping_type(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
unsigned width = 0, height = 0;
*w = 19;
*s = '\0';
(void)width;
(void)height;
strlcpy(s2, path, len2);
2017-04-28 19:03:04 +00:00
switch (settings->uints.input_keyboard_gamepad_mapping_type)
{
case 0:
2016-06-29 00:44:27 +00:00
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NONE), len);
break;
case 1:
strlcpy(s, "iPega PG-9017", len);
break;
case 2:
strlcpy(s, "8-bitty", len);
break;
2015-11-15 01:26:31 +00:00
case 3:
strlcpy(s, "SNES30 8bitdo", len);
break;
}
}
static void menu_action_setting_disp_set_label_menu_video_resolution(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
unsigned width = 0, height = 0;
*w = 19;
2015-06-02 16:31:44 +00:00
*s = '\0';
strlcpy(s2, path, len2);
2015-03-08 04:48:29 +00:00
if (video_driver_get_video_output_size(&width, &height))
{
#ifdef GEKKO
if (width == 0 || height == 0)
strlcpy(s, "DEFAULT", len);
else
#endif
snprintf(s, len, "%ux%u", width, height);
}
else
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
}
static void menu_action_setting_generic_disp_set_label(
2015-06-02 16:31:44 +00:00
unsigned *w, char *s, size_t len,
const char *path, const char *label,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
*s = '\0';
if (label)
2015-06-02 16:31:44 +00:00
strlcpy(s, label, len);
*w = (unsigned)strlen(s);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_menu_file_plain(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(FILE)", s2, len2);
}
2015-06-28 15:21:32 +00:00
static void menu_action_setting_disp_set_label_menu_file_imageviewer(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(IMAGE)", s2, len2);
}
static void menu_action_setting_disp_set_label_movie(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(MOVIE)", s2, len2);
}
static void menu_action_setting_disp_set_label_music(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(MUSIC)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_use_directory(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, NULL, s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_directory(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(DIR)", s2, len2);
}
2015-10-25 07:31:55 +00:00
static void menu_action_setting_disp_set_label_menu_file_parent_directory(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
menu_action_setting_generic_disp_set_label(w, s, len,
path, NULL, s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_carchive(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(COMP)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_shader(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(SHADER)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_shader_preset(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(PRESET)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_in_carchive(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(CFILE)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_overlay(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(OVERLAY)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_config(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(CONFIG)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_font(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(FONT)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_filter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(FILTER)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_url_core(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
const char *alt = NULL;
strlcpy(s, "(CORE)", len);
2015-10-18 19:54:20 +00:00
menu_entries_get_at_offset(list, i, NULL,
NULL, NULL, NULL, &alt);
*w = (unsigned)strlen(s);
if (alt)
strlcpy(s2, alt, len2);
}
static void menu_action_setting_disp_set_label_menu_file_rdb(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(RDB)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_cursor(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(CURSOR)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_cheat(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
2015-06-02 16:31:44 +00:00
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
menu_action_setting_generic_disp_set_label(w, s, len,
path, "(CHEAT)", s2, len2);
}
static void menu_action_setting_disp_set_label_core_option_create(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2017-04-23 14:41:26 +00:00
rarch_system_info_t *system = runloop_get_system_info();
2015-12-10 21:30:25 +00:00
if (!system)
return;
*s = '\0';
*w = 19;
strlcpy(s, "", len);
2016-09-29 06:46:41 +00:00
if (!string_is_empty(path_get(RARCH_PATH_BASENAME)))
strlcpy(s, path_basename(path_get(RARCH_PATH_BASENAME)), len);
strlcpy(s2, path, len2);
}
2016-05-18 19:21:58 +00:00
static void menu_action_setting_disp_set_label_playlist_associations(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2016-10-27 07:32:07 +00:00
char playlist_name_with_ext[255];
2016-05-26 04:50:57 +00:00
bool found_matching_core_association = false;
settings_t *settings = config_get_ptr();
2017-04-28 20:59:13 +00:00
struct string_list *str_list = string_split(settings->arrays.playlist_names, ";");
struct string_list *str_list2 = string_split(settings->arrays.playlist_cores, ";");
2016-05-26 04:50:57 +00:00
2016-05-18 19:21:58 +00:00
strlcpy(s2, path, len2);
playlist_name_with_ext[0] = '\0';
2016-05-18 19:21:58 +00:00
*s = '\0';
*w = 19;
2016-07-01 14:36:57 +00:00
fill_pathname_noext(playlist_name_with_ext, path,
2016-06-26 08:12:28 +00:00
file_path_str(FILE_PATH_LPL_EXTENSION),
sizeof(playlist_name_with_ext));
2016-05-18 19:21:58 +00:00
for (i = 0; i < str_list->size; i++)
{
if (string_is_equal(str_list->elems[i].data, playlist_name_with_ext))
{
if (str_list->size != str_list2->size)
break;
if (str_list2->elems[i].data == NULL)
break;
found_matching_core_association = true;
strlcpy(s, str_list2->elems[i].data, len);
}
}
string_list_free(str_list);
string_list_free(str_list2);
2016-07-01 14:36:57 +00:00
if (string_is_equal(s, file_path_str(FILE_PATH_DETECT)) || !found_matching_core_association)
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
2016-05-18 19:21:58 +00:00
else
{
char buf[PATH_MAX_LENGTH];
core_info_list_t *list = NULL;
core_info_get_list(&list);
if (core_info_list_get_display_name(list, s, buf, sizeof(buf)))
strlcpy(s, buf, len);
}
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_core_options(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
core_option_manager_t *coreopts = NULL;
const char *core_opt = NULL;
*s = '\0';
*w = 19;
2017-05-15 03:06:23 +00:00
if (rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts))
{
core_opt = core_option_manager_get_val(coreopts,
type - MENU_SETTINGS_CORE_OPTION_START);
strlcpy(s, "", len);
if (core_opt)
strlcpy(s, core_opt, len);
}
strlcpy(s2, path, len2);
2016-05-18 19:21:58 +00:00
}
static void menu_action_setting_disp_set_label_achievement_information(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
2015-06-02 16:31:44 +00:00
*s = '\0';
*w = 2;
menu_setting_get_label(list, s,
len, w, type, label, entry_label, i);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_no_items(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*s = '\0';
*w = 19;
menu_setting_get_label(list, s,
len, w, type, label, entry_label, i);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_setting_bool(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
*s = '\0';
*w = 19;
if (setting)
{
if (*setting->value.target.boolean)
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON), len);
else
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
}
strlcpy(s2, path, len2);
}
2016-10-24 03:20:29 +00:00
static void menu_action_setting_disp_set_label_setting_string(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
*w = 19;
strlcpy(s, setting->value.target.string, len);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_setting_path(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
const char *basename = setting ? path_basename(setting->value.target.string) : NULL;
2016-10-24 03:20:29 +00:00
*w = 19;
if (!string_is_empty(basename))
strlcpy(s, basename, len);
2016-10-24 03:20:29 +00:00
strlcpy(s2, path, len2);
}
static int menu_cbs_init_bind_get_string_representation_compare_label(
menu_file_list_cbs_t *cbs)
{
if (cbs->enum_idx != MSG_UNKNOWN)
{
2016-06-16 18:14:15 +00:00
switch (cbs->enum_idx)
{
2016-12-13 15:13:38 +00:00
case MENU_ENUM_LABEL_VIDEO_DRIVER:
case MENU_ENUM_LABEL_AUDIO_DRIVER:
case MENU_ENUM_LABEL_INPUT_DRIVER:
case MENU_ENUM_LABEL_JOYPAD_DRIVER:
case MENU_ENUM_LABEL_AUDIO_RESAMPLER_DRIVER:
case MENU_ENUM_LABEL_RECORD_DRIVER:
case MENU_ENUM_LABEL_LOCATION_DRIVER:
case MENU_ENUM_LABEL_CAMERA_DRIVER:
case MENU_ENUM_LABEL_WIFI_DRIVER:
case MENU_ENUM_LABEL_MENU_DRIVER:
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
break;
2016-06-16 18:14:15 +00:00
case MENU_ENUM_LABEL_STATE_SLOT:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_state);
break;
case MENU_ENUM_LABEL_INPUT_POLL_TYPE_BEHAVIOR:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_poll_type_behavior);
break;
case MENU_ENUM_LABEL_XMB_THEME:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_xmb_theme);
break;
case MENU_ENUM_LABEL_CONNECT_WIFI:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_wifi_is_online);
break;
case MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_xmb_menu_color_theme);
break;
case MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME:
2016-06-16 18:14:15 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_materialui_menu_color_theme);
2016-06-16 18:14:15 +00:00
break;
case MENU_ENUM_LABEL_THUMBNAILS:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_thumbnails);
break;
2016-06-17 15:43:53 +00:00
case MENU_ENUM_LABEL_INPUT_MENU_ENUM_TOGGLE_GAMEPAD_COMBO:
2016-06-16 18:14:15 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_toggle_gamepad_combo);
break;
case MENU_ENUM_LABEL_CHEAT_NUM_PASSES:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheat_num_passes);
break;
case MENU_ENUM_LABEL_REMAP_FILE_LOAD:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_remap_file_load);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_FILTER_PASS:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_filter_pass);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_SCALE_PASS:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_scale_pass);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_NUM_PASSES:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_num_passes);
break;
case MENU_ENUM_LABEL_XMB_RIBBON_ENABLE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_pipeline);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_PASS:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_pass);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_DEFAULT_FILTER:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_default_filter);
break;
case MENU_ENUM_LABEL_VIDEO_FILTER:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_filter);
break;
case MENU_ENUM_LABEL_CONFIGURATIONS:
2016-06-16 18:14:15 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_configurations);
break;
case MENU_ENUM_LABEL_SCREEN_RESOLUTION:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_video_resolution);
break;
case MENU_ENUM_LABEL_INPUT_KEYBOARD_GAMEPAD_MAPPING_TYPE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_input_keyboard_gamepad_mapping_type);
break;
case MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST:
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
2016-12-13 00:06:28 +00:00
case MENU_ENUM_LABEL_FAVORITES:
2016-06-16 18:14:15 +00:00
case MENU_ENUM_LABEL_CORE_OPTIONS:
case MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS:
case MENU_ENUM_LABEL_SHADER_OPTIONS:
case MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS:
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
case MENU_ENUM_LABEL_CHEAT_FILE_SAVE_AS:
case MENU_ENUM_LABEL_FRONTEND_COUNTERS:
case MENU_ENUM_LABEL_CORE_COUNTERS:
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
case MENU_ENUM_LABEL_CURSOR_MANAGER_LIST:
case MENU_ENUM_LABEL_RESTART_CONTENT:
case MENU_ENUM_LABEL_CLOSE_CONTENT:
case MENU_ENUM_LABEL_RESUME_CONTENT:
case MENU_ENUM_LABEL_TAKE_SCREENSHOT:
case MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
case MENU_ENUM_LABEL_CORE_INFORMATION:
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
2016-11-05 21:55:57 +00:00
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE:
2016-06-16 18:14:15 +00:00
case MENU_ENUM_LABEL_SAVE_STATE:
case MENU_ENUM_LABEL_LOAD_STATE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_more);
break;
default:
return - 1;
}
}
else
{
return -1;
}
return 0;
}
static int menu_cbs_init_bind_get_string_representation_compare_type(
2015-06-07 15:52:01 +00:00
menu_file_list_cbs_t *cbs, unsigned type)
{
if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
&& type <= MENU_SETTINGS_INPUT_DESC_END)
2015-10-11 19:19:18 +00:00
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_input_desc);
}
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
2015-10-11 19:19:18 +00:00
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheat);
}
else if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN
&& type <= MENU_SETTINGS_PERF_COUNTERS_END)
2015-10-11 19:19:18 +00:00
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_perf_counters);
}
else if (type >= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN
&& type <= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END)
2015-10-11 19:19:18 +00:00
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_libretro_perf_counters);
}
2015-06-07 15:52:01 +00:00
else
{
2015-06-07 15:52:01 +00:00
switch (type)
{
case MENU_SETTINGS_CORE_OPTION_CREATE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_core_option_create);
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_CORE:
case FILE_TYPE_DIRECT_LOAD:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_core);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_PLAIN:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_plain);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_MOVIE:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_movie);
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_MUSIC:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_music);
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_IMAGE:
case FILE_TYPE_IMAGEVIEWER:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_imageviewer);
2015-06-28 15:21:32 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_USE_DIRECTORY:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_use_directory);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_DIRECTORY:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_directory);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_PARENT_DIRECTORY:
2015-10-25 07:31:55 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_parent_directory);
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_CARCHIVE:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_carchive);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_OVERLAY:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_overlay);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_FONT:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_font);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_SHADER:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_shader);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_SHADER_PRESET:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_shader_preset);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_CONFIG:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_config);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_IN_CARCHIVE:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_in_carchive);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_VIDEOFILTER:
case FILE_TYPE_AUDIOFILTER:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_filter);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_DOWNLOAD_CORE:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_url_core);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_RDB:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_rdb);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_CURSOR:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_cursor);
2015-06-07 15:52:01 +00:00
break;
2016-06-20 13:50:37 +00:00
case FILE_TYPE_CHEAT:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_cheat);
2015-06-07 15:52:01 +00:00
break;
case MENU_SETTING_SUBGROUP:
case MENU_SETTINGS_CUSTOM_BIND_ALL:
case MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL:
2016-10-23 02:15:37 +00:00
case MENU_SETTING_ACTION:
case MENU_SETTING_ACTION_LOADSTATE:
2016-10-23 20:10:54 +00:00
case 7: /* Run */
case MENU_SETTING_ACTION_DELETE_ENTRY:
case MENU_SETTING_ACTION_CORE_DISK_OPTIONS:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_more);
2015-06-07 15:52:01 +00:00
break;
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_disk_index);
2015-06-07 15:52:01 +00:00
break;
case 31: /* Database entry */
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label_db_entry);
break;
case 25: /* URL directory entries */
case 26: /* URL entries */
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label_entry);
break;
2016-10-23 20:10:54 +00:00
case MENU_SETTING_NO_ITEM:
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label_no_items);
break;
case 32: /* Recent history entry */
case 65535: /* System info entry */
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label_entry);
break;
2015-06-07 15:52:01 +00:00
default:
#if 0
RARCH_LOG("type: %d\n", type);
#endif
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
2015-06-07 15:52:01 +00:00
break;
}
}
2015-06-07 15:52:01 +00:00
return 0;
}
int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx)
2015-06-07 15:52:01 +00:00
{
if (!cbs)
2015-06-07 16:36:10 +00:00
return -1;
2015-06-07 15:52:01 +00:00
2016-11-03 19:06:39 +00:00
if (strstr(label, "joypad_index") && strstr(label, "input_player"))
{
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
return 0;
}
#if 0
RARCH_LOG("MENU_SETTINGS_NONE: %d\n", MENU_SETTINGS_NONE);
2016-10-23 20:10:54 +00:00
RARCH_LOG("MENU_SETTINGS_LAST: %d\n", MENU_SETTINGS_LAST);
#endif
if (cbs->setting)
{
2016-10-31 14:01:40 +00:00
switch (setting_get_type(cbs->setting))
{
case ST_BOOL:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_setting_bool);
return 0;
2016-10-24 03:20:29 +00:00
case ST_STRING:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_setting_string);
return 0;
case ST_PATH:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_setting_path);
return 0;
default:
break;
}
}
if (cbs->enum_idx != MSG_UNKNOWN)
{
2016-06-16 15:52:32 +00:00
switch (cbs->enum_idx)
{
2016-07-08 16:38:09 +00:00
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheevos_unlocked_entry);
return 0;
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY:
2016-07-08 16:19:10 +00:00
BIND_ACTION_GET_VALUE(cbs,
2016-07-08 16:38:09 +00:00
menu_action_setting_disp_set_label_cheevos_locked_entry);
2016-07-08 16:19:10 +00:00
return 0;
2016-06-16 15:52:32 +00:00
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_more);
2016-06-16 15:52:32 +00:00
return 0;
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_achievement_information);
return 0;
2016-11-05 21:55:57 +00:00
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_achievement_information);
return 0;
2016-06-16 15:52:32 +00:00
default:
break;
}
}
2016-05-18 19:21:58 +00:00
if (type >= MENU_SETTINGS_PLAYLIST_ASSOCIATION_START)
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_playlist_associations);
return 0;
}
if (type >= MENU_SETTINGS_CORE_OPTION_START)
{
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_core_options);
return 0;
}
2016-05-18 19:21:58 +00:00
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
{
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_parameter);
return 0;
}
2015-06-27 17:24:46 +00:00
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
{
2015-10-11 19:19:18 +00:00
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_preset_parameter);
2015-06-27 17:24:46 +00:00
return 0;
}
if (menu_cbs_init_bind_get_string_representation_compare_label(cbs) == 0)
2015-06-07 16:36:10 +00:00
return 0;
if (menu_cbs_init_bind_get_string_representation_compare_type(cbs, type) == 0)
2015-06-07 16:36:10 +00:00
return 0;
2015-06-07 15:52:01 +00:00
2015-06-07 16:36:10 +00:00
return -1;
}