fixed c++ errors

This commit is contained in:
ykeara
2019-04-11 19:50:12 -05:00
parent c2680a6ccc
commit 17b31734be
4 changed files with 38 additions and 12 deletions
+2
View File
@@ -10,6 +10,7 @@ SOURCES += src/main.cpp\
src/tabcontrollers/ReviveTabController.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/utils/ChaperoneUtils.cpp \ src/utils/ChaperoneUtils.cpp \
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp \ src/tabcontrollers/audiomanager/AudioManagerDummy.cpp \
src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp \ src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp \
@@ -28,6 +29,7 @@ HEADERS += src/overlaycontroller.h \
src/tabcontrollers/SteamVRTabController.h \ src/tabcontrollers/SteamVRTabController.h \
src/tabcontrollers/ReviveTabController.h \ src/tabcontrollers/ReviveTabController.h \
src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/UtilitiesTabController.h \
src/tabcontrollers/VideoTabController.h \
src/tabcontrollers/AudioManager.h \ src/tabcontrollers/AudioManager.h \
src/tabcontrollers/PttController.h \ src/tabcontrollers/PttController.h \
src/tabcontrollers/KeyboardInput.h \ src/tabcontrollers/KeyboardInput.h \
+1 -1
View File
@@ -122,7 +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(); m_videoTabController.initStage1();
// init action handles // init action handles
+15 -6
View File
@@ -33,7 +33,7 @@ namespace advsettings
vr::VROverlay()->SetOverlayFromFile(m_brightnessNotificationOverlayHandle, vr::VROverlay()->SetOverlayFromFile(m_brightnessNotificationOverlayHandle,
notifIconPath->c_str()); notifIconPath->c_str());
vr::VROverlay()->SetOverlayWidthInMeters( vr::VROverlay()->SetOverlayWidthInMeters(
m_ulNotificationOverlayHandle, 1.0f); m_brightnessNotificationOverlayHandle, 1.0f);
vr::HmdMatrix34_t notificationTransform vr::HmdMatrix34_t notificationTransform
= { { { 1.0f, 0.0f, 0.0f, 0.00f }, = { { { 1.0f, 0.0f, 0.0f, 0.00f },
{ 0.0f, 1.0f, 0.0f, 0.00f }, { 0.0f, 1.0f, 0.0f, 0.00f },
@@ -63,7 +63,7 @@ namespace advsettings
} }
void VideoTabController::reloadVideoConfig() { /*void VideoTabController::reloadVideoConfig() {
//Others Use Mutex needed? //Others Use Mutex needed?
auto settings = OverlayController::appSettings(); auto settings = OverlayController::appSettings();
settings->beginGroup(getSettingsName()); settings->beginGroup(getSettingsName());
@@ -74,7 +74,9 @@ namespace advsettings
settings->endGroup(); settings->endGroup();
} }
*/
/*
void VideoTabController::saveVideoConfig() { void VideoTabController::saveVideoConfig() {
auto settings = OverlayController::appSettings(); auto settings = OverlayController::appSettings();
settings->beginGroup(getSettingsName()); settings->beginGroup(getSettingsName());
@@ -85,6 +87,7 @@ namespace advsettings
void VideoTabController::saveVideoConfig() { void VideoTabController::saveVideoConfig() {
} }
*/
float VideoTabController::brightnessValue() const float VideoTabController::brightnessValue() const
{ {
@@ -96,6 +99,7 @@ namespace advsettings
return m_brightnessEnabled; return m_brightnessEnabled;
} }
void VideoTabController::setBrightnessEnabled(bool value, bool notify) void VideoTabController::setBrightnessEnabled(bool value, bool notify)
{ {
//TODO mutex? //TODO mutex?
@@ -122,7 +126,7 @@ namespace advsettings
} }
} }
void VideoTabController::setBrightnessvalue(float value, bool notify) void VideoTabController::setBrightnessValue(float value, bool notify)
{ {
//TODO mutex? //TODO mutex?
//std::lock_guard<std::recursive_mutex> lock(eventLoopMutex); //std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
@@ -130,11 +134,16 @@ namespace advsettings
{ {
m_brightnessValue = value; m_brightnessValue = value;
if (value <= 1.0f && value >= 0.0f) { if (value <= 1.0f && value >= 0.0f) {
vr::VROverlayError overlayError = VROverlay()->SetOverlayAlpha(m_ulNotificationOverlayHandle, value) vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(m_brightnessNotificationOverlayHandle, value);
//TODO handle error
if (overlayError != vr::VROverlayError_None) {
LOG(ERROR) << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError);
}
} }
else { else {
//TODO log warning invalid input? LOG(WARNING) << "alpha value is invalid setting to 1.0";
m_brightnessValue = 1.0f; m_brightnessValue = 1.0f;
} }
+20 -5
View File
@@ -1,6 +1,18 @@
#pragma once #pragma once
#include <QObject>
#include <QString>
#include <QVariant>
#include <openvr.h>
//#include "../overlaycontroller.h"
class QQuickWindow;
namespace advsettings { namespace advsettings {
// forward declaration
class OverlayController;
class VideoTabController : public QObject class VideoTabController : public QObject
{ {
@@ -13,13 +25,16 @@ namespace advsettings {
private: private:
//TODO //TODO
//constexpr auto notificationBrightnessFilename //constexpr auto notificationBrightnessFilename
OverlayController * parent;
QQuickWindow* widget;
vr::VROverlayHandle_t m_brightnessNotificationOverlayHandle vr::VROverlayHandle_t m_brightnessNotificationOverlayHandle
= vr::k_ulOverlayHandleInvalid; = vr::k_ulOverlayHandleInvalid;
float m_brightnessValue = 1.0; float m_brightnessValue = 1.0f;
bool m_brightnessEnabled = false; bool m_brightnessEnabled = false;
void reloadVideoConfig(); //void reloadVideoConfig();
void saveVideoConfig(); //void saveVideoConfig();
QString getSettingsName(){ QString getSettingsName(){
@@ -37,8 +52,8 @@ namespace advsettings {
bool brightnessEnabled() const; bool brightnessEnabled() const;
void initStage1(); void initStage1();
//TODO ?? on args
void initStage2(OverlayController* var_parent, QQuickWindow* var_widget); void initStage2(OverlayController* var_parent, QQuickWindow* var_widget);
void eventLoopTick();
public slots: public slots:
@@ -51,4 +66,4 @@ namespace advsettings {
void brightnessValueChanged(float value); void brightnessValueChanged(float value);
}; };
} }// namespace