diff --git a/config.def.h b/config.def.h index 6c8db36dd5..d225f1ae01 100644 --- a/config.def.h +++ b/config.def.h @@ -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 diff --git a/configuration.c b/configuration.c index 4c605c28b6..3961e18b35 100644 --- a/configuration.c +++ b/configuration.c @@ -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 diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 6c755dc475..03317c8983 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -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.") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index f2d527571c..222710fbdb 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -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.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 4c0d7d8a2a..6342b01b41 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -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.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 45a585e9a7..d17606342d 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -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.") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index f0ed3274dd..edf813b75b 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -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.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index ef364e7504..f7c2e095a3 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -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.") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index b6186f2663..16ed8f29ad 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -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.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index ef88392bd3..cbf2c0ff4d 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -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.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 819b514ece..5e55c5033e 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -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.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 213b301f0a..0ec02a5087 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -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.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index ce5ea030a9..a0030f4e10 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -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.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 1591ac87d2..24bda6a3db 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -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") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 074b99cf1f..1f42319d19 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -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.") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index ff054fa1cf..f9f3f85866 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -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.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index e769a94161..3f68055dbd 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -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.") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 5cd11f7b0b..1111583a40 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -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.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index ad1d84f579..d88450018d 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -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.") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index 5f739cff94..8c92c7b2b7 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -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.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 7117459fd9..647bdf0ea5 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -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.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index bcb05de05f..270e262be6 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -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.") diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index cc26b15e5b..54808bdf4b 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -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; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 3db6f13522..ac1a866aa5 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -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, diff --git a/msg_hash.h b/msg_hash.h index 10910e6596..c9137543f0 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -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),