Make replay power supply an option that works with the other replay autostart options

This commit is contained in:
dec05eba
2026-04-18 05:08:08 +02:00
parent 82453684b1
commit 8a49ea991b
13 changed files with 63 additions and 30 deletions

View File

@@ -14,8 +14,7 @@ namespace gsr {
enum class ReplayStartupMode {
DONT_TURN_ON_AUTOMATICALLY,
TURN_ON_AT_SYSTEM_STARTUP,
TURN_ON_AT_GAME_LAUNCH,
TURN_ON_AT_POWER_SUPPLY_CONNECTED
TURN_ON_AT_GAME_LAUNCH
};
ReplayStartupMode replay_startup_string_to_type(const char *startup_mode_str);
@@ -136,6 +135,7 @@ namespace gsr {
std::string turn_on_replay_automatically_mode = "dont_turn_on_automatically";
bool save_video_in_game_folder = false;
bool restart_replay_on_save = false;
bool only_start_replay_if_power_supply_connected = false;
std::string save_directory;
std::string container = "mp4";
int32_t replay_time = 60;

View File

@@ -67,6 +67,12 @@ namespace gsr {
FAST
};
enum class GameReplayAction {
NONE,
LAUNCHED,
EXITED
};
class Overlay {
public:
Overlay(std::string resources_path, GsrInfo gsr_info, SupportedCaptureOptions capture_options, egl_functions egl_funcs);
@@ -139,6 +145,7 @@ namespace gsr {
void replay_status_update_status();
void update_power_supply_status();
void update_system_startup_status();
void update_gsr_game_tracker_replay_status();
void on_stop_recording(int exit_code, std::string &video_filepath);
@@ -257,6 +264,8 @@ namespace gsr {
int gsr_game_tracker_process_output_fd = -1;
FILE *gsr_game_tracker_process_output_file = nullptr;
pid_t gsr_game_tracker_process_id = -1;
bool game_running = false;
bool game_running_replay = false;
struct wl_display *wayland_dpy = nullptr;

View File

@@ -122,6 +122,7 @@ namespace gsr {
std::unique_ptr<List> create_replay_time();
std::unique_ptr<List> create_replay_storage();
std::unique_ptr<RadioButton> create_start_replay_automatically();
std::unique_ptr<Widget> create_start_replay_automatically_section();
std::unique_ptr<CheckBox> create_save_replay_in_game_folder();
std::unique_ptr<CheckBox> create_restart_replay_on_save();
std::unique_ptr<Label> create_estimated_replay_file_size();
@@ -230,6 +231,7 @@ namespace gsr {
List *webcam_body_list_ptr = nullptr;
CheckBox *flip_camera_horizontally_checkbox_ptr = nullptr;
CheckBox *low_power_mode_checkbox_ptr = nullptr;
CheckBox *replay_power_supply_checkbox_ptr = nullptr;
PageStack *page_stack = nullptr;