Re-Add color overlay (#311)
* fixed Chaperone toggle, toggle state on launch * made update rates based on variable frame rate assuming 90 default * added overlay color back in * fixed opacity value not synching * updated to ovr 1.8.19 * fixed license issue * rolled back ovr update * fixed overlay toggle state, formatting, and clamped max opacity to .85%
This commit is contained in:
@@ -49,6 +49,7 @@ DISTFILES += \
|
|||||||
src/res/qml/video_page/miscvid/* \
|
src/res/qml/video_page/miscvid/* \
|
||||||
src/res/qml/video_page/profiles/* \
|
src/res/qml/video_page/profiles/* \
|
||||||
src/res/qml/video_page/dialogboxes/* \
|
src/res/qml/video_page/dialogboxes/* \
|
||||||
|
src/res/qml/video_page/overlaycolorbright/* \
|
||||||
src/res/qml/common/* \
|
src/res/qml/common/* \
|
||||||
src/res/qml/desktop_overlay_page/* \
|
src/res/qml/desktop_overlay_page/* \
|
||||||
src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml \
|
src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml \
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ SOURCES += src/main.cpp\
|
|||||||
src/openvr/ivrinput.cpp \
|
src/openvr/ivrinput.cpp \
|
||||||
src/utils/setup.cpp \
|
src/utils/setup.cpp \
|
||||||
src/utils/paths.cpp \
|
src/utils/paths.cpp \
|
||||||
|
src/utils/FrameRateUtils.cpp \
|
||||||
src/openvr/overlay_utils.cpp \
|
src/openvr/overlay_utils.cpp \
|
||||||
src/keyboard_input/keyboard_input.cpp \
|
src/keyboard_input/keyboard_input.cpp \
|
||||||
src/keyboard_input/input_parser.cpp
|
src/keyboard_input/input_parser.cpp
|
||||||
@@ -45,6 +46,7 @@ HEADERS += src/overlaycontroller.h \
|
|||||||
src/openvr/ivrinput.h \
|
src/openvr/ivrinput.h \
|
||||||
src/utils/setup.h \
|
src/utils/setup.h \
|
||||||
src/utils/paths.h \
|
src/utils/paths.h \
|
||||||
|
src/utils/FrameRateUtils.h \
|
||||||
src/openvr/overlay_utils.h \
|
src/openvr/overlay_utils.h \
|
||||||
src/keyboard_input/input_parser.h \
|
src/keyboard_input/input_parser.h \
|
||||||
src/keyboard_input/input_sender.h
|
src/keyboard_input/input_sender.h
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -8,14 +8,17 @@ import "color"
|
|||||||
import "supersampling"
|
import "supersampling"
|
||||||
import "miscvid"
|
import "miscvid"
|
||||||
import "profiles"
|
import "profiles"
|
||||||
|
import "overlaycolorbright"
|
||||||
|
|
||||||
MyStackViewPage {
|
MyStackViewPage {
|
||||||
width: 1200
|
width: 1200
|
||||||
headerText: "Video Settings"
|
headerText: "Video Settings"
|
||||||
|
|
||||||
content: ColumnLayout {
|
content: ColumnLayout {
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
|
OverlayMethodGroupBox{
|
||||||
|
id: overlayMethodGroupBox
|
||||||
|
}
|
||||||
BrightnessGroupBox {
|
BrightnessGroupBox {
|
||||||
id: brightnessGroupBox}
|
id: brightnessGroupBox}
|
||||||
ColorGroupBox {
|
ColorGroupBox {
|
||||||
@@ -36,4 +39,20 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive
|
||||||
|
brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
|
||||||
|
colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: VideoTabController
|
||||||
|
onIsOverlayMethodActiveChanged:{
|
||||||
|
overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive
|
||||||
|
brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
|
||||||
|
colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ GroupBox {
|
|||||||
id: brightnessToggle
|
id: brightnessToggle
|
||||||
text: "Toggle On/Off"
|
text: "Toggle On/Off"
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
VideoTabController.setBrightnessEnabled(this.checked, false) }
|
VideoTabController.setBrightnessEnabled(this.checked, true) }
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -57,12 +57,12 @@ GroupBox {
|
|||||||
value: 1.0
|
value: 1.0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
var val = (this.position * 100)
|
var val = (this.value * 100)
|
||||||
brightnessValueText.text = Math.round(val) + "%"
|
brightnessValueText.text = Math.round(val) + "%"
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
|
||||||
VideoTabController.setBrightnessValue(value.toFixed(2), false)
|
VideoTabController.setBrightnessValue(value.toFixed(2), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ GroupBox {
|
|||||||
MySlider {
|
MySlider {
|
||||||
id: colorRedSlider
|
id: colorRedSlider
|
||||||
from: 0.01
|
from: 0.01
|
||||||
to: 2.0
|
to: 1.0
|
||||||
stepSize: 0.01
|
stepSize: 0.01
|
||||||
value: 1.0
|
value: 1.0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -51,7 +51,7 @@ GroupBox {
|
|||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
|
||||||
VideoTabController.setColorRed(value.toFixed(2), false)
|
VideoTabController.setColorRed(value.toFixed(2), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ GroupBox {
|
|||||||
MySlider {
|
MySlider {
|
||||||
id: colorGreenSlider
|
id: colorGreenSlider
|
||||||
from: 0.01
|
from: 0.01
|
||||||
to: 2.0
|
to: 1.0
|
||||||
stepSize: 0.01
|
stepSize: 0.01
|
||||||
value: 1.0
|
value: 1.0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -95,7 +95,7 @@ GroupBox {
|
|||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
|
||||||
VideoTabController.setColorGreen(value.toFixed(2), false)
|
VideoTabController.setColorGreen(value.toFixed(2), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ GroupBox {
|
|||||||
MySlider {
|
MySlider {
|
||||||
id: colorBlueSlider
|
id: colorBlueSlider
|
||||||
from: 0.01
|
from: 0.01
|
||||||
to: 2.0
|
to: 1.0
|
||||||
stepSize: 0.01
|
stepSize: 0.01
|
||||||
value: 1.0
|
value: 1.0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -140,7 +140,7 @@ GroupBox {
|
|||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
|
||||||
VideoTabController.setColorBlue(value.toFixed(2), false)
|
VideoTabController.setColorBlue(value.toFixed(2), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,17 @@ GroupBox {
|
|||||||
VideoTabController.setAllowSupersampleFiltering(this.checked, false)
|
VideoTabController.setAllowSupersampleFiltering(this.checked, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Item {
|
||||||
|
Layout.preferredWidth: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
MyToggleButton {
|
||||||
|
id: videoUseOverlayToggle
|
||||||
|
text: "Use Overlay For Color"
|
||||||
|
onCheckedChanged: {
|
||||||
|
VideoTabController.setIsOverlayMethodActive(this.checked, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -57,7 +68,7 @@ GroupBox {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
|
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
|
||||||
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
|
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
|
||||||
|
videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -69,6 +80,9 @@ GroupBox {
|
|||||||
onMotionSmoothingChanged: {
|
onMotionSmoothingChanged: {
|
||||||
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
|
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
|
||||||
}
|
}
|
||||||
|
onIsOverlayMethodActiveChanged:{
|
||||||
|
videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,329 @@
|
|||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import ovras.advsettings 1.0
|
||||||
|
import "../../common"
|
||||||
|
|
||||||
|
GroupBox {
|
||||||
|
id: overlayMethodGroupBox
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
label: MyText {
|
||||||
|
leftPadding: 10
|
||||||
|
text: "Brightness and Color (via overlay)"
|
||||||
|
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 {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
MyToggleButton {
|
||||||
|
id: brightnessToggle
|
||||||
|
text: "Toggle On/Off"
|
||||||
|
onCheckedChanged: {
|
||||||
|
VideoTabController.setBrightnessEnabled(this.checked, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.preferredWidth: 150
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
text: "Brightness:"
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.rightMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
id: brightnessSlider
|
||||||
|
from: 0.01
|
||||||
|
to: 1.0
|
||||||
|
stepSize: 0.01
|
||||||
|
value: 1.0
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onPositionChanged: {
|
||||||
|
var val = (this.value * 100)
|
||||||
|
brightnessValueText.text = Math.round(val) + "%"
|
||||||
|
}
|
||||||
|
onValueChanged: {
|
||||||
|
|
||||||
|
VideoTabController.setBrightnessValue(value.toFixed(2), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyTextField {
|
||||||
|
id: brightnessValueText
|
||||||
|
text: "100%"
|
||||||
|
keyBoardUID: 902
|
||||||
|
Layout.preferredWidth: 100
|
||||||
|
Layout.leftMargin: 10
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
function onInputEvent(input) {
|
||||||
|
var val2 = parseFloat(input)
|
||||||
|
if (!isNaN(val2)) {
|
||||||
|
if (val2 < 5) {
|
||||||
|
val2 = 5
|
||||||
|
} else if (val2 > 100.0) {
|
||||||
|
val2 = 100.0
|
||||||
|
}
|
||||||
|
var v2 = (val2/100).toFixed(2)
|
||||||
|
brightnessSlider.value = v
|
||||||
|
}
|
||||||
|
text = Math.round(VideoTabController.brightnessValue * 100) + "%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
MyToggleButton {
|
||||||
|
id: colorToggle
|
||||||
|
text: "Toggle On/Off"
|
||||||
|
onCheckedChanged: {
|
||||||
|
VideoTabController.setColorOverlayEnabled(this.checked, true) }
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.preferredWidth: 150
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
text: "Opacity:"
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.rightMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
id: opacitySlider
|
||||||
|
from: 0.01
|
||||||
|
to: 0.85
|
||||||
|
stepSize: 0.01
|
||||||
|
value: 0.01
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onPositionChanged: {
|
||||||
|
var val = (this.value * 100)
|
||||||
|
opacityValueText.text = Math.round(val) + "%"
|
||||||
|
}
|
||||||
|
onValueChanged: {
|
||||||
|
|
||||||
|
VideoTabController.setColorOverlayOpacity(this.value.toFixed(2), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyTextField {
|
||||||
|
id: opacityValueText
|
||||||
|
text: "1%"
|
||||||
|
keyBoardUID: 903
|
||||||
|
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 > 85.0) {
|
||||||
|
val = 85.0
|
||||||
|
}
|
||||||
|
var v = (val/100).toFixed(2)
|
||||||
|
opacitySlider.value = v
|
||||||
|
}
|
||||||
|
text = Math.round(VideoTabController.colorOverlayOpacity * 100) + "%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
text: "Red:"
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.preferredWidth: 75
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
id: colorRedSlider
|
||||||
|
from: 0.01
|
||||||
|
to: 1.0
|
||||||
|
stepSize: 0.01
|
||||||
|
value: 1.0
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onPositionChanged: {
|
||||||
|
var val = (this.value * 100)
|
||||||
|
colorRedText.text = Math.round(val) + "%"
|
||||||
|
}
|
||||||
|
onValueChanged: {
|
||||||
|
|
||||||
|
VideoTabController.setColorRed(value.toFixed(2), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyTextField {
|
||||||
|
id: colorRedText
|
||||||
|
text: "100%"
|
||||||
|
keyBoardUID: 915
|
||||||
|
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)
|
||||||
|
colorRedSlider.value = v
|
||||||
|
}
|
||||||
|
text = Math.round(VideoTabController.colorRed * 100) + "%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MyText {
|
||||||
|
text: "Green:"
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.preferredWidth: 85
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
id: colorGreenSlider
|
||||||
|
from: 0.01
|
||||||
|
to: 1.0
|
||||||
|
stepSize: 0.01
|
||||||
|
value: 1.0
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onPositionChanged: {
|
||||||
|
var val = (this.value * 100)
|
||||||
|
colorGreenText.text = Math.round(val) + "%"
|
||||||
|
}
|
||||||
|
onValueChanged: {
|
||||||
|
|
||||||
|
VideoTabController.setColorGreen(value.toFixed(2), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyTextField {
|
||||||
|
id: colorGreenText
|
||||||
|
text: "100%"
|
||||||
|
keyBoardUID: 916
|
||||||
|
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)
|
||||||
|
colorGreenSlider.value = v
|
||||||
|
}
|
||||||
|
text = Math.round(VideoTabController.colorGreen * 100) + "%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
text: "Blue:"
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.preferredWidth: 75
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
id: colorBlueSlider
|
||||||
|
from: 0.01
|
||||||
|
to: 1.0
|
||||||
|
stepSize: 0.01
|
||||||
|
value: 1.0
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onPositionChanged: {
|
||||||
|
var val = (this.value * 100)
|
||||||
|
colorBlueText.text = Math.round(val) + "%"
|
||||||
|
}
|
||||||
|
onValueChanged: {
|
||||||
|
|
||||||
|
VideoTabController.setColorBlue(value.toFixed(2), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyTextField {
|
||||||
|
id: colorBlueText
|
||||||
|
text: "100%"
|
||||||
|
keyBoardUID: 917
|
||||||
|
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: {
|
||||||
|
brightnessSlider.value = VideoTabController.brightnessValue
|
||||||
|
brightnessToggle.checked = VideoTabController.brightnessEnabled
|
||||||
|
colorToggle.checked = VideoTabController.colorOverlayEnabled
|
||||||
|
opacitySlider.value = VideoTabController.colorOverlayOpacity
|
||||||
|
colorRedSlider.value = VideoTabController.colorRed
|
||||||
|
colorGreenSlider.value = VideoTabController.colorGreen
|
||||||
|
colorBlueSlider.value = VideoTabController.colorBlue
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: VideoTabController
|
||||||
|
|
||||||
|
onBrightnessValueChanged: {
|
||||||
|
brightnessSlider.value = VideoTabController.brightnessValue
|
||||||
|
}
|
||||||
|
onBrightnessEnabledChanged: {
|
||||||
|
brightnessToggle.checked = VideoTabController.brightnessEnabled
|
||||||
|
}
|
||||||
|
onColorOverlayOpacityChanged:{
|
||||||
|
opacitySlider.value = VideoTabController.colorOverlayOpacity
|
||||||
|
}
|
||||||
|
onColorOverlayEnabledChanged:{
|
||||||
|
colorToggle.checked = VideoTabController.colorOverlayEnabled
|
||||||
|
}
|
||||||
|
|
||||||
|
onColorRedChanged:{
|
||||||
|
colorRedSlider.value = VideoTabController.colorRed
|
||||||
|
}
|
||||||
|
onColorGreenChanged:{
|
||||||
|
colorGreenSlider.value = VideoTabController.colorGreen
|
||||||
|
}
|
||||||
|
onColorBlueChanged:{
|
||||||
|
colorBlueSlider.value = VideoTabController.colorBlue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,8 @@ void AudioTabController::initStage1()
|
|||||||
audioManager.reset( new AudioManagerDummy() );
|
audioManager.reset( new AudioManagerDummy() );
|
||||||
#endif
|
#endif
|
||||||
audioManager->init( this );
|
audioManager->init( this );
|
||||||
|
m_k_audioSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_audioSettingsUpdateCounter );
|
||||||
m_playbackDevices = audioManager->getPlaybackDevices();
|
m_playbackDevices = audioManager->getPlaybackDevices();
|
||||||
m_recordingDevices = audioManager->getRecordingDevices();
|
m_recordingDevices = audioManager->getRecordingDevices();
|
||||||
findPlaybackDeviceIndex( audioManager->getPlaybackDevId(), false );
|
findPlaybackDeviceIndex( audioManager->getPlaybackDevId(), false );
|
||||||
@@ -165,7 +167,7 @@ void AudioTabController::eventLoopTick()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( settingsUpdateCounter >= k_audioSettingsUpdateCounter )
|
if ( settingsUpdateCounter >= m_k_audioSettingsUpdateCounter )
|
||||||
{
|
{
|
||||||
vr::EVRSettingsError vrSettingsError;
|
vr::EVRSettingsError vrSettingsError;
|
||||||
char mirrorDeviceId[1024];
|
char mirrorDeviceId[1024];
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "AudioManager.h"
|
#include "AudioManager.h"
|
||||||
#include "PttController.h"
|
#include "PttController.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -73,6 +74,8 @@ private:
|
|||||||
bool m_micReversePtt = false;
|
bool m_micReversePtt = false;
|
||||||
bool m_isDefaultAudioProfile = false;
|
bool m_isDefaultAudioProfile = false;
|
||||||
|
|
||||||
|
unsigned int m_k_audioSettingsUpdateCounter = 90;
|
||||||
|
|
||||||
int m_defaultProfileIndex = -1;
|
int m_defaultProfileIndex = -1;
|
||||||
|
|
||||||
unsigned settingsUpdateCounter = 0;
|
unsigned settingsUpdateCounter = 0;
|
||||||
|
|||||||
@@ -35,8 +35,15 @@ void ChaperoneTabController::initStage1()
|
|||||||
m_fadeDistanceRemembered
|
m_fadeDistanceRemembered
|
||||||
= settings->value( "fadeDistanceRemembered", 0.5f ).toFloat();
|
= settings->value( "fadeDistanceRemembered", 0.5f ).toFloat();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
reloadChaperoneProfiles();
|
|
||||||
|
|
||||||
|
if ( m_disableChaperone )
|
||||||
|
{
|
||||||
|
setFadeDistance( 0.0f, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadChaperoneProfiles();
|
||||||
|
m_k_chaperoneSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_chaperoneSettingsUpdateCounter );
|
||||||
eventLoopTick( nullptr );
|
eventLoopTick( nullptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +645,7 @@ void ChaperoneTabController::eventLoopTick(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( settingsUpdateCounter >= k_chaperoneSettingsUpdateCounter )
|
if ( settingsUpdateCounter >= m_k_chaperoneSettingsUpdateCounter )
|
||||||
{
|
{
|
||||||
if ( parent->isDashboardVisible() )
|
if ( parent->isDashboardVisible() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <openvr.h>
|
#include <openvr.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -170,6 +171,8 @@ private:
|
|||||||
|
|
||||||
int m_updateTicksChaperoneReload = 0;
|
int m_updateTicksChaperoneReload = 0;
|
||||||
|
|
||||||
|
unsigned int m_k_chaperoneSettingsUpdateCounter = 101;
|
||||||
|
|
||||||
vr::VRActionHandle_t m_rightActionHandle;
|
vr::VRActionHandle_t m_rightActionHandle;
|
||||||
vr::VRActionHandle_t m_leftActionHandle;
|
vr::VRActionHandle_t m_leftActionHandle;
|
||||||
vr::VRInputValueHandle_t m_leftInputHandle;
|
vr::VRInputValueHandle_t m_leftInputHandle;
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ void MoveCenterTabController::initStage1()
|
|||||||
}
|
}
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
reloadOffsetProfiles();
|
reloadOffsetProfiles();
|
||||||
|
m_k_moveCenterSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_moveCenterSettingsUpdateCounter );
|
||||||
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
|
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
|
||||||
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
|
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <openvr.h>
|
#include <openvr.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <qmath.h>
|
#include <qmath.h>
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -190,6 +191,9 @@ private:
|
|||||||
int m_hmdRotationStatsUpdateCounter = 0;
|
int m_hmdRotationStatsUpdateCounter = 0;
|
||||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||||
unsigned m_turnComfortFrameSkipCounter = 0;
|
unsigned m_turnComfortFrameSkipCounter = 0;
|
||||||
|
|
||||||
|
unsigned int m_k_moveCenterSettingsUpdateCounter = 83;
|
||||||
|
|
||||||
double m_velocity[3] = { 0.0, 0.0, 0.0 };
|
double m_velocity[3] = { 0.0, 0.0, 0.0 };
|
||||||
std::chrono::steady_clock::time_point m_lastGravityUpdateTimePoint;
|
std::chrono::steady_clock::time_point m_lastGravityUpdateTimePoint;
|
||||||
std::chrono::steady_clock::time_point m_lastDragUpdateTimePoint;
|
std::chrono::steady_clock::time_point m_lastDragUpdateTimePoint;
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ void SettingsTabController::initStage1()
|
|||||||
{
|
{
|
||||||
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(
|
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(
|
||||||
application_strings::applicationKey );
|
application_strings::applicationKey );
|
||||||
|
m_k_settingsTabSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_settingsTabSettingsUpdateCounter );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsTabController::initStage2( OverlayController* var_parent )
|
void SettingsTabController::initStage2( OverlayController* var_parent )
|
||||||
@@ -18,7 +20,7 @@ void SettingsTabController::initStage2( OverlayController* var_parent )
|
|||||||
|
|
||||||
void SettingsTabController::dashboardLoopTick()
|
void SettingsTabController::dashboardLoopTick()
|
||||||
{
|
{
|
||||||
if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter )
|
if ( settingsUpdateCounter >= m_k_settingsTabSettingsUpdateCounter )
|
||||||
{
|
{
|
||||||
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
|
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
|
||||||
application_strings::applicationKey ) );
|
application_strings::applicationKey ) );
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -23,6 +24,8 @@ private:
|
|||||||
|
|
||||||
bool m_autoStartEnabled = false;
|
bool m_autoStartEnabled = false;
|
||||||
|
|
||||||
|
unsigned int m_k_settingsTabSettingsUpdateCounter = 157;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void initStage1();
|
void initStage1();
|
||||||
void initStage2( OverlayController* parent );
|
void initStage2( OverlayController* parent );
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace advsettings
|
|||||||
{
|
{
|
||||||
void SteamVRTabController::initStage1()
|
void SteamVRTabController::initStage1()
|
||||||
{
|
{
|
||||||
|
m_k_steamVrSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_steamVrSettingsUpdateCounter );
|
||||||
dashboardLoopTick();
|
dashboardLoopTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +19,7 @@ void SteamVRTabController::initStage2( OverlayController* var_parent )
|
|||||||
|
|
||||||
void SteamVRTabController::dashboardLoopTick()
|
void SteamVRTabController::dashboardLoopTick()
|
||||||
{
|
{
|
||||||
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
|
if ( settingsUpdateCounter >= m_k_steamVrSettingsUpdateCounter )
|
||||||
{
|
{
|
||||||
vr::EVRSettingsError vrSettingsError;
|
vr::EVRSettingsError vrSettingsError;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -50,6 +51,8 @@ private:
|
|||||||
|
|
||||||
unsigned settingsUpdateCounter = 0;
|
unsigned settingsUpdateCounter = 0;
|
||||||
|
|
||||||
|
unsigned int m_k_steamVrSettingsUpdateCounter = 97;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void initStage1();
|
void initStage1();
|
||||||
void initStage2( OverlayController* parent );
|
void initStage2( OverlayController* parent );
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ void UtilitiesTabController::initStage1()
|
|||||||
m_alarmIsModal = qAlarmIsModal.toBool();
|
m_alarmIsModal = qAlarmIsModal.toBool();
|
||||||
m_vrcDebug = qVrcDebug.toBool();
|
m_vrcDebug = qVrcDebug.toBool();
|
||||||
m_alarmTime = QTime( qAlarmHour.toInt(), qAlarmMinute.toInt() );
|
m_alarmTime = QTime( qAlarmHour.toInt(), qAlarmMinute.toInt() );
|
||||||
|
|
||||||
|
m_k_utilitiesSettingsUpdateCounter
|
||||||
|
= utils::adjustUpdateRate( k_utilitiesSettingsUpdateCounter );
|
||||||
}
|
}
|
||||||
|
|
||||||
void UtilitiesTabController::initStage2( OverlayController* var_parent )
|
void UtilitiesTabController::initStage2( OverlayController* var_parent )
|
||||||
@@ -461,7 +464,7 @@ vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index )
|
|||||||
|
|
||||||
void UtilitiesTabController::eventLoopTick()
|
void UtilitiesTabController::eventLoopTick()
|
||||||
{
|
{
|
||||||
if ( settingsUpdateCounter >= k_utilitiesSettingsUpdateCounter )
|
if ( settingsUpdateCounter >= m_k_utilitiesSettingsUpdateCounter )
|
||||||
{
|
{
|
||||||
if ( m_alarmEnabled && m_alarmTime.isValid() )
|
if ( m_alarmEnabled && m_alarmTime.isValid() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include "src/keyboard_input/keyboard_input.h"
|
#include "src/keyboard_input/keyboard_input.h"
|
||||||
#include "src/media_keys/media_keys.h"
|
#include "src/media_keys/media_keys.h"
|
||||||
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -45,6 +46,8 @@ private:
|
|||||||
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
||||||
bool m_batteryVisible[vr::k_unMaxTrackedDeviceCount];
|
bool m_batteryVisible[vr::k_unMaxTrackedDeviceCount];
|
||||||
|
|
||||||
|
unsigned int m_k_utilitiesSettingsUpdateCounter = 19;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void initStage1();
|
void initStage1();
|
||||||
void initStage2( OverlayController* var_parent );
|
void initStage2( OverlayController* var_parent );
|
||||||
|
|||||||
@@ -8,8 +8,12 @@ namespace advsettings
|
|||||||
{
|
{
|
||||||
void VideoTabController::initStage1()
|
void VideoTabController::initStage1()
|
||||||
{
|
{
|
||||||
|
// In order to ensure gain is "normal" before applying to either overlay or
|
||||||
|
// gain.
|
||||||
|
resetGain();
|
||||||
|
|
||||||
initBrightnessOverlay();
|
initBrightnessOverlay();
|
||||||
initColorGain();
|
initColorOverlay();
|
||||||
initMotionSmoothing();
|
initMotionSmoothing();
|
||||||
initSupersampleOverride();
|
initSupersampleOverride();
|
||||||
m_overlayInit = true;
|
m_overlayInit = true;
|
||||||
@@ -57,6 +61,70 @@ void VideoTabController::initBrightnessOverlay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
const auto notifIconPath = paths::binaryDirectoryFindFile(
|
||||||
|
video_keys::k_colorOverlayFilename );
|
||||||
|
if ( notifIconPath.has_value() )
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
¬ificationTransform );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not find Base color overlay: \""
|
||||||
|
<< video_keys::k_colorOverlayFilename << "\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not create color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoTabController::loadColorOverlay()
|
||||||
|
{
|
||||||
|
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
|
||||||
|
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set Colors for color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
|
||||||
|
overlayError = vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle,
|
||||||
|
m_colorOverlayOpacity );
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set alpha: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
emit colorOverlayOpacityChanged( true );
|
||||||
|
}
|
||||||
|
|
||||||
void VideoTabController::eventLoopTick() {}
|
void VideoTabController::eventLoopTick() {}
|
||||||
|
|
||||||
void VideoTabController::dashboardLoopTick()
|
void VideoTabController::dashboardLoopTick()
|
||||||
@@ -158,9 +226,19 @@ void VideoTabController::reloadVideoConfig()
|
|||||||
m_brightnessOpacityValue
|
m_brightnessOpacityValue
|
||||||
= settings->value( "brightnessOpacityValue", 0.0f ).toFloat();
|
= settings->value( "brightnessOpacityValue", 0.0f ).toFloat();
|
||||||
m_brightnessValue = settings->value( "brightnessValue", 1.0f ).toFloat();
|
m_brightnessValue = settings->value( "brightnessValue", 1.0f ).toFloat();
|
||||||
|
setColorOverlayEnabled(
|
||||||
|
settings->value( "colorOverlayEnabled", false ).toBool(), true );
|
||||||
|
setColorOverlayOpacity(
|
||||||
|
settings->value( "colorOverlayOpacity", 0.0f ).toFloat(), true );
|
||||||
|
setIsOverlayMethodActive(
|
||||||
|
settings->value( "isOverlayMethodActive", false ).toBool(), true );
|
||||||
|
setColorRed( settings->value( "colorRed", 1.0f ).toFloat() );
|
||||||
|
setColorGreen( settings->value( "colorGreen", 1.0f ).toFloat() );
|
||||||
|
setColorBlue( settings->value( "colorBlue", 1.0f ).toFloat() );
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
setBrightnessOpacityValue();
|
setBrightnessOpacityValue();
|
||||||
|
loadColorOverlay();
|
||||||
settings->sync();
|
settings->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,6 +249,12 @@ void VideoTabController::saveVideoConfig()
|
|||||||
settings->setValue( "brightnessEnabled", brightnessEnabled() );
|
settings->setValue( "brightnessEnabled", brightnessEnabled() );
|
||||||
settings->setValue( "brightnessOpacityValue", brightnessOpacityValue() );
|
settings->setValue( "brightnessOpacityValue", brightnessOpacityValue() );
|
||||||
settings->setValue( "brightnessValue", brightnessValue() );
|
settings->setValue( "brightnessValue", brightnessValue() );
|
||||||
|
settings->setValue( "colorOverlayEnabled", colorOverlayEnabled() );
|
||||||
|
settings->setValue( "colorOverlayOpacity", colorOverlayOpacity() );
|
||||||
|
settings->setValue( "colorRed", colorRed() );
|
||||||
|
settings->setValue( "colorGreen", colorGreen() );
|
||||||
|
settings->setValue( "colorBlue", colorBlue() );
|
||||||
|
settings->setValue( "isOverlayMethodActive", isOverlayMethodActive() );
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
settings->sync();
|
settings->sync();
|
||||||
@@ -191,11 +275,16 @@ bool VideoTabController::brightnessEnabled() const
|
|||||||
return m_brightnessEnabled;
|
return m_brightnessEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::setBrightnessEnabled( bool value, bool notify )
|
void VideoTabController::setBrightnessEnabled( bool value,
|
||||||
|
bool notify,
|
||||||
|
bool keepValue )
|
||||||
{
|
{
|
||||||
if ( value != m_brightnessEnabled )
|
if ( value != m_brightnessEnabled || keepValue )
|
||||||
{
|
{
|
||||||
m_brightnessEnabled = value;
|
if ( !keepValue )
|
||||||
|
{
|
||||||
|
m_brightnessEnabled = value;
|
||||||
|
}
|
||||||
auto overlayHandle = getBrightnessOverlayHandle();
|
auto overlayHandle = getBrightnessOverlayHandle();
|
||||||
if ( value )
|
if ( value )
|
||||||
{
|
{
|
||||||
@@ -280,6 +369,16 @@ void VideoTabController::setBrightnessOpacityValue()
|
|||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
|
bool VideoTabController::colorOverlayEnabled() const
|
||||||
|
{
|
||||||
|
return m_colorOverlayEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
float VideoTabController::colorOverlayOpacity() const
|
||||||
|
{
|
||||||
|
return m_colorOverlayOpacity;
|
||||||
|
}
|
||||||
|
|
||||||
float VideoTabController::colorRed() const
|
float VideoTabController::colorRed() const
|
||||||
{
|
{
|
||||||
return m_colorRed;
|
return m_colorRed;
|
||||||
@@ -295,27 +394,138 @@ float VideoTabController::colorBlue() const
|
|||||||
return m_colorBlue;
|
return m_colorBlue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VideoTabController::isOverlayMethodActive() const
|
||||||
|
{
|
||||||
|
return m_isOverlayMethodActive;
|
||||||
|
}
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
|
|
||||||
void VideoTabController::setColorRed( float value, bool notify )
|
void VideoTabController::setIsOverlayMethodActive( bool value, bool notify )
|
||||||
{
|
{
|
||||||
if ( fabs( static_cast<double>( value - m_colorRed ) ) > .005 )
|
resetGain();
|
||||||
|
m_isOverlayMethodActive = value;
|
||||||
|
if ( value )
|
||||||
{
|
{
|
||||||
m_colorRed = value;
|
setColorOverlayEnabled( colorOverlayEnabled(), true, false );
|
||||||
vr::EVRSettingsError vrSettingsError;
|
}
|
||||||
vr::VRSettings()->SetFloat(
|
else
|
||||||
vr::k_pch_SteamVR_Section,
|
{
|
||||||
vr::k_pch_SteamVR_HmdDisplayColorGainR_Float,
|
setColorOverlayEnabled( false, true, false );
|
||||||
m_colorRed,
|
}
|
||||||
&vrSettingsError );
|
setColor( colorRed(), colorGreen(), colorBlue(), true, true );
|
||||||
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
saveVideoConfig();
|
||||||
|
if ( notify )
|
||||||
|
{
|
||||||
|
emit isOverlayMethodActiveChanged( value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoTabController::setColorOverlayEnabled( bool value,
|
||||||
|
bool notify,
|
||||||
|
bool keepValue )
|
||||||
|
{
|
||||||
|
if ( value != m_colorOverlayEnabled || keepValue )
|
||||||
|
{
|
||||||
|
if ( !keepValue )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "could not set Red Gain Value, Error: "
|
m_colorOverlayEnabled = value;
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
}
|
||||||
LOG( DEBUG ) << "Changed Red Gain to: " << m_colorRed;
|
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 colorOverlayEnabledChanged( value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoTabController::setColorOverlayOpacity( float value, bool notify )
|
||||||
|
{
|
||||||
|
if ( fabs( static_cast<double>( value - m_colorOverlayOpacity ) ) > .005 )
|
||||||
|
{
|
||||||
|
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(
|
||||||
|
m_colorOverlayHandle, m_colorOverlayOpacity );
|
||||||
|
if ( value > .85f )
|
||||||
|
{
|
||||||
|
m_colorOverlayOpacity = 0.85f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_colorOverlayOpacity = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set alpha for color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
saveVideoConfig();
|
||||||
|
if ( notify )
|
||||||
|
{
|
||||||
|
emit colorOverlayOpacityChanged( m_colorOverlayOpacity );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoTabController::setColorRed( float value, bool notify, bool keepValue )
|
||||||
|
{
|
||||||
|
if ( ( fabs( static_cast<double>( value - m_colorRed ) ) > .005 )
|
||||||
|
|| keepValue )
|
||||||
|
{
|
||||||
|
if ( !keepValue )
|
||||||
|
{
|
||||||
|
m_colorRed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isOverlayMethodActive() )
|
||||||
|
{
|
||||||
|
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
|
||||||
|
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set Red for color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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 Gain Value, Error: "
|
||||||
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
|
vrSettingsError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG( DEBUG ) << "Changed Red Value to: " << m_colorRed;
|
||||||
|
saveVideoConfig();
|
||||||
vr::VRSettings()->Sync();
|
vr::VRSettings()->Sync();
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -324,25 +534,48 @@ void VideoTabController::setColorRed( float value, bool notify )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::setColorGreen( float value, bool notify )
|
void VideoTabController::setColorGreen( float value,
|
||||||
|
bool notify,
|
||||||
|
bool keepValue )
|
||||||
{
|
{
|
||||||
if ( fabs( static_cast<double>( value - m_colorGreen ) ) > .005 )
|
if ( ( fabs( static_cast<double>( value - m_colorGreen ) ) > .005 )
|
||||||
|
|| keepValue )
|
||||||
{
|
{
|
||||||
m_colorGreen = value;
|
if ( !keepValue )
|
||||||
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 Gain Value, Error: "
|
m_colorGreen = value;
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
}
|
||||||
LOG( DEBUG ) << "Changed Green Gain to: " << m_colorGreen;
|
|
||||||
|
if ( isOverlayMethodActive() )
|
||||||
|
{
|
||||||
|
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
|
||||||
|
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set Green for color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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 Gain Value, Error: "
|
||||||
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
|
vrSettingsError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG( DEBUG ) << "Changed Green Value to: " << m_colorGreen;
|
||||||
|
saveVideoConfig();
|
||||||
vr::VRSettings()->Sync();
|
vr::VRSettings()->Sync();
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -351,25 +584,47 @@ void VideoTabController::setColorGreen( float value, bool notify )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::setColorBlue( float value, bool notify )
|
void VideoTabController::setColorBlue( float value,
|
||||||
|
bool notify,
|
||||||
|
bool keepValue )
|
||||||
{
|
{
|
||||||
if ( fabs( static_cast<double>( value - m_colorBlue ) ) > .005 )
|
if ( ( fabs( static_cast<double>( value - m_colorBlue ) ) > .005 )
|
||||||
|
|| keepValue )
|
||||||
{
|
{
|
||||||
m_colorBlue = value;
|
if ( !keepValue )
|
||||||
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 Gain Value, Error: "
|
m_colorBlue = value;
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
}
|
||||||
LOG( DEBUG ) << "Changed Blue Gain to: " << m_colorBlue;
|
if ( isOverlayMethodActive() )
|
||||||
|
{
|
||||||
|
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayColor(
|
||||||
|
m_colorOverlayHandle, m_colorRed, m_colorGreen, m_colorBlue );
|
||||||
|
if ( overlayError != vr::VROverlayError_None )
|
||||||
|
{
|
||||||
|
LOG( ERROR ) << "Could not set Blue for color overlay: "
|
||||||
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
|
overlayError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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 Gain Value, Error: "
|
||||||
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
|
vrSettingsError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG( DEBUG ) << "Changed Blue Value to: " << m_colorBlue;
|
||||||
|
saveVideoConfig();
|
||||||
vr::VRSettings()->Sync();
|
vr::VRSettings()->Sync();
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -378,58 +633,54 @@ void VideoTabController::setColorBlue( float value, bool notify )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::initColorGain()
|
void VideoTabController::resetGain()
|
||||||
{
|
{
|
||||||
float temporary = 0.0f;
|
|
||||||
vr::EVRSettingsError vrSettingsError;
|
vr::EVRSettingsError vrSettingsError;
|
||||||
temporary = vr::VRSettings()->GetFloat(
|
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_HmdDisplayColorGainR_Float,
|
||||||
vr::k_pch_SteamVR_HmdDisplayColorGainR_Float,
|
1.0f,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "Could not get Red Gain Value ERROR: "
|
LOG( ERROR ) << "could not set Red Gain Value, Error: "
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
vrSettingsError );
|
vrSettingsError );
|
||||||
}
|
}
|
||||||
else
|
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
||||||
{
|
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
|
||||||
m_colorRed = temporary;
|
1.0f,
|
||||||
setColorRed( temporary );
|
&vrSettingsError );
|
||||||
}
|
|
||||||
|
|
||||||
temporary = vr::VRSettings()->GetFloat(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "Could not get Green Gain Value ERROR: "
|
LOG( ERROR ) << "could not set Green Gain Value, Error: "
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
vrSettingsError );
|
vrSettingsError );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_colorGreen = temporary;
|
|
||||||
setColorGreen( temporary );
|
|
||||||
}
|
|
||||||
|
|
||||||
temporary = vr::VRSettings()->GetFloat(
|
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_HmdDisplayColorGainB_Float,
|
||||||
vr::k_pch_SteamVR_HmdDisplayColorGainB_Float,
|
1.0f,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "Could not get Blue Gain Value ERROR: "
|
LOG( ERROR ) << "could not set Blue Gain Value, Error: "
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
vrSettingsError );
|
vrSettingsError );
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
m_colorBlue = temporary;
|
void VideoTabController::setColor( float R,
|
||||||
setColorBlue( temporary );
|
float G,
|
||||||
}
|
float B,
|
||||||
|
bool notify,
|
||||||
|
bool keepValue )
|
||||||
|
{
|
||||||
|
setColorRed( R, notify, keepValue );
|
||||||
|
setColorGreen( G, notify, keepValue );
|
||||||
|
setColorBlue( B, notify, keepValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -621,6 +872,8 @@ void VideoTabController::addVideoProfile( const QString name )
|
|||||||
profile->colorBlue = m_colorBlue;
|
profile->colorBlue = m_colorBlue;
|
||||||
profile->brightnessToggle = m_brightnessEnabled;
|
profile->brightnessToggle = m_brightnessEnabled;
|
||||||
profile->brightnessValue = m_brightnessValue;
|
profile->brightnessValue = m_brightnessValue;
|
||||||
|
profile->opacity = m_colorOverlayOpacity;
|
||||||
|
profile->overlayMethodState = m_isOverlayMethodActive;
|
||||||
|
|
||||||
saveVideoProfiles();
|
saveVideoProfiles();
|
||||||
OverlayController::appSettings()->sync();
|
OverlayController::appSettings()->sync();
|
||||||
@@ -638,11 +891,13 @@ void VideoTabController::applyVideoProfile( const unsigned index )
|
|||||||
setSuperSampling( profile.supersampling );
|
setSuperSampling( profile.supersampling );
|
||||||
setAllowSupersampleFiltering( profile.anisotropicFiltering );
|
setAllowSupersampleFiltering( profile.anisotropicFiltering );
|
||||||
setMotionSmoothing( profile.motionSmooth );
|
setMotionSmoothing( profile.motionSmooth );
|
||||||
|
setIsOverlayMethodActive( profile.overlayMethodState );
|
||||||
setColorRed( profile.colorRed );
|
setColorRed( profile.colorRed );
|
||||||
setColorBlue( profile.colorBlue );
|
setColorBlue( profile.colorBlue );
|
||||||
setColorGreen( profile.colorGreen );
|
setColorGreen( profile.colorGreen );
|
||||||
setBrightnessEnabled( profile.brightnessToggle );
|
setBrightnessEnabled( profile.brightnessToggle );
|
||||||
setBrightnessValue( profile.brightnessValue );
|
setBrightnessValue( profile.brightnessValue );
|
||||||
|
setColorOverlayOpacity( profile.opacity );
|
||||||
vr::VRSettings()->Sync( true );
|
vr::VRSettings()->Sync( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -663,8 +918,8 @@ void VideoTabController::reloadVideoProfiles()
|
|||||||
{
|
{
|
||||||
videoProfiles.clear();
|
videoProfiles.clear();
|
||||||
auto settings = OverlayController::appSettings();
|
auto settings = OverlayController::appSettings();
|
||||||
settings->beginGroup( "steamVRSettings" );
|
settings->beginGroup( "VideoSettings" );
|
||||||
auto profileCount = settings->beginReadArray( "steamVRProfiles" );
|
auto profileCount = settings->beginReadArray( "videoProfiles" );
|
||||||
for ( int i = 0; i < profileCount; i++ )
|
for ( int i = 0; i < profileCount; i++ )
|
||||||
{
|
{
|
||||||
settings->setArrayIndex( i );
|
settings->setArrayIndex( i );
|
||||||
@@ -689,6 +944,9 @@ void VideoTabController::reloadVideoProfiles()
|
|||||||
= settings->value( "brightnessToggle", false ).toBool();
|
= settings->value( "brightnessToggle", false ).toBool();
|
||||||
entry.brightnessValue
|
entry.brightnessValue
|
||||||
= settings->value( "brightnessValue", 1.0f ).toFloat();
|
= settings->value( "brightnessValue", 1.0f ).toFloat();
|
||||||
|
entry.opacity = settings->value( "opacity", 0.0f ).toFloat();
|
||||||
|
entry.overlayMethodState
|
||||||
|
= settings->value( "overlayMethodState", false ).toBool();
|
||||||
}
|
}
|
||||||
settings->endArray();
|
settings->endArray();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
@@ -718,6 +976,9 @@ void VideoTabController::saveVideoProfiles()
|
|||||||
settings->setValue( "brightnessToggle", p.brightnessToggle );
|
settings->setValue( "brightnessToggle", p.brightnessToggle );
|
||||||
settings->setValue( "brightnessValue", p.brightnessValue );
|
settings->setValue( "brightnessValue", p.brightnessValue );
|
||||||
|
|
||||||
|
settings->setValue( "opacity", p.opacity );
|
||||||
|
settings->setValue( "overlayMethodState", p.overlayMethodState );
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
settings->endArray();
|
settings->endArray();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class QQuickWindow;
|
|||||||
namespace video_keys
|
namespace video_keys
|
||||||
{
|
{
|
||||||
constexpr auto k_brightnessOverlayFilename = "/res/img/video/dimmer.png";
|
constexpr auto k_brightnessOverlayFilename = "/res/img/video/dimmer.png";
|
||||||
|
constexpr auto k_colorOverlayFilename = "/res/img/video/color.png";
|
||||||
|
|
||||||
} // namespace video_keys
|
} // namespace video_keys
|
||||||
|
|
||||||
@@ -31,6 +32,8 @@ struct VideoProfile
|
|||||||
float colorBlue = 1.0f;
|
float colorBlue = 1.0f;
|
||||||
bool brightnessToggle = false;
|
bool brightnessToggle = false;
|
||||||
float brightnessValue = 1.0f;
|
float brightnessValue = 1.0f;
|
||||||
|
bool overlayMethodState = false;
|
||||||
|
float opacity = 0.0f;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VideoTabController : public QObject
|
class VideoTabController : public QObject
|
||||||
@@ -56,12 +59,20 @@ class VideoTabController : public QObject
|
|||||||
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
|
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
|
||||||
WRITE setAllowSupersampleFiltering NOTIFY
|
WRITE setAllowSupersampleFiltering NOTIFY
|
||||||
allowSupersampleFilteringChanged )
|
allowSupersampleFilteringChanged )
|
||||||
|
Q_PROPERTY(
|
||||||
|
bool isOverlayMethodActive READ isOverlayMethodActive WRITE
|
||||||
|
setIsOverlayMethodActive NOTIFY isOverlayMethodActiveChanged )
|
||||||
|
Q_PROPERTY( bool colorOverlayEnabled READ colorOverlayEnabled WRITE
|
||||||
|
setColorOverlayEnabled NOTIFY colorOverlayEnabledChanged )
|
||||||
|
Q_PROPERTY( float colorOverlayOpacity READ colorOverlayOpacity WRITE
|
||||||
|
setColorOverlayOpacity NOTIFY colorOverlayOpacityChanged )
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned settingsUpdateCounter = 0;
|
unsigned settingsUpdateCounter = 0;
|
||||||
|
|
||||||
// how far away the overlay is, any OVERLAY closer will not be dimmed.
|
// how far away the overlay is, any OVERLAY closer will not be dimmed.
|
||||||
const float k_hmdDistance = -0.15f;
|
const float k_hmdDistance = -0.15f;
|
||||||
|
|
||||||
// how wide overlay is, Increase this value if edges of view are not
|
// how wide overlay is, Increase this value if edges of view are not
|
||||||
// dimmed.
|
// dimmed.
|
||||||
const float k_overlayWidth = 1.0f;
|
const float k_overlayWidth = 1.0f;
|
||||||
@@ -79,16 +90,29 @@ private:
|
|||||||
float m_colorBlue = 0.0f;
|
float m_colorBlue = 0.0f;
|
||||||
float m_colorGreen = 0.0f;
|
float m_colorGreen = 0.0f;
|
||||||
bool m_overlayInit = false;
|
bool m_overlayInit = false;
|
||||||
|
bool m_isOverlayMethodActive = false;
|
||||||
|
|
||||||
|
bool m_colorOverlayEnabled = false;
|
||||||
|
float m_colorOverlayOpacity = 0.0f;
|
||||||
|
|
||||||
float m_superSampling = 1.0;
|
float m_superSampling = 1.0;
|
||||||
bool m_allowSupersampleOverride = false;
|
bool m_allowSupersampleOverride = false;
|
||||||
bool m_motionSmoothing = true;
|
bool m_motionSmoothing = true;
|
||||||
bool m_allowSupersampleFiltering = true;
|
bool m_allowSupersampleFiltering = true;
|
||||||
|
|
||||||
void initColorGain();
|
void setColor( float R,
|
||||||
|
float G,
|
||||||
|
float B,
|
||||||
|
bool notify = true,
|
||||||
|
bool keepValue = false );
|
||||||
|
void resetGain();
|
||||||
|
|
||||||
void initSupersampleOverride();
|
void initSupersampleOverride();
|
||||||
void initMotionSmoothing();
|
void initMotionSmoothing();
|
||||||
|
|
||||||
|
void initColorOverlay();
|
||||||
|
void loadColorOverlay();
|
||||||
|
|
||||||
void reloadVideoConfig();
|
void reloadVideoConfig();
|
||||||
void saveVideoConfig();
|
void saveVideoConfig();
|
||||||
void setBrightnessOpacityValue();
|
void setBrightnessOpacityValue();
|
||||||
@@ -107,6 +131,11 @@ private:
|
|||||||
return m_brightnessOverlayHandle;
|
return m_brightnessOverlayHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vr::VROverlayHandle_t getColorOverlayHandle()
|
||||||
|
{
|
||||||
|
return m_colorOverlayHandle;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
float brightnessOpacityValue() const;
|
float brightnessOpacityValue() const;
|
||||||
// inverse of brightnessValue
|
// inverse of brightnessValue
|
||||||
@@ -114,15 +143,18 @@ public:
|
|||||||
bool brightnessEnabled() const;
|
bool brightnessEnabled() const;
|
||||||
|
|
||||||
// Color overlay Getters
|
// Color overlay Getters
|
||||||
bool colorEnabled() const;
|
bool colorOverlayEnabled() const;
|
||||||
float colorRed() const;
|
float colorRed() const;
|
||||||
float colorGreen() const;
|
float colorGreen() const;
|
||||||
float colorBlue() const;
|
float colorBlue() const;
|
||||||
|
|
||||||
|
float colorOverlayOpacity() const;
|
||||||
|
|
||||||
bool allowSupersampleOverride() const;
|
bool allowSupersampleOverride() const;
|
||||||
float superSampling() const;
|
float superSampling() const;
|
||||||
bool motionSmoothing() const;
|
bool motionSmoothing() const;
|
||||||
bool allowSupersampleFiltering() const;
|
bool allowSupersampleFiltering() const;
|
||||||
|
bool isOverlayMethodActive() const;
|
||||||
|
|
||||||
void initStage1();
|
void initStage1();
|
||||||
void eventLoopTick();
|
void eventLoopTick();
|
||||||
@@ -135,19 +167,31 @@ public:
|
|||||||
Q_INVOKABLE QString getVideoProfileName( unsigned index );
|
Q_INVOKABLE QString getVideoProfileName( unsigned index );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setBrightnessEnabled( bool value, bool notify = true );
|
void setBrightnessEnabled( bool value,
|
||||||
|
bool notify = true,
|
||||||
|
bool keepValue = false );
|
||||||
void setBrightnessValue( float percvalue, bool notify = true );
|
void setBrightnessValue( float percvalue, bool notify = true );
|
||||||
|
|
||||||
void setSuperSampling( float value, bool notify = true );
|
void setSuperSampling( float value, bool notify = true );
|
||||||
void setAllowSupersampleOverride( bool value, bool notify = true );
|
void setAllowSupersampleOverride( bool value, bool notify = true );
|
||||||
// Color overlay Setters
|
// Color overlay Setters
|
||||||
void setColorRed( float value, bool notify = true );
|
void setColorRed( float value, bool notify = true, bool keepValue = false );
|
||||||
void setColorGreen( float value, bool notify = true );
|
void setColorGreen( float value,
|
||||||
void setColorBlue( float value, bool notify = true );
|
bool notify = true,
|
||||||
|
bool keepValue = false );
|
||||||
|
void
|
||||||
|
setColorBlue( float value, bool notify = true, bool keepValue = false );
|
||||||
|
|
||||||
|
void setColorOverlayEnabled( bool value,
|
||||||
|
bool notify = true,
|
||||||
|
bool keepValue = false );
|
||||||
|
void setColorOverlayOpacity( float value, bool notify = true );
|
||||||
|
|
||||||
void setMotionSmoothing( bool value, bool notify = true );
|
void setMotionSmoothing( bool value, bool notify = true );
|
||||||
void setAllowSupersampleFiltering( bool value, bool notify = true );
|
void setAllowSupersampleFiltering( bool value, bool notify = true );
|
||||||
|
|
||||||
|
void setIsOverlayMethodActive( bool value, bool notify = true );
|
||||||
|
|
||||||
void addVideoProfile( QString name );
|
void addVideoProfile( QString name );
|
||||||
void applyVideoProfile( unsigned index );
|
void applyVideoProfile( unsigned index );
|
||||||
void deleteVideoProfile( unsigned index );
|
void deleteVideoProfile( unsigned index );
|
||||||
@@ -158,6 +202,10 @@ signals:
|
|||||||
void colorRedChanged( float value );
|
void colorRedChanged( float value );
|
||||||
void colorGreenChanged( float value );
|
void colorGreenChanged( float value );
|
||||||
void colorBlueChanged( float value );
|
void colorBlueChanged( float value );
|
||||||
|
void isOverlayMethodActiveChanged( bool value );
|
||||||
|
|
||||||
|
void colorOverlayEnabledChanged( bool value );
|
||||||
|
void colorOverlayOpacityChanged( float value );
|
||||||
|
|
||||||
void superSamplingChanged( float value );
|
void superSamplingChanged( float value );
|
||||||
void allowSupersampleOverrideChanged( bool value );
|
void allowSupersampleOverrideChanged( bool value );
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include "FrameRateUtils.h"
|
||||||
|
#include <easylogging++.h>
|
||||||
|
|
||||||
|
namespace utils
|
||||||
|
{
|
||||||
|
/* Adjusts update rate for event loop ticks so that regardless of ticks we
|
||||||
|
* maintain the approximate same time value for the updates, if Key is not set
|
||||||
|
* in SteamVR we assume HMD is @ 90 hz
|
||||||
|
* */
|
||||||
|
unsigned int adjustUpdateRate( const unsigned int baseRefreshKey )
|
||||||
|
{
|
||||||
|
double updateRate;
|
||||||
|
vr::EVRSettingsError vrSettingsError;
|
||||||
|
updateRate = static_cast<double>(
|
||||||
|
vr::VRSettings()->GetInt32( vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_PreferredRefreshRate,
|
||||||
|
&vrSettingsError ) );
|
||||||
|
|
||||||
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
|
{
|
||||||
|
LOG( WARNING ) << "Could not read \""
|
||||||
|
<< vr::k_pch_SteamVR_PreferredRefreshRate
|
||||||
|
<< "\" setting: "
|
||||||
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
|
vrSettingsError );
|
||||||
|
return baseRefreshKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assume Base 90 hz Refresh
|
||||||
|
double multiplier = updateRate / 90.0;
|
||||||
|
unsigned int adjustedRefreshKey = static_cast<unsigned int>(
|
||||||
|
static_cast<double>( baseRefreshKey ) * multiplier );
|
||||||
|
if ( adjustedRefreshKey < 45 )
|
||||||
|
{
|
||||||
|
return baseRefreshKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
return adjustedRefreshKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end namespace utils
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <openvr.h>
|
||||||
|
|
||||||
|
namespace utils
|
||||||
|
{
|
||||||
|
unsigned int adjustUpdateRate( const unsigned int keyvalue );
|
||||||
|
|
||||||
|
} // end namespace utils
|
||||||
Reference in New Issue
Block a user