Video and Steam VR Tab Re-work + keyboard binds (#289)

* changed color overlay to use gain values instead of overlay

* moved SS/Motion smoothing, and filter to video tab

* began refactor of steamVR qml page

* added misc toggles to steamvr tab

* added imu fallback and DND, and some qml formatting

* added Camera Settings to SteamVR page

* changed formatting to minimize height

* added video profiles cleaned up steamvr controller

* delta comparison change

* added profiles for video

* fixed display bug in colorgroupbox and removed frivoulous saves

* removed commented code

* added custom keybind buttons
This commit is contained in:
ykeara
2019-09-01 02:35:00 -05:00
committed by GitHub
parent 5452144157
commit 4b0be27ff6
24 changed files with 1750 additions and 1257 deletions
+7 -1
View File
@@ -29,7 +29,9 @@ DISTFILES += \
src/res/qml/RootPage.qml \
src/res/qml/SettingsPage.qml \
src/res/qml/StatisticsPage.qml \
src/res/qml/SteamVRPage.qml \
src/res/qml/steamvr_page/SteamVRPage.qml \
src/res/qml/steamvr_page/camera/* \
src/res/qml/steamvr_page/steamvrmisc/* \
src/res/qml/utilities_page/* \
src/res/qml/utilities_page/media_keys/* \
src/res/qml/utilities_page/keyboard_utils/* \
@@ -43,6 +45,10 @@ DISTFILES += \
src/res/qml/video_page/* \
src/res/qml/video_page/brightness/* \
src/res/qml/video_page/color/* \
src/res/qml/video_page/supersampling/* \
src/res/qml/video_page/miscvid/* \
src/res/qml/video_page/profiles/* \
src/res/qml/video_page/dialogboxes/* \
src/res/qml/common/* \
src/res/qml/desktop_overlay_page/* \
src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml \
+1
View File
@@ -1044,6 +1044,7 @@ void OverlayController::mainEventLoop()
m_settingsTabController.dashboardLoopTick();
m_steamVRTabController.dashboardLoopTick();
m_fixFloorTabController.dashboardLoopTick( devicePoses );
m_videoTabController.dashboardLoopTick();
}
if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid )
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

+20 -18
View File
@@ -164,34 +164,36 @@ MyStackViewPage {
spacing: 18
MyText {
text: "Supersampling Profile:"
text: "Video Profile:"
}
Item{
Layout.fillWidth: true
}
MyComboBox {
id: summarySteamVRProfileComboBox
id: summaryVideoProfileComboBox
Layout.maximumWidth: 378
Layout.minimumWidth: 378
Layout.preferredWidth: 378
Layout.fillWidth: true
model: [""]
onCurrentIndexChanged: {
if (currentIndex > 0) {
summarySteamVRProfileApplyButton.enabled = true
summaryVideoProfileApplyButton.enabled = true
} else {
summarySteamVRProfileApplyButton.enabled = false
summaryVideoProfileApplyButton.enabled = false
}
}
}
MyPushButton {
id: summarySteamVRProfileApplyButton
id: summaryVideoProfileApplyButton
enabled: false
Layout.preferredWidth: 150
text: "Apply"
onClicked: {
if (summarySteamVRProfileComboBox.currentIndex > 0) {
SteamVRTabController.applySteamVRProfile(summarySteamVRProfileComboBox.currentIndex - 1)
summarySteamVRProfileComboBox.currentIndex = 0
if (summaryVideoProfileComboBox.currentIndex > 0) {
VideoTabController.applyVideoProfile(summaryVideoProfileComboBox.currentIndex - 1)
summaryVideoProfileComboBox.currentIndex = 0
}
}
}
@@ -394,7 +396,7 @@ MyStackViewPage {
Component.onCompleted: {
reloadChaperoneProfiles()
reloadSteamVRProfiles()
reloadVideoProfiles()
summaryVersionText.text = applicationVersion
@@ -423,9 +425,9 @@ MyStackViewPage {
}
Connections {
target: SteamVRTabController
onSteamVRProfilesUpdated: {
reloadSteamVRProfiles()
target: VideoTabController
onVideoProfilesUpdated: {
reloadVideoProfiles()
}
}
@@ -499,13 +501,13 @@ MyStackViewPage {
}
function reloadSteamVRProfiles() {
function reloadVideoProfiles() {
var profiles = [""]
var profileCount = SteamVRTabController.getSteamVRProfileCount()
var profileCount = VideoTabController.getVideoProfileCount()
for (var i = 0; i < profileCount; i++) {
profiles.push(SteamVRTabController.getSteamVRProfileName(i))
profiles.push(VideoTabController.getVideoProfileName(i))
}
summarySteamVRProfileComboBox.currentIndex = 0
summarySteamVRProfileComboBox.model = profiles
summaryVideoProfileComboBox.currentIndex = 0
summaryVideoProfileComboBox.model = profiles
}
}
-374
View File
@@ -1,374 +0,0 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "common"
MyStackViewPage {
id: myStackViewPage1
headerText: "SteamVR Settings"
MyDialogOkPopup {
id: steamvrMessageDialog
function showMessage(title, text) {
dialogTitle = title
dialogText = text
open()
}
}
MyDialogOkCancelPopup {
id: steamvrDeleteProfileDialog
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this profile?"
onClosed: {
if (okClicked) {
SteamVRTabController.deleteSteamVRProfile(profileIndex)
}
}
}
MyDialogOkCancelPopup {
id: steamvrNewProfileDialog
dialogTitle: "Create New Profile"
dialogWidth: 600
dialogHeight: 400
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: steamvrNewProfileName
keyBoardUID: 490
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent(input) {
steamvrNewProfileName.text = input
}
}
}
MyText {
Layout.topMargin: 24
text: "What to include:"
}
MyToggleButton {
id: steamvrNewProfileIncludeSupersampling
Layout.leftMargin: 32
text: "Application Supersampling"
}
MyToggleButton {
id: steamvrNewProfileIncludeSupersampleFiltering
Layout.leftMargin: 32
text: "Supersample Filtering"
}
MyToggleButton {
id: steamvrNewProfileIncludeMotionSmoothing
Layout.leftMargin: 32
text: "Motion Smoothing Setting"
}
}
onClosed: {
if (okClicked) {
if (steamvrNewProfileName.text == "") {
steamvrMessageDialog.showMessage("Create New Profile", "ERROR: Empty profile name.")
} else if (!steamvrNewProfileIncludeSupersampling.checked
&& !steamvrNewProfileIncludeSupersampleFiltering.checked
&& !steamvrNewProfileIncludeMotionSmoothing.checked) {
steamvrMessageDialog.showMessage("Create New Profile", "ERROR: Nothing included.")
} else {
SteamVRTabController.addSteamVRProfile(steamvrNewProfileName.text,
steamvrNewProfileIncludeSupersampling.checked,
steamvrNewProfileIncludeSupersampleFiltering.checked,
steamvrNewProfileIncludeMotionSmoothing.checked
)
}
}
}
function openPopup() {
steamvrNewProfileName.text = ""
steamvrNewProfileIncludeSupersampling.checked = false
steamvrNewProfileIncludeSupersampleFiltering.checked = false
steamvrNewProfileIncludeMotionSmoothing.checked = false
open()
}
}
content: ColumnLayout {
spacing: 18
ColumnLayout {
Layout.bottomMargin: 32
spacing: 18
RowLayout {
spacing: 18
MyText {
text: "Profile:"
}
MyComboBox {
id: steamvrProfileComboBox
Layout.maximumWidth: 799
Layout.minimumWidth: 799
Layout.preferredWidth: 799
Layout.fillWidth: true
model: [""]
onCurrentIndexChanged: {
if (currentIndex > 0) {
steamvrApplyProfileButton.enabled = true
steamvrDeleteProfileButton.enabled = true
} else {
steamvrApplyProfileButton.enabled = false
steamvrDeleteProfileButton.enabled = false
}
}
}
MyPushButton {
id: steamvrApplyProfileButton
enabled: false
Layout.preferredWidth: 200
text: "Apply"
onClicked: {
if (steamvrProfileComboBox.currentIndex > 0) {
SteamVRTabController.applySteamVRProfile(steamvrProfileComboBox.currentIndex - 1)
}
}
}
}
RowLayout {
spacing: 18
Item {
Layout.fillWidth: true
}
MyPushButton {
id: steamvrDeleteProfileButton
enabled: false
Layout.preferredWidth: 200
text: "Delete Profile"
onClicked: {
if (steamvrProfileComboBox.currentIndex > 0) {
steamvrDeleteProfileDialog.profileIndex = steamvrProfileComboBox.currentIndex - 1
steamvrDeleteProfileDialog.open()
}
}
}
MyPushButton {
Layout.preferredWidth: 200
text: "New Profile"
onClicked: {
steamvrNewProfileDialog.openPopup()
}
}
}
}
RowLayout {
spacing: 16
MyText {
text: "Application Supersampling:"
Layout.preferredWidth: 350
Layout.rightMargin: 12
}
MyPushButton2 {
id: steamvrSupersampleDecrement
text: "-"
Layout.preferredWidth: 40
onClicked: {
steamvrSupersamplingSlider.decrease()
}
}
MySlider {
id: steamvrSupersamplingSlider
from: 0.2
to: 5.0
stepSize: 0.1
value: 1.0
snapMode: Slider.SnapAlways
Layout.fillWidth: true
onValueChanged: {
var val = this.value
steamvrSupersamplingText.text = val.toFixed(1)
SteamVRTabController.setSuperSampling(this.value.toFixed(1), true)
}
}
MyPushButton2 {
id: steamvrSupersampleIncrement
text: "+"
Layout.preferredWidth: 40
onClicked: {
steamvrSupersamplingSlider.increase()
}
}
MyTextField {
id: steamvrSupersamplingText
text: "0.0"
keyBoardUID: 401
Layout.preferredWidth: 100
Layout.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 0.1) {
val = 0.1
}
var v = val.toFixed(1)
if (v <= steamvrSupersamplingSlider.to) {
steamvrSupersamplingSlider.value = v
} else {
SteamVRTabController.setSuperSampling(v, false)
}
}
text = SteamVRTabController.superSampling.toFixed(1)
}
}
}
MyToggleButton {
id: steamvrAllowSupersampleOverrideToggle
text: "Enable Manual Supersampling Override: (refresh dashboard to take effect)"
onCheckedChanged: {
SteamVRTabController.setAllowSupersampleOverride(this.checked, false)
SteamVRTabController.setSuperSampling(steamvrSupersamplingSlider.value, true)
steamvrSupersamplingText.text = SteamVRTabController.superSampling.toFixed(1)
if(!this.checked){
steamvrSupersamplingText.enabled = false
steamvrSupersamplingSlider.enabled = false
steamvrSupersampleIncrement.enabled = false
steamvrSupersampleDecrement.enabled = false
}else{
steamvrSupersamplingText.enabled = true
steamvrSupersamplingSlider.enabled = true
steamvrSupersampleIncrement.enabled = true
steamvrSupersampleDecrement.enabled = true
}
}
}
MyToggleButton {
id: steamvrAllowSupersampleFilteringToggle
text: "Enable Advanced Supersample Filtering"
onCheckedChanged: {
SteamVRTabController.setAllowSupersampleFiltering(this.checked, false)
}
}
MyToggleButton {
id: steamvrMotionSmoothingToggle
text: "Enable Motion Smoothing"
onCheckedChanged: {
SteamVRTabController.setMotionSmoothing(this.checked, false)
}
}
MyToggleButton {
id: steamvrPerformanceGraphToggle
text: "Enable Timing Overlay"
onCheckedChanged: {
SteamVRTabController.setPerformanceGraph(this.checked, false)
}
}
Item { Layout.fillHeight: true; Layout.fillWidth: true}
RowLayout {
Layout.fillWidth: true
MyPushButton {
id: steamVRResetButton
text: "Reset"
Layout.preferredWidth: 250
onClicked: {
SteamVRTabController.reset()
}
}
Item { Layout.fillWidth: true}
MyPushButton {
id: steamVRRestartButton
text: "Restart SteamVR"
Layout.preferredWidth: 250
onClicked: {
SteamVRTabController.restartSteamVR()
}
}
}
Component.onCompleted: {
var s1 = SteamVRTabController.superSampling.toFixed(1)
if (s1 <= steamvrSupersamplingSlider.to) {
steamvrSupersamplingSlider.value = s1
}
steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
if(!steamvrAllowSupersampleOverrideToggle.checked){
steamvrSupersamplingText.enabled = false
steamvrSupersamplingSlider.enabled = false
steamvrSupersampleIncrement.enabled = false
steamvrSupersampleDecrement.enabled = false
}
reloadSteamVRProfiles()
}
Connections {
target: SteamVRTabController
onSuperSamplingChanged: {
var s1 = SteamVRTabController.superSampling.toFixed(1)
steamvrSupersamplingSlider.value = s1
steamvrSupersamplingText.text = s1
}
onAllowSupersampleOverrideChanged: {
steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride
var s1 = SteamVRTabController.superSampling.toFixed(1)
steamvrSupersamplingSlider.value = s1
steamvrSupersamplingText.text = s1
}
onAllowSupersampleFilteringChanged: {
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
}
onMotionSmoothingChanged: {
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
}
onPerformanceGraphChanged:{
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
}
onSteamVRProfilesUpdated: {
reloadSteamVRProfiles()
}
onSteamVRProfileAdded:{
steamvrProfileComboBox.currentIndex = SteamVRTabController.getSteamVRProfileCount()
}
}
}
function reloadSteamVRProfiles() {
var profiles = [""]
var profileCount = SteamVRTabController.getSteamVRProfileCount()
for (var i = 0; i < profileCount; i++) {
profiles.push(SteamVRTabController.getSteamVRProfileName(i))
}
steamvrProfileComboBox.currentIndex = 0
steamvrProfileComboBox.model = profiles
}
}
+1
View File
@@ -8,6 +8,7 @@ import "../motion_page"
import "../video_page"
import "../desktop_overlay_page"
import "../chaperone_page"
import "../steamvr_page"
Rectangle {
id: root
+38
View File
@@ -0,0 +1,38 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../common"
import "camera"
import "steamvrmisc"
MyStackViewPage {
width: 1200
headerText: "SteamVR"
content: ColumnLayout {
spacing: 16
SteamVRMiscGroupBox {
id: steamVRMiscGroupBox}
CameraGroupBox {
id: cameraGroupBox}
Item { Layout.fillHeight: true; Layout.fillWidth: true}
RowLayout {
Layout.fillWidth: true
Item { Layout.fillWidth: true}
MyPushButton {
id: steamVRRestartButton
text: "Restart SteamVR"
Layout.preferredWidth: 250
onClicked: {
SteamVRTabController.restartSteamVR()
}
}
}
}
}
@@ -0,0 +1,119 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
GroupBox {
id: cameraGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "Camera: (requires SteamVR restart)"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
spacing: 16
MyToggleButton {
id: steamvrCameraActiveToggle
text: "Enable Camera"
Layout.preferredWidth: 400
onCheckedChanged: {
SteamVRTabController.setCameraActive(this.checked, false)
if(this.checked){
steamvrCameraBoundsToggle.enabled = true
steamvrCameraDashboardToggle.enabled = true
steamvrCameraRoomToggle.enabled = true
}else{
steamvrCameraBoundsToggle.enabled = false
steamvrCameraDashboardToggle.enabled = false
steamvrCameraRoomToggle.enabled = false
}
}
}
}
RowLayout {
spacing: 16
MyToggleButton {
id: steamvrCameraBoundsToggle
text: "Camera for Bounds"
Layout.preferredWidth: 300
onCheckedChanged: {
SteamVRTabController.setCameraBounds(this.checked, false)
}
}
MyToggleButton {
id: steamvrCameraDashboardToggle
text: "Camera for Dashboard"
Layout.preferredWidth: 300
onCheckedChanged: {
SteamVRTabController.setCameraDashboard(this.checked, false)
}
}
MyToggleButton {
id: steamvrCameraRoomToggle
text: "Camera for Room View"
onCheckedChanged: {
SteamVRTabController.setCameraRoom(this.checked, false)
}
}
}
}
Component.onCompleted: {
var c1 = SteamVRTabController.cameraActive
steamvrCameraActiveToggle.checked = c1
steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds
steamvrCameraDashboardToggle.checked = SteamVRTabController.cameraDashboard
steamvrCameraRoomToggle.checked = SteamVRTabController.cameraRoom
if(!c1){
steamvrCameraDashboardToggle.enabled = false;
steamvrCameraBoundsToggle.enabled = false;
steamvrCameraRoomToggle.enabled = false;
}
}
Connections {
target: SteamVRTabController
onCameraActiveChanged: {
steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive
}
onCameraRoomChanged: {
steamvrCameraRoomToggle.checked = SteamVRTabController.cameraRoom
}
onCameraDashboardChanged: {
steamvrCameraDashboardToggle.checked = SteamVRTabController.cameraDashboard
}
onCameraBoundsChanged: {
steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds
}
}
}
@@ -0,0 +1,130 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
GroupBox {
id: steamVRMiscGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "Misc:"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
spacing: 16
MyToggleButton {
id: steamvrPerformanceGraphToggle
text: "Enable Timing Overlay"
Layout.preferredWidth: 400
onCheckedChanged: {
SteamVRTabController.setPerformanceGraph(this.checked, false)
}
}
MyText {
Layout.preferredWidth: 20
text: " "
}
MyToggleButton {
id: steamvrSystemButtonToggle
Layout.fillWidth: true
text: "Enable System Button Binding"
onCheckedChanged: {
SteamVRTabController.setSystemButton(this.checked, false)
}
}
}
RowLayout {
spacing: 16
MyToggleButton {
id: steamvrMultipleDriverToggle
Layout.preferredWidth: 400
text: "Allow Multiple Drivers"
onCheckedChanged: {
SteamVRTabController.setMultipleDriver(this.checked, false)
}
}
MyText {
Layout.preferredWidth: 20
text: " "
}
MyToggleButton {
id: steamvrNoFadeToGridToggle
Layout.fillWidth: true
text: "No Fade to Grid"
onCheckedChanged: {
SteamVRTabController.setNoFadeToGrid(this.checked, false)
}
}
}
RowLayout {
spacing: 16
MyToggleButton {
id: steamvrNotificationToggle
text: "Disable Notifications"
Layout.preferredWidth: 400
onCheckedChanged: {
SteamVRTabController.setDND(this.checked, false)
}
}
MyText {
Layout.preferredWidth: 20
text: " "
}
}
}
Component.onCompleted: {
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton
steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver
steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid
steamvrNotificationToggle.checked = SteamVRTabController.dnd
}
Connections {
target: SteamVRTabController
onPerformanceGraphChanged:{
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
}
onSystemButtonChanged:{
steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton
}
onMultipleDriverChanged:{
steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver
}
onNoFadeToGridChanged:{
steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid
}
onDNDChanged:{
steamvrNotificationToggle.checked = SteamVRTabController.dnd
}
}
}
@@ -111,7 +111,28 @@ GroupBox {
onClicked: {
UtilitiesTabController.sendKeyboardCtrlV()
}
}
}
MyPushButton {
text: "Custom Key 1"
Layout.preferredWidth: 200
onClicked: {
UtilitiesTabController.sendKeyboardOne();
}
}
MyPushButton {
text: "Custom Key 2"
Layout.preferredWidth: 200
onClicked: {
UtilitiesTabController.sendKeyboardTwo();
}
}
MyPushButton {
text: "Custom Key 3"
Layout.preferredWidth: 200
onClicked: {
UtilitiesTabController.sendKeyboardThree();
}
}
Item {
Layout.fillWidth: true
+14 -1
View File
@@ -5,18 +5,31 @@ import ovras.advsettings 1.0
import "../common"
import "brightness"
import "color"
import "supersampling"
import "miscvid"
import "profiles"
MyStackViewPage {
width: 1200
headerText: "Video Settings"
content: ColumnLayout {
spacing: 18
spacing: 10
BrightnessGroupBox {
id: brightnessGroupBox}
ColorGroupBox {
id: colorGroupBox}
SuperSamplingGroupBox{
id: ssGroupBox
}
VideoProfileGroupBox{
id: videoProfileGroupBox
}
VideoMiscGroupBox{
id:miscVideoGroupBox
}
Item {
Layout.fillHeight: true
+47 -123
View File
@@ -29,84 +29,24 @@ GroupBox {
Layout.bottomMargin: 5
}
RowLayout {
Layout.fillWidth: true
MyToggleButton {
id: colorToggle
text: "Toggle On/Off"
onCheckedChanged: {
VideoTabController.setColorEnabled(this.checked, false) }
}
Item {
Layout.preferredWidth: 150
}
MyText {
text: "Opacity:"
horizontalAlignment: Text.AlignRight
Layout.rightMargin: 10
}
MySlider {
id: colorOpacitySlider
from: 0.5
to: 1.0
stepSize: 0.01
value: 1.0
Layout.fillWidth: true
onPositionChanged: {
var val = ((this.position * 100)/2 + 50)
colorOpacityText.text = Math.round(val) + "%"
}
onValueChanged: {
VideoTabController.setColorOpacityPerc(value.toFixed(2), false)
}
}
MyTextField {
id: colorOpacityText
text: "100%"
keyBoardUID: 911
Layout.preferredWidth: 100
Layout.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 50) {
val = 50
} else if (val > 100.0) {
val = 100.0
}
var v = (val/100).toFixed(2)
colorOpacitySlider.value = v
}
text = Math.round(VideoTabController.colorOpacityPerc * 100) + "%"
}
}
}
RowLayout {
Layout.fillWidth: true
MyText {
text: "Red:"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 200
Layout.preferredWidth: 75
}
MySlider {
id: colorRedSlider
from: 0.01
to: 1.0
to: 2.0
stepSize: 0.01
value: 1.0
Layout.fillWidth: true
onPositionChanged: {
var val = (this.position * 100)
var val = (this.value * 100)
colorRedText.text = Math.round(val) + "%"
}
onValueChanged: {
@@ -136,26 +76,21 @@ GroupBox {
text = Math.round(VideoTabController.colorRed * 100) + "%"
}
}
}
RowLayout {
Layout.fillWidth: true
MyText {
text: "Green:"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 200
Layout.preferredWidth: 85
}
MySlider {
id: colorGreenSlider
from: 0.01
to: 1.0
to: 2.0
stepSize: 0.01
value: 1.0
Layout.fillWidth: true
onPositionChanged: {
var val = (this.position * 100)
var val = (this.value * 100)
colorGreenText.text = Math.round(val) + "%"
}
onValueChanged: {
@@ -185,61 +120,57 @@ GroupBox {
text = Math.round(VideoTabController.colorGreen * 100) + "%"
}
}
}
RowLayout {
Layout.fillWidth: true
MyText {
text: "Blue:"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 200
}
MySlider {
id: colorBlueSlider
from: 0.01
to: 1.0
stepSize: 0.01
value: 1.0
Layout.fillWidth: true
onPositionChanged: {
var val = (this.position * 100)
colorBlueText.text = Math.round(val) + "%"
MyText {
text: "Blue:"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 75
}
onValueChanged: {
VideoTabController.setColorBlue(value.toFixed(2), false)
}
}
MySlider {
id: colorBlueSlider
from: 0.01
to: 2.0
stepSize: 0.01
value: 1.0
Layout.fillWidth: true
onPositionChanged: {
var val = (this.value * 100)
colorBlueText.text = Math.round(val) + "%"
}
onValueChanged: {
MyTextField {
id: colorBlueText
text: "100%"
keyBoardUID: 914
Layout.preferredWidth: 100
Layout.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 5) {
val = 5
} else if (val > 100.0) {
val = 100.0
}
var v = (val/100).toFixed(2)
colorBlueSlider.value = v
VideoTabController.setColorBlue(value.toFixed(2), false)
}
text = Math.round(VideoTabController.colorBlue * 100) + "%"
}
}
MyTextField {
id: colorBlueText
text: "100%"
keyBoardUID: 914
Layout.preferredWidth: 100
Layout.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 5) {
val = 5
} else if (val > 100.0) {
val = 100.0
}
var v = (val/100).toFixed(2)
colorBlueSlider.value = v
}
text = Math.round(VideoTabController.colorBlue * 100) + "%"
}
}
}
}
Component.onCompleted: {
colorOpacitySlider.value = VideoTabController.colorOpacityPerc
colorToggle.checked = VideoTabController.colorEnabled
colorRedSlider.value = VideoTabController.colorRed
colorGreenSlider.value = VideoTabController.colorGreen
colorBlueSlider.value = VideoTabController.colorBlue
@@ -247,13 +178,6 @@ GroupBox {
Connections {
target: VideoTabController
onColorOpacityPercChanged: {
colorOpacitySlider.value = VideoTabController.colorOpacityPerc
}
onColorEnabledChanged: {
colorToggle.checked = VideoTabController.colorEnabled
}
onColorRedChanged:{
colorRedSlider.value = VideoTabController.colorRed
}
@@ -0,0 +1,21 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
MyDialogOkCancelPopup {
id: videoDeleteProfileDialog
dialogWidth: 600
dialogHeight: 300
y: -200
x: 0
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this video profile?"
onClosed: {
if (okClicked) {
VideoTabController.deleteVideoProfile(profileIndex)
}
}
}
@@ -0,0 +1,16 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
MyDialogOkPopup {
id: videoMessageDialog
y: -200
x: 0
function showMessage(title, text) {
dialogTitle = title
dialogText = text
open()
}
}
@@ -0,0 +1,50 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
MyDialogOkCancelPopup {
id: videoNewProfileDialog
dialogTitle: "Create New Video Profile"
dialogWidth: 600
dialogHeight: 300
y: -200
x: 0
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: videoNewProfileName
keyBoardUID: 990
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent(input) {
videoNewProfileName.text = input
}
}
}
}
onClosed: {
if (okClicked) {
if (videoNewProfileName.text != "") {
VideoTabController.addVideoProfile(videoNewProfileName.text)
} else {
videoMessageDialog.showMessage("Create New Profile", "ERROR: No name given.")
}
}
}
function openPopup() {
videoNewProfileName.text = ""
open()
}
}
@@ -0,0 +1,74 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
GroupBox {
id: brightnessGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "Misc:"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
spacing: 16
MyToggleButton {
id: videoMotionSmoothingToggle
text: "Motion Smoothing"
onCheckedChanged: {
VideoTabController.setMotionSmoothing(this.checked, false)
}
}
Item {
Layout.preferredWidth: 20
}
MyToggleButton {
id: videoAllowSupersampleFilteringToggle
text: "Advanced SS Filtering"
onCheckedChanged: {
VideoTabController.setAllowSupersampleFiltering(this.checked, false)
}
}
}
}
Component.onCompleted: {
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
}
Connections {
target: VideoTabController
onAllowSupersampleFilteringChanged: {
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
}
onMotionSmoothingChanged: {
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
}
}
}
@@ -0,0 +1,130 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
import "../dialogboxes"
GroupBox {
id: videoProfileGroupBox
Layout.fillWidth: true
VideoDeleteProfileDialog {
id: videoDeleteProfileDialog
}
VideoNewProfileDialog {
id: videoNewProfileDialog
}
VideoMessageDialog{
id:videoMessageDialog
}
label: MyText {
leftPadding: 10
text: "Video Profiles:"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
spacing: 10
MyText {
Layout.preferredWidth: 150
text: "Profile: "
}
MyComboBox {
id: videoProfileComboBox
Layout.fillWidth: true
model: [""]
onCurrentIndexChanged: {
if (currentIndex > 0) {
videoApplyProfileButton.enabled = true
videoDeleteProfileButton.enabled = true
} else {
videoApplyProfileButton.enabled = false
videoDeleteProfileButton.enabled = false
}
}
}
MyPushButton {
id: videoApplyProfileButton
enabled: true
Layout.preferredWidth: 150
text: "Apply"
onClicked: {
if (videoProfileComboBox.currentIndex > 0) {
VideoTabController.applyVideoProfile(
videoProfileComboBox.currentIndex - 1)
}
}
}
}
RowLayout {
spacing: 10
Item{
Layout.fillWidth: true
}
MyPushButton {
id: videoDeleteProfileButton
enabled: true
Layout.preferredWidth: 200
text: "Delete Profile"
onClicked: {
if (videoProfileComboBox.currentIndex > 0) {
videoDeleteProfileDialog.profileIndex = videoProfileComboBox.currentIndex - 1
videoDeleteProfileDialog.open()
}
}
}
MyPushButton {
Layout.preferredWidth: 200
text: "New Profile"
onClicked: {
videoNewProfileDialog.openPopup()
}
}
}
}
Component.onCompleted: {
reloadVideoProfiles()
}
Connections {
target: VideoTabController
onVideoProfilesUpdated: {
reloadVideoProfiles()
}
onVideoProfileAdded: {
videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount()
}
}
function reloadVideoProfiles() {
var profiles = [""]
var profileCount = VideoTabController.getVideoProfileCount()
for (var i = 0; i < profileCount; i++) {
profiles.push(VideoTabController.getVideoProfileName(i))
}
videoProfileComboBox.currentIndex = 0
videoProfileComboBox.model = profiles
}
}
@@ -0,0 +1,149 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import ovras.advsettings 1.0
import "../../common"
GroupBox {
id: brightnessGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "SuperSampling: (may require refresh of dashboard or restart of SteamVR)"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
spacing: 16
MyToggleButton {
id: videoAllowSupersampleOverrideToggle
text: "Toggle Override"
onCheckedChanged: {
VideoTabController.setAllowSupersampleOverride(this.checked, false)
VideoTabController.setSuperSampling(videoSupersamplingSlider.value, true)
videoSupersamplingText.text = VideoTabController.superSampling.toFixed(1)
if(!this.checked){
videoSupersamplingText.enabled = false
videoSupersamplingSlider.enabled = false
videoSupersampleIncrement.enabled = false
videoSupersampleDecrement.enabled = false
}else{
videoSupersamplingText.enabled = true
videoSupersamplingSlider.enabled = true
videoSupersampleIncrement.enabled = true
videoSupersampleDecrement.enabled = true
}
}
}
MyPushButton2 {
id: videoSupersampleDecrement
text: "-"
Layout.preferredWidth: 40
onClicked: {
videoSupersamplingSlider.decrease()
}
}
MySlider {
id: videoSupersamplingSlider
from: 0.2
to: 5.0
stepSize: 0.1
value: 1.0
snapMode: Slider.SnapAlways
Layout.fillWidth: true
onValueChanged: {
var val = this.value
videoSupersamplingText.text = val.toFixed(1)
VideoTabController.setSuperSampling(this.value.toFixed(1), true)
}
}
MyPushButton2 {
id: videoSupersampleIncrement
text: "+"
Layout.preferredWidth: 40
onClicked: {
videoSupersamplingSlider.increase()
}
}
MyTextField {
id: videoSupersamplingText
text: "0.0"
keyBoardUID: 921
Layout.preferredWidth: 100
Layout.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 0.1) {
val = 0.1
}
var v = val.toFixed(1)
if (v <= videoSupersamplingSlider.to) {
videoSupersamplingSlider.value = v
} else {
VideoTabController.setSuperSampling(v, false)
}
}
text = VideoTabController.superSampling.toFixed(1)
}
}
}
}
Component.onCompleted: {
var s1 = VideoTabController.superSampling.toFixed(1)
if (s1 <= videoSupersamplingSlider.to) {
videoSupersamplingSlider.value = s1
}
videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride
if(!videoAllowSupersampleOverrideToggle.checked){
videoSupersamplingText.enabled = false
videoSupersamplingSlider.enabled = false
videoSupersampleIncrement.enabled = false
videoSupersampleDecrement.enabled = false
}
}
Connections {
target: VideoTabController
onSuperSamplingChanged: {
var s1 = VideoTabController.superSampling.toFixed(1)
videoSupersamplingSlider.value = s1
videoSupersamplingText.text = s1
}
onAllowSupersampleOverrideChanged: {
videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride
var s1 = VideoTabController.superSampling.toFixed(1)
videoSupersamplingSlider.value = s1
videoSupersamplingText.text = s1
}
}
}
+279 -475
View File
@@ -7,10 +7,7 @@ namespace advsettings
{
void SteamVRTabController::initStage1()
{
initMotionSmoothing();
initSupersampleOverride();
dashboardLoopTick();
reloadSteamVRProfiles();
}
void SteamVRTabController::initStage2( OverlayController* var_parent )
@@ -23,78 +20,6 @@ void SteamVRTabController::dashboardLoopTick()
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
{
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleOverride( sso );
// checks supersampling and re-synchs if necessary
auto ss = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
}
else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
{
LOG( INFO ) << "OpenVR reports a changed supersampling value: "
<< m_superSampling << " => " << ss;
setSuperSampling( ss );
}
// checks if Supersampling filter is on and changes if it has been
// changed elsewhere
auto sf = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
// Checks if Motion smoothing setting can be read and synchs adv
// settings to steamvr/openvr
auto ms
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
// Checks and synchs performance graph
auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
@@ -110,6 +35,125 @@ void SteamVRTabController::dashboardLoopTick()
}
setPerformanceGraph( pg );
// synch systembutton
auto sb = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setSystemButton( sb );
// synch nofadetogrid
auto nf = vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_DoNotFadeToGrid,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_DoNotFadeToGrid
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setNoFadeToGrid( nf );
// synch multipleDriver
auto md = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMultipleDriver( md );
// synch dnd
auto donotd = vr::VRSettings()->GetBool(
vr::k_pch_Notifications_Section,
vr::k_pch_Notifications_DoNotDisturb_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Notifications_DoNotDisturb_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setDND( donotd );
// synch camera
auto ca = vr::VRSettings()->GetBool( vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCamera_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Camera_EnableCamera_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setCameraActive( ca );
// synch camera room
auto cr = vr::VRSettings()->GetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Camera_EnableCameraForRoomView_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setCameraRoom( cr );
// synch camera dashboard
auto cd = vr::VRSettings()->GetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Camera_EnableCameraInDashboard_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setCameraDashboard( cd );
// synch camera bounds
auto cb = vr::VRSettings()->GetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setCameraBounds( cb );
settingsUpdateCounter = 0;
}
else
@@ -118,341 +162,6 @@ void SteamVRTabController::dashboardLoopTick()
}
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*Profile Logic Functions*/
void SteamVRTabController::addSteamVRProfile(
const QString name,
const bool includeSupersampling,
const bool includeSupersampleFiltering,
const bool includeMotionSmoothing )
{
SteamVRProfile* profile = nullptr;
for ( auto& p : steamvrProfiles )
{
if ( p.profileName.compare( name.toStdString() ) == 0 )
{
profile = &p;
break;
}
}
if ( !profile )
{
auto i = steamvrProfiles.size();
steamvrProfiles.emplace_back();
profile = &steamvrProfiles[i];
}
profile->profileName = name.toStdString();
profile->includesSupersampling = includeSupersampling;
if ( includeSupersampling )
{
profile->supersampleOverride = m_allowSupersampleOverride;
profile->supersampling = m_superSampling;
}
profile->includesSupersampleFiltering = includeSupersampleFiltering;
if ( includeSupersampleFiltering )
{
profile->supersampleFiltering = m_allowSupersampleFiltering;
}
profile->includesMotionSmoothing = includeMotionSmoothing;
if ( includeMotionSmoothing )
{
profile->motionSmooth = m_motionSmoothing;
}
saveSteamVRProfiles();
OverlayController::appSettings()->sync();
emit steamVRProfilesUpdated();
emit steamVRProfileAdded();
}
void SteamVRTabController::applySteamVRProfile( const unsigned index )
{
if ( index < steamvrProfiles.size() )
{
auto& profile = steamvrProfiles[index];
if ( profile.includesSupersampling )
{
setAllowSupersampleOverride( profile.supersampleOverride );
setSuperSampling( profile.supersampling );
}
if ( profile.includesSupersampleFiltering )
{
setAllowSupersampleFiltering( profile.supersampleFiltering );
}
if ( profile.includesMotionSmoothing )
{
setMotionSmoothing( profile.motionSmooth );
}
vr::VRSettings()->Sync( true );
}
}
void SteamVRTabController::deleteSteamVRProfile( const unsigned index )
{
if ( index < steamvrProfiles.size() )
{
auto pos = steamvrProfiles.begin() + index;
steamvrProfiles.erase( pos );
saveSteamVRProfiles();
OverlayController::appSettings()->sync();
emit steamVRProfilesUpdated();
}
}
void SteamVRTabController::reloadSteamVRProfiles()
{
steamvrProfiles.clear();
auto settings = OverlayController::appSettings();
settings->beginGroup( "steamVRSettings" );
auto profileCount = settings->beginReadArray( "steamVRProfiles" );
for ( int i = 0; i < profileCount; i++ )
{
settings->setArrayIndex( i );
steamvrProfiles.emplace_back();
auto& entry = steamvrProfiles[static_cast<size_t>( i )];
entry.profileName
= settings->value( "profileName" ).toString().toStdString();
entry.includesSupersampling
= settings->value( "includesSupersampling", false ).toBool();
if ( entry.includesSupersampling )
{
entry.supersampleOverride
= settings->value( "supersamplingOverride", false ).toBool();
entry.supersampling
= settings->value( "supersampling", 1.0f ).toFloat();
}
entry.includesSupersampleFiltering
= settings->value( "includesSupersampleFiltering", false ).toBool();
if ( entry.includesSupersampleFiltering )
{
entry.supersampleFiltering
= settings->value( "supersampleFiltering", true ).toBool();
}
entry.includesMotionSmoothing
= settings->value( "includesMotionSmoothing", false ).toBool();
if ( entry.includesMotionSmoothing )
{
entry.motionSmooth
= settings->value( "motionSmooth", true ).toBool();
}
}
settings->endArray();
settings->endGroup();
}
void SteamVRTabController::saveSteamVRProfiles()
{
auto settings = OverlayController::appSettings();
settings->beginGroup( "steamVRSettings" );
settings->beginWriteArray( "steamVRProfiles" );
unsigned i = 0;
for ( auto& p : steamvrProfiles )
{
settings->setArrayIndex( static_cast<int>( i ) );
settings->setValue( "profileName",
QString::fromStdString( p.profileName ) );
settings->setValue( "includesSupersampling", p.includesSupersampling );
if ( p.includesSupersampling )
{
settings->setValue( "supersamplingOverride",
p.supersampleOverride );
settings->setValue( "supersampling", p.supersampling );
}
settings->setValue( "includesSupersampleFiltering",
p.includesSupersampleFiltering );
if ( p.includesSupersampleFiltering )
{
settings->setValue( "supersampleFiltering",
p.supersampleFiltering );
}
settings->setValue( "includesMotionSmoothing",
p.includesMotionSmoothing );
if ( p.includesMotionSmoothing )
{
settings->setValue( "motionSmooth", p.motionSmooth );
}
i++;
}
settings->endArray();
settings->endGroup();
}
int SteamVRTabController::getSteamVRProfileCount()
{
return static_cast<int>( steamvrProfiles.size() );
}
QString SteamVRTabController::getSteamVRProfileName( const unsigned index )
{
if ( index >= steamvrProfiles.size() )
{
return QString();
}
else
{
return QString::fromStdString( steamvrProfiles[index].profileName );
}
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*SuperSample (value) functions*/
void SteamVRTabController::setSuperSampling( float value, const bool notify )
{
bool override = false;
// Mirrors Desktop Clamp
if ( value < 0.2f )
{
LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
value = 1.0f;
override = true;
}
if ( override || m_superSampling != value )
{
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling
<< " => " << value;
m_superSampling = value;
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
m_superSampling );
vr::VRSettings()->Sync();
if ( notify )
{
emit superSamplingChanged( m_superSampling );
}
}
}
float SteamVRTabController::superSampling() const
{
return m_superSampling;
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*Motion Smoothing boolean/toggle functions*/
bool SteamVRTabController::motionSmoothing() const
{
return m_motionSmoothing;
}
void SteamVRTabController::setMotionSmoothing( const bool value,
const bool notify )
{
if ( m_motionSmoothing != value )
{
m_motionSmoothing = value;
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
m_motionSmoothing );
vr::VRSettings()->Sync();
if ( notify )
{
emit motionSmoothingChanged( m_motionSmoothing );
}
}
}
void SteamVRTabController::initMotionSmoothing()
{
bool temporary = false;
vr::EVRSettingsError vrSettingsError;
temporary
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not get MotionSmoothing State \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->Sync();
setMotionSmoothing( temporary, true );
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*Supersample Filtering boolean/toggle functions*/
bool SteamVRTabController::allowSupersampleFiltering() const
{
return m_allowSupersampleFiltering;
}
void SteamVRTabController::setAllowSupersampleFiltering( const bool value,
const bool notify )
{
if ( m_allowSupersampleFiltering != value )
{
m_allowSupersampleFiltering = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
m_allowSupersampleFiltering );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowSupersampleFilteringChanged(
m_allowSupersampleFiltering );
}
}
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*SuperSampling Override boolean/toggle functions*/
bool SteamVRTabController::allowSupersampleOverride() const
{
return m_allowSupersampleOverride;
}
void SteamVRTabController::setAllowSupersampleOverride( const bool value,
const bool notify )
{
if ( m_allowSupersampleOverride != value )
{
m_allowSupersampleOverride = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
m_allowSupersampleOverride );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowSupersampleOverrideChanged( m_allowSupersampleOverride );
}
}
}
void SteamVRTabController::initSupersampleOverride()
{
bool temporary = false;
vr::EVRSettingsError vrSettingsError;
temporary = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not get SuperSampling Override State \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->Sync();
setAllowSupersampleOverride( temporary, true );
}
/*------------------------------------------*/
/* -----------------------------------------*/
bool SteamVRTabController::performanceGraph() const
{
return m_performanceGraphToggle;
@@ -475,91 +184,186 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
}
}
/*------------------------------------------*/
/* -----------------------------------------*/
void SteamVRTabController::reset()
bool SteamVRTabController::multipleDriver() const
{
vr::EVRSettingsError vrSettingsError;
return m_multipleDriverToggle;
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
void SteamVRTabController::setMultipleDriver( const bool value,
const bool notify )
{
if ( m_multipleDriverToggle != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_multipleDriverToggle = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
m_multipleDriverToggle );
vr::VRSettings()->Sync();
if ( notify )
{
emit multipleDriverChanged( m_multipleDriverToggle );
}
}
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
bool SteamVRTabController::noFadeToGrid() const
{
return m_noFadeToGridToggle;
}
void SteamVRTabController::setNoFadeToGrid( const bool value,
const bool notify )
{
if ( m_noFadeToGridToggle != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_noFadeToGridToggle = value;
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_DoNotFadeToGrid,
m_noFadeToGridToggle );
vr::VRSettings()->Sync();
if ( notify )
{
emit noFadeToGridChanged( m_noFadeToGridToggle );
}
}
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
bool SteamVRTabController::systemButton() const
{
return m_systemButtonToggle;
}
void SteamVRTabController::setSystemButton( const bool value,
const bool notify )
{
if ( m_systemButtonToggle != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_systemButtonToggle = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
m_systemButtonToggle );
vr::VRSettings()->Sync();
if ( notify )
{
emit systemButtonChanged( m_systemButtonToggle );
}
}
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
bool SteamVRTabController::dnd() const
{
return m_dnd;
}
void SteamVRTabController::setDND( const bool value, const bool notify )
{
if ( m_dnd != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_dnd = value;
vr::VRSettings()->SetBool( vr::k_pch_Notifications_Section,
vr::k_pch_Notifications_DoNotDisturb_Bool,
m_dnd );
vr::VRSettings()->Sync();
if ( notify )
{
emit dNDChanged( m_dnd );
}
}
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
/*------------------------------------------*/
/* -----------Camera Setting----------------*/
bool SteamVRTabController::cameraActive() const
{
return m_cameraActive;
}
void SteamVRTabController::setCameraActive( const bool value,
const bool notify )
{
if ( m_cameraActive != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_cameraActive = value;
vr::VRSettings()->SetBool( vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCamera_Bool,
m_cameraActive );
vr::VRSettings()->Sync();
if ( notify )
{
emit cameraActiveChanged( m_cameraActive );
}
}
}
vr::VRSettings()->RemoveKeyInSection( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
bool SteamVRTabController::cameraBounds() const
{
return m_cameraBounds;
}
void SteamVRTabController::setCameraBounds( const bool value,
const bool notify )
{
if ( m_cameraBounds != value )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_Perf_PerfGraphInHMD_Bool << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
m_cameraBounds = value;
vr::VRSettings()->SetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
m_cameraBounds );
vr::VRSettings()->Sync();
if ( notify )
{
emit cameraBoundsChanged( m_cameraBounds );
}
}
}
vr::VRSettings()->Sync();
settingsUpdateCounter = 999; // Easiest way to get default values
bool SteamVRTabController::cameraRoom() const
{
return m_cameraRoom;
}
void SteamVRTabController::setCameraRoom( const bool value, const bool notify )
{
if ( m_cameraRoom != value )
{
m_cameraRoom = value;
vr::VRSettings()->SetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
m_cameraRoom );
vr::VRSettings()->Sync();
if ( notify )
{
emit cameraRoomChanged( m_cameraRoom );
}
}
}
bool SteamVRTabController::cameraDashboard() const
{
return m_cameraDashboard;
}
void SteamVRTabController::setCameraDashboard( const bool value,
const bool notify )
{
if ( m_cameraDashboard != value )
{
m_cameraDashboard = value;
vr::VRSettings()->SetBool(
vr::k_pch_Camera_Section,
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
m_cameraDashboard );
vr::VRSettings()->Sync();
if ( notify )
{
emit cameraDashboardChanged( m_cameraDashboard );
}
}
}
void SteamVRTabController::restartSteamVR()
+51 -59
View File
@@ -10,51 +10,43 @@ namespace advsettings
// forward declaration
class OverlayController;
struct SteamVRProfile
{
std::string profileName;
bool includesSupersampling = false;
float supersampling = 1.0f;
bool includesSupersampleFiltering = false;
bool supersampleFiltering = false;
bool motionSmooth = false;
bool includesMotionSmoothing = false;
bool supersampleOverride = false;
};
class SteamVRTabController : public QObject
{
Q_OBJECT
Q_PROPERTY( float superSampling READ superSampling WRITE setSuperSampling
NOTIFY superSamplingChanged )
Q_PROPERTY( bool systemButton READ systemButton WRITE setSystemButton NOTIFY
systemButtonChanged )
Q_PROPERTY( bool multipleDriver READ multipleDriver WRITE setMultipleDriver
NOTIFY multipleDriverChanged )
Q_PROPERTY( bool motionSmoothing READ motionSmoothing WRITE
setMotionSmoothing NOTIFY motionSmoothingChanged )
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
WRITE setAllowSupersampleFiltering NOTIFY
allowSupersampleFilteringChanged )
Q_PROPERTY(
bool allowSupersampleOverride READ allowSupersampleOverride WRITE
setAllowSupersampleOverride NOTIFY allowSupersampleOverrideChanged )
Q_PROPERTY( bool noFadeToGrid READ noFadeToGrid WRITE setNoFadeToGrid NOTIFY
noFadeToGridChanged )
Q_PROPERTY( bool performanceGraph READ performanceGraph WRITE
setPerformanceGraph NOTIFY performanceGraphChanged )
Q_PROPERTY( bool dnd READ dnd WRITE setDND NOTIFY dNDChanged )
Q_PROPERTY( bool cameraActive READ cameraActive WRITE setCameraActive NOTIFY
cameraActiveChanged )
Q_PROPERTY( bool cameraBounds READ cameraBounds WRITE setCameraBounds NOTIFY
cameraBoundsChanged )
Q_PROPERTY( bool cameraRoom READ cameraRoom WRITE setCameraRoom NOTIFY
cameraRoomChanged )
Q_PROPERTY( bool cameraDashboard READ cameraDashboard WRITE
setCameraDashboard NOTIFY cameraDashboardChanged )
private:
OverlayController* parent;
float m_superSampling = 1.0;
bool m_motionSmoothing = true;
bool m_allowSupersampleFiltering = true;
bool m_allowSupersampleOverride = false;
bool m_performanceGraphToggle = false;
bool m_systemButtonToggle = false;
bool m_noFadeToGridToggle = false;
bool m_multipleDriverToggle = false;
bool m_dnd = false;
void initMotionSmoothing();
void initSupersampleOverride();
std::vector<SteamVRProfile> steamvrProfiles;
bool m_cameraActive = false;
bool m_cameraBounds = false;
bool m_cameraRoom = false;
bool m_cameraDashboard = false;
unsigned settingsUpdateCounter = 0;
@@ -65,44 +57,44 @@ public:
void eventLoopTick();
void dashboardLoopTick();
float superSampling() const;
bool motionSmoothing() const;
bool allowSupersampleFiltering() const;
bool allowSupersampleOverride() const;
bool performanceGraph() const;
bool noFadeToGrid() const;
bool multipleDriver() const;
bool systemButton() const;
bool dnd() const;
void reloadSteamVRProfiles();
void saveSteamVRProfiles();
Q_INVOKABLE int getSteamVRProfileCount();
Q_INVOKABLE QString getSteamVRProfileName( unsigned index );
bool cameraActive() const;
bool cameraBounds() const;
bool cameraRoom() const;
bool cameraDashboard() const;
public slots:
void setSuperSampling( float value, bool notify = true );
void setMotionSmoothing( bool value, bool notify = true );
void setAllowSupersampleFiltering( bool value, bool notify = true );
void setAllowSupersampleOverride( bool value, bool notify = true );
void setPerformanceGraph( bool value, bool notify = true );
void setSystemButton( bool value, bool notify = true );
void setNoFadeToGrid( bool value, bool notify = true );
void setMultipleDriver( bool value, bool notify = true );
void setDND( bool value, bool notify = true );
void addSteamVRProfile( QString name,
bool includeSupersampling,
bool includeSupersampleFiltering,
bool includeMotionSmoothing );
void applySteamVRProfile( unsigned index );
void deleteSteamVRProfile( unsigned index );
void setCameraActive( bool value, bool notify = true );
void setCameraBounds( bool value, bool notify = true );
void setCameraRoom( bool value, bool notify = true );
void setCameraDashboard( bool value, bool notify = true );
void reset();
void restartSteamVR();
signals:
void superSamplingChanged( float value );
void motionSmoothingChanged( bool value );
void allowSupersampleFilteringChanged( bool value );
void allowSupersampleOverrideChanged( bool value );
void performanceGraphChanged( bool value );
void steamVRProfilesUpdated();
void steamVRProfileAdded();
void performanceGraphChanged( bool value );
void multipleDriverChanged( bool value );
void systemButtonChanged( bool value );
void noFadeToGridChanged( bool value );
void dNDChanged( bool value );
void cameraActiveChanged( bool value );
void cameraBoundsChanged( bool value );
void cameraRoomChanged( bool value );
void cameraDashboardChanged( bool value );
};
} // namespace advsettings
@@ -2,6 +2,7 @@
#include <QQuickWindow>
#include <QApplication>
#include "../overlaycontroller.h"
#include "../keyboard_input/input_sender.h"
#include <chrono>
#include <thread>
@@ -79,6 +80,40 @@ void UtilitiesTabController::sendMediaStopSong()
keyboardinput::sendMediaStopSong();
}
void UtilitiesTabController::sendKeyboardOne()
{
m_parent->appSettings()->beginGroup( "keyboardShortcuts" );
const auto commands = m_parent->appSettings()
->value( "keyboardOne" )
.toString()
.toStdString();
m_parent->appSettings()->endGroup();
sendStringAsInput( commands );
}
void UtilitiesTabController::sendKeyboardTwo()
{
m_parent->appSettings()->beginGroup( "keyboardShortcuts" );
const auto commands = m_parent->appSettings()
->value( "keyboardTwo" )
.toString()
.toStdString();
m_parent->appSettings()->endGroup();
sendStringAsInput( commands );
}
void UtilitiesTabController::sendKeyboardThree()
{
m_parent->appSettings()->beginGroup( "keyboardShortcuts" );
const auto commands = m_parent->appSettings()
->value( "keyboardThree" )
.toString()
.toStdString();
m_parent->appSettings()->endGroup();
sendStringAsInput( commands );
}
bool UtilitiesTabController::alarmEnabled() const
{
return m_alarmEnabled;
@@ -65,6 +65,9 @@ public slots:
void sendMediaPreviousSong();
void sendMediaPausePlay();
void sendMediaStopSong();
Q_INVOKABLE void sendKeyboardOne();
Q_INVOKABLE void sendKeyboardTwo();
Q_INVOKABLE void sendKeyboardThree();
void setAlarmEnabled( bool enabled, bool notify = true );
void setAlarmIsModal( bool modal, bool notify = true );
+476 -178
View File
@@ -9,9 +9,12 @@ namespace advsettings
void VideoTabController::initStage1()
{
initBrightnessOverlay();
initColorOverlay();
initColorGain();
initMotionSmoothing();
initSupersampleOverride();
m_overlayInit = true;
reloadVideoConfig();
reloadVideoProfiles();
}
void VideoTabController::initBrightnessOverlay()
@@ -53,50 +56,99 @@ void VideoTabController::initBrightnessOverlay()
overlayError );
}
}
void VideoTabController::initColorOverlay()
{
std::string notifKey
= std::string( application_strings::applicationKey ) + ".coloroverlay";
vr::VROverlayError overlayError = vr::VROverlay()->CreateOverlay(
notifKey.c_str(), notifKey.c_str(), &m_colorOverlayHandle );
if ( overlayError == vr::VROverlayError_None )
void VideoTabController::eventLoopTick() {}
void VideoTabController::dashboardLoopTick()
{
// TODO different key
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
{
const auto notifIconPath = paths::binaryDirectoryFindFile(
video_keys::k_colorOverlayFilename );
if ( notifIconPath.has_value() )
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
vr::VROverlay()->SetOverlayFromFile( m_colorOverlayHandle,
notifIconPath->c_str() );
vr::VROverlay()->SetOverlayWidthInMeters( m_colorOverlayHandle,
k_overlayWidth );
// position it just slightly further out so we don't have to worry
// about render order.
vr::HmdMatrix34_t notificationTransform
= { { { 1.0f, 0.0f, 0.0f, 0.00f },
{ 0.0f, 1.0f, 0.0f, 0.00f },
{ 0.0f, 0.0f, 1.0f, ( k_hmdDistance - 0.01f ) } } };
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
m_colorOverlayHandle,
vr::k_unTrackedDeviceIndex_Hmd,
&notificationTransform );
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
setAllowSupersampleOverride( sso );
// checks supersampling and re-synchs if necessary
auto ss = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not find Base color overlay: \""
<< video_keys::k_colorOverlayFilename << "\"";
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
}
else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
{
LOG( INFO ) << "OpenVR reports a changed supersampling value: "
<< m_superSampling << " => " << ss;
setSuperSampling( ss );
}
// checks if Supersampling filter is on and changes if it has been
// changed elsewhere
auto sf = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
// Checks if Motion smoothing setting can be read and synchs adv
// settings to steamvr/openvr
auto ms
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
settingsUpdateCounter = 0;
}
else
{
LOG( ERROR ) << "Could not create color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
settingsUpdateCounter++;
}
}
void VideoTabController::eventLoopTick() {}
void VideoTabController::reloadVideoConfig()
{
auto settings = OverlayController::appSettings();
@@ -106,15 +158,9 @@ void VideoTabController::reloadVideoConfig()
m_brightnessOpacityValue
= settings->value( "brightnessOpacityValue", 0.0f ).toFloat();
m_brightnessValue = settings->value( "brightnessValue", 1.0f ).toFloat();
setColorEnabled( settings->value( "colorEnabled", false ).toBool(), true );
m_colorOpacity = settings->value( "colorOpacity", 0.0f ).toFloat();
m_colorOpacityPerc = settings->value( "colorOpacityPerc", 1.0f ).toFloat();
setColorRed( settings->value( "colorRed", 0.0f ).toFloat() );
setColorGreen( settings->value( "colorGreen", 0.0f ).toFloat() );
setColorBlue( settings->value( "colorBlue", 0.0f ).toFloat() );
settings->endGroup();
setBrightnessOpacityValue();
loadColorOverlay();
settings->sync();
}
@@ -125,12 +171,7 @@ void VideoTabController::saveVideoConfig()
settings->setValue( "brightnessEnabled", brightnessEnabled() );
settings->setValue( "brightnessOpacityValue", brightnessOpacityValue() );
settings->setValue( "brightnessValue", brightnessValue() );
settings->setValue( "colorEnabled", colorEnabled() );
settings->setValue( "colorOpacity", colorOpacity() );
settings->setValue( "colorOpacityPerc", colorOpacityPerc() );
settings->setValue( "colorRed", colorRed() );
settings->setValue( "colorGreen", colorGreen() );
settings->setValue( "colorBlue", colorBlue() );
settings->endGroup();
settings->sync();
}
@@ -187,7 +228,8 @@ void VideoTabController::setBrightnessValue( float percvalue, bool notify )
float realvalue = static_cast<float>(
std::pow( static_cast<double>( 1.0f - percvalue ), 1 / 3. ) );
if ( realvalue != m_brightnessOpacityValue )
if ( fabs( static_cast<double>( realvalue - m_brightnessOpacityValue ) )
> .005 )
{
m_brightnessValue = percvalue;
if ( realvalue <= 1.0f && realvalue >= 0.0f )
@@ -237,20 +279,6 @@ void VideoTabController::setBrightnessOpacityValue()
*/
// getters
bool VideoTabController::colorEnabled() const
{
return m_colorEnabled;
}
float VideoTabController::colorOpacity() const
{
return m_colorOpacity;
}
float VideoTabController::colorOpacityPerc() const
{
return m_colorOpacityPerc;
}
float VideoTabController::colorRed() const
{
@@ -268,71 +296,27 @@ float VideoTabController::colorBlue() const
}
// setters
void VideoTabController::setColorEnabled( bool value, bool notify )
{
if ( value != m_colorEnabled )
{
m_colorEnabled = value;
auto overlayHandle = getColorOverlayHandle();
if ( value )
{
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{
vr::VROverlay()->ShowOverlay( getColorOverlayHandle() );
LOG( INFO ) << "Color Overlay toggled on";
}
}
else
{
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{
vr::VROverlay()->HideOverlay( getColorOverlayHandle() );
LOG( INFO ) << "Color Overlay toggled off";
}
}
saveVideoConfig();
if ( notify )
{
emit colorEnabledChanged( value );
}
}
}
void VideoTabController::setColorOpacity( float value, bool notify )
{
if ( value != m_colorOpacity )
{
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(
m_colorOverlayHandle, m_colorOpacity );
m_colorOpacity = value;
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set alpha for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
saveVideoConfig();
if ( notify )
{
emit colorOpacityChanged( m_colorOpacity );
}
}
}
void VideoTabController::setColorRed( float value, bool notify )
{
if ( value != m_colorRed )
if ( fabs( static_cast<double>( value - m_colorRed ) ) > .005 )
{
m_colorRed = value;
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
if ( overlayError != vr::VROverlayError_None )
vr::EVRSettingsError vrSettingsError;
vr::VRSettings()->SetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainR_Float,
m_colorRed,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set Red for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
LOG( ERROR ) << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
saveVideoConfig();
LOG( DEBUG ) << "Changed Red Gain to: " << m_colorRed;
vr::VRSettings()->Sync();
if ( notify )
{
emit colorRedChanged( m_colorRed );
@@ -342,18 +326,24 @@ void VideoTabController::setColorRed( float value, bool notify )
void VideoTabController::setColorGreen( float value, bool notify )
{
if ( value != m_colorGreen )
if ( fabs( static_cast<double>( value - m_colorGreen ) ) > .005 )
{
m_colorGreen = value;
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
if ( overlayError != vr::VROverlayError_None )
vr::EVRSettingsError vrSettingsError;
vr::VRSettings()->SetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
m_colorGreen,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set Green for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
LOG( ERROR ) << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
saveVideoConfig();
LOG( DEBUG ) << "Changed Green Gain to: " << m_colorGreen;
vr::VRSettings()->Sync();
if ( notify )
{
emit colorGreenChanged( m_colorGreen );
@@ -363,18 +353,24 @@ void VideoTabController::setColorGreen( float value, bool notify )
void VideoTabController::setColorBlue( float value, bool notify )
{
if ( value != m_colorBlue )
if ( fabs( static_cast<double>( value - m_colorBlue ) ) > .005 )
{
m_colorBlue = value;
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
if ( overlayError != vr::VROverlayError_None )
vr::EVRSettingsError vrSettingsError;
vr::VRSettings()->SetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainB_Float,
m_colorBlue,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set Blue for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
LOG( ERROR ) << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
saveVideoConfig();
LOG( DEBUG ) << "Changed Blue Gain to: " << m_colorBlue;
vr::VRSettings()->Sync();
if ( notify )
{
emit colorBlueChanged( m_colorBlue );
@@ -382,68 +378,370 @@ void VideoTabController::setColorBlue( float value, bool notify )
}
}
void VideoTabController::loadColorOverlay()
void VideoTabController::initColorGain()
{
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
if ( overlayError != vr::VROverlayError_None )
float temporary = 0.0f;
vr::EVRSettingsError vrSettingsError;
temporary = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainR_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set Colors for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
LOG( ERROR ) << "Could not get Red Gain Value ERROR: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
m_colorRed = temporary;
setColorRed( temporary );
}
overlayError = vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle,
m_colorOpacity );
if ( overlayError != vr::VROverlayError_None )
temporary = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
LOG( ERROR ) << "Could not get Green Gain Value ERROR: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
m_colorGreen = temporary;
setColorGreen( temporary );
}
temporary = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainB_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not get Blue Gain Value ERROR: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
m_colorBlue = temporary;
setColorBlue( temporary );
}
}
void VideoTabController::setColorOpacityPerc( float percvalue, bool notify )
/*
* -------------------------
* SuperSampling
* -------------------------
*/
// Getters
float VideoTabController::superSampling() const
{
// This takes the Perceived value, and converts it to allow more accurate
// linear positioning. (human perception logarithmic)
return m_superSampling;
}
// clamp the "percieved" value to 50% this is to ensure useability.
if ( percvalue <= 0.5f )
bool VideoTabController::allowSupersampleOverride() const
{
return m_allowSupersampleOverride;
}
void VideoTabController::initSupersampleOverride()
{
bool temporary = false;
vr::EVRSettingsError vrSettingsError;
temporary = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
percvalue = 0.5f;
LOG( WARNING ) << "Could not get SuperSampling Override State \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
float realvalue = static_cast<float>(
std::pow( static_cast<double>( 1.0f - percvalue ), 0.5555f ) );
vr::VRSettings()->Sync();
setAllowSupersampleOverride( temporary, true );
}
if ( realvalue != m_colorOpacity )
void VideoTabController::setSuperSampling( float value, const bool notify )
{
bool override = false;
// Mirrors Desktop Clamp
if ( value < 0.2f )
{
m_colorOpacityPerc = percvalue;
if ( realvalue <= 1.0f && realvalue >= 0.0f )
{
m_colorOpacity = realvalue;
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(
m_colorOverlayHandle, realvalue );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set alpha of color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
// only saves if opacity Value is valid. [1-0]
saveVideoConfig();
}
else
{
LOG( WARNING ) << "alpha value is invalid setting to 1.0";
m_brightnessOpacityValue = 0.0f;
}
LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
value = 1.0f;
override = true;
}
if ( override
|| fabs( static_cast<double>( m_superSampling - value ) ) > .005 )
{
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling
<< " => " << value;
m_superSampling = value;
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
m_superSampling );
vr::VRSettings()->Sync();
if ( notify )
{
emit brightnessValueChanged( percvalue );
emit superSamplingChanged( m_superSampling );
}
}
}
void VideoTabController::setAllowSupersampleOverride( const bool value,
const bool notify )
{
if ( m_allowSupersampleOverride != value )
{
m_allowSupersampleOverride = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
m_allowSupersampleOverride );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowSupersampleOverrideChanged( m_allowSupersampleOverride );
}
}
}
/*
* -------------------------
* motion smoothing/antistropic (misc)
* -------------------------
*/
bool VideoTabController::motionSmoothing() const
{
return m_motionSmoothing;
}
void VideoTabController::setMotionSmoothing( const bool value,
const bool notify )
{
if ( m_motionSmoothing != value )
{
m_motionSmoothing = value;
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
m_motionSmoothing );
vr::VRSettings()->Sync();
if ( notify )
{
emit motionSmoothingChanged( m_motionSmoothing );
}
}
}
void VideoTabController::initMotionSmoothing()
{
bool temporary = false;
vr::EVRSettingsError vrSettingsError;
temporary
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not get MotionSmoothing State \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->Sync();
setMotionSmoothing( temporary, true );
}
bool VideoTabController::allowSupersampleFiltering() const
{
return m_allowSupersampleFiltering;
}
void VideoTabController::setAllowSupersampleFiltering( const bool value,
const bool notify )
{
if ( m_allowSupersampleFiltering != value )
{
m_allowSupersampleFiltering = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
m_allowSupersampleFiltering );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowSupersampleFilteringChanged(
m_allowSupersampleFiltering );
}
}
}
/* -----------------------------------------*/
/*------------------------------------------*/
/*Profile Logic Functions*/
void VideoTabController::addVideoProfile( const QString name )
{
VideoProfile* profile = nullptr;
for ( auto& p : videoProfiles )
{
if ( p.profileName.compare( name.toStdString() ) == 0 )
{
profile = &p;
break;
}
}
if ( !profile )
{
auto i = videoProfiles.size();
videoProfiles.emplace_back();
profile = &videoProfiles[i];
}
profile->profileName = name.toStdString();
profile->supersampleOverride = m_allowSupersampleOverride;
profile->supersampling = m_superSampling;
profile->anisotropicFiltering = m_allowSupersampleFiltering;
profile->motionSmooth = m_motionSmoothing;
profile->colorRed = m_colorRed;
profile->colorGreen = m_colorGreen;
profile->colorBlue = m_colorBlue;
profile->brightnessToggle = m_brightnessEnabled;
profile->brightnessValue = m_brightnessValue;
saveVideoProfiles();
OverlayController::appSettings()->sync();
emit videoProfilesUpdated();
emit videoProfileAdded();
}
void VideoTabController::applyVideoProfile( const unsigned index )
{
if ( index < videoProfiles.size() )
{
auto& profile = videoProfiles[index];
setAllowSupersampleOverride( profile.supersampleOverride );
setSuperSampling( profile.supersampling );
setAllowSupersampleFiltering( profile.anisotropicFiltering );
setMotionSmoothing( profile.motionSmooth );
setColorRed( profile.colorRed );
setColorBlue( profile.colorBlue );
setColorGreen( profile.colorGreen );
setBrightnessEnabled( profile.brightnessToggle );
setBrightnessValue( profile.brightnessValue );
vr::VRSettings()->Sync( true );
}
}
void VideoTabController::deleteVideoProfile( const unsigned index )
{
if ( index < videoProfiles.size() )
{
auto pos = videoProfiles.begin() + index;
videoProfiles.erase( pos );
saveVideoProfiles();
OverlayController::appSettings()->sync();
emit videoProfilesUpdated();
}
}
void VideoTabController::reloadVideoProfiles()
{
videoProfiles.clear();
auto settings = OverlayController::appSettings();
settings->beginGroup( "steamVRSettings" );
auto profileCount = settings->beginReadArray( "steamVRProfiles" );
for ( int i = 0; i < profileCount; i++ )
{
settings->setArrayIndex( i );
videoProfiles.emplace_back();
auto& entry = videoProfiles[static_cast<size_t>( i )];
entry.profileName
= settings->value( "profileName" ).toString().toStdString();
entry.supersampleOverride
= settings->value( "supersamplingOverride", false ).toBool();
entry.supersampling
= settings->value( "supersampling", 1.0f ).toFloat();
entry.anisotropicFiltering
= settings->value( "anisotropicFiltering", true ).toBool();
entry.motionSmooth = settings->value( "motionSmooth", true ).toBool();
entry.colorRed = settings->value( "colorRed", 1.0f ).toFloat();
entry.colorBlue = settings->value( "colorBlue", 1.0f ).toFloat();
entry.colorGreen = settings->value( "colorGreen", 1.0f ).toFloat();
entry.brightnessToggle
= settings->value( "brightnessToggle", false ).toBool();
entry.brightnessValue
= settings->value( "brightnessValue", 1.0f ).toFloat();
}
settings->endArray();
settings->endGroup();
}
void VideoTabController::saveVideoProfiles()
{
auto settings = OverlayController::appSettings();
settings->beginGroup( "VideoSettings" );
settings->beginWriteArray( "videoProfiles" );
unsigned i = 0;
for ( auto& p : videoProfiles )
{
settings->setArrayIndex( static_cast<int>( i ) );
settings->setValue( "profileName",
QString::fromStdString( p.profileName ) );
settings->setValue( "supersamplingOverride", p.supersampleOverride );
settings->setValue( "supersampling", p.supersampling );
settings->setValue( "anisotropicFiltering", p.anisotropicFiltering );
settings->setValue( "motionSmooth", p.motionSmooth );
settings->setValue( "colorRed", p.colorRed );
settings->setValue( "colorBlue", p.colorBlue );
settings->setValue( "colorGreen", p.colorGreen );
settings->setValue( "brightnessToggle", p.brightnessToggle );
settings->setValue( "brightnessValue", p.brightnessValue );
i++;
}
settings->endArray();
settings->endGroup();
}
int VideoTabController::getVideoProfileCount()
{
return static_cast<int>( videoProfiles.size() );
}
QString VideoTabController::getVideoProfileName( const unsigned index )
{
if ( index >= videoProfiles.size() )
{
return QString();
}
else
{
return QString::fromStdString( videoProfiles[index].profileName );
}
}
/*------------------------------------------*/
/* -----------------------------------------*/
} // namespace advsettings
+67 -27
View File
@@ -10,7 +10,6 @@ class QQuickWindow;
namespace video_keys
{
constexpr auto k_brightnessOverlayFilename = "/res/img/video/dimmer.png";
constexpr auto k_colorOverlayFilename = "/res/img/video/color.png";
} // namespace video_keys
@@ -19,6 +18,21 @@ namespace advsettings
// forward declaration
class OverlayController;
struct VideoProfile
{
std::string profileName;
float supersampling = 1.0f;
bool anisotropicFiltering = false;
bool motionSmooth = false;
bool supersampleOverride = false;
float colorRed = 1.0f;
float colorGreen = 1.0f;
float colorBlue = 1.0f;
bool brightnessToggle = false;
float brightnessValue = 1.0f;
};
class VideoTabController : public QObject
{
Q_OBJECT
@@ -26,20 +40,26 @@ class VideoTabController : public QObject
setBrightnessEnabled NOTIFY brightnessEnabledChanged )
Q_PROPERTY( float brightnessValue READ brightnessValue WRITE
setBrightnessValue NOTIFY brightnessValueChanged )
Q_PROPERTY( bool colorEnabled READ colorEnabled WRITE setColorEnabled NOTIFY
colorEnabledChanged )
Q_PROPERTY( float colorOpacity READ colorOpacity WRITE setColorOpacity
NOTIFY colorOpacityChanged )
Q_PROPERTY( float colorOpacityPerc READ colorOpacityPerc WRITE
setColorOpacityPerc NOTIFY colorOpacityPercChanged )
Q_PROPERTY(
float colorRed READ colorRed WRITE setColorRed NOTIFY colorRedChanged )
Q_PROPERTY( float colorGreen READ colorGreen WRITE setColorGreen NOTIFY
colorGreenChanged )
Q_PROPERTY( float colorBlue READ colorBlue WRITE setColorBlue NOTIFY
colorBlueChanged )
Q_PROPERTY( float superSampling READ superSampling WRITE setSuperSampling
NOTIFY superSamplingChanged )
Q_PROPERTY(
bool allowSupersampleOverride READ allowSupersampleOverride WRITE
setAllowSupersampleOverride NOTIFY allowSupersampleOverrideChanged )
Q_PROPERTY( bool motionSmoothing READ motionSmoothing WRITE
setMotionSmoothing NOTIFY motionSmoothingChanged )
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
WRITE setAllowSupersampleFiltering NOTIFY
allowSupersampleFilteringChanged )
private:
unsigned settingsUpdateCounter = 0;
// how far away the overlay is, any OVERLAY closer will not be dimmed.
const float k_hmdDistance = -0.15f;
// how wide overlay is, Increase this value if edges of view are not
@@ -55,23 +75,27 @@ private:
float m_brightnessValue = 1.0f;
bool m_brightnessEnabled = false;
// color member vars
bool m_colorEnabled = false;
float m_colorOpacity = 1.0f;
float m_colorOpacityPerc = 0.0f;
float m_colorRed = 0.0f;
float m_colorBlue = 0.0f;
float m_colorGreen = 0.0f;
bool m_overlayInit = false;
float m_superSampling = 1.0;
bool m_allowSupersampleOverride = false;
bool m_motionSmoothing = true;
bool m_allowSupersampleFiltering = true;
void initColorGain();
void initSupersampleOverride();
void initMotionSmoothing();
void reloadVideoConfig();
void saveVideoConfig();
void setBrightnessOpacityValue();
void initBrightnessOverlay();
void initColorOverlay();
void loadColorOverlay();
std::vector<VideoProfile> videoProfiles;
QString getSettingsName()
{
@@ -83,11 +107,6 @@ private:
return m_brightnessOverlayHandle;
}
vr::VROverlayHandle_t getColorOverlayHandle()
{
return m_colorOverlayHandle;
}
public:
float brightnessOpacityValue() const;
// inverse of brightnessValue
@@ -96,37 +115,58 @@ public:
// Color overlay Getters
bool colorEnabled() const;
float colorOpacity() const;
float colorRed() const;
float colorGreen() const;
float colorBlue() const;
float colorOpacityPerc() const;
bool allowSupersampleOverride() const;
float superSampling() const;
bool motionSmoothing() const;
bool allowSupersampleFiltering() const;
void initStage1();
void eventLoopTick();
void dashboardLoopTick();
void reloadVideoProfiles();
void saveVideoProfiles();
Q_INVOKABLE int getVideoProfileCount();
Q_INVOKABLE QString getVideoProfileName( unsigned index );
public slots:
void setBrightnessEnabled( bool value, bool notify = true );
void setBrightnessValue( float percvalue, bool notify = true );
void setSuperSampling( float value, bool notify = true );
void setAllowSupersampleOverride( bool value, bool notify = true );
// Color overlay Setters
void setColorEnabled( bool value, bool notify = true );
void setColorOpacity( float value, bool notify = true );
void setColorRed( float value, bool notify = true );
void setColorGreen( float value, bool notify = true );
void setColorBlue( float value, bool notify = true );
void setColorOpacityPerc( float value, bool notify = true );
void setMotionSmoothing( bool value, bool notify = true );
void setAllowSupersampleFiltering( bool value, bool notify = true );
void addVideoProfile( QString name );
void applyVideoProfile( unsigned index );
void deleteVideoProfile( unsigned index );
signals:
void brightnessEnabledChanged( bool value );
void brightnessValueChanged( float value );
void colorEnabledChanged( bool value );
void colorOpacityChanged( float value );
void colorRedChanged( float value );
void colorGreenChanged( float value );
void colorBlueChanged( float value );
void colorOpacityPercChanged( float value );
void superSamplingChanged( float value );
void allowSupersampleOverrideChanged( bool value );
void motionSmoothingChanged( bool value );
void allowSupersampleFilteringChanged( bool value );
void videoProfilesUpdated();
void videoProfileAdded();
};
} // namespace advsettings