Complete GUI overhaul (from Qt Widgets to Qt Quick Controls 2)

Added chaperone profiles
Added separate supersampling sliders for applications/compositor
Added asynchronous reprojection on/off switch
Merged in Microphone Control Overlay
Added Push-to-Talk profiles
Updated to OpenVR 1.0.3
Requires at least SteamVR beta 1477423729.
This commit is contained in:
2016-10-28 18:38:05 +02:00
parent 8e815b0ce4
commit e39c240ff5
462 changed files with 64668 additions and 2760 deletions
+91 -13
View File
@@ -2,38 +2,116 @@
#pragma once
#include <QObject>
#include <memory>
#include <openvr.h>
class QQuickWindow;
// application namespace
namespace advsettings {
// forward declaration
class OverlayWidget;
class OverlayController;
struct ChaperoneProfile {
std::string profileName;
bool includesChaperoneGeometry = false;
unsigned chaperoneGeometryQuadCount = 0;
std::unique_ptr<vr::HmdQuad_t> chaperoneGeometryQuads = nullptr;
vr::HmdMatrix34_t standingCenter;
float playSpaceAreaX = 0.0f;
float playSpaceAreaZ = 0.0f;
bool includesVisibility = false;
float visibility = 0.6f;
bool includesFadeDistance = false;
float fadeDistance = 0.7f;
bool includesCenterMarker = false;
bool centerMarker = false;
bool includesPlaySpaceMarker = false;
bool playSpaceMarker = false;
bool includesFloorBoundsMarker = false;
bool floorBoundsMarker = false;
bool includesBoundsColor = false;
int boundsColor[3] = {0, 0, 0};
bool includesChaperoneStyle = false;
int chaperoneStyle = 0;
bool includesForceBounds = false;
bool forceBounds = false;
};
class ChaperoneTabController : public QObject {
Q_OBJECT
Q_PROPERTY(float boundsVisibility READ boundsVisibility WRITE setBoundsVisibility NOTIFY boundsVisibilityChanged)
Q_PROPERTY(float fadeDistance READ fadeDistance WRITE setFadeDistance NOTIFY fadeDistanceChanged)
Q_PROPERTY(float centerMarker READ centerMarker WRITE setCenterMarker NOTIFY centerMarkerChanged)
Q_PROPERTY(float playSpaceMarker READ playSpaceMarker WRITE setPlaySpaceMarker NOTIFY playSpaceMarkerChanged)
Q_PROPERTY(float forceBounds READ forceBounds WRITE setForceBounds NOTIFY forceBoundsChanged)
private:
OverlayController* parent;
OverlayWidget* widget;
QQuickWindow* widget;
bool forceBoundsFlag = false;
float m_visibility = 0.6f;
float m_fadeDistance = 0.7f;
bool m_centerMarker = false;
bool m_playSpaceMarker = false;
bool m_forceBounds = false;
unsigned settingsUpdateCounter = 0;
std::vector<ChaperoneProfile> chaperoneProfiles;
public:
void init(OverlayController* parent, OverlayWidget* widget);
void initStage1();
void initStage2(OverlayController* parent, QQuickWindow* widget);
void eventLoopTick();
float boundsVisibility() const;
float fadeDistance() const;
bool centerMarker() const;
bool playSpaceMarker() const;
bool forceBounds() const;
void reloadChaperoneProfiles();
void saveChaperoneProfiles();
Q_INVOKABLE unsigned getChaperoneProfileCount();
Q_INVOKABLE QString getChaperoneProfileName(unsigned index);
public slots:
void UpdateTab();
void setBoundsVisibility(float value, bool notify = true);
void setFadeDistance(float value, bool notify = true);
void setCenterMarker(bool value, bool notify = true);
void setPlaySpaceMarker(bool value, bool notify = true);
void setForceBounds(bool value, bool notify = true);
void CenterMarkerToggled(bool value);
void PlaySpaceToggled(bool value);
void ForceBoundsToggled(bool value);
void FadeDistanceChanged(int value);
void ColorAlphaChanged(int value);
void FlipOrientationClicked();
void ReloadClicked();
void ResetDefaultsClicked();
void flipOrientation();
void reloadFromDisk();
void addChaperoneProfile(QString name, bool includeGeometry, bool includeVisbility, bool includeFadeDistance, bool includeCenterMarker,
bool includePlaySpaceMarker, bool includeFloorBounds, bool includeBoundsColor, bool includeChaperoneStyle, bool includeForceBounds);
void applyChaperoneProfile(unsigned index);
void deleteChaperoneProfile(unsigned index);
signals:
void boundsVisibilityChanged(float value);
void fadeDistanceChanged(float value);
void centerMarkerChanged(bool value);
void playSpaceMarkerChanged(bool value);
void forceBoundsChanged(bool value);
void chaperoneProfilesUpdated();
};
} // namespace advsettings