mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Add low power mode for amd
This commit is contained in:
@@ -60,6 +60,7 @@ namespace gsr {
|
|||||||
bool overclock = false;
|
bool overclock = false;
|
||||||
bool record_cursor = true;
|
bool record_cursor = true;
|
||||||
bool restore_portal_session = true;
|
bool restore_portal_session = true;
|
||||||
|
bool low_power_mode = false;
|
||||||
|
|
||||||
std::string webcam_source = "";
|
std::string webcam_source = "";
|
||||||
bool webcam_flip_horizontally = false;
|
bool webcam_flip_horizontally = false;
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ namespace gsr {
|
|||||||
std::unique_ptr<CheckBox> create_led_indicator(const char *type);
|
std::unique_ptr<CheckBox> create_led_indicator(const char *type);
|
||||||
std::unique_ptr<CheckBox> create_notifications(const char *type);
|
std::unique_ptr<CheckBox> create_notifications(const char *type);
|
||||||
std::unique_ptr<List> create_indicator(const char *type);
|
std::unique_ptr<List> create_indicator(const char *type);
|
||||||
|
std::unique_ptr<CheckBox> create_low_power_mode_checkbox();
|
||||||
void add_replay_widgets();
|
void add_replay_widgets();
|
||||||
void add_record_widgets();
|
void add_record_widgets();
|
||||||
|
|
||||||
@@ -217,6 +218,7 @@ namespace gsr {
|
|||||||
ComboBox *webcam_video_format_box_ptr = nullptr;
|
ComboBox *webcam_video_format_box_ptr = nullptr;
|
||||||
List *webcam_body_list_ptr = nullptr;
|
List *webcam_body_list_ptr = nullptr;
|
||||||
CheckBox *flip_camera_horizontally_checkbox_ptr = nullptr;
|
CheckBox *flip_camera_horizontally_checkbox_ptr = nullptr;
|
||||||
|
CheckBox *low_power_mode_checkbox_ptr = nullptr;
|
||||||
|
|
||||||
PageStack *page_stack = nullptr;
|
PageStack *page_stack = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ namespace gsr {
|
|||||||
{"streaming.record_options.overclock", &config.streaming_config.record_options.overclock},
|
{"streaming.record_options.overclock", &config.streaming_config.record_options.overclock},
|
||||||
{"streaming.record_options.record_cursor", &config.streaming_config.record_options.record_cursor},
|
{"streaming.record_options.record_cursor", &config.streaming_config.record_options.record_cursor},
|
||||||
{"streaming.record_options.restore_portal_session", &config.streaming_config.record_options.restore_portal_session},
|
{"streaming.record_options.restore_portal_session", &config.streaming_config.record_options.restore_portal_session},
|
||||||
|
{"streaming.record_options.low_power_mode", &config.streaming_config.record_options.low_power_mode},
|
||||||
{"streaming.record_options.webcam_source", &config.streaming_config.record_options.webcam_source},
|
{"streaming.record_options.webcam_source", &config.streaming_config.record_options.webcam_source},
|
||||||
{"streaming.record_options.webcam_flip_horizontally", &config.streaming_config.record_options.webcam_flip_horizontally},
|
{"streaming.record_options.webcam_flip_horizontally", &config.streaming_config.record_options.webcam_flip_horizontally},
|
||||||
{"streaming.record_options.webcam_video_format", &config.streaming_config.record_options.webcam_video_format},
|
{"streaming.record_options.webcam_video_format", &config.streaming_config.record_options.webcam_video_format},
|
||||||
@@ -238,6 +239,7 @@ namespace gsr {
|
|||||||
{"record.record_options.overclock", &config.record_config.record_options.overclock},
|
{"record.record_options.overclock", &config.record_config.record_options.overclock},
|
||||||
{"record.record_options.record_cursor", &config.record_config.record_options.record_cursor},
|
{"record.record_options.record_cursor", &config.record_config.record_options.record_cursor},
|
||||||
{"record.record_options.restore_portal_session", &config.record_config.record_options.restore_portal_session},
|
{"record.record_options.restore_portal_session", &config.record_config.record_options.restore_portal_session},
|
||||||
|
{"record.record_options.low_power_mode", &config.record_config.record_options.low_power_mode},
|
||||||
{"record.record_options.webcam_source", &config.record_config.record_options.webcam_source},
|
{"record.record_options.webcam_source", &config.record_config.record_options.webcam_source},
|
||||||
{"record.record_options.webcam_flip_horizontally", &config.record_config.record_options.webcam_flip_horizontally},
|
{"record.record_options.webcam_flip_horizontally", &config.record_config.record_options.webcam_flip_horizontally},
|
||||||
{"record.record_options.webcam_video_format", &config.record_config.record_options.webcam_video_format},
|
{"record.record_options.webcam_video_format", &config.record_config.record_options.webcam_video_format},
|
||||||
@@ -274,6 +276,7 @@ namespace gsr {
|
|||||||
{"replay.record_options.overclock", &config.replay_config.record_options.overclock},
|
{"replay.record_options.overclock", &config.replay_config.record_options.overclock},
|
||||||
{"replay.record_options.record_cursor", &config.replay_config.record_options.record_cursor},
|
{"replay.record_options.record_cursor", &config.replay_config.record_options.record_cursor},
|
||||||
{"replay.record_options.restore_portal_session", &config.replay_config.record_options.restore_portal_session},
|
{"replay.record_options.restore_portal_session", &config.replay_config.record_options.restore_portal_session},
|
||||||
|
{"replay.record_options.low_power_mode", &config.replay_config.record_options.low_power_mode},
|
||||||
{"replay.record_options.webcam_source", &config.replay_config.record_options.webcam_source},
|
{"replay.record_options.webcam_source", &config.replay_config.record_options.webcam_source},
|
||||||
{"replay.record_options.webcam_flip_horizontally", &config.replay_config.record_options.webcam_flip_horizontally},
|
{"replay.record_options.webcam_flip_horizontally", &config.replay_config.record_options.webcam_flip_horizontally},
|
||||||
{"replay.record_options.webcam_video_format", &config.replay_config.record_options.webcam_video_format},
|
{"replay.record_options.webcam_video_format", &config.replay_config.record_options.webcam_video_format},
|
||||||
|
|||||||
@@ -2529,6 +2529,11 @@ namespace gsr {
|
|||||||
args.push_back("yes");
|
args.push_back("yes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(record_options.low_power_mode) {
|
||||||
|
args.push_back("-low-power");
|
||||||
|
args.push_back("yes");
|
||||||
|
}
|
||||||
|
|
||||||
if(record_options.record_area_option == "region")
|
if(record_options.record_area_option == "region")
|
||||||
add_region_command(args, region_str, region_str_size, region_selector);
|
add_region_command(args, region_str, region_str_size, region_selector);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1095,6 +1095,14 @@ namespace gsr {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<CheckBox> SettingsPage::create_low_power_mode_checkbox() {
|
||||||
|
// TODO: Show hint that states: May affect recording performance, recommended to use with sync to content frame rate mode
|
||||||
|
auto checkbox = std::make_unique<CheckBox>(&get_theme().body_font, "Record in low-power mode");
|
||||||
|
checkbox->set_visible(gsr_info->gpu_info.vendor == GpuVendor::AMD);
|
||||||
|
low_power_mode_checkbox_ptr = checkbox.get();
|
||||||
|
return checkbox;
|
||||||
|
}
|
||||||
|
|
||||||
void SettingsPage::add_replay_widgets() {
|
void SettingsPage::add_replay_widgets() {
|
||||||
auto file_info_list = std::make_unique<List>(List::Orientation::VERTICAL);
|
auto file_info_list = std::make_unique<List>(List::Orientation::VERTICAL);
|
||||||
auto file_info_data_list = std::make_unique<List>(List::Orientation::HORIZONTAL);
|
auto file_info_data_list = std::make_unique<List>(List::Orientation::HORIZONTAL);
|
||||||
@@ -1110,6 +1118,7 @@ namespace gsr {
|
|||||||
general_list->add_widget(create_save_replay_in_game_folder());
|
general_list->add_widget(create_save_replay_in_game_folder());
|
||||||
if(gsr_info->system_info.gsr_version >= GsrVersion{5, 0, 3})
|
if(gsr_info->system_info.gsr_version >= GsrVersion{5, 0, 3})
|
||||||
general_list->add_widget(create_restart_replay_on_save());
|
general_list->add_widget(create_restart_replay_on_save());
|
||||||
|
general_list->add_widget(create_low_power_mode_checkbox());
|
||||||
|
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("General", std::move(general_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("General", std::move(general_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("Replay indicator", create_indicator("replay"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("Replay indicator", create_indicator("replay"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
@@ -1166,6 +1175,7 @@ namespace gsr {
|
|||||||
|
|
||||||
auto general_list = std::make_unique<List>(List::Orientation::VERTICAL);
|
auto general_list = std::make_unique<List>(List::Orientation::VERTICAL);
|
||||||
general_list->add_widget(create_save_recording_in_game_folder());
|
general_list->add_widget(create_save_recording_in_game_folder());
|
||||||
|
general_list->add_widget(create_low_power_mode_checkbox());
|
||||||
|
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("General", std::move(general_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("General", std::move(general_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("Recording indicator", create_indicator("recording"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("Recording indicator", create_indicator("recording"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
@@ -1293,6 +1303,11 @@ namespace gsr {
|
|||||||
streaming_info_list->add_widget(create_stream_custom_section());
|
streaming_info_list->add_widget(create_stream_custom_section());
|
||||||
|
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("Streaming info", std::move(streaming_info_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("Streaming info", std::move(streaming_info_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
|
|
||||||
|
auto general_list = std::make_unique<List>(List::Orientation::VERTICAL);
|
||||||
|
general_list->add_widget(create_low_power_mode_checkbox());
|
||||||
|
|
||||||
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("General", std::move(general_list), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
settings_list_ptr->add_widget(std::make_unique<Subsection>("Streaming indicator", create_indicator("streaming"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
settings_list_ptr->add_widget(std::make_unique<Subsection>("Streaming indicator", create_indicator("streaming"), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f)));
|
||||||
|
|
||||||
streaming_service_box_ptr->on_selection_changed = [this](const std::string&, const std::string &id) {
|
streaming_service_box_ptr->on_selection_changed = [this](const std::string&, const std::string &id) {
|
||||||
@@ -1433,6 +1448,7 @@ namespace gsr {
|
|||||||
restore_portal_session_checkbox_ptr->set_checked(record_options.restore_portal_session);
|
restore_portal_session_checkbox_ptr->set_checked(record_options.restore_portal_session);
|
||||||
show_notification_checkbox_ptr->set_checked(record_options.show_notifications);
|
show_notification_checkbox_ptr->set_checked(record_options.show_notifications);
|
||||||
led_indicator_checkbox_ptr->set_checked(record_options.use_led_indicator);
|
led_indicator_checkbox_ptr->set_checked(record_options.use_led_indicator);
|
||||||
|
low_power_mode_checkbox_ptr->set_checked(record_options.low_power_mode);
|
||||||
|
|
||||||
webcam_sources_box_ptr->set_selected_item(record_options.webcam_source);
|
webcam_sources_box_ptr->set_selected_item(record_options.webcam_source);
|
||||||
flip_camera_horizontally_checkbox_ptr->set_checked(record_options.webcam_flip_horizontally);
|
flip_camera_horizontally_checkbox_ptr->set_checked(record_options.webcam_flip_horizontally);
|
||||||
@@ -1576,6 +1592,7 @@ namespace gsr {
|
|||||||
record_options.restore_portal_session = restore_portal_session_checkbox_ptr->is_checked();
|
record_options.restore_portal_session = restore_portal_session_checkbox_ptr->is_checked();
|
||||||
record_options.show_notifications = show_notification_checkbox_ptr->is_checked();
|
record_options.show_notifications = show_notification_checkbox_ptr->is_checked();
|
||||||
record_options.use_led_indicator = led_indicator_checkbox_ptr->is_checked();
|
record_options.use_led_indicator = led_indicator_checkbox_ptr->is_checked();
|
||||||
|
record_options.low_power_mode = low_power_mode_checkbox_ptr->is_checked();
|
||||||
|
|
||||||
if(selected_camera_setup.has_value())
|
if(selected_camera_setup.has_value())
|
||||||
webcam_box_size = clamp_keep_aspect_ratio(selected_camera_setup->resolution.to_vec2f(), webcam_box_size);
|
webcam_box_size = clamp_keep_aspect_ratio(selected_camera_setup->resolution.to_vec2f(), webcam_box_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user