aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-08 14:32:11 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-08 14:32:11 +0100
commitf3565fdd77fb480575feec5de252466b093daf86 (patch)
tree1769a3923eda51aabe8a3f8bfa905a4df7a12df4 /include
parent6b66eebb6896b768f1b7cd5f37caa01fbf4b7e28 (diff)
Query capture options when opening settings and validate capture options when starting recording
Diffstat (limited to 'include')
-rw-r--r--include/Config.hpp6
-rw-r--r--include/GsrInfo.hpp3
-rw-r--r--include/Overlay.hpp2
-rw-r--r--include/gui/SettingsPage.hpp46
4 files changed, 30 insertions, 27 deletions
diff --git a/include/Config.hpp b/include/Config.hpp
index 6044ab8..02f1634 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -7,7 +7,7 @@
#include <optional>
namespace gsr {
- struct GsrInfo;
+ struct SupportedCaptureOptions;
struct ConfigHotkey {
int64_t keysym = 0;
@@ -92,7 +92,7 @@ namespace gsr {
};
struct Config {
- Config(const GsrInfo &gsr_info);
+ Config(const SupportedCaptureOptions &capture_options);
MainConfig main_config;
StreamingConfig streaming_config;
@@ -100,6 +100,6 @@ namespace gsr {
ReplayConfig replay_config;
};
- std::optional<Config> read_config(const GsrInfo &gsr_info);
+ std::optional<Config> read_config(const SupportedCaptureOptions &capture_options);
void save_config(Config &config);
} \ No newline at end of file
diff --git a/include/GsrInfo.hpp b/include/GsrInfo.hpp
index cd6292c..6ec8e23 100644
--- a/include/GsrInfo.hpp
+++ b/include/GsrInfo.hpp
@@ -52,13 +52,13 @@ namespace gsr {
struct GpuInfo {
GpuVendor vendor = GpuVendor::UNKNOWN;
+ std::string card_path;
};
struct GsrInfo {
SystemInfo system_info;
GpuInfo gpu_info;
SupportedVideoCodecs supported_video_codecs;
- SupportedCaptureOptions supported_capture_options;
};
enum class GsrInfoExitStatus {
@@ -78,4 +78,5 @@ namespace gsr {
std::vector<AudioDevice> get_audio_devices();
std::vector<std::string> get_application_audio();
+ SupportedCaptureOptions get_supported_capture_options(const GsrInfo &gsr_info);
} \ No newline at end of file
diff --git a/include/Overlay.hpp b/include/Overlay.hpp
index 0a4a1e9..283f2b1 100644
--- a/include/Overlay.hpp
+++ b/include/Overlay.hpp
@@ -36,7 +36,7 @@ namespace gsr {
class Overlay {
public:
- Overlay(std::string resources_path, GsrInfo gsr_info, egl_functions egl_funcs);
+ Overlay(std::string resources_path, GsrInfo gsr_info, SupportedCaptureOptions capture_options, egl_functions egl_funcs);
Overlay(const Overlay&) = delete;
Overlay& operator=(const Overlay&) = delete;
~Overlay();
diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp
index f18ff65..b115d78 100644
--- a/include/gui/SettingsPage.hpp
+++ b/include/gui/SettingsPage.hpp
@@ -25,17 +25,17 @@ namespace gsr {
STREAM
};
- SettingsPage(Type type, const GsrInfo &gsr_info, 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;
- void load(const GsrInfo &gsr_info);
+ void load();
void save();
void on_navigate_away_from_page() override;
private:
std::unique_ptr<RadioButton> create_view_radio_button();
- std::unique_ptr<ComboBox> create_record_area_box(const GsrInfo &gsr_info);
- std::unique_ptr<Widget> create_record_area(const GsrInfo &gsr_info);
+ std::unique_ptr<ComboBox> create_record_area_box();
+ std::unique_ptr<Widget> create_record_area();
std::unique_ptr<List> create_select_window();
std::unique_ptr<Entry> create_area_width_entry();
std::unique_ptr<Entry> create_area_height_entry();
@@ -48,7 +48,7 @@ namespace gsr {
std::unique_ptr<CheckBox> create_restore_portal_session_checkbox();
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<Widget> create_capture_target();
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();
@@ -70,8 +70,8 @@ namespace gsr {
std::unique_ptr<ComboBox> create_color_range_box();
std::unique_ptr<List> create_color_range();
std::unique_ptr<List> create_video_quality_section();
- std::unique_ptr<ComboBox> create_video_codec_box(const GsrInfo &gsr_info);
- std::unique_ptr<List> create_video_codec(const GsrInfo &gsr_info);
+ std::unique_ptr<ComboBox> create_video_codec_box();
+ std::unique_ptr<List> create_video_codec();
std::unique_ptr<ComboBox> create_audio_codec_box();
std::unique_ptr<List> create_audio_codec();
std::unique_ptr<Entry> create_framerate_entry();
@@ -80,24 +80,24 @@ namespace gsr {
std::unique_ptr<List> create_framerate_mode();
std::unique_ptr<List> create_framerate_section();
std::unique_ptr<Widget> create_record_cursor_section();
- std::unique_ptr<Widget> create_video_section(const GsrInfo &gsr_info);
- std::unique_ptr<Widget> create_settings(const GsrInfo &gsr_info);
- void add_widgets(const GsrInfo &gsr_info);
+ std::unique_ptr<Widget> create_video_section();
+ std::unique_ptr<Widget> create_settings();
+ void add_widgets();
- void add_page_specific_widgets(const GsrInfo &gsr_info);
+ void add_page_specific_widgets();
std::unique_ptr<List> create_save_directory(const char *label);
std::unique_ptr<ComboBox> create_container_box();
std::unique_ptr<List> create_container_section();
std::unique_ptr<Entry> create_replay_time_entry();
std::unique_ptr<List> create_replay_time();
- std::unique_ptr<RadioButton> create_start_replay_automatically(const GsrInfo &gsr_info);
- std::unique_ptr<CheckBox> create_save_replay_in_game_folder(const GsrInfo &gsr_info);
+ std::unique_ptr<RadioButton> create_start_replay_automatically();
+ std::unique_ptr<CheckBox> create_save_replay_in_game_folder();
std::unique_ptr<Label> create_estimated_file_size();
void update_estimated_file_size();
- std::unique_ptr<CheckBox> create_save_recording_in_game_folder(const GsrInfo &gsr_info);
- void add_replay_widgets(const GsrInfo &gsr_info);
- void add_record_widgets(const GsrInfo &gsr_info);
+ std::unique_ptr<CheckBox> create_save_recording_in_game_folder();
+ void add_replay_widgets();
+ void add_record_widgets();
std::unique_ptr<ComboBox> create_streaming_service_box();
std::unique_ptr<List> create_streaming_service_section();
@@ -105,13 +105,13 @@ namespace gsr {
std::unique_ptr<List> create_stream_url_section();
std::unique_ptr<ComboBox> create_stream_container_box();
std::unique_ptr<List> create_stream_container_section();
- void add_stream_widgets(const GsrInfo &gsr_info);
+ void add_stream_widgets();
- void load_audio_tracks(const RecordOptions &record_options, const GsrInfo &gsr_info);
- void load_common(RecordOptions &record_options, const GsrInfo &gsr_info);
- void load_replay(const GsrInfo &gsr_info);
- void load_record(const GsrInfo &gsr_info);
- void load_stream(const GsrInfo &gsr_info);
+ void load_audio_tracks(const RecordOptions &record_options);
+ void load_common(RecordOptions &record_options);
+ void load_replay();
+ void load_record();
+ void load_stream();
void save_common(RecordOptions &record_options);
void save_replay();
@@ -120,8 +120,10 @@ namespace gsr {
private:
Type type;
Config &config;
+ const GsrInfo *gsr_info = nullptr;
std::vector<AudioDevice> audio_devices;
std::vector<std::string> application_audio;
+ SupportedCaptureOptions capture_options;
GsrPage *content_page_ptr = nullptr;
ScrollablePage *settings_scrollable_page_ptr = nullptr;