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:
@@ -14,6 +14,7 @@ void SteamVRTabController::initStage1()
|
||||
void SteamVRTabController::initStage2( OverlayController* var_parent )
|
||||
{
|
||||
this->parent = var_parent;
|
||||
synchSteamVR();
|
||||
}
|
||||
|
||||
void SteamVRTabController::dashboardLoopTick()
|
||||
@@ -22,141 +23,33 @@ void SteamVRTabController::dashboardLoopTick()
|
||||
{
|
||||
return;
|
||||
}
|
||||
synchSteamVR();
|
||||
}
|
||||
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
|
||||
// Checks and synchs performance graph
|
||||
auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
|
||||
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
||||
&vrSettingsError );
|
||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||
{
|
||||
LOG( WARNING ) << "Could not read \""
|
||||
<< vr::k_pch_Perf_PerfGraphInHMD_Bool << "\" setting: "
|
||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||
vrSettingsError );
|
||||
}
|
||||
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 );
|
||||
void SteamVRTabController::synchSteamVR()
|
||||
{
|
||||
// Un-comment these if other Apps make heavy use OR ADDED to STEAMVR
|
||||
// officially
|
||||
setPerformanceGraph( performanceGraph() );
|
||||
// setSystemButton(systemButton());
|
||||
setMultipleDriver( multipleDriver() );
|
||||
setDND( dnd() );
|
||||
setNoFadeToGrid( noFadeToGrid() );
|
||||
setCameraActive( cameraActive() );
|
||||
setCameraRoom( cameraRoom() );
|
||||
setCameraDashboard( cameraDashboard() );
|
||||
setCameraBounds( cameraBounds() );
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -166,9 +59,9 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
|
||||
if ( m_performanceGraphToggle != value )
|
||||
{
|
||||
m_performanceGraphToggle = value;
|
||||
vr::VRSettings()->SetBool( vr::k_pch_Perf_Section,
|
||||
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
||||
m_performanceGraphToggle );
|
||||
ovr_settings_wrapper::setBool( vr::k_pch_Perf_Section,
|
||||
vr::k_pch_Perf_PerfGraphInHMD_Bool,
|
||||
m_performanceGraphToggle );
|
||||
if ( notify )
|
||||
{
|
||||
emit performanceGraphChanged( m_performanceGraphToggle );
|
||||
@@ -178,6 +71,14 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -187,7 +88,7 @@ void SteamVRTabController::setMultipleDriver( const bool value,
|
||||
if ( m_multipleDriverToggle != value )
|
||||
{
|
||||
m_multipleDriverToggle = value;
|
||||
vr::VRSettings()->SetBool(
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_ActivateMultipleDrivers_Bool,
|
||||
m_multipleDriverToggle );
|
||||
@@ -200,6 +101,13 @@ void SteamVRTabController::setMultipleDriver( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -209,9 +117,9 @@ void SteamVRTabController::setNoFadeToGrid( const bool value,
|
||||
if ( m_noFadeToGridToggle != value )
|
||||
{
|
||||
m_noFadeToGridToggle = value;
|
||||
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_DoNotFadeToGrid,
|
||||
m_noFadeToGridToggle );
|
||||
ovr_settings_wrapper::setBool( vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_DoNotFadeToGrid,
|
||||
m_noFadeToGridToggle );
|
||||
if ( notify )
|
||||
{
|
||||
emit noFadeToGridChanged( m_noFadeToGridToggle );
|
||||
@@ -221,6 +129,14 @@ void SteamVRTabController::setNoFadeToGrid( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -230,7 +146,7 @@ void SteamVRTabController::setSystemButton( const bool value,
|
||||
if ( m_systemButtonToggle != value )
|
||||
{
|
||||
m_systemButtonToggle = value;
|
||||
vr::VRSettings()->SetBool(
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_SendSystemButtonToAllApps_Bool,
|
||||
m_systemButtonToggle );
|
||||
@@ -243,6 +159,14 @@ void SteamVRTabController::setSystemButton( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -251,9 +175,10 @@ void SteamVRTabController::setDND( const bool value, const bool notify )
|
||||
if ( m_dnd != value )
|
||||
{
|
||||
m_dnd = value;
|
||||
vr::VRSettings()->SetBool( vr::k_pch_Notifications_Section,
|
||||
vr::k_pch_Notifications_DoNotDisturb_Bool,
|
||||
m_dnd );
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_Notifications_Section,
|
||||
vr::k_pch_Notifications_DoNotDisturb_Bool,
|
||||
m_dnd );
|
||||
if ( notify )
|
||||
{
|
||||
emit dNDChanged( m_dnd );
|
||||
@@ -266,6 +191,13 @@ void SteamVRTabController::setDND( const bool value, const bool notify )
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -275,9 +207,9 @@ void SteamVRTabController::setCameraActive( const bool value,
|
||||
if ( m_cameraActive != value )
|
||||
{
|
||||
m_cameraActive = value;
|
||||
vr::VRSettings()->SetBool( vr::k_pch_Camera_Section,
|
||||
vr::k_pch_Camera_EnableCamera_Bool,
|
||||
m_cameraActive );
|
||||
ovr_settings_wrapper::setBool( vr::k_pch_Camera_Section,
|
||||
vr::k_pch_Camera_EnableCamera_Bool,
|
||||
m_cameraActive );
|
||||
if ( notify )
|
||||
{
|
||||
emit cameraActiveChanged( m_cameraActive );
|
||||
@@ -287,6 +219,14 @@ void SteamVRTabController::setCameraActive( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -296,7 +236,7 @@ void SteamVRTabController::setCameraBounds( const bool value,
|
||||
if ( m_cameraBounds != value )
|
||||
{
|
||||
m_cameraBounds = value;
|
||||
vr::VRSettings()->SetBool(
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_Camera_Section,
|
||||
vr::k_pch_Camera_EnableCameraForCollisionBounds_Bool,
|
||||
m_cameraBounds );
|
||||
@@ -309,6 +249,14 @@ void SteamVRTabController::setCameraBounds( const bool value,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -317,7 +265,7 @@ void SteamVRTabController::setCameraRoom( const bool value, const bool notify )
|
||||
if ( m_cameraRoom != value )
|
||||
{
|
||||
m_cameraRoom = value;
|
||||
vr::VRSettings()->SetBool(
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_Camera_Section,
|
||||
vr::k_pch_Camera_EnableCameraForRoomView_Bool,
|
||||
m_cameraRoom );
|
||||
@@ -330,6 +278,14 @@ void SteamVRTabController::setCameraRoom( const bool value, const bool notify )
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -359,7 +315,7 @@ void SteamVRTabController::setCameraDashboard( const bool value,
|
||||
if ( m_cameraDashboard != value )
|
||||
{
|
||||
m_cameraDashboard = value;
|
||||
vr::VRSettings()->SetBool(
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_Camera_Section,
|
||||
vr::k_pch_Camera_EnableCameraInDashboard_Bool,
|
||||
m_cameraDashboard );
|
||||
|
||||
Reference in New Issue
Block a user