Fixed Synchro Bug 5.2.0 release (#470)
* fixed synch bug * refactored chaperone tab controller for better ui synching/updated * refactored steamvr tab controller * refactored video tab controller * cleanup * update version strings fix implicit conversions
This commit is contained in:
@@ -1 +1 @@
|
|||||||
5.1.2-dev
|
5.2.0-release
|
||||||
@@ -491,6 +491,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
|
|||||||
m_utilitiesTabController.initStage2( this );
|
m_utilitiesTabController.initStage2( this );
|
||||||
m_moveCenterTabController.initStage2( this );
|
m_moveCenterTabController.initStage2( this );
|
||||||
m_rotationTabController.initStage2( this );
|
m_rotationTabController.initStage2( this );
|
||||||
|
m_videoTabController.initStage2();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayController::OnRenderRequest()
|
void OverlayController::OnRenderRequest()
|
||||||
@@ -918,6 +919,7 @@ void OverlayController::OnTimeoutPumpEvents()
|
|||||||
{
|
{
|
||||||
mainEventLoop();
|
mainEventLoop();
|
||||||
m_customTickRateCounter = 0;
|
m_customTickRateCounter = 0;
|
||||||
|
updateRate.incrementCounter();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -938,6 +940,7 @@ void OverlayController::OnTimeoutPumpEvents()
|
|||||||
// main event loop. (this function should trigger about every 11ms
|
// main event loop. (this function should trigger about every 11ms
|
||||||
// assuming 90fps compositor)
|
// assuming 90fps compositor)
|
||||||
mainEventLoop();
|
mainEventLoop();
|
||||||
|
updateRate.incrementCounter();
|
||||||
|
|
||||||
// wait for the next frame after executing our main event loop once.
|
// wait for the next frame after executing our main event loop once.
|
||||||
m_lastFrame = m_currentFrame;
|
m_lastFrame = m_currentFrame;
|
||||||
@@ -957,8 +960,6 @@ void OverlayController::OnTimeoutPumpEvents()
|
|||||||
m_vsyncTooLateCounter++;
|
m_vsyncTooLateCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRate.incrementCounter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayController::mainEventLoop()
|
void OverlayController::mainEventLoop()
|
||||||
|
|||||||
@@ -27,9 +27,8 @@ void ChaperoneTabController::initStage2( OverlayController* var_parent )
|
|||||||
{
|
{
|
||||||
this->parent = var_parent;
|
this->parent = var_parent;
|
||||||
|
|
||||||
updateChaperoneSettings(); // force one update of OVR saved settings to make
|
updateChaperoneSettings();
|
||||||
// sure our m_ variables are correct
|
|
||||||
// Force call Update Overlay Once, so Default state is in correct location
|
|
||||||
if ( m_centerMarkerOverlayIsInit )
|
if ( m_centerMarkerOverlayIsInit )
|
||||||
{
|
{
|
||||||
vr::HmdMatrix34_t temp = { { { 1.0f, 0.0f, 0.0f, 0.0f },
|
vr::HmdMatrix34_t temp = { { { 1.0f, 0.0f, 0.0f, 0.0f },
|
||||||
@@ -344,42 +343,22 @@ void ChaperoneTabController::eventLoopTick(
|
|||||||
|
|
||||||
void ChaperoneTabController::updateChaperoneSettings()
|
void ChaperoneTabController::updateChaperoneSettings()
|
||||||
{
|
{
|
||||||
setBoundsVisibility( static_cast<float>( chaperoneColorA() ) / 255.0f );
|
setBoundsVisibility( boundsVisibility() );
|
||||||
setFadeDistance( fadeDistance(), true );
|
setFadeDistance( fadeDistance(), true );
|
||||||
setCenterMarker( centerMarker() );
|
setCenterMarker( centerMarker() );
|
||||||
setPlaySpaceMarker( playSpaceMarker() );
|
setPlaySpaceMarker( playSpaceMarker() );
|
||||||
setChaperoneColorR( chaperoneColorR() );
|
setChaperoneColorR( chaperoneColorR() );
|
||||||
setChaperoneColorG( chaperoneColorG() );
|
setChaperoneColorG( chaperoneColorG() );
|
||||||
setChaperoneColorB( chaperoneColorB() );
|
setChaperoneColorB( chaperoneColorB() );
|
||||||
|
setChaperoneFloorToggle( chaperoneFloorToggle() );
|
||||||
setCollisionBoundStyle( collisionBoundStyle() );
|
setCollisionBoundStyle( collisionBoundStyle() );
|
||||||
}
|
setHeight( height() );
|
||||||
|
|
||||||
float ChaperoneTabController::boundsVisibility() const
|
|
||||||
{
|
|
||||||
return m_visibility;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChaperoneTabController::setBoundsVisibility( float value, bool notify )
|
void ChaperoneTabController::setBoundsVisibility( float value, bool notify )
|
||||||
{
|
{
|
||||||
if ( fabs( static_cast<double>( m_visibility - value ) ) > 0.005 )
|
setChaperoneColorA(
|
||||||
{
|
static_cast<int>( static_cast<float>( value ) * 255.0f ), notify );
|
||||||
if ( value <= 0.3f )
|
|
||||||
{
|
|
||||||
m_visibility = 0.3f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_visibility = value;
|
|
||||||
}
|
|
||||||
setChaperoneColorA( static_cast<int>( 255 * m_visibility ), notify );
|
|
||||||
ovr_overlay_wrapper::setOverlayAlpha(
|
|
||||||
m_chaperoneFloorOverlayHandle, m_visibility, "" );
|
|
||||||
|
|
||||||
if ( notify )
|
|
||||||
{
|
|
||||||
emit boundsVisibilityChanged( m_visibility );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float ChaperoneTabController::fadeDistance()
|
float ChaperoneTabController::fadeDistance()
|
||||||
@@ -391,7 +370,6 @@ float ChaperoneTabController::fadeDistance()
|
|||||||
"" );
|
"" );
|
||||||
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
m_fadeDistance = p.second;
|
|
||||||
return p.second;
|
return p.second;
|
||||||
}
|
}
|
||||||
return m_fadeDistance;
|
return m_fadeDistance;
|
||||||
@@ -470,7 +448,6 @@ bool ChaperoneTabController::centerMarker()
|
|||||||
"" );
|
"" );
|
||||||
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
m_centerMarker = p.second;
|
|
||||||
return p.second;
|
return p.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,7 +464,6 @@ void ChaperoneTabController::setCenterMarker( bool value, bool notify )
|
|||||||
vr::k_pch_CollisionBounds_CenterMarkerOn_Bool,
|
vr::k_pch_CollisionBounds_CenterMarkerOn_Bool,
|
||||||
m_centerMarker,
|
m_centerMarker,
|
||||||
"" );
|
"" );
|
||||||
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit centerMarkerChanged( m_centerMarker );
|
emit centerMarkerChanged( m_centerMarker );
|
||||||
@@ -504,7 +480,6 @@ bool ChaperoneTabController::playSpaceMarker()
|
|||||||
"" );
|
"" );
|
||||||
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
m_playSpaceMarker = p.second;
|
|
||||||
return p.second;
|
return p.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +506,8 @@ void ChaperoneTabController::setPlaySpaceMarker( bool value, bool notify )
|
|||||||
|
|
||||||
bool ChaperoneTabController::forceBounds() const
|
bool ChaperoneTabController::forceBounds() const
|
||||||
{
|
{
|
||||||
// todo ivrchaperonewrapper
|
// Currently th ere is no way to get from OVR if force bounds is on/off as
|
||||||
|
// of OVR 1.12.5
|
||||||
return m_forceBounds;
|
return m_forceBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,11 +584,10 @@ int ChaperoneTabController::chaperoneColorR()
|
|||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_ColorGammaR_Int32,
|
vr::k_pch_CollisionBounds_ColorGammaR_Int32,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return m_chaperoneColorR;
|
return p.second;
|
||||||
}
|
}
|
||||||
m_chaperoneColorR = p.second;
|
|
||||||
return m_chaperoneColorR;
|
return m_chaperoneColorR;
|
||||||
}
|
}
|
||||||
int ChaperoneTabController::chaperoneColorG()
|
int ChaperoneTabController::chaperoneColorG()
|
||||||
@@ -622,11 +597,10 @@ int ChaperoneTabController::chaperoneColorG()
|
|||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_ColorGammaG_Int32,
|
vr::k_pch_CollisionBounds_ColorGammaG_Int32,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return m_chaperoneColorG;
|
return p.second;
|
||||||
}
|
}
|
||||||
m_chaperoneColorG = p.second;
|
|
||||||
return m_chaperoneColorG;
|
return m_chaperoneColorG;
|
||||||
}
|
}
|
||||||
int ChaperoneTabController::chaperoneColorB()
|
int ChaperoneTabController::chaperoneColorB()
|
||||||
@@ -636,28 +610,42 @@ int ChaperoneTabController::chaperoneColorB()
|
|||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_ColorGammaB_Int32,
|
vr::k_pch_CollisionBounds_ColorGammaB_Int32,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return m_chaperoneColorB;
|
return p.second;
|
||||||
}
|
}
|
||||||
m_chaperoneColorB = p.second;
|
|
||||||
return m_chaperoneColorB;
|
return m_chaperoneColorB;
|
||||||
}
|
}
|
||||||
// aka transparancy
|
// aka transparancy
|
||||||
int ChaperoneTabController::chaperoneColorA() const
|
int ChaperoneTabController::chaperoneColorA()
|
||||||
{
|
{
|
||||||
std::pair<ovr_settings_wrapper::SettingsError, int> p
|
std::pair<ovr_settings_wrapper::SettingsError, int> p
|
||||||
= ovr_settings_wrapper::getInt32(
|
= ovr_settings_wrapper::getInt32(
|
||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_ColorGammaA_Int32,
|
vr::k_pch_CollisionBounds_ColorGammaA_Int32,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return 255;
|
return m_chaperoneColorA;
|
||||||
}
|
}
|
||||||
return p.second;
|
return p.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float ChaperoneTabController::boundsVisibility()
|
||||||
|
{
|
||||||
|
std::pair<ovr_settings_wrapper::SettingsError, int> p
|
||||||
|
= ovr_settings_wrapper::getInt32(
|
||||||
|
vr::k_pch_CollisionBounds_Section,
|
||||||
|
vr::k_pch_CollisionBounds_ColorGammaA_Int32,
|
||||||
|
"" );
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return static_cast<float>( static_cast<float>( m_chaperoneColorA )
|
||||||
|
/ 255.0f );
|
||||||
|
}
|
||||||
|
return static_cast<float>( static_cast<float>( p.second ) / 255.0f );
|
||||||
|
}
|
||||||
|
|
||||||
bool ChaperoneTabController::chaperoneFloorToggle()
|
bool ChaperoneTabController::chaperoneFloorToggle()
|
||||||
{
|
{
|
||||||
std::pair<ovr_settings_wrapper::SettingsError, int> p
|
std::pair<ovr_settings_wrapper::SettingsError, int> p
|
||||||
@@ -665,11 +653,11 @@ bool ChaperoneTabController::chaperoneFloorToggle()
|
|||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return false;
|
return p.second;
|
||||||
}
|
}
|
||||||
return p.second;
|
return m_chaperoneFloorToggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ChaperoneTabController::collisionBoundStyle()
|
int ChaperoneTabController::collisionBoundStyle()
|
||||||
@@ -678,11 +666,10 @@ int ChaperoneTabController::collisionBoundStyle()
|
|||||||
= ovr_settings_wrapper::getInt32( vr::k_pch_CollisionBounds_Section,
|
= ovr_settings_wrapper::getInt32( vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_Style_Int32,
|
vr::k_pch_CollisionBounds_Style_Int32,
|
||||||
"" );
|
"" );
|
||||||
if ( p.first != ovr_settings_wrapper::SettingsError::NoError )
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
{
|
{
|
||||||
return m_collisionBoundStyle;
|
return p.second;
|
||||||
}
|
}
|
||||||
m_collisionBoundStyle = p.second;
|
|
||||||
return m_collisionBoundStyle;
|
return m_collisionBoundStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -818,25 +805,34 @@ void ChaperoneTabController::updateCenterMarkerOverlayColor()
|
|||||||
|
|
||||||
void ChaperoneTabController::setChaperoneColorA( int value, bool notify )
|
void ChaperoneTabController::setChaperoneColorA( int value, bool notify )
|
||||||
{
|
{
|
||||||
if ( value > 255 )
|
if ( value != m_chaperoneColorA )
|
||||||
{
|
{
|
||||||
value = 255;
|
if ( value > 255 )
|
||||||
LOG( WARNING ) << "Alpha Channel larger than 255, setting to 255";
|
{
|
||||||
|
value = 255;
|
||||||
|
LOG( WARNING ) << "Alpha Channel larger than 255, setting to 255";
|
||||||
|
}
|
||||||
|
else if ( value < 0 )
|
||||||
|
{
|
||||||
|
value = 0;
|
||||||
|
LOG( WARNING ) << "Alpha Channel smaller than 0, setting to 0";
|
||||||
|
}
|
||||||
|
m_chaperoneColorA = value;
|
||||||
|
ovr_settings_wrapper::setInt32(
|
||||||
|
vr::k_pch_CollisionBounds_Section,
|
||||||
|
vr::k_pch_CollisionBounds_ColorGammaA_Int32,
|
||||||
|
value,
|
||||||
|
"" );
|
||||||
|
ovr_overlay_wrapper::setOverlayAlpha( m_chaperoneFloorOverlayHandle,
|
||||||
|
static_cast<float>( value )
|
||||||
|
/ 255.0f,
|
||||||
|
"" );
|
||||||
|
if ( notify )
|
||||||
|
{
|
||||||
|
emit chaperoneColorAChanged( value );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( value < 0 )
|
} // namespace advsettings
|
||||||
{
|
|
||||||
value = 0;
|
|
||||||
LOG( WARNING ) << "Alpha Channel smaller than 0, setting to 0";
|
|
||||||
}
|
|
||||||
ovr_settings_wrapper::setInt32( vr::k_pch_CollisionBounds_Section,
|
|
||||||
vr::k_pch_CollisionBounds_ColorGammaA_Int32,
|
|
||||||
value,
|
|
||||||
"" );
|
|
||||||
if ( notify )
|
|
||||||
{
|
|
||||||
emit chaperoneColorAChanged( value );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChaperoneTabController::setCenterMarkerNew( bool value, bool notify )
|
void ChaperoneTabController::setCenterMarkerNew( bool value, bool notify )
|
||||||
{
|
{
|
||||||
@@ -1222,7 +1218,7 @@ void ChaperoneTabController::addChaperoneProfile(
|
|||||||
profile->includesVisibility = includeVisbility;
|
profile->includesVisibility = includeVisbility;
|
||||||
if ( includeVisbility )
|
if ( includeVisbility )
|
||||||
{
|
{
|
||||||
profile->visibility = m_visibility;
|
profile->visibility = boundsVisibility();
|
||||||
}
|
}
|
||||||
profile->includesFadeDistance = includeFadeDistance;
|
profile->includesFadeDistance = includeFadeDistance;
|
||||||
if ( includeFadeDistance )
|
if ( includeFadeDistance )
|
||||||
@@ -1570,7 +1566,7 @@ void ChaperoneTabController::initCenterMarkerOverlay()
|
|||||||
m_chaperoneFloorOverlayHandle, 0.5f );
|
m_chaperoneFloorOverlayHandle, 0.5f );
|
||||||
updateCenterMarkerOverlayColor();
|
updateCenterMarkerOverlayColor();
|
||||||
ovr_overlay_wrapper::setOverlayAlpha(
|
ovr_overlay_wrapper::setOverlayAlpha(
|
||||||
m_chaperoneFloorOverlayHandle, m_visibility, "" );
|
m_chaperoneFloorOverlayHandle, boundsVisibility(), "" );
|
||||||
m_centerMarkerOverlayIsInit = true;
|
m_centerMarkerOverlayIsInit = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ struct ChaperoneProfile : settings::ISettingsObject
|
|||||||
vr::HmdMatrix34_t standingCenter;
|
vr::HmdMatrix34_t standingCenter;
|
||||||
float playSpaceAreaX = 0.0f;
|
float playSpaceAreaX = 0.0f;
|
||||||
float playSpaceAreaZ = 0.0f;
|
float playSpaceAreaZ = 0.0f;
|
||||||
|
|
||||||
bool includesVisibility = false;
|
bool includesVisibility = false;
|
||||||
float visibility = 0.6f;
|
float visibility = 0.6f;
|
||||||
|
|
||||||
@@ -324,7 +323,6 @@ class ChaperoneTabController : public QObject
|
|||||||
private:
|
private:
|
||||||
OverlayController* parent;
|
OverlayController* parent;
|
||||||
|
|
||||||
float m_visibility = 0.6f;
|
|
||||||
float m_fadeDistance = 0.7f;
|
float m_fadeDistance = 0.7f;
|
||||||
float m_height = 2.0f;
|
float m_height = 2.0f;
|
||||||
bool m_centerMarker = false;
|
bool m_centerMarker = false;
|
||||||
@@ -354,6 +352,7 @@ private:
|
|||||||
int m_chaperoneColorR = 0;
|
int m_chaperoneColorR = 0;
|
||||||
int m_chaperoneColorG = 255;
|
int m_chaperoneColorG = 255;
|
||||||
int m_chaperoneColorB = 255;
|
int m_chaperoneColorB = 255;
|
||||||
|
int m_chaperoneColorA = 153;
|
||||||
|
|
||||||
int m_collisionBoundStyle = 0;
|
int m_collisionBoundStyle = 0;
|
||||||
|
|
||||||
@@ -397,7 +396,6 @@ public:
|
|||||||
|
|
||||||
void updateCenterMarkerOverlay( vr::HmdMatrix34_t* centerPlaySpaceMatrix );
|
void updateCenterMarkerOverlay( vr::HmdMatrix34_t* centerPlaySpaceMatrix );
|
||||||
|
|
||||||
float boundsVisibility() const;
|
|
||||||
float fadeDistance();
|
float fadeDistance();
|
||||||
float height();
|
float height();
|
||||||
bool centerMarker();
|
bool centerMarker();
|
||||||
@@ -408,7 +406,8 @@ public:
|
|||||||
int chaperoneColorR();
|
int chaperoneColorR();
|
||||||
int chaperoneColorG();
|
int chaperoneColorG();
|
||||||
int chaperoneColorB();
|
int chaperoneColorB();
|
||||||
int chaperoneColorA() const;
|
int chaperoneColorA();
|
||||||
|
float boundsVisibility();
|
||||||
|
|
||||||
bool centerMarkerNew();
|
bool centerMarkerNew();
|
||||||
bool m_centerMarkerOverlayNeedsUpdate = false;
|
bool m_centerMarkerOverlayNeedsUpdate = false;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ void SteamVRTabController::initStage1()
|
|||||||
void SteamVRTabController::initStage2( OverlayController* var_parent )
|
void SteamVRTabController::initStage2( OverlayController* var_parent )
|
||||||
{
|
{
|
||||||
this->parent = var_parent;
|
this->parent = var_parent;
|
||||||
|
synchSteamVR();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SteamVRTabController::dashboardLoopTick()
|
void SteamVRTabController::dashboardLoopTick()
|
||||||
@@ -22,141 +23,33 @@ void SteamVRTabController::dashboardLoopTick()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
synchSteamVR();
|
||||||
|
}
|
||||||
|
|
||||||
vr::EVRSettingsError vrSettingsError;
|
void SteamVRTabController::synchSteamVR()
|
||||||
|
{
|
||||||
// Checks and synchs performance graph
|
// Un-comment these if other Apps make heavy use OR ADDED to STEAMVR
|
||||||
auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
|
// officially
|
||||||
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
setPerformanceGraph( performanceGraph() );
|
||||||
&vrSettingsError );
|
// setSystemButton(systemButton());
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
setMultipleDriver( multipleDriver() );
|
||||||
{
|
setDND( dnd() );
|
||||||
LOG( WARNING ) << "Could not read \""
|
setNoFadeToGrid( noFadeToGrid() );
|
||||||
<< vr::k_pch_Perf_PerfGraphInHMD_Bool << "\" setting: "
|
setCameraActive( cameraActive() );
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
setCameraRoom( cameraRoom() );
|
||||||
vrSettingsError );
|
setCameraDashboard( cameraDashboard() );
|
||||||
}
|
setCameraBounds( cameraBounds() );
|
||||||
setPerformanceGraph( pg );
|
|
||||||
|
|
||||||
// synch systembutton
|
|
||||||
auto sb = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setSystemButton( sb );
|
|
||||||
|
|
||||||
// synch nofadetogrid
|
|
||||||
auto nf = vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_DoNotFadeToGrid,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_DoNotFadeToGrid << "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setNoFadeToGrid( nf );
|
|
||||||
|
|
||||||
// synch multipleDriver
|
|
||||||
auto md = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setMultipleDriver( md );
|
|
||||||
|
|
||||||
// synch dnd
|
|
||||||
auto donotd
|
|
||||||
= vr::VRSettings()->GetBool( vr::k_pch_Notifications_Section,
|
|
||||||
vr::k_pch_Notifications_DoNotDisturb_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_Notifications_DoNotDisturb_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setDND( donotd );
|
|
||||||
|
|
||||||
// synch camera
|
|
||||||
auto ca = vr::VRSettings()->GetBool( vr::k_pch_Camera_Section,
|
|
||||||
vr::k_pch_Camera_EnableCamera_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_Camera_EnableCamera_Bool << "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setCameraActive( ca );
|
|
||||||
|
|
||||||
// synch camera room
|
|
||||||
auto cr = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_Camera_Section,
|
|
||||||
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_Camera_EnableCameraForRoomView_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setCameraRoom( cr );
|
|
||||||
|
|
||||||
// synch camera dashboard
|
|
||||||
auto cd = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_Camera_Section,
|
|
||||||
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_Camera_EnableCameraInDashboard_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setCameraDashboard( cd );
|
|
||||||
|
|
||||||
// synch camera bounds
|
|
||||||
auto cb = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_Camera_Section,
|
|
||||||
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setCameraBounds( cb );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SteamVRTabController::performanceGraph() const
|
bool SteamVRTabController::performanceGraph() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Perf_Section, vr::k_pch_Perf_PerfGraphInHMD_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_performanceGraphToggle;
|
return m_performanceGraphToggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,9 +59,9 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
|
|||||||
if ( m_performanceGraphToggle != value )
|
if ( m_performanceGraphToggle != value )
|
||||||
{
|
{
|
||||||
m_performanceGraphToggle = value;
|
m_performanceGraphToggle = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_Perf_Section,
|
ovr_settings_wrapper::setBool( vr::k_pch_Perf_Section,
|
||||||
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
||||||
m_performanceGraphToggle );
|
m_performanceGraphToggle );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit performanceGraphChanged( m_performanceGraphToggle );
|
emit performanceGraphChanged( m_performanceGraphToggle );
|
||||||
@@ -178,6 +71,14 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::multipleDriver() const
|
bool SteamVRTabController::multipleDriver() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_multipleDriverToggle;
|
return m_multipleDriverToggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +88,7 @@ void SteamVRTabController::setMultipleDriver( const bool value,
|
|||||||
if ( m_multipleDriverToggle != value )
|
if ( m_multipleDriverToggle != value )
|
||||||
{
|
{
|
||||||
m_multipleDriverToggle = value;
|
m_multipleDriverToggle = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
|
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
|
||||||
m_multipleDriverToggle );
|
m_multipleDriverToggle );
|
||||||
@@ -200,6 +101,13 @@ void SteamVRTabController::setMultipleDriver( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::noFadeToGrid() const
|
bool SteamVRTabController::noFadeToGrid() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool( vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_DoNotFadeToGrid );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_noFadeToGridToggle;
|
return m_noFadeToGridToggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,9 +117,9 @@ void SteamVRTabController::setNoFadeToGrid( const bool value,
|
|||||||
if ( m_noFadeToGridToggle != value )
|
if ( m_noFadeToGridToggle != value )
|
||||||
{
|
{
|
||||||
m_noFadeToGridToggle = value;
|
m_noFadeToGridToggle = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
|
ovr_settings_wrapper::setBool( vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_DoNotFadeToGrid,
|
vr::k_pch_SteamVR_DoNotFadeToGrid,
|
||||||
m_noFadeToGridToggle );
|
m_noFadeToGridToggle );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit noFadeToGridChanged( m_noFadeToGridToggle );
|
emit noFadeToGridChanged( m_noFadeToGridToggle );
|
||||||
@@ -221,6 +129,14 @@ void SteamVRTabController::setNoFadeToGrid( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::systemButton() const
|
bool SteamVRTabController::systemButton() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_systemButtonToggle;
|
return m_systemButtonToggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +146,7 @@ void SteamVRTabController::setSystemButton( const bool value,
|
|||||||
if ( m_systemButtonToggle != value )
|
if ( m_systemButtonToggle != value )
|
||||||
{
|
{
|
||||||
m_systemButtonToggle = value;
|
m_systemButtonToggle = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
|
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
|
||||||
m_systemButtonToggle );
|
m_systemButtonToggle );
|
||||||
@@ -243,6 +159,14 @@ void SteamVRTabController::setSystemButton( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::dnd() const
|
bool SteamVRTabController::dnd() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Notifications_Section,
|
||||||
|
vr::k_pch_Notifications_DoNotDisturb_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_dnd;
|
return m_dnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,9 +175,10 @@ void SteamVRTabController::setDND( const bool value, const bool notify )
|
|||||||
if ( m_dnd != value )
|
if ( m_dnd != value )
|
||||||
{
|
{
|
||||||
m_dnd = value;
|
m_dnd = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_Notifications_Section,
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_Notifications_DoNotDisturb_Bool,
|
vr::k_pch_Notifications_Section,
|
||||||
m_dnd );
|
vr::k_pch_Notifications_DoNotDisturb_Bool,
|
||||||
|
m_dnd );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit dNDChanged( m_dnd );
|
emit dNDChanged( m_dnd );
|
||||||
@@ -266,6 +191,13 @@ void SteamVRTabController::setDND( const bool value, const bool notify )
|
|||||||
|
|
||||||
bool SteamVRTabController::cameraActive() const
|
bool SteamVRTabController::cameraActive() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Camera_Section, vr::k_pch_Camera_EnableCamera_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_cameraActive;
|
return m_cameraActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,9 +207,9 @@ void SteamVRTabController::setCameraActive( const bool value,
|
|||||||
if ( m_cameraActive != value )
|
if ( m_cameraActive != value )
|
||||||
{
|
{
|
||||||
m_cameraActive = value;
|
m_cameraActive = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_Camera_Section,
|
ovr_settings_wrapper::setBool( vr::k_pch_Camera_Section,
|
||||||
vr::k_pch_Camera_EnableCamera_Bool,
|
vr::k_pch_Camera_EnableCamera_Bool,
|
||||||
m_cameraActive );
|
m_cameraActive );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit cameraActiveChanged( m_cameraActive );
|
emit cameraActiveChanged( m_cameraActive );
|
||||||
@@ -287,6 +219,14 @@ void SteamVRTabController::setCameraActive( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::cameraBounds() const
|
bool SteamVRTabController::cameraBounds() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Camera_Section,
|
||||||
|
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_cameraBounds;
|
return m_cameraBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +236,7 @@ void SteamVRTabController::setCameraBounds( const bool value,
|
|||||||
if ( m_cameraBounds != value )
|
if ( m_cameraBounds != value )
|
||||||
{
|
{
|
||||||
m_cameraBounds = value;
|
m_cameraBounds = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_Camera_Section,
|
vr::k_pch_Camera_Section,
|
||||||
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
|
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
|
||||||
m_cameraBounds );
|
m_cameraBounds );
|
||||||
@@ -309,6 +249,14 @@ void SteamVRTabController::setCameraBounds( const bool value,
|
|||||||
|
|
||||||
bool SteamVRTabController::cameraRoom() const
|
bool SteamVRTabController::cameraRoom() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Camera_Section,
|
||||||
|
vr::k_pch_Camera_EnableCameraForRoomView_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_cameraRoom;
|
return m_cameraRoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,7 +265,7 @@ void SteamVRTabController::setCameraRoom( const bool value, const bool notify )
|
|||||||
if ( m_cameraRoom != value )
|
if ( m_cameraRoom != value )
|
||||||
{
|
{
|
||||||
m_cameraRoom = value;
|
m_cameraRoom = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_Camera_Section,
|
vr::k_pch_Camera_Section,
|
||||||
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
|
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
|
||||||
m_cameraRoom );
|
m_cameraRoom );
|
||||||
@@ -330,6 +278,14 @@ void SteamVRTabController::setCameraRoom( const bool value, const bool notify )
|
|||||||
|
|
||||||
bool SteamVRTabController::cameraDashboard() const
|
bool SteamVRTabController::cameraDashboard() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_Camera_Section,
|
||||||
|
vr::k_pch_Camera_EnableCameraInDashboard_Bool );
|
||||||
|
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_cameraDashboard;
|
return m_cameraDashboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,7 +315,7 @@ void SteamVRTabController::setCameraDashboard( const bool value,
|
|||||||
if ( m_cameraDashboard != value )
|
if ( m_cameraDashboard != value )
|
||||||
{
|
{
|
||||||
m_cameraDashboard = value;
|
m_cameraDashboard = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_Camera_Section,
|
vr::k_pch_Camera_Section,
|
||||||
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
|
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
|
||||||
m_cameraDashboard );
|
m_cameraDashboard );
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "../utils/FrameRateUtils.h"
|
#include "../utils/FrameRateUtils.h"
|
||||||
|
#include "../openvr/ovr_settings_wrapper.h"
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
// application namespace
|
// application namespace
|
||||||
@@ -49,6 +50,8 @@ private:
|
|||||||
bool m_cameraRoom = false;
|
bool m_cameraRoom = false;
|
||||||
bool m_cameraDashboard = false;
|
bool m_cameraDashboard = false;
|
||||||
|
|
||||||
|
void synchSteamVR();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void initStage1();
|
void initStage1();
|
||||||
void initStage2( OverlayController* parent );
|
void initStage2( OverlayController* parent );
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ void VideoTabController::initStage1()
|
|||||||
|
|
||||||
initBrightnessOverlay();
|
initBrightnessOverlay();
|
||||||
initColorOverlay();
|
initColorOverlay();
|
||||||
initMotionSmoothing();
|
|
||||||
initSupersampleOverride();
|
|
||||||
m_overlayInit = true;
|
m_overlayInit = true;
|
||||||
reloadVideoConfig();
|
reloadVideoConfig();
|
||||||
reloadVideoProfiles();
|
reloadVideoProfiles();
|
||||||
@@ -30,6 +28,19 @@ void VideoTabController::initStage1()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VideoTabController::initStage2()
|
||||||
|
{
|
||||||
|
synchSteamVR();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoTabController::synchSteamVR()
|
||||||
|
{
|
||||||
|
setMotionSmoothing( motionSmoothing() );
|
||||||
|
setAllowSupersampleOverride( allowSupersampleOverride() );
|
||||||
|
setSuperSampling( superSampling() );
|
||||||
|
setAllowSupersampleFiltering( allowSupersampleFiltering() );
|
||||||
|
}
|
||||||
|
|
||||||
void VideoTabController::initBrightnessOverlay()
|
void VideoTabController::initBrightnessOverlay()
|
||||||
{
|
{
|
||||||
std::string notifKey = std::string( application_strings::applicationKey )
|
std::string notifKey = std::string( application_strings::applicationKey )
|
||||||
@@ -143,94 +154,13 @@ void VideoTabController::dashboardLoopTick()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
synchSteamVR();
|
||||||
vr::EVRSettingsError vrSettingsError;
|
|
||||||
|
|
||||||
// checks supersampling override and resynchs if necessry
|
|
||||||
// also prints error if can't find.
|
|
||||||
auto sso = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
|
|
||||||
setAllowSupersampleOverride( sso );
|
|
||||||
// checks supersampling and re-synchs if necessary
|
|
||||||
auto ss
|
|
||||||
= vr::VRSettings()->GetFloat( vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_SupersampleScale_Float
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
if ( m_superSampling != 1.0f )
|
|
||||||
{
|
|
||||||
LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
|
|
||||||
"supersampling value: "
|
|
||||||
<< m_superSampling;
|
|
||||||
setSuperSampling( 1.0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
|
|
||||||
{
|
|
||||||
LOG( INFO ) << "OpenVR reports a changed supersampling value: "
|
|
||||||
<< m_superSampling << " => " << ss;
|
|
||||||
setSuperSampling( ss );
|
|
||||||
}
|
|
||||||
// checks if Supersampling filter is on and changes if it has been
|
|
||||||
// changed elsewhere
|
|
||||||
|
|
||||||
auto sf = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setAllowSupersampleFiltering( sf );
|
|
||||||
|
|
||||||
// Checks if Motion smoothing setting can be read and synchs adv
|
|
||||||
// settings to steamvr/openvr
|
|
||||||
auto ms = vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not read \""
|
|
||||||
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setMotionSmoothing( ms );
|
|
||||||
|
|
||||||
// Synch's our saved Values of gain to the SteamVR's version
|
|
||||||
// This will allow other apps to modify Gain.
|
|
||||||
|
|
||||||
bool valueAdjust = true;
|
bool valueAdjust = true;
|
||||||
if ( isOverlayMethodActive() )
|
if ( isOverlayMethodActive() )
|
||||||
{
|
{
|
||||||
valueAdjust = false;
|
valueAdjust = false;
|
||||||
}
|
}
|
||||||
synchGain( valueAdjust );
|
synchGain( valueAdjust );
|
||||||
|
|
||||||
settingsUpdateCounter = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::reloadVideoConfig()
|
void VideoTabController::reloadVideoConfig()
|
||||||
@@ -242,14 +172,9 @@ void VideoTabController::reloadVideoConfig()
|
|||||||
setColorGreen( colorGreen() );
|
setColorGreen( colorGreen() );
|
||||||
setColorBlue( colorBlue() );
|
setColorBlue( colorBlue() );
|
||||||
|
|
||||||
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(
|
ovr_overlay_wrapper::setOverlayAlpha( m_brightnessOverlayHandle,
|
||||||
m_brightnessOverlayHandle, brightnessOpacityValue() );
|
brightnessOpacityValue() );
|
||||||
if ( overlayError != vr::VROverlayError_None )
|
|
||||||
{
|
|
||||||
LOG( ERROR ) << "Could not set alpha for Brightness Overlay: "
|
|
||||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
|
||||||
overlayError );
|
|
||||||
}
|
|
||||||
loadColorOverlay();
|
loadColorOverlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +208,8 @@ void VideoTabController::setBrightnessEnabled( bool value,
|
|||||||
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
||||||
{
|
{
|
||||||
setBrightnessOpacityValue( brightnessOpacityValue(), false );
|
setBrightnessOpacityValue( brightnessOpacityValue(), false );
|
||||||
vr::VROverlay()->ShowOverlay( getBrightnessOverlayHandle() );
|
ovr_overlay_wrapper::showOverlay(
|
||||||
|
getBrightnessOverlayHandle() );
|
||||||
LOG( INFO ) << "Brightness Overlay toggled on";
|
LOG( INFO ) << "Brightness Overlay toggled on";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,7 +217,8 @@ void VideoTabController::setBrightnessEnabled( bool value,
|
|||||||
{
|
{
|
||||||
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
||||||
{
|
{
|
||||||
vr::VROverlay()->HideOverlay( getBrightnessOverlayHandle() );
|
ovr_overlay_wrapper::hideOverlay(
|
||||||
|
getBrightnessOverlayHandle() );
|
||||||
LOG( INFO ) << "Brightness Overlay toggled off";
|
LOG( INFO ) << "Brightness Overlay toggled off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -321,14 +248,8 @@ void VideoTabController::setBrightnessOpacityValue( float percvalue,
|
|||||||
settings::DoubleSetting::VIDEO_brightnessOpacityValue, 1.0 );
|
settings::DoubleSetting::VIDEO_brightnessOpacityValue, 1.0 );
|
||||||
realvalue = 0;
|
realvalue = 0;
|
||||||
}
|
}
|
||||||
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(
|
ovr_overlay_wrapper::setOverlayAlpha( m_brightnessOverlayHandle,
|
||||||
m_brightnessOverlayHandle, realvalue );
|
realvalue );
|
||||||
if ( overlayError != vr::VROverlayError_None )
|
|
||||||
{
|
|
||||||
LOG( ERROR ) << "Could not set alpha for brightness overlay: "
|
|
||||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
|
||||||
overlayError );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -420,7 +341,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
|
|||||||
{
|
{
|
||||||
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
||||||
{
|
{
|
||||||
vr::VROverlay()->ShowOverlay( getColorOverlayHandle() );
|
ovr_overlay_wrapper::showOverlay( getColorOverlayHandle() );
|
||||||
LOG( INFO ) << "Color Overlay toggled on";
|
LOG( INFO ) << "Color Overlay toggled on";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -428,7 +349,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
|
|||||||
{
|
{
|
||||||
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
|
||||||
{
|
{
|
||||||
vr::VROverlay()->HideOverlay( getColorOverlayHandle() );
|
ovr_overlay_wrapper::hideOverlay( getColorOverlayHandle() );
|
||||||
LOG( INFO ) << "Color Overlay toggled off";
|
LOG( INFO ) << "Color Overlay toggled off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,14 +374,7 @@ void VideoTabController::setColorOverlayOpacity( float value, bool notify )
|
|||||||
settings::DoubleSetting::VIDEO_colorOverlayOpacity,
|
settings::DoubleSetting::VIDEO_colorOverlayOpacity,
|
||||||
static_cast<double>( value ) );
|
static_cast<double>( value ) );
|
||||||
|
|
||||||
vr::VROverlayError overlayError
|
ovr_overlay_wrapper::setOverlayAlpha( m_colorOverlayHandle, value );
|
||||||
= vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle, value );
|
|
||||||
if ( overlayError != vr::VROverlayError_None )
|
|
||||||
{
|
|
||||||
LOG( ERROR ) << "Could not set alpha for color overlay: "
|
|
||||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
|
||||||
overlayError );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -745,54 +659,46 @@ void VideoTabController::setColor( float R,
|
|||||||
|
|
||||||
float VideoTabController::superSampling() const
|
float VideoTabController::superSampling() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getFloat(
|
||||||
|
vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_SupersampleScale_Float );
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_superSampling;
|
return m_superSampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoTabController::allowSupersampleOverride() const
|
bool VideoTabController::allowSupersampleOverride() const
|
||||||
{
|
{
|
||||||
return m_allowSupersampleOverride;
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
}
|
|
||||||
|
|
||||||
void VideoTabController::initSupersampleOverride()
|
|
||||||
{
|
|
||||||
bool temporary = false;
|
|
||||||
vr::EVRSettingsError vrSettingsError;
|
|
||||||
temporary = vr::VRSettings()->GetBool(
|
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
|
vr::k_pch_SteamVR_SupersampleManualOverride_Bool );
|
||||||
&vrSettingsError );
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
{
|
||||||
LOG( WARNING ) << "Could not get SuperSampling Override State \""
|
return p.second;
|
||||||
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
}
|
||||||
setAllowSupersampleOverride( temporary, true );
|
return m_allowSupersampleOverride;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::setSuperSampling( float value, const bool notify )
|
void VideoTabController::setSuperSampling( float value, const bool notify )
|
||||||
{
|
{
|
||||||
bool override = false;
|
if ( fabs( static_cast<double>( m_superSampling - value ) ) > .005 )
|
||||||
// Mirrors Desktop Clamp
|
|
||||||
if ( value < 0.2f )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
|
|
||||||
"supersampling to 1.0";
|
|
||||||
value = 1.0f;
|
|
||||||
override = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( override
|
|
||||||
|| fabs( static_cast<double>( m_superSampling - value ) ) > .005 )
|
|
||||||
{
|
{
|
||||||
|
// Mirrors Desktop Clamp
|
||||||
|
if ( value < 0.2f )
|
||||||
|
{
|
||||||
|
LOG( WARNING )
|
||||||
|
<< "Encountered a supersampling value <= 0.2, setting "
|
||||||
|
"supersampling to 1.0";
|
||||||
|
value = 1.0f;
|
||||||
|
}
|
||||||
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling
|
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling
|
||||||
<< " => " << value;
|
<< " => " << value;
|
||||||
m_superSampling = value;
|
m_superSampling = value;
|
||||||
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
ovr_settings_wrapper::setFloat(
|
||||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
vr::k_pch_SteamVR_Section,
|
||||||
m_superSampling );
|
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||||
|
m_superSampling );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit superSamplingChanged( m_superSampling );
|
emit superSamplingChanged( m_superSampling );
|
||||||
@@ -806,7 +712,7 @@ void VideoTabController::setAllowSupersampleOverride( const bool value,
|
|||||||
if ( m_allowSupersampleOverride != value )
|
if ( m_allowSupersampleOverride != value )
|
||||||
{
|
{
|
||||||
m_allowSupersampleOverride = value;
|
m_allowSupersampleOverride = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
|
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
|
||||||
m_allowSupersampleOverride );
|
m_allowSupersampleOverride );
|
||||||
@@ -825,6 +731,12 @@ void VideoTabController::setAllowSupersampleOverride( const bool value,
|
|||||||
|
|
||||||
bool VideoTabController::motionSmoothing() const
|
bool VideoTabController::motionSmoothing() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_MotionSmoothing_Bool );
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_motionSmoothing;
|
return m_motionSmoothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,9 +746,9 @@ void VideoTabController::setMotionSmoothing( const bool value,
|
|||||||
if ( m_motionSmoothing != value )
|
if ( m_motionSmoothing != value )
|
||||||
{
|
{
|
||||||
m_motionSmoothing = value;
|
m_motionSmoothing = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
|
ovr_settings_wrapper::setBool( vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
||||||
m_motionSmoothing );
|
m_motionSmoothing );
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit motionSmoothingChanged( m_motionSmoothing );
|
emit motionSmoothingChanged( m_motionSmoothing );
|
||||||
@@ -844,27 +756,15 @@ void VideoTabController::setMotionSmoothing( const bool value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::initMotionSmoothing()
|
|
||||||
{
|
|
||||||
bool temporary = false;
|
|
||||||
vr::EVRSettingsError vrSettingsError;
|
|
||||||
temporary
|
|
||||||
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not get MotionSmoothing State \""
|
|
||||||
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
|
|
||||||
<< "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
setMotionSmoothing( temporary, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VideoTabController::allowSupersampleFiltering() const
|
bool VideoTabController::allowSupersampleFiltering() const
|
||||||
{
|
{
|
||||||
|
auto p = ovr_settings_wrapper::getBool(
|
||||||
|
vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool );
|
||||||
|
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||||
|
{
|
||||||
|
return p.second;
|
||||||
|
}
|
||||||
return m_allowSupersampleFiltering;
|
return m_allowSupersampleFiltering;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -874,7 +774,7 @@ void VideoTabController::setAllowSupersampleFiltering( const bool value,
|
|||||||
if ( m_allowSupersampleFiltering != value )
|
if ( m_allowSupersampleFiltering != value )
|
||||||
{
|
{
|
||||||
m_allowSupersampleFiltering = value;
|
m_allowSupersampleFiltering = value;
|
||||||
vr::VRSettings()->SetBool(
|
ovr_settings_wrapper::setBool(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||||
m_allowSupersampleFiltering );
|
m_allowSupersampleFiltering );
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <openvr.h>
|
#include <openvr.h>
|
||||||
|
#include "../openvr/ovr_settings_wrapper.h"
|
||||||
|
#include "../openvr/ovr_overlay_wrapper.h"
|
||||||
#include "../utils/FrameRateUtils.h"
|
#include "../utils/FrameRateUtils.h"
|
||||||
#include "../settings/settings_object.h"
|
#include "../settings/settings_object.h"
|
||||||
|
|
||||||
@@ -156,9 +158,6 @@ private:
|
|||||||
bool keepValue = false );
|
bool keepValue = false );
|
||||||
void resetGain();
|
void resetGain();
|
||||||
|
|
||||||
void initSupersampleOverride();
|
|
||||||
void initMotionSmoothing();
|
|
||||||
|
|
||||||
void initColorOverlay();
|
void initColorOverlay();
|
||||||
void loadColorOverlay();
|
void loadColorOverlay();
|
||||||
|
|
||||||
@@ -167,6 +166,7 @@ private:
|
|||||||
void initBrightnessOverlay();
|
void initBrightnessOverlay();
|
||||||
|
|
||||||
void synchGain( bool setValue = false );
|
void synchGain( bool setValue = false );
|
||||||
|
void synchSteamVR();
|
||||||
|
|
||||||
std::vector<VideoProfile> videoProfiles;
|
std::vector<VideoProfile> videoProfiles;
|
||||||
|
|
||||||
@@ -204,6 +204,7 @@ public:
|
|||||||
bool isOverlayMethodActive() const;
|
bool isOverlayMethodActive() const;
|
||||||
|
|
||||||
void initStage1();
|
void initStage1();
|
||||||
|
void initStage2();
|
||||||
void eventLoopTick();
|
void eventLoopTick();
|
||||||
void dashboardLoopTick();
|
void dashboardLoopTick();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ private:
|
|||||||
// counter is deliberately set as unsigned so that the program can continue
|
// counter is deliberately set as unsigned so that the program can continue
|
||||||
// functioning if the counter should go above INT_MAX (or UINT_MAX in this
|
// functioning if the counter should go above INT_MAX (or UINT_MAX in this
|
||||||
// case)
|
// case)
|
||||||
unsigned int m_counter;
|
unsigned int m_counter = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern UpdateRate updateRate;
|
extern UpdateRate updateRate;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "major": 5, "minor": 1, "patch": 2, "updateMessage": "", "optionalMessage": "" }
|
{ "major": 5, "minor": 2, "patch": 0, "updateMessage": "", "optionalMessage": "" }
|
||||||
Reference in New Issue
Block a user