Gathering all the needed settings in one place

This commit is contained in:
Sam Gateau 2019-05-28 21:55:17 -07:00
parent 0862e40b41
commit aedc631c45
5 changed files with 29 additions and 5 deletions

View file

@ -27,6 +27,11 @@ PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface:
return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile(); return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
} }
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
static const QStringList refreshRateProfileNames = { "Eco", "Interactive", "Realtime" };
return refreshRateProfileNames;
}
int PerformanceScriptingInterface::getActiveRefreshRate() const { int PerformanceScriptingInterface::getActiveRefreshRate() const {
return qApp->getRefreshRateManager().getActiveRefreshRate(); return qApp->getRefreshRateManager().getActiveRefreshRate();
} }

View file

@ -33,14 +33,15 @@ public:
~PerformanceScriptingInterface() = default; ~PerformanceScriptingInterface() = default;
public slots: public slots:
void setRefreshRateProfile(RefreshRateProfile refreshRateProfile); void setRefreshRateProfile(RefreshRateProfile refreshRateProfile);
RefreshRateProfile getRefreshRateProfile() const; RefreshRateProfile getRefreshRateProfile() const;
QStringList getRefreshRateProfileNames() const;
int getActiveRefreshRate() const; int getActiveRefreshRate() const;
RefreshRateManager::UXMode getUXMode() const; RefreshRateManager::UXMode getUXMode() const;
RefreshRateManager::RefreshRateRegime getRefreshRateRegime() const; RefreshRateManager::RefreshRateRegime getRefreshRateRegime() const;
private: private:
static std::once_flag registry_flag; static std::once_flag registry_flag;
}; };

View file

@ -48,6 +48,11 @@ void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderM
} }
} }
QStringList RenderScriptingInterface::getRenderMethodNames() const {
static const QStringList refrenderMethodNames = { "Deferred", "Forward" };
return refrenderMethodNames;
}
bool RenderScriptingInterface::getShadowsEnabled() { bool RenderScriptingInterface::getShadowsEnabled() {
return _shadowsEnabledSetting.get(); return _shadowsEnabledSetting.get();
} }

View file

@ -68,6 +68,14 @@ public slots:
*/ */
void setRenderMethod(RenderMethod renderMethod); void setRenderMethod(RenderMethod renderMethod);
/**jsdoc
* Gets the possible enum names of the RenderMethod type
* @function Render.getRenderMethodNames
* @returns [string] [ <code>"DEFERRED"</code>, <code>"FORWARD"</code> ]
*/
QStringList getRenderMethodNames() const;
/**jsdoc /**jsdoc
* Whether or not shadows are enabled * Whether or not shadows are enabled
* @function Render.getShadowsEnabled * @function Render.getShadowsEnabled

View file

@ -19,14 +19,19 @@ Column {
anchors.fill: parent anchors.fill: parent
id: theGrapchicsSettings; id: theGrapchicsSettings;
Prop.PropEnum {
label: "Refresh Rate Profile"
//object: Performance
valueVarSetter: Performance.setRefreshRateProfile
valueVarGetter: Performance.getRefreshRateProfile
enums: Performance.getRefreshRateProfileNames()
}
Prop.PropEnum { Prop.PropEnum {
label: "Render Method" label: "Render Method"
object: Render object: Render
property: "renderMethod" property: "renderMethod"
enums: [ enums: Render.getRenderMethodNames()
"Deferred",
"Forward"
]
} }
Prop.PropBool { Prop.PropBool {