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 --- src/gui/SettingsPage.cpp | 215 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 185 insertions(+), 30 deletions(-) (limited to 'src/gui/SettingsPage.cpp') diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index a08bd52..083fec5 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -1,6 +1,7 @@ #include "../../include/gui/SettingsPage.hpp" #include "../../include/gui/GsrPage.hpp" #include "../../include/gui/Label.hpp" +#include "../../include/gui/LineSeparator.hpp" #include "../../include/gui/PageStack.hpp" #include "../../include/gui/FileChooser.hpp" #include "../../include/gui/Subsection.hpp" @@ -13,15 +14,19 @@ #include #include +#include + namespace gsr { - SettingsPage::SettingsPage(Type type, const GsrInfo &gsr_info, std::vector audio_devices, Config &config, PageStack *page_stack) : + SettingsPage::SettingsPage(Type type, const GsrInfo &gsr_info, Config &config, PageStack *page_stack) : StaticPage(mgl::vec2f(get_theme().window_width, get_theme().window_height).floor()), type(type), config(config), - audio_devices(std::move(audio_devices)), page_stack(page_stack), settings_title_text("Settings", get_theme().title_font) { + audio_devices = get_audio_devices(); + application_audio = get_application_audio(); + auto content_page = std::make_unique(); content_page->add_button("Back", "back", get_color_theme().page_bg_color); content_page->on_click = [page_stack](const std::string &id) { @@ -177,7 +182,7 @@ namespace gsr { return std::make_unique("Record area", std::move(ll), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)); } - std::unique_ptr SettingsPage::create_audio_track_selection_checkbox() { + std::unique_ptr SettingsPage::create_audio_device_selection_combobox() { auto audio_device_box = std::make_unique(&get_theme().body_font); for(const auto &audio_device : audio_devices) { audio_device_box->add_item(audio_device.description, audio_device.name); @@ -185,7 +190,7 @@ namespace gsr { return audio_device_box; } - std::unique_ptr