add Audio.context

This commit is contained in:
Zach Pomerantz 2017-06-06 17:55:06 -04:00
parent 2b99f299c8
commit 67288528da
2 changed files with 14 additions and 2 deletions

View file

@ -11,4 +11,11 @@
#include "Audio.h"
using namespace scripting;
using namespace scripting;
static const QString DESKTOP_CONTEXT { "Desktop" };
static const QString HMD_CONTEXT { "VR" };
QString Audio::getContext() {
return _contextIsHMD ? HMD_CONTEXT : DESKTOP_CONTEXT;
}

View file

@ -26,7 +26,7 @@ class Audio : public AudioScriptingInterface {
// TODO: Q_PROPERTY(bool reverb)
// TODO: Q_PROPERTY(float inputVolume)
// TODO: Q_PROPERTY(bool showMicLevel)
// TODO: Q_PROPERTY(QString context)
Q_PROPERTY(QString context READ getContext NOTIFY changedContext)
Q_PROPERTY(AudioDevices* devices READ getDevices NOTIFY nop)
public:
@ -34,13 +34,18 @@ public:
signals:
void nop();
void changedContext(QString);
protected:
Audio() {}
QString getContext();
private:
AudioDevices* getDevices() { return &_devices; }
AudioDevices _devices;
bool _contextIsHMD { false };
};
};