From 305c9df7acc140d1d4b723948b9f59e8282eea87 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 4 May 2025 22:39:37 +0200 Subject: Add option to save temporary replay data on disk --- TODO | 12 +++++++++--- include/Config.hpp | 1 + include/gui/RadioButton.hpp | 3 ++- include/gui/SettingsPage.hpp | 4 +++- meson.build | 12 ++++++------ project.conf | 2 +- src/Config.cpp | 1 + src/Overlay.cpp | 10 +++++++++- src/gui/RadioButton.cpp | 11 ++++++++++- src/gui/SettingsPage.cpp | 38 ++++++++++++++++++++++++++++++-------- 10 files changed, 72 insertions(+), 22 deletions(-) diff --git a/TODO b/TODO index 5e4b3c3..471387a 100644 --- a/TODO +++ b/TODO @@ -164,9 +164,15 @@ Keyboard layout is incorrect on wayland when using kde plasma keyboard settings Need to use "setxkbmap fr" as well. This happens only when grabbing keyboard (gsr-global-hotkeys). Same thing is seen with xev. -Allow to configure replay by disk space as well. When changing bitrate change an editable field that says the disk space, and when changing that disk space field then change the bitrate or duration. - Getting focused monitor on wayland doesn't work when vrr is enabled. This is because it uses software cursor instead (at least on kde plasma wayland). Right now it falls back to create window & getting window position trick if there is no cursor visible (or a software cursor) and one monitor has vrr enabled. Remove this when linux & wayland supports vrr with hardware cursor plane. - Find out another way to get cursor position on wayland. \ No newline at end of file + Find out another way to get cursor position on wayland. + This was fixed in linux 6.11 and in kde plasma in this commit: https://invent.kde.org/plasma/kwin/-/merge_requests/7582/diffs. + +Add option to start recording/replay/stream after the notification has disappeared. Show "Starting recording on this monitor in 3 seconds". + See if we can use hardware overlay plane instead somehow. + +When using wayland for mgl try using wlr-layer-shell and set layer to overlay and keyboard interactivity to exclusive. Do something similar for notifications. + +When starting gsr-ui remove any temporary replay disk data that has possibly remained from a crash, by looking for all folders that starts with gsr-replay and end with .gsr, in the replay directory. \ No newline at end of file diff --git a/include/Config.hpp b/include/Config.hpp index c8c6650..2bb79fb 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -117,6 +117,7 @@ namespace gsr { std::string save_directory; std::string container = "mp4"; int32_t replay_time = 60; + std::string replay_storage = "ram"; ConfigHotkey start_stop_hotkey; ConfigHotkey save_hotkey; ConfigHotkey save_1_min_hotkey; diff --git a/include/gui/RadioButton.hpp b/include/gui/RadioButton.hpp index 16d638e..e319aa0 100644 --- a/include/gui/RadioButton.hpp +++ b/include/gui/RadioButton.hpp @@ -23,7 +23,8 @@ namespace gsr { void add_item(const std::string &text, const std::string &id); void set_selected_item(const std::string &id, bool trigger_event = true, bool trigger_event_even_if_selection_not_changed = true); - const std::string get_selected_id() const; + const std::string& get_selected_id() const; + const std::string& get_selected_text() const; mgl::vec2f get_size() override; diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index fb705cc..ae4b480 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -97,11 +97,12 @@ namespace gsr { std::unique_ptr create_container_section(); std::unique_ptr create_replay_time_entry(); std::unique_ptr create_replay_time(); + std::unique_ptr create_replay_storage(); std::unique_ptr create_start_replay_automatically(); std::unique_ptr create_save_replay_in_game_folder(); std::unique_ptr create_restart_replay_on_save(); std::unique_ptr