aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-13 22:18:30 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-13 22:36:55 +0100
commit4ba1e814b748d57631f6b7afb7eaa63e8435c24e (patch)
treeaa49caab6f299fb42f404ace5907025616aad553 /include
parent590428425e8d35c96fffca666a50755a65c1cdba (diff)
Add application audio option
Diffstat (limited to 'include')
-rw-r--r--include/Config.hpp3
-rw-r--r--include/GsrInfo.hpp1
-rw-r--r--include/Overlay.hpp3
-rw-r--r--include/gui/Label.hpp1
-rw-r--r--include/gui/LineSeparator.hpp24
-rw-r--r--include/gui/SettingsPage.hpp31
-rw-r--r--include/gui/Subsection.hpp1
7 files changed, 55 insertions, 9 deletions
diff --git a/include/Config.hpp b/include/Config.hpp
index 785af69..fbfc86f 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -23,8 +23,11 @@ namespace gsr {
int32_t fps = 60;
int32_t video_bitrate = 15000;
bool merge_audio_tracks = true;
+ bool application_audio_invert = false;
bool change_video_resolution = false;
+ std::string audio_type_view = "audio_devices";
std::vector<std::string> audio_tracks;
+ std::vector<std::string> application_audio;
std::string color_range = "limited";
std::string video_quality = "very_high";
std::string video_codec = "auto";
diff --git a/include/GsrInfo.hpp b/include/GsrInfo.hpp
index fb12cd4..c3da6d7 100644
--- a/include/GsrInfo.hpp
+++ b/include/GsrInfo.hpp
@@ -76,4 +76,5 @@ namespace gsr {
GsrInfoExitStatus get_gpu_screen_recorder_info(GsrInfo *gsr_info);
std::vector<AudioDevice> get_audio_devices();
+ std::vector<std::string> get_application_audio();
} \ No newline at end of file
diff --git a/include/Overlay.hpp b/include/Overlay.hpp
index eafb4ab..823e3a6 100644
--- a/include/Overlay.hpp
+++ b/include/Overlay.hpp
@@ -90,14 +90,13 @@ namespace gsr {
std::string resources_path;
GsrInfo gsr_info;
egl_functions egl_funcs;
- std::vector<gsr::AudioDevice> audio_devices;
mgl::Texture window_texture_texture;
mgl::Sprite window_texture_sprite;
mgl::Texture screenshot_texture;
mgl::Sprite screenshot_sprite;
mgl::Rectangle bg_screenshot_overlay;
WindowTexture window_texture;
- gsr::PageStack page_stack;
+ PageStack page_stack;
mgl::Rectangle top_bar_background;
mgl::Text top_bar_text;
mgl::Sprite logo_sprite;
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<AudioDevice> 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<List> create_restore_portal_session_section();
std::unique_ptr<Widget> create_change_video_resolution_section();
std::unique_ptr<Widget> create_capture_target(const GsrInfo &gsr_info);
- std::unique_ptr<ComboBox> create_audio_track_selection_checkbox();
- std::unique_ptr<Button> create_remove_audio_track_button(List *audio_device_list_ptr);
- std::unique_ptr<List> create_audio_track();
- std::unique_ptr<Button> create_add_audio_track_button();
- std::unique_ptr<List> create_audio_track_section();
+ std::unique_ptr<ComboBox> create_audio_device_selection_combobox();
+ std::unique_ptr<Button> create_remove_audio_device_button(List *audio_device_list_ptr);
+ std::unique_ptr<List> create_audio_device();
+ std::unique_ptr<Button> create_add_audio_device_button();
+ std::unique_ptr<List> create_audio_device_track_section();
std::unique_ptr<CheckBox> create_merge_audio_tracks_checkbox();
+ std::unique_ptr<RadioButton> create_audio_type_button();
std::unique_ptr<Widget> create_audio_device_section();
+ std::unique_ptr<List> create_application_audio_track_section();
+ std::unique_ptr<CheckBox> create_application_audio_invert_checkbox();
+ std::unique_ptr<List> create_application_audio_section();
+ std::unique_ptr<ComboBox> create_application_audio_selection_combobox();
+ std::unique_ptr<Button> create_remove_application_audio_button(List *app_audio_item);
+ std::unique_ptr<List> create_application_audio();
+ std::unique_ptr<List> create_custom_application_audio();
+ std::unique_ptr<List> create_add_application_audio_buttons();
+ std::unique_ptr<Widget> create_audio_section();
std::unique_ptr<List> create_video_quality_box();
std::unique_ptr<Entry> create_video_bitrate_entry();
std::unique_ptr<List> create_video_bitrate();
@@ -98,7 +108,8 @@ namespace gsr {
std::unique_ptr<List> create_stream_container_section();
void add_stream_widgets();
- void load_audio_tracks(RecordOptions &record_options);
+ void load_audio_device_tracks(RecordOptions &record_options);
+ void load_application_audio_tracks(RecordOptions &record_options);
void load_common(RecordOptions &record_options);
void load_replay();
void load_record();
@@ -112,6 +123,7 @@ namespace gsr {
Type type;
Config &config;
std::vector<AudioDevice> audio_devices;
+ std::vector<std::string> application_audio;
GsrPage *content_page_ptr = nullptr;
ScrollablePage *settings_scrollable_page_ptr = nullptr;
@@ -133,7 +145,12 @@ namespace gsr {
Entry *video_bitrate_entry_ptr = nullptr;
List *video_bitrate_list_ptr = nullptr;
List *audio_devices_list_ptr = nullptr;
+ List *audio_devices_section_list_ptr = nullptr;
+ List *application_audio_section_list_ptr = nullptr;
CheckBox *merge_audio_tracks_checkbox_ptr = nullptr;
+ RadioButton *audio_type_radio_button_ptr = nullptr;
+ List *application_audio_list_ptr = nullptr;
+ CheckBox *application_audio_invert_checkbox_ptr = nullptr;
CheckBox *change_video_resolution_checkbox_ptr = nullptr;
ComboBox *color_range_box_ptr = nullptr;
ComboBox *video_quality_box_ptr = nullptr;
diff --git a/include/gui/Subsection.hpp b/include/gui/Subsection.hpp
index 90cb798..4da6baf 100644
--- a/include/gui/Subsection.hpp
+++ b/include/gui/Subsection.hpp
@@ -16,6 +16,7 @@ namespace gsr {
void draw(mgl::Window &window, mgl::vec2f offset) override;
mgl::vec2f get_size() override;
+ mgl::vec2f get_inner_size() override;
private:
Label label;
std::unique_ptr<Widget> inner_widget;