diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-05-16 18:09:39 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-05-16 18:09:39 +0200 |
commit | 9ac14c963e1a45ff12e7d61528a2b84bc61c4305 (patch) | |
tree | aa94eb037cb5787b3324b7e90fdf9a6bdf10c77b | |
parent | cae1c476435a6b8af6a0a3cd73d9e9e7dcbcfed1 (diff) |
Properly honor notification settings (when not saving video in game folder). Add pause/unpause notification option
-rw-r--r-- | include/Config.hpp | 1 | ||||
-rw-r--r-- | include/gui/SettingsPage.hpp | 1 | ||||
-rw-r--r-- | src/Config.cpp | 1 | ||||
-rw-r--r-- | src/Overlay.cpp | 12 | ||||
-rw-r--r-- | src/gui/SettingsPage.cpp | 7 |
5 files changed, 17 insertions, 5 deletions
diff --git a/include/Config.hpp b/include/Config.hpp index 2bb79fb..c094125 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -100,6 +100,7 @@ namespace gsr { bool save_video_in_game_folder = false; bool show_recording_started_notifications = true; bool show_video_saved_notifications = true; + bool show_video_paused_notifications = true; std::string save_directory; std::string container = "mp4"; ConfigHotkey start_stop_hotkey; diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index 2a78802..d433a88 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -186,6 +186,7 @@ namespace gsr { CheckBox *save_recording_in_game_folder_ptr = nullptr; CheckBox *show_recording_started_notification_checkbox_ptr = nullptr; CheckBox *show_video_saved_notification_checkbox_ptr = nullptr; + CheckBox *show_video_paused_notification_checkbox_ptr = nullptr; CheckBox *show_streaming_started_notification_checkbox_ptr = nullptr; CheckBox *show_streaming_stopped_notification_checkbox_ptr = nullptr; Button *save_directory_button_ptr = nullptr; diff --git a/src/Config.cpp b/src/Config.cpp index 292c7b3..ced9375 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -229,6 +229,7 @@ namespace gsr { {"record.save_video_in_game_folder", &config.record_config.save_video_in_game_folder}, {"record.show_recording_started_notifications", &config.record_config.show_recording_started_notifications}, {"record.show_video_saved_notifications", &config.record_config.show_video_saved_notifications}, + {"record.show_video_paused_notifications", &config.record_config.show_video_paused_notifications}, {"record.save_directory", &config.record_config.save_directory}, {"record.container", &config.record_config.container}, {"record.start_stop_hotkey", &config.record_config.start_stop_hotkey}, diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 35235ac..e9abe67 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -1382,10 +1382,12 @@ namespace gsr { if(paused) { update_ui_recording_unpaused(); - show_notification("Recording has been unpaused", notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD); + if(config.record_config.show_video_paused_notifications) + show_notification("Recording has been unpaused", notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD); } else { update_ui_recording_paused(); - show_notification("Recording has been paused", notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD); + if(config.record_config.show_video_paused_notifications) + show_notification("Recording has been paused", notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD); } kill(gpu_screen_recorder_process, SIGUSR2); @@ -1684,7 +1686,7 @@ namespace gsr { replay_save_show_notification = false; if(config.replay_config.save_video_in_game_folder) { save_video_in_current_game_directory(replay_saved_filepath, NotificationType::REPLAY); - } else { + } else if(config.replay_config.show_replay_saved_notifications) { char duration[32]; if(replay_save_duration_min > 0) snprintf(duration, sizeof(duration), " %d minute ", replay_save_duration_min); @@ -1814,7 +1816,7 @@ namespace gsr { if(exit_code == 0) { if(config.screenshot_config.save_screenshot_in_game_folder) { save_video_in_current_game_directory(screenshot_filepath.c_str(), NotificationType::SCREENSHOT); - } else { + } else if(config.screenshot_config.show_screenshot_saved_notifications) { char msg[512]; if(is_capture_target_monitor(screenshot_capture_target.c_str())) snprintf(msg, sizeof(msg), "Saved a screenshot of this monitor"); @@ -1916,7 +1918,7 @@ namespace gsr { if(exit_code == 0) { if(config.record_config.save_video_in_game_folder) { save_video_in_current_game_directory(video_filepath.c_str(), NotificationType::RECORD); - } else { + } else if(config.record_config.show_video_saved_notifications) { char msg[512]; if(is_capture_target_monitor(recording_capture_target.c_str())) snprintf(msg, sizeof(msg), "Saved a recording of this monitor"); diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index c68bf09..78c6e91 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -940,6 +940,11 @@ namespace gsr { show_video_saved_notification_checkbox_ptr = show_video_saved_notification_checkbox.get(); checkboxes_list->add_widget(std::move(show_video_saved_notification_checkbox)); + auto show_video_paused_notification_checkbox = std::make_unique<CheckBox>(&get_theme().body_font, "Show video paused/unpaused notification"); + show_video_paused_notification_checkbox->set_checked(true); + show_video_paused_notification_checkbox_ptr = show_video_paused_notification_checkbox.get(); + checkboxes_list->add_widget(std::move(show_video_paused_notification_checkbox)); + auto notifications_subsection = std::make_unique<Subsection>("Notifications", std::move(checkboxes_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)); Subsection *notifications_subsection_ptr = notifications_subsection.get(); settings_list_ptr->add_widget(std::move(notifications_subsection)); @@ -1239,6 +1244,7 @@ namespace gsr { save_recording_in_game_folder_ptr->set_checked(config.record_config.save_video_in_game_folder); show_recording_started_notification_checkbox_ptr->set_checked(config.record_config.show_recording_started_notifications); show_video_saved_notification_checkbox_ptr->set_checked(config.record_config.show_video_saved_notifications); + show_video_paused_notification_checkbox_ptr->set_checked(config.record_config.show_video_paused_notifications); save_directory_button_ptr->set_text(config.record_config.save_directory); container_box_ptr->set_selected_item(config.record_config.container); } @@ -1379,6 +1385,7 @@ namespace gsr { config.record_config.save_video_in_game_folder = save_recording_in_game_folder_ptr->is_checked(); config.record_config.show_recording_started_notifications = show_recording_started_notification_checkbox_ptr->is_checked(); config.record_config.show_video_saved_notifications = show_video_saved_notification_checkbox_ptr->is_checked(); + config.record_config.show_video_paused_notifications = show_video_paused_notification_checkbox_ptr->is_checked(); config.record_config.save_directory = save_directory_button_ptr->get_text(); config.record_config.container = container_box_ptr->get_selected_id(); } |