qml format changes and format

This commit is contained in:
ykeara
2019-04-12 18:42:17 -05:00
parent 9de14e20cb
commit 59caa8e1af
6 changed files with 234 additions and 237 deletions
+54 -62
View File
@@ -1,84 +1,76 @@
#pragma once
#include <QObject>
#include <QString>
#include <QVariant>
#include <openvr.h>
class QQuickWindow;
namespace video_keys {
namespace video_keys
{
constexpr auto k_brightnessOverlayFilename = "/res/img/video/dimmer.png";
constexpr auto k_brightnessOverlayFilename = "/res/img/video/dimmer.png";
} // namespace video_keys
}//namespace video_keys
namespace advsettings
{
// forward declaration
class OverlayController;
namespace advsettings {
// forward declaration
class OverlayController;
class VideoTabController : public QObject
{
Q_OBJECT
Q_PROPERTY( bool brightnessEnabled READ brightnessEnabled WRITE
setBrightnessEnabled NOTIFY brightnessEnabledChanged )
Q_PROPERTY( float brightnessValue READ brightnessValue WRITE
setBrightnessValue NOTIFY brightnessValueChanged )
class VideoTabController : public QObject
{
Q_OBJECT
Q_PROPERTY(bool brightnessEnabled READ brightnessEnabled WRITE
setBrightnessEnabled NOTIFY brightnessEnabledChanged)
Q_PROPERTY(float brightnessValue READ brightnessValue WRITE
setBrightnessValue NOTIFY brightnessValueChanged)
private:
// how far away the overlay is, any OVERLAY closer will not be dimmed.
const float k_hmdDistance = -0.15f;
// how wide overlay is, Increase this value if edges of view are not dimmed.
const float k_overlayWidth = 1.0f;
OverlayController* parent;
QQuickWindow* widget;
private:
vr::VROverlayHandle_t m_brightnessNotificationOverlayHandle
= vr::k_ulOverlayHandleInvalid;
float m_opacityValue = 0.0f;
float m_brightnessValue = 1.0f;
bool m_brightnessEnabled = false;
// how far away the overlay is, any OVERLAY closer will not be dimmed.
const float k_hmdDistance = -0.15f;
// how wide overlay is, Increase this value if edges of view are not dimmed.
const float k_overlayWidth = 1.0f;
OverlayController * parent;
QQuickWindow* widget;
void reloadVideoConfig();
void saveVideoConfig();
void setOpacityValue();
vr::VROverlayHandle_t m_brightnessNotificationOverlayHandle
= vr::k_ulOverlayHandleInvalid;
float m_opacityValue = 0.0f;
float m_brightnessValue = 1.0f;
bool m_brightnessEnabled = false;
QString getSettingsName()
{
return "videoSettings";
}
vr::VROverlayHandle_t getBrightnessOverlayHandle()
{
return m_brightnessNotificationOverlayHandle;
}
void reloadVideoConfig();
void saveVideoConfig();
void setOpacityValue();
public:
float opacityValue() const;
// inverse of brightnessValue
float brightnessValue() const;
bool brightnessEnabled() const;
void initStage1();
void initStage2( OverlayController* var_parent, QQuickWindow* var_widget );
void eventLoopTick();
QString getSettingsName(){
return "videoSettings";
}
public slots:
void setBrightnessEnabled( bool value, bool notify = true );
void setBrightnessValue( float percvalue, bool notify = true );
vr::VROverlayHandle_t getBrightnessOverlayHandle()
{
return m_brightnessNotificationOverlayHandle;
}
signals:
void brightnessEnabledChanged( bool value );
void brightnessValueChanged( float value );
};
public:
float opacityValue() const;
//inverse of brightnessValue
float brightnessValue() const;
bool brightnessEnabled() const;
void initStage1();
void initStage2(OverlayController* var_parent, QQuickWindow* var_widget);
void eventLoopTick();
public slots:
void setBrightnessEnabled(bool value, bool notify = true);
void setBrightnessValue(float percvalue, bool notify = true);
signals:
void brightnessEnabledChanged(bool value);
void brightnessValueChanged(float value);
};
}// namespace advsettings
} // namespace advsettings