From 4ba1e814b748d57631f6b7afb7eaa63e8435c24e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 13 Nov 2024 22:18:30 +0100 Subject: Add application audio option --- include/gui/Label.hpp | 1 + include/gui/LineSeparator.hpp | 24 ++++++++++++++++++++++++ include/gui/SettingsPage.hpp | 31 ++++++++++++++++++++++++------- include/gui/Subsection.hpp | 1 + 4 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 include/gui/LineSeparator.hpp (limited to 'include/gui') diff --git a/include/gui/Label.hpp b/include/gui/Label.hpp index a702497..f9045e0 100644 --- a/include/gui/Label.hpp +++ b/include/gui/Label.hpp @@ -19,6 +19,7 @@ namespace gsr { mgl::vec2f get_size() override; void set_text(std::string str); + const std::string& get_text() const; private: mgl::Text text; }; diff --git a/include/gui/LineSeparator.hpp b/include/gui/LineSeparator.hpp new file mode 100644 index 0000000..8c39114 --- /dev/null +++ b/include/gui/LineSeparator.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include "Widget.hpp" + +namespace gsr { + class LineSeparator : public Widget { + public: + enum class Type { + HORIZONTAL + }; + + LineSeparator(Type type, float width); + LineSeparator(const LineSeparator&) = delete; + LineSeparator& operator=(const LineSeparator&) = delete; + + bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; + void draw(mgl::Window &window, mgl::vec2f offset) override; + + mgl::vec2f get_size() override; + private: + Type type; + float width; + }; +} \ No newline at end of file diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index 467463f..2fba93b 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -24,7 +24,7 @@ namespace gsr { STREAM }; - SettingsPage(Type type, const GsrInfo &gsr_info, std::vector audio_devices, Config &config, PageStack *page_stack); + SettingsPage(Type type, const GsrInfo &gsr_info, Config &config, PageStack *page_stack); SettingsPage(const SettingsPage&) = delete; SettingsPage& operator=(const SettingsPage&) = delete; @@ -48,13 +48,23 @@ namespace gsr { std::unique_ptr create_restore_portal_session_section(); std::unique_ptr create_change_video_resolution_section(); std::unique_ptr create_capture_target(const GsrInfo &gsr_info); - std::unique_ptr create_audio_track_selection_checkbox(); - std::unique_ptr