2016-10-20 13:57:35 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2016 - 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 <compat/strl.h>
|
|
|
|
#include <file/file_path.h>
|
|
|
|
|
|
|
|
#include "../menu_driver.h"
|
|
|
|
#include "../menu_cbs.h"
|
|
|
|
#include "../menu_navigation.h"
|
|
|
|
#include "../../file_path_special.h"
|
|
|
|
|
|
|
|
#ifndef BIND_ACTION_SUBLABEL
|
|
|
|
#define BIND_ACTION_SUBLABEL(cbs, name) \
|
|
|
|
cbs->action_sublabel = name; \
|
|
|
|
cbs->action_sublabel_ident = #name;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int action_bind_sublabel_generic(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-24 02:27:43 +00:00
|
|
|
static int action_bind_sublabel_menu_settings_list(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_MENU_SETTINGS), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 14:10:20 +00:00
|
|
|
static int action_bind_sublabel_video_settings_list(
|
2016-10-20 13:57:35 +00:00
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
2016-10-20 14:10:20 +00:00
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_SETTINGS), len);
|
2016-10-20 13:57:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 15:45:35 +00:00
|
|
|
static int action_bind_sublabel_suspend_screensaver_enable(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_SUSPEND_SCREENSAVER_ENABLE), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 14:19:14 +00:00
|
|
|
static int action_bind_sublabel_audio_settings_list(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_AUDIO_SETTINGS), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 17:42:42 +00:00
|
|
|
static int action_bind_sublabel_max_swapchain_images(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_online_updater(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_ONLINE_UPDATER), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 17:28:45 +00:00
|
|
|
static int action_bind_sublabel_fps_show(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_FPS_SHOW), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 17:50:25 +00:00
|
|
|
static int action_bind_sublabel_netplay_settings(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
2016-10-20 18:52:20 +00:00
|
|
|
|
2016-10-20 17:50:25 +00:00
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_NETPLAY), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 18:52:20 +00:00
|
|
|
static int action_bind_sublabel_user_bind_settings(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_INPUT_USER_BINDS), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_input_hotkey_settings(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BINDS), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_add_content_list(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_ADD_CONTENT_LIST), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_video_frame_delay(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_FRAME_DELAY), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_video_black_frame_insertion(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_BLACK_FRAME_INSERTION), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 23:05:47 +00:00
|
|
|
static int action_bind_sublabel_systeminfo_cpu_cores(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_CPU_CORES), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_toggle_gamepad_combo(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_INPUT_MENU_ENUM_TOGGLE_GAMEPAD_COMBO), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 23:29:54 +00:00
|
|
|
static int action_bind_sublabel_show_hidden_files(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_SHOW_HIDDEN_FILES), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_log_verbosity(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_LOG_VERBOSITY), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-21 04:52:52 +00:00
|
|
|
static int action_bind_sublabel_video_monitor_index(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_MONITOR_INDEX), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_bind_sublabel_video_refresh_rate_auto(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE_AUTO), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-24 09:51:51 +00:00
|
|
|
static int action_bind_sublabel_video_hard_sync(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_HARD_SYNC), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-21 04:56:11 +00:00
|
|
|
static int action_bind_sublabel_video_hard_sync_frames(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_HARD_SYNC_FRAMES), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-24 09:51:51 +00:00
|
|
|
static int action_bind_sublabel_video_threaded(
|
|
|
|
file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len)
|
|
|
|
{
|
|
|
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_THREADED), len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-10-20 13:57:35 +00:00
|
|
|
int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|
|
|
const char *path, const char *label, unsigned type, size_t idx)
|
|
|
|
{
|
|
|
|
if (!cbs)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_generic);
|
|
|
|
|
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
|
|
|
{
|
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
2016-10-24 09:51:51 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_THREADED:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_threaded);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_HARD_SYNC:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_hard_sync);
|
|
|
|
break;
|
2016-10-21 04:56:11 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_HARD_SYNC_FRAMES:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_hard_sync_frames);
|
|
|
|
break;
|
2016-10-21 04:52:52 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_refresh_rate_auto);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_MONITOR_INDEX:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_monitor_index);
|
|
|
|
break;
|
2016-10-20 23:29:54 +00:00
|
|
|
case MENU_ENUM_LABEL_LOG_VERBOSITY:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_log_verbosity);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SHOW_HIDDEN_FILES:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_show_hidden_files);
|
|
|
|
break;
|
2016-10-20 23:05:47 +00:00
|
|
|
case MENU_ENUM_LABEL_INPUT_MENU_ENUM_TOGGLE_GAMEPAD_COMBO:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_toggle_gamepad_combo);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CPU_CORES:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_systeminfo_cpu_cores);
|
|
|
|
break;
|
2016-10-20 18:52:20 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_BLACK_FRAME_INSERTION:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_black_frame_insertion);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_FRAME_DELAY:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_frame_delay);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_add_content_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_INPUT_HOTKEY_BINDS:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_hotkey_settings);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_1_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_2_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_3_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_4_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_5_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_6_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_7_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_8_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_9_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_10_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_11_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_12_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_13_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_14_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_15_BINDS:
|
|
|
|
case MENU_ENUM_LABEL_INPUT_USER_16_BINDS:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_user_bind_settings);
|
|
|
|
break;
|
2016-10-20 17:50:25 +00:00
|
|
|
case MENU_ENUM_LABEL_NETPLAY:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_netplay_settings);
|
|
|
|
break;
|
2016-10-20 17:42:42 +00:00
|
|
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_online_updater);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_max_swapchain_images);
|
|
|
|
break;
|
2016-10-20 17:28:45 +00:00
|
|
|
case MENU_ENUM_LABEL_FPS_SHOW:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_fps_show);
|
|
|
|
break;
|
2016-10-24 02:27:43 +00:00
|
|
|
case MENU_ENUM_LABEL_MENU_SETTINGS:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_settings_list);
|
|
|
|
break;
|
2016-10-20 14:10:20 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SETTINGS:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_settings_list);
|
2016-10-20 13:57:35 +00:00
|
|
|
break;
|
2016-10-20 14:19:14 +00:00
|
|
|
case MENU_ENUM_LABEL_AUDIO_SETTINGS:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_settings_list);
|
|
|
|
break;
|
2016-10-20 15:45:35 +00:00
|
|
|
case MENU_ENUM_LABEL_SUSPEND_SCREENSAVER_ENABLE:
|
|
|
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_suspend_screensaver_enable);
|
|
|
|
break;
|
2016-10-20 13:57:35 +00:00
|
|
|
default:
|
|
|
|
case MSG_UNKNOWN:
|
2016-10-20 14:10:20 +00:00
|
|
|
return -1;
|
2016-10-20 13:57:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-20 14:10:20 +00:00
|
|
|
return 0;
|
2016-10-20 13:57:35 +00:00
|
|
|
}
|