aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-25 17:33:21 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-25 17:37:25 +0100
commitf0bbbbe4a9d6b0314dc98ed27b63e96045a6e8cf (patch)
tree9e5f68394e53fc98ec99f6a1bd068770ceb2493f /include
parentd9a1e5c2eb2fe9411a01b50915b9a919d089d64b (diff)
Replay on startup: wait until audio devices are available before turning replay onHEADmaster
Diffstat (limited to 'include')
-rw-r--r--include/Config.hpp9
-rw-r--r--include/Overlay.hpp5
-rw-r--r--include/Process.hpp8
3 files changed, 17 insertions, 5 deletions
diff --git a/include/Config.hpp b/include/Config.hpp
index 1c82822..1e2e9cb 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -11,6 +11,15 @@
namespace gsr {
struct SupportedCaptureOptions;
+ enum class ReplayStartupMode {
+ DONT_TURN_ON_AUTOMATICALLY,
+ TURN_ON_AT_SYSTEM_STARTUP,
+ TURN_ON_AT_FULLSCREEN,
+ TURN_ON_AT_POWER_SUPPLY_CONNECTED
+ };
+
+ ReplayStartupMode replay_startup_string_to_type(const char *startup_mode_str);
+
struct ConfigHotkey {
int64_t key = 0; // Mgl key
uint32_t modifiers = 0; // HotkeyModifier
diff --git a/include/Overlay.hpp b/include/Overlay.hpp
index 812954e..89747cd 100644
--- a/include/Overlay.hpp
+++ b/include/Overlay.hpp
@@ -92,6 +92,7 @@ namespace gsr {
void replay_status_update_status();
void update_focused_fullscreen_status();
void update_power_supply_status();
+ void update_system_startup_status();
void on_stop_recording(int exit_code);
@@ -108,7 +109,7 @@ namespace gsr {
void update_ui_replay_stopped();
void on_press_save_replay();
- void on_press_start_replay(bool disable_notification);
+ bool on_press_start_replay(bool disable_notification);
void on_press_start_record();
void on_press_start_stream();
void on_press_take_screenshot();
@@ -197,6 +198,8 @@ namespace gsr {
mgl::Clock replay_save_clock;
bool replay_save_show_notification = false;
+ ReplayStartupMode replay_startup_mode = ReplayStartupMode::TURN_ON_AT_SYSTEM_STARTUP;
+ bool try_replay_startup = true;
AudioPlayer audio_player;
};
diff --git a/include/Process.hpp b/include/Process.hpp
index 072ef58..1789fb1 100644
--- a/include/Process.hpp
+++ b/include/Process.hpp
@@ -12,14 +12,14 @@ namespace gsr {
};
// Arguments ending with NULL
- bool exec_program_daemonized(const char **args);
+ bool exec_program_daemonized(const char **args, bool debug = true);
// Arguments ending with NULL. |read_fd| can be NULL
- pid_t exec_program(const char **args, int *read_fd);
+ pid_t exec_program(const char **args, int *read_fd, bool debug = true);
// Arguments ending with NULL. Returns the exit status of the program or -1 on error
- int exec_program_get_stdout(const char **args, std::string &result);
+ int exec_program_get_stdout(const char **args, std::string &result, bool debug = true);
// Arguments ending with NULL. Returns the exit status of the program or -1 on error.
// This works the same as |exec_program_get_stdout|, except on flatpak where this runs the program on the
// host machine with flatpak-spawn --host
- int exec_program_on_host_get_stdout(const char **args, std::string &result);
+ int exec_program_on_host_get_stdout(const char **args, std::string &result, bool debug = true);
pid_t pidof(const char *process_name, pid_t ignore_pid);
} \ No newline at end of file