aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
committerdec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
commit59dfd87c21026ef4dc713c3e0648cfa89d534557 (patch)
tree6f2f5242eb9efdcb18f0150c59cb43bd1a348773 /include
parent28c437e90a3ad4660f44da8b8bf07008032d2bba (diff)
Add hotkeys for replay and streaming, finish everything
Diffstat (limited to 'include')
-rw-r--r--include/Config.hpp6
-rw-r--r--include/Overlay.hpp18
-rw-r--r--include/Theme.hpp1
-rw-r--r--include/gui/SettingsPage.hpp4
4 files changed, 21 insertions, 8 deletions
diff --git a/include/Config.hpp b/include/Config.hpp
index 5839297..1bb4e27 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -7,6 +7,8 @@
#include <optional>
namespace gsr {
+ struct GsrInfo;
+
struct ConfigHotkey {
int64_t keysym = 0;
uint32_t modifiers = 0;
@@ -86,7 +88,7 @@ namespace gsr {
};
struct Config {
- Config();
+ Config(const GsrInfo &gsr_info);
MainConfig main_config;
StreamingConfig streaming_config;
@@ -94,6 +96,6 @@ namespace gsr {
ReplayConfig replay_config;
};
- std::optional<Config> read_config();
+ std::optional<Config> read_config(const GsrInfo &gsr_info);
void save_config(Config &config);
} \ No newline at end of file
diff --git a/include/Overlay.hpp b/include/Overlay.hpp
index e693764..d5a8fb6 100644
--- a/include/Overlay.hpp
+++ b/include/Overlay.hpp
@@ -45,6 +45,9 @@ namespace gsr {
void toggle_show();
void toggle_record();
void toggle_pause();
+ void toggle_stream();
+ void toggle_replay();
+ void save_replay();
void show_notification(const char *str, double timeout_seconds, mgl::Color icon_color, mgl::Color bg_color, NotificationType notification_type);
bool is_open() const;
private:
@@ -59,9 +62,16 @@ namespace gsr {
void update_ui_recording_started();
void update_ui_recording_stopped();
- void on_press_start_replay(const std::string &id);
- void on_press_start_record(const std::string &id);
- void on_press_start_stream(const std::string &id);
+ void update_ui_streaming_started();
+ void update_ui_streaming_stopped();
+
+ void update_ui_replay_started();
+ void update_ui_replay_stopped();
+
+ void on_press_save_replay();
+ void on_press_start_replay();
+ void on_press_start_record();
+ void on_press_start_stream();
bool update_compositor_texture(const mgl_monitor *monitor);
private:
using KeyBindingCallback = std::function<void()>;
@@ -92,7 +102,7 @@ namespace gsr {
uint64_t default_cursor = 0;
pid_t gpu_screen_recorder_process = -1;
pid_t notification_process = -1;
- std::optional<Config> config;
+ Config config;
DropdownButton *replay_dropdown_button_ptr = nullptr;
DropdownButton *record_dropdown_button_ptr = nullptr;
DropdownButton *stream_dropdown_button_ptr = nullptr;
diff --git a/include/Theme.hpp b/include/Theme.hpp
index 0dc3cd1..f7e0ce4 100644
--- a/include/Theme.hpp
+++ b/include/Theme.hpp
@@ -42,6 +42,7 @@ namespace gsr {
mgl::Texture play_texture;
mgl::Texture stop_texture;
mgl::Texture pause_texture;
+ mgl::Texture save_texture;
double double_click_timeout_seconds = 0.4;
diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp
index 77542a8..104cf18 100644
--- a/include/gui/SettingsPage.hpp
+++ b/include/gui/SettingsPage.hpp
@@ -23,7 +23,7 @@ namespace gsr {
STREAM
};
- SettingsPage(Type type, const GsrInfo &gsr_info, std::vector<AudioDevice> audio_devices, std::optional<Config> &config, PageStack *page_stack);
+ SettingsPage(Type type, const GsrInfo &gsr_info, std::vector<AudioDevice> audio_devices, Config &config, PageStack *page_stack);
SettingsPage(const SettingsPage&) = delete;
SettingsPage& operator=(const SettingsPage&) = delete;
@@ -104,7 +104,7 @@ namespace gsr {
void save_stream();
private:
Type type;
- std::optional<Config> &config;
+ Config &config;
std::vector<AudioDevice> audio_devices;
GsrPage *content_page_ptr = nullptr;