added main loop logic for videotab

This commit is contained in:
ykeara
2019-04-10 21:11:04 -05:00
parent 89f01ef3be
commit cfec157e2d
3 changed files with 31 additions and 0 deletions
+13
View File
@@ -122,6 +122,7 @@ OverlayController::OverlayController( bool desktopMode,
m_reviveTabController.initStage1( m_reviveTabController.initStage1(
m_settingsTabController.forceRevivePage() ); m_settingsTabController.forceRevivePage() );
m_utilitiesTabController.initStage1(); m_utilitiesTabController.initStage1();
m_videoTabController.initStage1();
// init action handles // init action handles
@@ -251,6 +252,16 @@ OverlayController::OverlayController( bool desktopMode,
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
return obj; return obj;
} ); } );
qmlRegisterSingletonType<SteamVRTabController>(
qmlSingletonImportName,
1,
0,
"VideoTabController",
[](QQmlEngine*, QJSEngine*) {
QObject* obj = &(objectAddress->m_videoTabController);
QQmlEngine::setObjectOwnership(obj, QQmlEngine::CppOwnership);
return obj;
});
} }
OverlayController::~OverlayController() OverlayController::~OverlayController()
@@ -405,6 +416,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
m_settingsTabController.initStage2( this, m_pWindow.get() ); m_settingsTabController.initStage2( this, m_pWindow.get() );
m_reviveTabController.initStage2( this, m_pWindow.get() ); m_reviveTabController.initStage2( this, m_pWindow.get() );
m_utilitiesTabController.initStage2( this, m_pWindow.get() ); m_utilitiesTabController.initStage2( this, m_pWindow.get() );
m_videoTabController.initStage2(this, m_pWindow.get());
} }
void OverlayController::OnRenderRequest() void OverlayController::OnRenderRequest()
@@ -815,6 +827,7 @@ void OverlayController::mainEventLoop()
m_settingsTabController.eventLoopTick(); m_settingsTabController.eventLoopTick();
m_reviveTabController.eventLoopTick(); m_reviveTabController.eventLoopTick();
m_audioTabController.eventLoopTick(); m_audioTabController.eventLoopTick();
//TODO do I need loop for vide?
if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid ) if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid )
{ {
+2
View File
@@ -37,6 +37,7 @@
#include "tabcontrollers/SettingsTabController.h" #include "tabcontrollers/SettingsTabController.h"
#include "tabcontrollers/ReviveTabController.h" #include "tabcontrollers/ReviveTabController.h"
#include "tabcontrollers/UtilitiesTabController.h" #include "tabcontrollers/UtilitiesTabController.h"
#include "tabcontrollers/VideoTabController.h"
#include "openvr/ivrinput.h" #include "openvr/ivrinput.h"
@@ -121,6 +122,7 @@ public: // I know it's an ugly hack to make them public to enable external
SettingsTabController m_settingsTabController; SettingsTabController m_settingsTabController;
ReviveTabController m_reviveTabController; ReviveTabController m_reviveTabController;
UtilitiesTabController m_utilitiesTabController; UtilitiesTabController m_utilitiesTabController;
VideoTabController m_videoTabController;
private: private:
QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse ); QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
+16
View File
@@ -103,6 +103,12 @@ namespace advsettings
if (value != m_brightnessEnabled) if (value != m_brightnessEnabled)
{ {
m_brightnessEnabled = value; m_brightnessEnabled = value;
if (value) {
//TODO enable
}
else {
//TODO disable
}
if (notify) if (notify)
{ {
emit brightnessEnabledChanged(value); emit brightnessEnabledChanged(value);
@@ -117,6 +123,16 @@ namespace advsettings
if (value != m_brightnessValue) if (value != m_brightnessValue)
{ {
m_brightnessValue = value; m_brightnessValue = value;
if (value <= 1.0f && value >= 0.0f) {
vr::VROverlayError overlayError = VROverlay()->SetOverlayAlpha(m_ulNotificationOverlayHandle, value)
//TODO handle error
}
else {
//TODO log warning invalid input?
m_brightnessValue = 1.0f;
}
if (notify) if (notify)
{ {
emit brightnessValueChanged(value); emit brightnessValueChanged(value);