Ssbugs, removal of re-vive, and dashboard loop tick (#277)

* minor changes

* debugging testing

* removed un-needed log calls

* moved some logic to run only when dashboard is active

* fixed linker error

* added casting

* removed revive tab

* removed stray revive reference

* removed revive from sources

* fixed misc formatting issues

* added newline
This commit is contained in:
ykeara
2019-08-22 13:40:48 -05:00
committed by GitHub
parent 1b5e092cc2
commit 746aa23207
18 changed files with 108 additions and 2834 deletions
-1
View File
@@ -26,7 +26,6 @@ DISTFILES += \
src/res/qml/motion_page/snap_turn/* \ src/res/qml/motion_page/snap_turn/* \
src/res/qml/motion_page/space_drag/* \ src/res/qml/motion_page/space_drag/* \
src/res/qml/motion_page/space_turn/* \ src/res/qml/motion_page/space_turn/* \
src/res/qml/RevivePage.qml \
src/res/qml/RootPage.qml \ src/res/qml/RootPage.qml \
src/res/qml/SettingsPage.qml \ src/res/qml/SettingsPage.qml \
src/res/qml/StatisticsPage.qml \ src/res/qml/StatisticsPage.qml \
-2
View File
@@ -7,7 +7,6 @@ SOURCES += src/main.cpp\
src/tabcontrollers/SettingsTabController.cpp \ src/tabcontrollers/SettingsTabController.cpp \
src/tabcontrollers/StatisticsTabController.cpp \ src/tabcontrollers/StatisticsTabController.cpp \
src/tabcontrollers/SteamVRTabController.cpp \ src/tabcontrollers/SteamVRTabController.cpp \
src/tabcontrollers/ReviveTabController.cpp \
src/tabcontrollers/UtilitiesTabController.cpp \ src/tabcontrollers/UtilitiesTabController.cpp \
src/tabcontrollers/PttController.cpp \ src/tabcontrollers/PttController.cpp \
src/tabcontrollers/VideoTabController.cpp \ src/tabcontrollers/VideoTabController.cpp \
@@ -28,7 +27,6 @@ HEADERS += src/overlaycontroller.h \
src/tabcontrollers/SettingsTabController.h \ src/tabcontrollers/SettingsTabController.h \
src/tabcontrollers/StatisticsTabController.h \ src/tabcontrollers/StatisticsTabController.h \
src/tabcontrollers/SteamVRTabController.h \ src/tabcontrollers/SteamVRTabController.h \
src/tabcontrollers/ReviveTabController.h \
src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/UtilitiesTabController.h \
src/tabcontrollers/VideoTabController.h \ src/tabcontrollers/VideoTabController.h \
src/tabcontrollers/AudioManager.h \ src/tabcontrollers/AudioManager.h \
+7 -17
View File
@@ -137,8 +137,6 @@ OverlayController::OverlayController( bool desktopMode,
m_moveCenterTabController.initStage1(); m_moveCenterTabController.initStage1();
m_audioTabController.initStage1(); m_audioTabController.initStage1();
m_settingsTabController.initStage1(); m_settingsTabController.initStage1();
m_reviveTabController.initStage1(
m_settingsTabController.forceRevivePage() );
m_utilitiesTabController.initStage1(); m_utilitiesTabController.initStage1();
m_videoTabController.initStage1(); m_videoTabController.initStage1();
@@ -250,16 +248,6 @@ OverlayController::OverlayController( bool desktopMode,
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
return obj; return obj;
} ); } );
qmlRegisterSingletonType<SteamVRTabController>(
qmlSingletonImportName,
1,
0,
"ReviveTabController",
[]( QQmlEngine*, QJSEngine* ) {
QObject* obj = &( objectAddress->m_reviveTabController );
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
return obj;
} );
qmlRegisterSingletonType<SteamVRTabController>( qmlRegisterSingletonType<SteamVRTabController>(
qmlSingletonImportName, qmlSingletonImportName,
1, 1,
@@ -488,7 +476,6 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
m_audioTabController.initStage2(); m_audioTabController.initStage2();
m_statisticsTabController.initStage2( this ); m_statisticsTabController.initStage2( this );
m_settingsTabController.initStage2( this ); m_settingsTabController.initStage2( this );
m_reviveTabController.initStage2( this );
m_utilitiesTabController.initStage2( this ); m_utilitiesTabController.initStage2( this );
m_moveCenterTabController.initStage2( this ); m_moveCenterTabController.initStage2( this );
} }
@@ -1055,16 +1042,19 @@ void OverlayController::mainEventLoop()
m_moveCenterTabController.eventLoopTick( m_moveCenterTabController.eventLoopTick(
vr::VRCompositor()->GetTrackingSpace(), devicePoses ); vr::VRCompositor()->GetTrackingSpace(), devicePoses );
m_utilitiesTabController.eventLoopTick(); m_utilitiesTabController.eventLoopTick();
m_fixFloorTabController.eventLoopTick( devicePoses );
m_statisticsTabController.eventLoopTick( m_statisticsTabController.eventLoopTick(
devicePoses, leftSpeed, rightSpeed ); devicePoses, leftSpeed, rightSpeed );
m_steamVRTabController.eventLoopTick();
m_chaperoneTabController.eventLoopTick( m_chaperoneTabController.eventLoopTick(
devicePoses, leftSpeed, rightSpeed, hmdSpeed ); devicePoses, leftSpeed, rightSpeed, hmdSpeed );
m_settingsTabController.eventLoopTick();
m_reviveTabController.eventLoopTick();
m_audioTabController.eventLoopTick(); m_audioTabController.eventLoopTick();
if ( vr::VROverlay()->IsDashboardVisible() )
{
m_settingsTabController.dashboardLoopTick();
m_steamVRTabController.dashboardLoopTick();
m_fixFloorTabController.dashboardLoopTick( devicePoses );
}
if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid ) if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid )
{ {
while ( vr::VROverlay()->PollNextOverlayEvent( while ( vr::VROverlay()->PollNextOverlayEvent(
-3
View File
@@ -35,7 +35,6 @@
#include "tabcontrollers/AudioTabController.h" #include "tabcontrollers/AudioTabController.h"
#include "tabcontrollers/StatisticsTabController.h" #include "tabcontrollers/StatisticsTabController.h"
#include "tabcontrollers/SettingsTabController.h" #include "tabcontrollers/SettingsTabController.h"
#include "tabcontrollers/ReviveTabController.h"
#include "tabcontrollers/UtilitiesTabController.h" #include "tabcontrollers/UtilitiesTabController.h"
#include "tabcontrollers/VideoTabController.h" #include "tabcontrollers/VideoTabController.h"
@@ -65,7 +64,6 @@ namespace advsettings
constexpr int k_audioSettingsUpdateCounter = 89; constexpr int k_audioSettingsUpdateCounter = 89;
constexpr int k_chaperoneSettingsUpdateCounter = 101; constexpr int k_chaperoneSettingsUpdateCounter = 101;
constexpr int k_moveCenterSettingsUpdateCounter = 83; constexpr int k_moveCenterSettingsUpdateCounter = 83;
constexpr int k_reviveSettingsUpdateCounter = 139;
constexpr int k_settingsTabSettingsUpdateCounter = 157; constexpr int k_settingsTabSettingsUpdateCounter = 157;
constexpr int k_steamVrSettingsUpdateCounter = 97; constexpr int k_steamVrSettingsUpdateCounter = 97;
constexpr int k_utilitiesSettingsUpdateCounter = 19; constexpr int k_utilitiesSettingsUpdateCounter = 19;
@@ -131,7 +129,6 @@ public: // I know it's an ugly hack to make them public to enable external
AudioTabController m_audioTabController; AudioTabController m_audioTabController;
StatisticsTabController m_statisticsTabController; StatisticsTabController m_statisticsTabController;
SettingsTabController m_settingsTabController; SettingsTabController m_settingsTabController;
ReviveTabController m_reviveTabController;
UtilitiesTabController m_utilitiesTabController; UtilitiesTabController m_utilitiesTabController;
VideoTabController m_videoTabController; VideoTabController m_videoTabController;
overlay::DesktopOverlay m_desktopOverlay; overlay::DesktopOverlay m_desktopOverlay;
File diff suppressed because it is too large Load Diff
-18
View File
@@ -103,18 +103,6 @@ MyStackViewPage {
} }
} }
MyPushButton {
id: reviveButton
activationSoundEnabled: false
text: "Revive"
Layout.fillWidth: true
visible: SettingsTabController.forceRevivePage ? true : ReviveTabController.isOverlayInstalled
onClicked: {
MyResources.playFocusChangedSound()
mainView.push(revivePage)
}
}
MyPushButton { MyPushButton {
id: utilitiesButton id: utilitiesButton
activationSoundEnabled: false activationSoundEnabled: false
@@ -467,12 +455,6 @@ MyStackViewPage {
} }
} }
Connections {
target: SettingsTabController
onForceRevivePageChanged: {
reviveButton.visible = SettingsTabController.forceRevivePage ? true : ReviveTabController.isOverlayInstalled
}
}
function updateStatistics() { function updateStatistics() {
var rotations = StatisticsTabController.hmdRotations var rotations = StatisticsTabController.hmdRotations
-12
View File
@@ -18,14 +18,6 @@ MyStackViewPage {
} }
} }
MyToggleButton {
id: forceReviveToggle
text: "Force Revive Page"
onCheckedChanged: {
SettingsTabController.setForceRevivePage(checked, true)
}
}
MyToggleButton { MyToggleButton {
id: allowExternalEditsToggle id: allowExternalEditsToggle
text: "Allow External App Chaperone Edits (Danger)" text: "Allow External App Chaperone Edits (Danger)"
@@ -111,7 +103,6 @@ MyStackViewPage {
Component.onCompleted: { Component.onCompleted: {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
forceReviveToggle.checked = SettingsTabController.forceRevivePage
allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits
oldStyleMotionToggle.checked = MoveCenterTabController.oldStyleMotion oldStyleMotionToggle.checked = MoveCenterTabController.oldStyleMotion
@@ -129,9 +120,6 @@ MyStackViewPage {
onAutoStartEnabledChanged: { onAutoStartEnabledChanged: {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
} }
onForceRevivePageChanged: {
forceReviveToggle.checked = SettingsTabController.forceRevivePage
}
} }
Connections { Connections {
+10 -9
View File
@@ -200,12 +200,10 @@ MyStackViewPage {
value: 1.0 value: 1.0
snapMode: Slider.SnapAlways snapMode: Slider.SnapAlways
Layout.fillWidth: true Layout.fillWidth: true
onPositionChanged: {
var val = this.from + ( this.position * (this.to - this.from))
steamvrSupersamplingText.text = val.toFixed(1)
}
onValueChanged: { onValueChanged: {
SteamVRTabController.setSuperSampling(this.value.toFixed(1), false) var val = this.value
steamvrSupersamplingText.text = val.toFixed(1)
SteamVRTabController.setSuperSampling(this.value.toFixed(1), true)
} }
} }
@@ -244,9 +242,11 @@ MyStackViewPage {
} }
MyToggleButton { MyToggleButton {
id: steamvrAllowSupersampleOverrideToggle id: steamvrAllowSupersampleOverrideToggle
text: "Enable Manual Supersampling Override" text: "Enable Manual Supersampling Override: (refresh dashboard to take effect)"
onCheckedChanged: { onCheckedChanged: {
SteamVRTabController.setAllowSupersampleOverride(this.checked, false) SteamVRTabController.setAllowSupersampleOverride(this.checked, false)
SteamVRTabController.setSuperSampling(steamvrSupersamplingSlider.value, true)
steamvrSupersamplingText.text = SteamVRTabController.superSampling.toFixed(1)
if(!this.checked){ if(!this.checked){
steamvrSupersamplingText.enabled = false steamvrSupersamplingText.enabled = false
steamvrSupersamplingSlider.enabled = false steamvrSupersamplingSlider.enabled = false
@@ -333,13 +333,14 @@ MyStackViewPage {
target: SteamVRTabController target: SteamVRTabController
onSuperSamplingChanged: { onSuperSamplingChanged: {
var s1 = SteamVRTabController.superSampling.toFixed(1) var s1 = SteamVRTabController.superSampling.toFixed(1)
if (s1 <= steamvrSupersamplingSlider.to && Math.abs(steamvrSupersamplingSlider.value-s1) > 0.08) { steamvrSupersamplingSlider.value = s1
steamvrSupersamplingSlider.value = s1
}
steamvrSupersamplingText.text = s1 steamvrSupersamplingText.text = s1
} }
onAllowSupersampleOverrideChanged: { onAllowSupersampleOverrideChanged: {
steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride
var s1 = SteamVRTabController.superSampling.toFixed(1)
steamvrSupersamplingSlider.value = s1
steamvrSupersamplingText.text = s1
} }
onAllowSupersampleFilteringChanged: { onAllowSupersampleFilteringChanged: {
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
-5
View File
@@ -64,11 +64,6 @@ Rectangle {
visible: false visible: false
} }
property RevivePage revivePage: RevivePage {
stackView: mainView
visible: false
}
property UtilitiesPage utilitiesPage: UtilitiesPage { property UtilitiesPage utilitiesPage: UtilitiesPage {
stackView: mainView stackView: mainView
visible: false visible: false
+1 -1
View File
@@ -10,7 +10,7 @@ void FixFloorTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent; this->parent = var_parent;
} }
void FixFloorTabController::eventLoopTick( void FixFloorTabController::dashboardLoopTick(
vr::TrackedDevicePose_t* devicePoses ) vr::TrackedDevicePose_t* devicePoses )
{ {
if ( state > 0 ) if ( state > 0 )
@@ -56,6 +56,7 @@ public:
void initStage2( OverlayController* parent ); void initStage2( OverlayController* parent );
void eventLoopTick( vr::TrackedDevicePose_t* devicePoses ); void eventLoopTick( vr::TrackedDevicePose_t* devicePoses );
void dashboardLoopTick( vr::TrackedDevicePose_t* devicePoses );
Q_INVOKABLE QString currentStatusMessage(); Q_INVOKABLE QString currentStatusMessage();
Q_INVOKABLE float currentStatusMessageTimeout(); Q_INVOKABLE float currentStatusMessageTimeout();
File diff suppressed because it is too large Load Diff
-199
View File
@@ -1,199 +0,0 @@
#pragma once
#include <QObject>
class QQuickWindow;
// application namespace
namespace advsettings
{
// forward declaration
class OverlayController;
struct ReviveControllerProfile
{
std::string profileName;
int gripButtonMode;
bool triggerAsGrip;
float thumbDeadzone;
float thumbRange;
float touchPitch;
float touchYaw;
float touchRoll;
float touchX;
float touchY;
float touchZ;
};
class ReviveTabController : public QObject
{
Q_OBJECT
Q_PROPERTY( int isOverlayInstalled READ isOverlayInstalled NOTIFY
isOverlayInstalledChanged )
Q_PROPERTY( int gripButtonMode READ gripButtonMode WRITE setGripButtonMode
NOTIFY gripButtonModeChanged )
Q_PROPERTY( int triggerAsGrip READ triggerAsGrip WRITE setTriggerAsGrip
NOTIFY triggerAsGripChanged )
Q_PROPERTY( bool pixelsPerDisplayPixelOverrideEnabled READ
isPixelsPerDisplayPixelOverrideEnabled WRITE
setPixelsPerDisplayPixelOverrideEnabled NOTIFY
pixelsPerDisplayPixelOverrideEnabledChanged )
Q_PROPERTY( float toggleDelay READ toggleDelay WRITE setToggleDelay NOTIFY
toggleDelayChanged )
Q_PROPERTY(
float pixelsPerDisplayPixelOverride READ pixelsPerDisplayPixelOverride
WRITE setPixelsPerDisplayPixelOverride NOTIFY
pixelsPerDisplayPixelOverrideChanged )
Q_PROPERTY( float thumbDeadzone READ thumbDeadzone WRITE setThumbDeadzone
NOTIFY thumbDeadzoneChanged )
Q_PROPERTY( float thumbRange READ thumbRange WRITE setThumbRange NOTIFY
thumbRangeChanged )
Q_PROPERTY( float touchPitch READ touchPitch WRITE setTouchPitch NOTIFY
touchPitchChanged )
Q_PROPERTY(
float touchYaw READ touchYaw WRITE setTouchYaw NOTIFY touchYawChanged )
Q_PROPERTY( float touchRoll READ touchRoll WRITE setTouchRoll NOTIFY
touchRollChanged )
Q_PROPERTY( float touchX READ touchX WRITE setTouchX NOTIFY touchXChanged )
Q_PROPERTY( float touchY READ touchY WRITE setTouchY NOTIFY touchYChanged )
Q_PROPERTY( float touchZ READ touchZ WRITE setTouchZ NOTIFY touchZChanged )
Q_PROPERTY( float piPlayerHeight READ piPlayerHeight WRITE setPiPlayerHeight
NOTIFY piPlayerHeightChanged )
Q_PROPERTY( float piEyeHeight READ piEyeHeight WRITE setPiEyeHeight NOTIFY
piEyeHeightChanged )
Q_PROPERTY( QString piUsername READ piUsername WRITE setPiUsername NOTIFY
piUsernameChanged )
Q_PROPERTY(
QString piName READ piName WRITE setPiName NOTIFY piNameChanged )
Q_PROPERTY(
int piGender READ piGender WRITE setPiGender NOTIFY piGenderChanged )
private:
OverlayController* parent;
bool m_isOverlayInstalled = false;
int m_gripButtonMode = 0;
float m_toggleDelay = 0.5f;
bool m_triggerAsGrip = false;
bool m_pixelsPerDisplayPixelOverrideEnabled = false;
float m_pixelsPerDisplayPixelOverride = 1.0f;
float m_thumbDeadzone = 0.3f;
float m_thumbRange = 2.0f;
float m_touchPitch = -28.0f;
float m_touchYaw = 0.0f;
float m_touchRoll = -14.0f;
float m_touchX = 0.016f;
float m_touchY = -0.036f;
float m_touchZ = 0.016f;
float m_piPlayerHeight = 1.778f;
float m_piEyeHeight = 1.675f;
QString m_piUsername = "";
QString m_piName = "";
int m_piGender = 0; // 0 .. Unknown, 1 .. Male, 2 .. Female
unsigned settingsUpdateCounter = 0;
std::vector<ReviveControllerProfile> controllerProfiles;
public:
void initStage1( bool forceRevivePage );
void initStage2( OverlayController* parent );
void eventLoopTick();
bool isOverlayInstalled() const;
int gripButtonMode() const;
bool triggerAsGrip() const;
float toggleDelay() const;
bool isPixelsPerDisplayPixelOverrideEnabled() const;
float pixelsPerDisplayPixelOverride() const;
float thumbDeadzone() const;
float thumbRange() const;
float touchPitch() const;
float touchYaw() const;
float touchRoll() const;
float touchX() const;
float touchY() const;
float touchZ() const;
float piPlayerHeight() const;
float piEyeHeight() const;
const QString& piUsername() const;
const QString& piName() const;
int piGender() const; // 0 .. Unknown, 1 .. Male, 2 .. Female
Q_INVOKABLE float getCurrentHMDHeight();
void reloadControllerProfiles();
void saveControllerProfiles();
Q_INVOKABLE unsigned getControllerProfileCount();
Q_INVOKABLE QString getControllerProfileName( unsigned index );
public slots:
void setGripButtonMode( int value, bool notify = true );
void setTriggerAsGrip( bool value, bool notify = true );
void setToggleDelay( float value, bool notify = true );
void setPixelsPerDisplayPixelOverrideEnabled( bool value,
bool notify = true );
void setPixelsPerDisplayPixelOverride( float value, bool notify = true );
void setThumbDeadzone( float value, bool notify = true );
void setThumbRange( float value, bool notify = true );
void setTouchPitch( float value, bool notify = true );
void setTouchYaw( float value, bool notify = true );
void setTouchRoll( float value, bool notify = true );
void setTouchX( float value, bool notify = true );
void setTouchY( float value, bool notify = true );
void setTouchZ( float value, bool notify = true );
void setPiPlayerHeight( float value, bool notify = true );
void setPiEyeHeight( float value, bool notify = true );
void setPiUsername( const QString& value, bool notify = true );
void setPiName( const QString& value, bool notify = true );
void setPiGender( int value,
bool notify
= true ); // 0 .. Unknown, 1 .. Male, 2 .. Female
void addControllerProfile( QString name );
void applyControllerProfile( unsigned index );
void deleteControllerProfile( unsigned index );
void reset();
signals:
void isOverlayInstalledChanged( bool value );
void gripButtonModeChanged( int value );
void triggerAsGripChanged( bool value );
void toggleDelayChanged( float value );
void pixelsPerDisplayPixelOverrideEnabledChanged( bool value );
void pixelsPerDisplayPixelOverrideChanged( float value );
void thumbDeadzoneChanged( float value );
void thumbRangeChanged( float value );
void touchPitchChanged( float value );
void touchYawChanged( float value );
void touchRollChanged( float value );
void touchXChanged( float value );
void touchYChanged( float value );
void touchZChanged( float value );
void piPlayerHeightChanged( float value );
void piEyeHeightChanged( float value );
void piUsernameChanged( const QString& value );
void piNameChanged( const QString& value );
void piGenderChanged( int value );
void controllerProfilesUpdated();
};
} // namespace advsettings
+3 -36
View File
@@ -9,14 +9,6 @@ void SettingsTabController::initStage1()
{ {
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch( m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(
application_strings::applicationKey ); application_strings::applicationKey );
auto settings = OverlayController::appSettings();
settings->beginGroup( "applicationSettings" );
auto value = settings->value( "forceRevivePage", m_forceRevivePage );
settings->endGroup();
if ( value.isValid() && !value.isNull() )
{
m_forceRevivePage = value.toBool();
}
} }
void SettingsTabController::initStage2( OverlayController* var_parent ) void SettingsTabController::initStage2( OverlayController* var_parent )
@@ -24,15 +16,12 @@ void SettingsTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent; this->parent = var_parent;
} }
void SettingsTabController::eventLoopTick() void SettingsTabController::dashboardLoopTick()
{ {
if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter ) if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter )
{ {
if ( parent->isDashboardVisible() ) setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
{ application_strings::applicationKey ) );
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
application_strings::applicationKey ) );
}
settingsUpdateCounter = 0; settingsUpdateCounter = 0;
} }
else else
@@ -66,26 +55,4 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify )
} }
} }
bool SettingsTabController::forceRevivePage() const
{
return m_forceRevivePage;
}
void SettingsTabController::setForceRevivePage( bool value, bool notify )
{
if ( m_forceRevivePage != value )
{
m_forceRevivePage = value;
auto settings = OverlayController::appSettings();
settings->beginGroup( "applicationSettings" );
settings->setValue( "forceRevivePage", m_forceRevivePage );
settings->endGroup();
settings->sync();
if ( notify )
{
emit forceRevivePageChanged( m_forceRevivePage );
}
}
}
} // namespace advsettings } // namespace advsettings
+1 -7
View File
@@ -15,8 +15,6 @@ class SettingsTabController : public QObject
Q_OBJECT Q_OBJECT
Q_PROPERTY( bool autoStartEnabled READ autoStartEnabled WRITE Q_PROPERTY( bool autoStartEnabled READ autoStartEnabled WRITE
setAutoStartEnabled NOTIFY autoStartEnabledChanged ) setAutoStartEnabled NOTIFY autoStartEnabledChanged )
Q_PROPERTY( bool forceRevivePage READ forceRevivePage WRITE
setForceRevivePage NOTIFY forceRevivePageChanged )
private: private:
OverlayController* parent; OverlayController* parent;
@@ -24,24 +22,20 @@ private:
unsigned settingsUpdateCounter = 0; unsigned settingsUpdateCounter = 0;
bool m_autoStartEnabled = false; bool m_autoStartEnabled = false;
bool m_forceRevivePage = false;
public: public:
void initStage1(); void initStage1();
void initStage2( OverlayController* parent ); void initStage2( OverlayController* parent );
void eventLoopTick(); void dashboardLoopTick();
bool autoStartEnabled() const; bool autoStartEnabled() const;
bool forceRevivePage() const;
public slots: public slots:
void setAutoStartEnabled( bool value, bool notify = true ); void setAutoStartEnabled( bool value, bool notify = true );
void setForceRevivePage( bool value, bool notify = true );
signals: signals:
void autoStartEnabledChanged( bool value ); void autoStartEnabledChanged( bool value );
void forceRevivePageChanged( bool value );
}; };
} // namespace advsettings } // namespace advsettings
+84 -91
View File
@@ -9,7 +9,7 @@ void SteamVRTabController::initStage1()
{ {
initMotionSmoothing(); initMotionSmoothing();
initSupersampleOverride(); initSupersampleOverride();
eventLoopTick(); dashboardLoopTick();
reloadSteamVRProfiles(); reloadSteamVRProfiles();
} }
@@ -18,105 +18,98 @@ void SteamVRTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent; this->parent = var_parent;
} }
void SteamVRTabController::eventLoopTick() void SteamVRTabController::dashboardLoopTick()
{ {
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter ) if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
{ {
if ( parent->isDashboardVisible() ) 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::EVRSettingsError vrSettingsError; LOG( WARNING ) << "Could not read \""
// checks supersampling override and resynchs if necessry << vr::k_pch_SteamVR_SupersampleManualOverride_Bool
// also prints error if can't find. << "\" setting: "
auto sso = vr::VRSettings()->GetBool( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vr::k_pch_SteamVR_Section, vrSettingsError );
vr::k_pch_SteamVR_SupersampleManualOverride_Bool, }
&vrSettingsError ); setAllowSupersampleOverride( sso );
if ( vrSettingsError != vr::VRSettingsError_None ) // 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( WARNING ) LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
<< "Could not read \"" "supersampling value: "
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool << m_superSampling;
<< "\" setting: " setSuperSampling( 1.0 );
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
} }
setAllowSupersampleOverride( sso ); }
// checks supersampling and re-synchs if necessary else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
auto ss = vr::VRSettings()->GetFloat( {
vr::k_pch_SteamVR_Section, LOG( INFO ) << "OpenVR reports a changed supersampling value: "
vr::k_pch_SteamVR_SupersampleScale_Float, << m_superSampling << " => " << ss;
&vrSettingsError ); setSuperSampling( ss );
if ( vrSettingsError != vr::VRSettingsError_None ) }
{ // checks if Supersampling filter is on and changes if it has been
LOG( WARNING ) // changed elsewhere
<< "Could not read \"" auto sf = vr::VRSettings()->GetBool(
<< vr::k_pch_SteamVR_SupersampleScale_Float vr::k_pch_SteamVR_Section,
<< "\" setting: " vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( &vrSettingsError );
vrSettingsError ); if ( vrSettingsError != vr::VRSettingsError_None )
if ( m_superSampling != 1.0f ) {
{ LOG( WARNING ) << "Could not read \""
LOG( DEBUG ) << vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "OpenVR returns an error and we have a custom " << "\" setting: "
"supersampling value: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(
<< m_superSampling; vrSettingsError );
setSuperSampling( 1.0 ); }
} setAllowSupersampleFiltering( sf );
}
else if ( m_superSampling != ss )
{
LOG( DEBUG ) << "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 // Checks if Motion smoothing setting can be read and synchs adv
// settings to steamvr/openvr // settings to steamvr/openvr
auto ms = vr::VRSettings()->GetBool( auto ms
vr::k_pch_SteamVR_Section, = vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool, vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) LOG( WARNING ) << "Could not read \""
<< "Could not read \"" << vr::k_pch_SteamVR_MotionSmoothing_Bool
<< vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
setMotionSmoothing( ms ); setMotionSmoothing( ms );
// Checks and synchs performance graph // Checks and synchs performance graph
auto pg auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
= vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool, vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) LOG( WARNING ) << "Could not read \""
<< "Could not read \"" << vr::k_pch_Perf_PerfGraphInHMD_Bool << vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
}
setPerformanceGraph( pg );
} }
setPerformanceGraph( pg );
settingsUpdateCounter = 0; settingsUpdateCounter = 0;
} }
else else
@@ -310,9 +303,9 @@ void SteamVRTabController::setSuperSampling( float value, const bool notify )
{ {
bool override = false; bool override = false;
// Mirrors Desktop Clamp // Mirrors Desktop Clamp
if ( value <= 0.2f ) if ( value < 0.2f )
{ {
LOG( WARNING ) << "Encountered a supersampling value <= 0.01, setting " LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0"; "supersampling to 1.0";
value = 1.0f; value = 1.0f;
override = true; override = true;
@@ -63,6 +63,7 @@ public:
void initStage2( OverlayController* parent ); void initStage2( OverlayController* parent );
void eventLoopTick(); void eventLoopTick();
void dashboardLoopTick();
float superSampling() const; float superSampling() const;
bool motionSmoothing() const; bool motionSmoothing() const;
@@ -113,8 +113,6 @@ void VideoTabController::reloadVideoConfig()
setColorGreen( settings->value( "colorGreen", 0.0f ).toFloat() ); setColorGreen( settings->value( "colorGreen", 0.0f ).toFloat() );
setColorBlue( settings->value( "colorBlue", 0.0f ).toFloat() ); setColorBlue( settings->value( "colorBlue", 0.0f ).toFloat() );
settings->endGroup(); settings->endGroup();
LOG( INFO ) << "bright opacityValue: " << m_brightnessOpacityValue
<< " REd value is: " << m_colorRed;
setBrightnessOpacityValue(); setBrightnessOpacityValue();
loadColorOverlay(); loadColorOverlay();
settings->sync(); settings->sync();