Hook up AI Service settings

This commit is contained in:
twinaphex 2019-08-22 07:07:07 +02:00
parent 203504e793
commit a612e7a4c3
25 changed files with 324 additions and 18 deletions

View File

@ -1053,6 +1053,10 @@ static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/
static char default_discord_app_id[] = "475456035851599874";
static char default_ai_service_url[] = "http://localhost:4404/";
#define DEFAULT_AI_SERVICE_ENABLE false
#define DEFAULT_AI_SERVICE_MODE 1
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"
#endif

View File

@ -1167,7 +1167,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, default_discord_app_id, true);
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, default_ai_service_url, true);
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, DEFAULT_AI_SERVICE_URL, true);
*size = count;
@ -1633,7 +1633,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, DEFAULT_LOG_TO_FILE, false);
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE);
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, DEFAULT_LOG_TO_FILE_TIMESTAMP, false);
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, true, false, false);
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, DEFAULT_AI_SERVICE_ENABLE, false, false);
*size = count;
@ -1825,7 +1825,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("video_windowed_position_y", &settings->uints.window_position_y, true, 0, false);
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, true, 0, false);
SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, DEFAULT_AI_SERVICE_MODE, 0, false);
SETTING_UINT("video_record_threads", &settings->uints.video_record_threads, true, DEFAULT_VIDEO_RECORD_THREADS, false);
@ -2040,7 +2040,7 @@ void config_set_defaults(void)
default_discord_app_id, sizeof(settings->arrays.discord_app_id));
strlcpy(settings->arrays.ai_service_url,
default_ai_service_url, sizeof(settings->arrays.ai_service_url));
DEFAULT_AI_SERVICE_URL, sizeof(settings->arrays.ai_service_url));
#ifdef HAVE_MATERIALUI

View File

@ -3870,3 +3870,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -4888,3 +4888,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3646,3 +3646,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3775,3 +3775,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -7852,3 +7852,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3534,3 +3534,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -8004,3 +8004,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -8792,3 +8792,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3755,3 +3755,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -9167,3 +9167,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -8999,3 +8999,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -1995,3 +1995,9 @@ MSG_HASH(MENU_ENUM_LABEL_SETTINGS_SHOW_INPUT,
"settings_show_input")
MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_SETTINGS,
"ai_service_settings")
MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_MODE,
"ai_service_mode")
MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_URL,
"ai_service_url")
MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_ENABLE,
"ai_service_enable")

View File

@ -3528,3 +3528,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Uitvoer")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Ingeschakeld")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -4319,3 +4319,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -9079,3 +9079,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3600,3 +3600,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3798,3 +3798,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -8804,3 +8804,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -9143,3 +9143,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3690,3 +3690,15 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS,
"Change settings for the AI Service (Translation/TTS/Misc)."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
"AI Service Output")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
"AI Service URL")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
"AI Service Enabled")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_MODE,
"Pauses gameplay during translation (Image mode), or continues to run (Speech mode)")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL,
"A http:// url pointing to the translation service to use.")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE,
"Enable AI Service to run when the AI Service hotkey is pressed.")

View File

@ -3720,6 +3720,23 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
switch (type)
{
case DISPLAYLIST_AI_SERVICE_SETTINGS_LIST:
{
menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_AI_SERVICE_MODE, PARSE_ONLY_UINT, true },
{MENU_ENUM_LABEL_AI_SERVICE_URL, PARSE_ONLY_STRING, true },
{MENU_ENUM_LABEL_AI_SERVICE_ENABLE, PARSE_ONLY_BOOL, true},
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
if (menu_displaylist_parse_settings_enum(list,
build_list[i].enum_idx, build_list[i].parse_type,
false) == 0)
count++;
}
}
break;
case DISPLAYLIST_ADD_CONTENT_LIST:
#ifdef HAVE_LIBRETRODB
if (menu_entries_append_enum(list,
@ -6947,6 +6964,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_MIDI_SETTINGS_LIST:
case DISPLAYLIST_CRT_SWITCHRES_SETTINGS_LIST:
case DISPLAYLIST_OPTIONS_DISK:
case DISPLAYLIST_AI_SERVICE_SETTINGS_LIST:
case DISPLAYLIST_USER_INTERFACE_SETTINGS_LIST:
case DISPLAYLIST_ACCOUNTS_TWITCH_LIST:
case DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST:
@ -7345,19 +7363,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
MENU_ENUM_LABEL_AUDIO_WASAPI_SH_BUFFER_LENGTH,
PARSE_ONLY_INT, false);
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_AI_SERVICE_SETTINGS_LIST:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (count == 0)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND),
msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND),
MENU_ENUM_LABEL_NO_SETTINGS_FOUND,
0, 0, 0);
info->need_refresh = true;
info->need_push = true;
break;

View File

@ -136,6 +136,7 @@ enum settings_list_type
SETTINGS_LIST_MENU,
SETTINGS_LIST_MENU_FILE_BROWSER,
SETTINGS_LIST_MULTIMEDIA,
SETTINGS_LIST_AI_SERVICE,
SETTINGS_LIST_USER_INTERFACE,
SETTINGS_LIST_POWER_MANAGEMENT,
SETTINGS_LIST_MENU_SOUNDS,
@ -12843,6 +12844,62 @@ static bool setting_append_list(
SD_FLAG_CMD_APPLY_AUTO);
#endif
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
break;
case SETTINGS_LIST_AI_SERVICE:
START_GROUP(list, list_info, &group_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS),
parent_group);
parent_group = msg_hash_to_str(MENU_ENUM_LABEL_AI_SERVICE_SETTINGS);
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
CONFIG_UINT(
list, list_info,
&settings->uints.ai_service_mode,
MENU_ENUM_LABEL_AI_SERVICE_MODE,
MENU_ENUM_LABEL_VALUE_AI_SERVICE_MODE,
DEFAULT_AI_SERVICE_MODE,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
menu_settings_list_current_add_range(list, list_info, 0, 1, 1, true, true);
CONFIG_STRING(
list, list_info,
settings->arrays.ai_service_url,
sizeof(settings->arrays.ai_service_url),
MENU_ENUM_LABEL_AI_SERVICE_URL,
MENU_ENUM_LABEL_VALUE_AI_SERVICE_URL,
DEFAULT_AI_SERVICE_URL,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_ALLOW_INPUT);
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_STRING_LINE_EDIT;
CONFIG_BOOL(
list, list_info,
&settings->bools.ai_service_enable,
MENU_ENUM_LABEL_AI_SERVICE_ENABLE,
MENU_ENUM_LABEL_VALUE_AI_SERVICE_ENABLE,
DEFAULT_AI_SERVICE_ENABLE,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
break;
@ -15206,6 +15263,9 @@ static rarch_setting_t *menu_setting_new_internal(rarch_setting_info_t *list_inf
SETTINGS_LIST_MENU,
SETTINGS_LIST_MENU_FILE_BROWSER,
SETTINGS_LIST_MULTIMEDIA,
#ifdef HAVE_TRANSLATE
SETTINGS_LIST_AI_SERVICE,
#endif
SETTINGS_LIST_USER_INTERFACE,
SETTINGS_LIST_POWER_MANAGEMENT,
SETTINGS_LIST_MENU_SOUNDS,

View File

@ -1669,6 +1669,9 @@ enum msg_hash_enums
MENU_LABEL(MAIN_MENU),
MENU_LABEL(INPUT_SETTINGS),
MENU_LABEL(AI_SERVICE_SETTINGS),
MENU_LABEL(AI_SERVICE_MODE),
MENU_LABEL(AI_SERVICE_URL),
MENU_LABEL(AI_SERVICE_ENABLE),
MENU_LABEL(ON),
MENU_LABEL(OFF),