Made dependencies inherit from Dependency

This commit is contained in:
Atlante45 2015-01-13 20:38:01 -08:00
parent 36db547c0f
commit 38729c5790
18 changed files with 32 additions and 26 deletions

View file

@ -73,7 +73,7 @@ class QAudioInput;
class QAudioOutput;
class QIODevice;
class Audio : public AbstractAudioInterface {
class Audio : public AbstractAudioInterface, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
public:

View file

@ -19,7 +19,7 @@
#include <DependencyManager.h>
/// customized canvas that simply forwards requests/events to the singleton application
class GLCanvas : public QGLWidget {
class GLCanvas : public QGLWidget, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -19,7 +19,7 @@
class AudioIOStats;
class AudioStreamStats;
class AudioIOStatsRenderer : public QObject {
class AudioIOStatsRenderer : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
public:

View file

@ -17,7 +17,7 @@
#include <QByteArray>
#include <QObject>
class AudioScope : public QObject {
class AudioScope : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
public:

View file

@ -25,10 +25,6 @@ const int MUTE_ICON_SIZE = 24;
AudioToolBox::AudioToolBox() :
_iconPulseTimeReference(usecTimestampNow())
{
auto glCanvas = DependencyManager::get<GLCanvas>();
_micTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/mic.svg"));
_muteTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/mic-mute.svg"));
_boxTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/audio-box.svg"));
}
bool AudioToolBox::mousePressEvent(int x, int y) {
@ -40,9 +36,19 @@ bool AudioToolBox::mousePressEvent(int x, int y) {
}
void AudioToolBox::render(int x, int y, bool boxed) {
glEnable(GL_TEXTURE_2D);
auto glCanvas = DependencyManager::get<GLCanvas>();
if (_micTextureId == 0) {
_micTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/mic.svg"));
}
if (_muteTextureId == 0) {
_muteTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/mic-mute.svg"));
}
if (_boxTextureId == 0) {
_boxTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/audio-box.svg"));
}
auto audioIO = DependencyManager::get<Audio>();
if (boxed) {

View file

@ -14,7 +14,7 @@
#include <DependencyManager.h>
class AudioToolBox : public QObject {
class AudioToolBox : public Dependency {
SINGLETON_DEPENDENCY
public:
void render(int x, int y, bool boxed);
@ -23,11 +23,11 @@ public:
protected:
AudioToolBox();
private:
GLuint _micTextureId;
GLuint _muteTextureId;
GLuint _boxTextureId;
GLuint _micTextureId = 0;
GLuint _muteTextureId = 0;
GLuint _boxTextureId = 0;
QRect _iconBounds;
qint64 _iconPulseTimeReference;
qint64 _iconPulseTimeReference = 0;
};
#endif // hifi_AudioToolBox_h

View file

@ -18,7 +18,7 @@
#include "FaceTracker.h"
class DdeFaceTracker : public FaceTracker {
class DdeFaceTracker : public FaceTracker, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -24,7 +24,7 @@
#include "FaceTracker.h"
/// Handles interaction with the Faceshift software, which provides head position/orientation and facial features.
class Faceshift : public FaceTracker {
class Faceshift : public FaceTracker, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -26,7 +26,7 @@ namespace VisageSDK {
}
/// Handles input from the Visage webcam feature tracking software.
class Visage : public FaceTracker {
class Visage : public FaceTracker, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -24,7 +24,7 @@ class Animation;
typedef QSharedPointer<Animation> AnimationPointer;
/// Scriptable interface for FBX animation loading.
class AnimationCache : public ResourceCache {
class AnimationCache : public ResourceCache, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -27,7 +27,7 @@ const QString DEFAULT_HIFI_ADDRESS = "hifi://sandbox";
typedef const glm::vec3& (*PositionGetter)();
typedef glm::quat (*OrientationGetter)();
class AddressManager : public QObject {
class AddressManager : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
Q_PROPERTY(bool isConnected READ isConnected)

View file

@ -69,7 +69,7 @@ namespace PingType {
const PingType_t Symmetric = 3;
}
class LimitedNodeList : public QObject {
class LimitedNodeList : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -19,7 +19,7 @@ class ProgramObject;
/// A screen space ambient occlusion effect. See John Chapman's tutorial at
/// http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html for reference.
class AmbientOcclusionEffect {
class AmbientOcclusionEffect : public Dependency {
SINGLETON_DEPENDENCY
public:

View file

@ -23,7 +23,7 @@ class AbstractViewStateInterface;
class PostLightingRenderable;
/// Handles deferred lighting for the bits that require it (voxels, metavoxels...)
class DeferredLightingEffect {
class DeferredLightingEffect : public Dependency {
SINGLETON_DEPENDENCY
public:

View file

@ -76,7 +76,7 @@ inline uint qHash(const Vec3PairVec2Pair& v, uint seed) {
/// Stores cached geometry.
class GeometryCache : public ResourceCache {
class GeometryCache : public ResourceCache, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -25,7 +25,7 @@ class QOpenGLFramebufferObject;
class ProgramObject;
/// A generic full screen glow effect.
class GlowEffect : public QObject {
class GlowEffect : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -467,7 +467,7 @@ Q_DECLARE_METATYPE(QWeakPointer<NetworkGeometry>)
Q_DECLARE_METATYPE(QVector<glm::vec3>)
/// Handle management of pending models that need blending
class ModelBlender : public QObject {
class ModelBlender : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY

View file

@ -30,7 +30,7 @@ typedef QSharedPointer<NetworkTexture> NetworkTexturePointer;
enum TextureType { DEFAULT_TEXTURE, NORMAL_TEXTURE, SPECULAR_TEXTURE, EMISSIVE_TEXTURE, SPLAT_TEXTURE };
/// Stores cached textures, including render-to-texture targets.
class TextureCache : public ResourceCache {
class TextureCache : public ResourceCache, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY