diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-10-26 11:37:52 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-10-26 11:37:52 +0200 |
commit | 1d2fc77cfcd3d40c3a382d3f5f8e6c28e8b38da9 (patch) | |
tree | ccca52a56efa7421e44c96594f42bc08c06c2497 /include | |
parent | 57977f29e10c8c2a8ba58c25e9ab653aed7cc0a9 (diff) |
Make the ui the daemon instead, add hotkey for recording/pause
Diffstat (limited to 'include')
-rw-r--r-- | include/Overlay.hpp | 18 | ||||
-rw-r--r-- | include/Theme.hpp | 1 | ||||
-rw-r--r-- | include/Utils.hpp | 2 | ||||
-rw-r--r-- | include/gui/DropdownButton.hpp | 5 | ||||
-rw-r--r-- | include/gui/FileChooser.hpp | 1 |
5 files changed, 17 insertions, 10 deletions
diff --git a/include/Overlay.hpp b/include/Overlay.hpp index fcc3781..fa6630d 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -23,6 +23,13 @@ namespace gsr { STREAM }; + enum class NotificationType { + NONE, + RECORD, + REPLAY, + STREAM + }; + class Overlay { public: Overlay(mgl::Window &window, std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs, mgl::Color bg_color); @@ -36,17 +43,17 @@ namespace gsr { void show(); void hide(); void toggle_show(); + void toggle_record(); + void toggle_pause(); + 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: void process_key_bindings(mgl::Event &event); void update_gsr_process_status(); - void load_program_status(); - void save_program_status(); - void load_program_pid(); - void save_program_pid(); - void recording_stopped_remove_runtime_files(); + void update_ui_recording_paused(); + void update_ui_recording_unpaused(); void update_ui_recording_started(); void update_ui_recording_stopped(); @@ -89,6 +96,7 @@ namespace gsr { DropdownButton *stream_dropdown_button_ptr = nullptr; RecordingStatus recording_status = RecordingStatus::NONE; + bool paused = false; std::array<KeyBinding, 1> key_bindings; }; diff --git a/include/Theme.hpp b/include/Theme.hpp index 79ad358..0dc3cd1 100644 --- a/include/Theme.hpp +++ b/include/Theme.hpp @@ -41,6 +41,7 @@ namespace gsr { mgl::Texture checkbox_background_texture; mgl::Texture play_texture; mgl::Texture stop_texture; + mgl::Texture pause_texture; double double_click_timeout_seconds = 0.4; diff --git a/include/Utils.hpp b/include/Utils.hpp index 8ca38b5..e7bb3bc 100644 --- a/include/Utils.hpp +++ b/include/Utils.hpp @@ -32,6 +32,4 @@ namespace gsr { // Returns the path to the parent directory (ignoring trailing /) // of "." if there is no parent directory and the directory path is relative std::string get_parent_directory(std::string_view directory); - - std::optional<std::string> get_gsr_runtime_dir(); }
\ No newline at end of file diff --git a/include/gui/DropdownButton.hpp b/include/gui/DropdownButton.hpp index 40d2810..cbbcda2 100644 --- a/include/gui/DropdownButton.hpp +++ b/include/gui/DropdownButton.hpp @@ -10,7 +10,7 @@ namespace gsr { class DropdownButton : public Widget { public: - DropdownButton(mgl::Font *title_font, mgl::Font *description_font, const char *title, const char *description_activated, const char *description_deactivated, mgl::Texture *icon_texture, mgl::vec2f size); + DropdownButton(mgl::Font *title_font, mgl::Font *description_font, const char *title, const char *description, mgl::Texture *icon_texture, mgl::vec2f size); DropdownButton(const DropdownButton&) = delete; DropdownButton& operator=(const DropdownButton&) = delete; @@ -21,6 +21,7 @@ namespace gsr { void set_item_label(const std::string &id, const std::string &new_label); void set_item_icon(const std::string &id, mgl::Texture *texture); + void set_description(std::string description_text); void set_activated(bool activated); mgl::vec2f get_size() override; @@ -50,8 +51,6 @@ namespace gsr { mgl::Text description; mgl::Sprite icon_sprite; - std::string description_activated; - std::string description_deactivated; bool activated = false; }; }
\ No newline at end of file diff --git a/include/gui/FileChooser.hpp b/include/gui/FileChooser.hpp index 36dac2d..dbe49bb 100644 --- a/include/gui/FileChooser.hpp +++ b/include/gui/FileChooser.hpp @@ -54,6 +54,7 @@ namespace gsr { bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; void draw(mgl::Window &window, mgl::vec2f offset) override; + void draw_navigation(mgl::Window &window, mgl::vec2f draw_pos); mgl::vec2f get_size() override; |