diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2015-03-25 19:43:19 +0530 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-04-23 11:56:18 +0000 |
commit | 176d52bb28b425f697ad8df001ba2c7c52fda766 (patch) | |
tree | ffc4740404f9537bcef939acddb25c2cce4f7203 /src/imports/audioengine/qdeclarative_audiosample_p.h | |
parent | 227c8aa723d9e82c2826a1d2823cd73236f18bbb (diff) |
Refactored code for audio engine to allow dynamic object creation
QDeclarativeSound, QDeclarativeAudioSample, QDeclarativeAudioCategory
and QDeclarativeAttenuationModel can now be dynamically added to
AudioEngine instance or declared inside AudioEngine object definition.
QDeclarativePlayVariation can now be dynamically added to Sound
instance or declared inside Sound object definition.
Change-Id: If4c2e16895a71eb71ded1998c107360698f8ac7f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/imports/audioengine/qdeclarative_audiosample_p.h')
-rw-r--r-- | src/imports/audioengine/qdeclarative_audiosample_p.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/imports/audioengine/qdeclarative_audiosample_p.h b/src/imports/audioengine/qdeclarative_audiosample_p.h index 94e1c7e27..5b549e785 100644 --- a/src/imports/audioengine/qdeclarative_audiosample_p.h +++ b/src/imports/audioengine/qdeclarative_audiosample_p.h @@ -35,16 +35,15 @@ #define QDECLARATIVEAUDIOSAMPLE_P_H #include <QtQml/qqml.h> -#include <QtQml/qqmlcomponent.h> QT_BEGIN_NAMESPACE class QSoundBuffer; +class QDeclarativeAudioEngine; -class QDeclarativeAudioSample : public QObject, public QQmlParserStatus +class QDeclarativeAudioSample : public QObject { Q_OBJECT - Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QUrl source READ source WRITE setSource) Q_PROPERTY(bool preloaded READ isPreloaded WRITE setPreloaded) @@ -55,9 +54,6 @@ public: QDeclarativeAudioSample(QObject *parent = 0); ~QDeclarativeAudioSample(); - void classBegin(); - void componentComplete(); - QString name() const; void setName(const QString& name); @@ -70,6 +66,9 @@ public: bool isPreloaded() const; void setPreloaded(bool preloaded); + QDeclarativeAudioEngine *engine() const; + void setEngine(QDeclarativeAudioEngine *); + bool isLoaded() const; QSoundBuffer* soundBuffer() const; @@ -85,13 +84,12 @@ public Q_SLOTS: private: Q_DISABLE_COPY(QDeclarativeAudioSample); - bool m_complete; QString m_name; QUrl m_url; bool m_streaming; bool m_preloaded; - QSoundBuffer *m_soundBuffer; + QDeclarativeAudioEngine *m_engine; }; QT_END_NAMESPACE |