2015-06-01 10:24:48 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2015 - 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 <string/string_list.h>
|
|
|
|
#include <string/stdstring.h>
|
|
|
|
#include <file/file_path.h>
|
|
|
|
|
2015-06-08 09:40:20 +00:00
|
|
|
#include <rhash.h>
|
|
|
|
|
2015-06-01 10:24:48 +00:00
|
|
|
#include "menu.h"
|
|
|
|
#include "menu_entries_cbs.h"
|
|
|
|
|
|
|
|
static INLINE void replace_chars(char *str, char c1, char c2)
|
|
|
|
{
|
|
|
|
char *pos;
|
|
|
|
while((pos = strchr(str, c1)))
|
|
|
|
*pos = c2;
|
|
|
|
}
|
|
|
|
|
2015-06-02 16:28:51 +00:00
|
|
|
static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
2015-06-01 10:24:48 +00:00
|
|
|
{
|
|
|
|
char new_label[PATH_MAX_LENGTH];
|
|
|
|
strlcpy(new_label, label, sizeof(new_label));
|
2015-06-02 16:28:51 +00:00
|
|
|
strlcpy(s, string_to_upper(new_label), len);
|
|
|
|
replace_chars(s, '_', ' ');
|
2015-06-01 10:24:48 +00:00
|
|
|
}
|
|
|
|
|
2015-06-08 10:12:00 +00:00
|
|
|
static int action_get_title_generic(char *s, size_t len, const char *path,
|
|
|
|
const char *text)
|
|
|
|
{
|
|
|
|
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
|
|
|
struct string_list *list_path = string_split(path, "|");
|
|
|
|
|
|
|
|
*elem0_path = *elem1_path = 0;
|
|
|
|
|
|
|
|
if (list_path)
|
|
|
|
{
|
|
|
|
if (list_path->size > 0)
|
|
|
|
{
|
|
|
|
strlcpy(elem0_path, list_path->elems[0].data, sizeof(elem0_path));
|
|
|
|
if (list_path->size > 1)
|
|
|
|
strlcpy(elem1_path, list_path->elems[1].data, sizeof(elem1_path));
|
|
|
|
}
|
|
|
|
string_list_free(list_path);
|
|
|
|
}
|
|
|
|
snprintf(s, len, "%s - %s", text,
|
|
|
|
(elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_deferred_database_manager_list(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE SELECTION");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_deferred_cursor_manager_list(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST");
|
|
|
|
}
|
|
|
|
|
2015-06-08 10:45:29 +00:00
|
|
|
static int action_get_title_list_rdb_entry_developer(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: DEVELOPER ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_publisher(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: PUBLISHER ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_origin(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: ORIGIN ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_franchise(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: FRANCHISE ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_edge_magazine_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: EDGE MAGAZINE RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_edge_magazine_issue(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: EDGE MAGAZINE ISSUE ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_releasedate_by_month(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: RELEASEDATE BY MONTH ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_releasedate_by_year(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: RELEASEDATE BY YEAR ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_esrb_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: ESRB RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_database_info(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
snprintf(s, len, "DATABASE INFO: %s", elem1);
|
|
|
|
#endif
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE INFO ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_elspa_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: ELSPA RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_pegi_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: PEGI RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_cero_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: CERO RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_bbfc_rating(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: BBFC RATING ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_list_rdb_entry_max_users(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
return action_get_title_generic(s, len, path, "DATABASE CURSOR LIST - FILTER: MAX USERS ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_deferred_core_list(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "DETECTED CORES %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-01 10:24:48 +00:00
|
|
|
static int action_get_title_default(const char *path, const char *label,
|
2015-06-02 16:28:51 +00:00
|
|
|
unsigned menu_type, char *s, size_t len)
|
2015-06-01 10:24:48 +00:00
|
|
|
{
|
2015-06-08 09:30:19 +00:00
|
|
|
uint32_t label_hash = 0;
|
2015-06-08 10:45:29 +00:00
|
|
|
char elem1[PATH_MAX_LENGTH];
|
2015-06-07 22:02:04 +00:00
|
|
|
driver_t *driver = driver_get_ptr();
|
2015-06-01 10:24:48 +00:00
|
|
|
|
2015-06-08 10:45:29 +00:00
|
|
|
*elem1 = 0;
|
2015-06-01 10:24:48 +00:00
|
|
|
|
2015-06-08 09:30:19 +00:00
|
|
|
label_hash = djb2_calculate(label);
|
2015-06-07 21:55:57 +00:00
|
|
|
|
2015-06-01 10:24:48 +00:00
|
|
|
#if 0
|
|
|
|
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
|
|
|
#endif
|
2015-06-04 14:23:00 +00:00
|
|
|
|
2015-06-08 09:30:19 +00:00
|
|
|
switch (label_hash)
|
2015-06-01 10:24:48 +00:00
|
|
|
{
|
2015-06-05 07:46:15 +00:00
|
|
|
case MENU_LABEL_DISK_IMAGE_APPEND:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "DISK APPEND %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "SHADER PRESET %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_FILE_LOAD:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "CHEAT FILE %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_LOAD:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "REMAP FILE %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
2015-06-06 14:05:15 +00:00
|
|
|
case MENU_LABEL_CONTENT_COLLECTION_LIST:
|
|
|
|
snprintf(s, len, "CONTENT COLLECTION LIST");
|
|
|
|
break;
|
2015-06-05 07:46:15 +00:00
|
|
|
case MENU_LABEL_CUSTOM_VIEWPORT_2:
|
2015-06-08 10:24:04 +00:00
|
|
|
strlcpy(s, "CUSTOM VIEWPORT", len);
|
|
|
|
break;
|
2015-06-05 07:46:15 +00:00
|
|
|
case MENU_LABEL_HELP:
|
2015-06-08 10:24:04 +00:00
|
|
|
strlcpy(s, "HELP", len);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_INPUT_OVERLAY:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "OVERLAY %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_FONT_PATH:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "FONT %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_FILTER:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "FILTER %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_AUDIO_DSP_PLUGIN:
|
2015-06-04 14:23:00 +00:00
|
|
|
snprintf(s, len, "DSP FILTER %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
2015-06-06 21:56:17 +00:00
|
|
|
case MENU_LABEL_CHEAT_DATABASE_PATH:
|
|
|
|
snprintf(s, len, "CHEAT DIR %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_LIBRETRO_DIR_PATH:
|
2015-06-06 21:46:22 +00:00
|
|
|
snprintf(s, len, "CORE DIR %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_LIBRETRO_INFO_PATH:
|
2015-06-06 21:46:22 +00:00
|
|
|
snprintf(s, len, "CORE INFO DIR %s", path);
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
|
|
|
default:
|
2015-06-07 22:02:04 +00:00
|
|
|
switch (menu_type)
|
2015-06-04 14:23:00 +00:00
|
|
|
{
|
2015-06-07 22:02:04 +00:00
|
|
|
case MENU_SETTINGS_CUSTOM_VIEWPORT:
|
2015-06-08 10:24:04 +00:00
|
|
|
strlcpy(s, "CUSTOM VIEWPORT", len);
|
|
|
|
break;
|
2015-06-07 22:02:04 +00:00
|
|
|
case MENU_SETTINGS:
|
|
|
|
snprintf(s, len, "MENU %s", path);
|
|
|
|
break;
|
|
|
|
case MENU_SETTINGS_CUSTOM_BIND:
|
|
|
|
case MENU_SETTINGS_CUSTOM_BIND_KEYBOARD:
|
|
|
|
strlcpy(s, "INPUT SETTINGS", len);
|
|
|
|
if (elem1[0] != '\0')
|
|
|
|
{
|
|
|
|
strlcat(s, " - ", len);
|
|
|
|
strlcat(s, string_to_upper(elem1), len);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (driver->menu->defer_core)
|
|
|
|
snprintf(s, len, "CONTENT %s", path);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
const char *core_name = global->menu.info.library_name;
|
2015-06-05 07:46:15 +00:00
|
|
|
|
2015-06-07 22:02:04 +00:00
|
|
|
if (!core_name)
|
|
|
|
core_name = global->system.info.library_name;
|
|
|
|
if (!core_name)
|
|
|
|
core_name = "No Core";
|
|
|
|
snprintf(s, len, "CONTENT (%s) %s", core_name, path);
|
|
|
|
}
|
|
|
|
break;
|
2015-06-04 14:23:00 +00:00
|
|
|
}
|
2015-06-05 07:46:15 +00:00
|
|
|
break;
|
2015-06-01 10:24:48 +00:00
|
|
|
}
|
2015-06-04 14:23:00 +00:00
|
|
|
|
2015-06-01 10:24:48 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-08 10:04:11 +00:00
|
|
|
static int action_get_title_group_settings(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
|
|
|
struct string_list *list_label = string_split(label, "|");
|
|
|
|
|
|
|
|
if (list_label)
|
|
|
|
{
|
|
|
|
if (list_label->size > 0)
|
|
|
|
{
|
|
|
|
strlcpy(elem0, list_label->elems[0].data, sizeof(elem0));
|
|
|
|
if (list_label->size > 1)
|
|
|
|
strlcpy(elem1, list_label->elems[1].data, sizeof(elem1));
|
|
|
|
}
|
|
|
|
string_list_free(list_label);
|
|
|
|
}
|
|
|
|
|
|
|
|
strlcpy(s, string_to_upper(elem0), len);
|
|
|
|
if (elem1[0] != '\0')
|
|
|
|
{
|
|
|
|
strlcat(s, " - ", len);
|
|
|
|
strlcat(s, string_to_upper(elem1), len);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-08 10:22:13 +00:00
|
|
|
static int action_get_title_action_generic(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
sanitize_to_string(s, label, len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-08 11:16:56 +00:00
|
|
|
static int action_get_title_configurations(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "CONFIG %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_content_database_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "DATABASE DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_savestate_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "SAVESTATE DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_dynamic_wallpapers_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "DYNAMIC WALLPAPERS DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_core_assets_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "CORE ASSETS DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_config_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "CONFIG DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_input_remapping_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "INPUT REMAPPING DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_autoconfig_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "AUTOCONFIG DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_playlist_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "PLAYLIST DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_browser_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "BROWSER DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_content_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "CONTENT DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_screenshot_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "SCREENSHOT DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_cursor_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "CURSOR DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_onscreen_overlay_keyboard_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "OSK OVERLAY DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_recording_config_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "RECORDING CONFIG DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_recording_output_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "RECORDING OUTPUT DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_video_shader_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "SHADER DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_audio_filter_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "AUDIO FILTER DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_video_filter_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "VIDEO FILTER DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_savefile_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "SAVEFILE DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_overlay_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "OVERLAY DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_system_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "SYSTEM DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_assets_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "ASSETS DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_get_title_extraction_directory(const char *path, const char *label,
|
|
|
|
unsigned menu_type, char *s, size_t len)
|
|
|
|
{
|
|
|
|
snprintf(s, len, "EXTRACTION DIR %s", path);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-07 16:36:10 +00:00
|
|
|
int menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
|
2015-06-01 10:24:48 +00:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
2015-06-05 11:17:44 +00:00
|
|
|
const char *elem0, const char *elem1,
|
|
|
|
uint32_t label_hash, uint32_t menu_label_hash)
|
2015-06-01 10:24:48 +00:00
|
|
|
{
|
2015-06-08 10:04:11 +00:00
|
|
|
driver_t *driver = driver_get_ptr();
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
|
2015-06-01 10:24:48 +00:00
|
|
|
if (!cbs)
|
2015-06-07 16:36:10 +00:00
|
|
|
return -1;
|
2015-06-01 10:24:48 +00:00
|
|
|
|
|
|
|
cbs->action_get_title = action_get_title_default;
|
2015-06-07 16:36:10 +00:00
|
|
|
|
2015-06-08 10:04:11 +00:00
|
|
|
#if 0
|
|
|
|
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
setting = menu_setting_find(label);
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
|
|
|
if (!strcmp(setting->parent_group, "Main Menu") && setting->type == ST_GROUP)
|
|
|
|
{
|
2015-06-08 10:22:13 +00:00
|
|
|
if (elem1[0] != '\0')
|
|
|
|
{
|
|
|
|
cbs->action_get_title = action_get_title_group_settings;
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-08 10:04:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-08 10:12:00 +00:00
|
|
|
switch (label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
|
|
|
cbs->action_get_title = action_get_title_deferred_database_manager_list;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST:
|
|
|
|
cbs->action_get_title = action_get_title_deferred_cursor_manager_list;
|
|
|
|
break;
|
2015-06-08 10:45:29 +00:00
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_DEVELOPER:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_developer;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_PUBLISHER:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_publisher;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_ORIGIN:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_origin;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_FRANCHISE:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_franchise;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_EDGE_MAGAZINE_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_edge_magazine_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_EDGE_MAGAZINE_ISSUE:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_edge_magazine_issue;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_RELEASEMONTH:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_releasedate_by_month;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_RELEASEYEAR:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_releasedate_by_year;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_ESRB_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_esrb_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_ELSPA_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_elspa_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_PEGI_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_pegi_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_CERO_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_cero_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_BBFC_RATING:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_bbfc_rating;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_MAX_USERS:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_max_users;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_RDB_ENTRY_DETAIL:
|
|
|
|
cbs->action_get_title = action_get_title_list_rdb_entry_database_info;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_LIST:
|
|
|
|
cbs->action_get_title = action_get_title_deferred_core_list;
|
|
|
|
break;
|
2015-06-08 11:16:56 +00:00
|
|
|
case MENU_LABEL_CONFIGURATIONS:
|
|
|
|
cbs->action_get_title = action_get_title_configurations;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_JOYPAD_AUTOCONFIG_DIR:
|
|
|
|
cbs->action_get_title = action_get_title_autoconfig_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_EXTRACTION_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_extraction_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SYSTEM_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_system_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_ASSETS_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_assets_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SAVEFILE_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_savefile_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_OVERLAY_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_overlay_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RGUI_BROWSER_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_browser_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_PLAYLIST_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_playlist_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CONTENT_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_content_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SCREENSHOT_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_screenshot_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_DIR:
|
|
|
|
cbs->action_get_title = action_get_title_video_shader_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_FILTER_DIR:
|
|
|
|
cbs->action_get_title = action_get_title_video_filter_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_AUDIO_FILTER_DIR:
|
|
|
|
cbs->action_get_title = action_get_title_audio_filter_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CURSOR_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_cursor_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RECORDING_CONFIG_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_recording_config_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RECORDING_OUTPUT_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_recording_output_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_OSK_OVERLAY_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_onscreen_overlay_keyboard_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_INPUT_REMAPPING_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_input_remapping_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CONTENT_DATABASE_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_content_database_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SAVESTATE_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_savestate_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DYNAMIC_WALLPAPERS_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_dynamic_wallpapers_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CORE_ASSETS_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_core_assets_directory;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RGUI_CONFIG_DIRECTORY:
|
|
|
|
cbs->action_get_title = action_get_title_config_directory;
|
|
|
|
break;
|
2015-06-08 10:22:13 +00:00
|
|
|
case MENU_LABEL_PERFORMANCE_COUNTERS:
|
|
|
|
case MENU_LABEL_CORE_LIST:
|
|
|
|
case MENU_LABEL_MANAGEMENT:
|
|
|
|
case MENU_LABEL_OPTIONS:
|
|
|
|
case MENU_LABEL_SETTINGS:
|
|
|
|
case MENU_LABEL_FRONTEND_COUNTERS:
|
|
|
|
case MENU_LABEL_CORE_COUNTERS:
|
|
|
|
case MENU_LABEL_HISTORY_LIST:
|
|
|
|
case MENU_LABEL_INFO_SCREEN:
|
|
|
|
case MENU_LABEL_SYSTEM_INFORMATION:
|
|
|
|
case MENU_LABEL_CORE_INFORMATION:
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
|
|
|
|
case MENU_LABEL_DISK_OPTIONS:
|
|
|
|
case MENU_LABEL_CORE_OPTIONS:
|
|
|
|
case MENU_LABEL_SHADER_OPTIONS:
|
|
|
|
case MENU_LABEL_VIDEO_OPTIONS:
|
|
|
|
case MENU_LABEL_CORE_CHEAT_OPTIONS:
|
|
|
|
case MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
|
|
|
case MENU_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
case MENU_LABEL_CURSOR_MANAGER_LIST:
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_UPDATER_LIST:
|
|
|
|
cbs->action_get_title = action_get_title_action_generic;
|
|
|
|
break;
|
2015-06-08 10:12:00 +00:00
|
|
|
}
|
|
|
|
|
2015-06-07 16:36:10 +00:00
|
|
|
return -1;
|
2015-06-01 10:24:48 +00:00
|
|
|
}
|