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