From 8df10eeecac15ddb45ed4e350d33814ac4690f89 Mon Sep 17 00:00:00 2001 From: trilene Date: Thu, 18 Feb 2021 15:55:29 -0500 Subject: Support desktop screen sharing on X11 --- src/UserSettingsPage.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'src/UserSettingsPage.cpp') diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index b6fdf504..186a03bb 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -107,13 +107,15 @@ UserSettings::load(std::optional profile) auto presenceValue = QMetaEnum::fromType().keyToValue(tempPresence.c_str()); if (presenceValue < 0) presenceValue = 0; - presence_ = static_cast(presenceValue); - ringtone_ = settings.value("user/ringtone", "Default").toString(); - microphone_ = settings.value("user/microphone", QString()).toString(); - camera_ = settings.value("user/camera", QString()).toString(); - cameraResolution_ = settings.value("user/camera_resolution", QString()).toString(); - cameraFrameRate_ = settings.value("user/camera_frame_rate", QString()).toString(); - useStunServer_ = settings.value("user/use_stun_server", false).toBool(); + presence_ = static_cast(presenceValue); + ringtone_ = settings.value("user/ringtone", "Default").toString(); + microphone_ = settings.value("user/microphone", QString()).toString(); + camera_ = settings.value("user/camera", QString()).toString(); + cameraResolution_ = settings.value("user/camera_resolution", QString()).toString(); + cameraFrameRate_ = settings.value("user/camera_frame_rate", QString()).toString(); + screenShareFrameRate_ = settings.value("user/screen_share_frame_rate", 5).toInt(); + screenShareRemoteVideo_ = settings.value("user/screen_share_remote_video", false).toBool(); + useStunServer_ = settings.value("user/use_stun_server", false).toBool(); if (profile) // set to "" if it's the default to maintain compatibility profile_ = (*profile == "default") ? "" : *profile; @@ -444,6 +446,26 @@ UserSettings::setCameraFrameRate(QString frameRate) save(); } +void +UserSettings::setScreenShareFrameRate(int frameRate) +{ + if (frameRate == screenShareFrameRate_) + return; + screenShareFrameRate_ = frameRate; + emit screenShareFrameRateChanged(frameRate); + save(); +} + +void +UserSettings::setScreenShareRemoteVideo(bool state) +{ + if (state == screenShareRemoteVideo_) + return; + screenShareRemoteVideo_ = state; + emit screenShareRemoteVideoChanged(state); + save(); +} + void UserSettings::setProfile(QString profile) { @@ -593,6 +615,8 @@ UserSettings::save() settings.setValue("camera", camera_); settings.setValue("camera_resolution", cameraResolution_); settings.setValue("camera_frame_rate", cameraFrameRate_); + settings.setValue("screen_share_frame_rate", screenShareFrameRate_); + settings.setValue("screen_share_remote_video", screenShareRemoteVideo_); settings.setValue("use_stun_server", useStunServer_); settings.setValue("currentProfile", profile_); -- cgit 1.4.1