Implement AI Service Pause

This commit is contained in:
twinaphex 2019-10-19 20:53:17 +02:00
parent 4e78375340
commit d51b32f662
9 changed files with 31 additions and 0 deletions

View File

@ -1120,6 +1120,8 @@ static char default_discord_app_id[] = "475456035851599874";
#define DEFAULT_AI_SERVICE_ENABLE true
#define DEFAULT_AI_SERVICE_PAUSE false
#define DEFAULT_AI_SERVICE_MODE 1
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"

View File

@ -1663,6 +1663,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
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, DEFAULT_AI_SERVICE_ENABLE, false, false);
SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false);
*size = count;

View File

@ -380,6 +380,7 @@ typedef struct settings
bool scan_without_core_match;
bool ai_service_enable;
bool ai_service_pause;
} bools;
struct

View File

@ -2095,3 +2095,5 @@ MSG_HASH(MENU_ENUM_LABEL_LOCALAP_ENABLE,
#endif
MSG_HASH(MENU_ENUM_LABEL_DRIVER_SWITCH_ENABLE,
"driver_switch_enable")
MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_PAUSE,
"ai_service_pause")

View File

@ -9733,3 +9733,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SWITCH_ENABLE,
"Allow cores to switch the video driver")
MSG_HASH(MENU_ENUM_SUBLABEL_DRIVER_SWITCH_ENABLE,
"Allow cores to force switch to a different video driver than is currently loaded.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_PAUSE,
"AI Service Pause Toggle")
MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_PAUSE,
"Pauses core while screen is translated.")

View File

@ -129,6 +129,7 @@ default_sublabel_macro(action_bind_sublabel_logging_settings_list, MENU_
default_sublabel_macro(action_bind_sublabel_user_interface_settings_list, MENU_ENUM_SUBLABEL_USER_INTERFACE_SETTINGS)
default_sublabel_macro(action_bind_sublabel_ai_service_settings_list, MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS)
default_sublabel_macro(action_bind_sublabel_ai_service_mode, MENU_ENUM_SUBLABEL_AI_SERVICE_MODE)
default_sublabel_macro(action_bind_sublabel_ai_service_pause, MENU_ENUM_SUBLABEL_AI_SERVICE_PAUSE)
default_sublabel_macro(action_bind_sublabel_ai_service_target_lang, MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG)
default_sublabel_macro(action_bind_sublabel_ai_service_source_lang, MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG)
default_sublabel_macro(action_bind_sublabel_ai_service_url, MENU_ENUM_SUBLABEL_AI_SERVICE_URL)
@ -2718,6 +2719,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_AI_SERVICE_MODE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_mode);
break;
case MENU_ENUM_LABEL_AI_SERVICE_PAUSE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_pause);
break;
case MENU_ENUM_LABEL_AI_SERVICE_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_enable);
break;

View File

@ -3827,6 +3827,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
{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},
{MENU_ENUM_LABEL_AI_SERVICE_PAUSE, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_AI_SERVICE_SOURCE_LANG, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_AI_SERVICE_TARGET_LANG, PARSE_ONLY_UINT, true},
};

View File

@ -13418,6 +13418,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->bools.ai_service_pause,
MENU_ENUM_LABEL_AI_SERVICE_PAUSE,
MENU_ENUM_LABEL_VALUE_AI_SERVICE_PAUSE,
DEFAULT_AI_SERVICE_PAUSE,
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);
CONFIG_UINT(
list, list_info,
&settings->uints.ai_service_source_lang,

View File

@ -1720,6 +1720,7 @@ enum msg_hash_enums
MENU_LABEL(AI_SERVICE_SOURCE_LANG),
MENU_LABEL(AI_SERVICE_URL),
MENU_LABEL(AI_SERVICE_ENABLE),
MENU_LABEL(AI_SERVICE_PAUSE),
MENU_LABEL(ON),
MENU_LABEL(OFF),