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>
This commit is contained in:
committed by
Konstantin Ritt
parent
227c8aa723
commit
176d52bb28
@@ -35,17 +35,16 @@
|
||||
#define QDECLARATIVEPLAYVARIATION_P_H
|
||||
|
||||
#include <QtQml/qqml.h>
|
||||
#include <QtQml/qqmlcomponent.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDeclarativeAudioSample;
|
||||
class QSoundInstance;
|
||||
class QDeclarativeAudioEngine;
|
||||
|
||||
class QDeclarativePlayVariation : public QObject, public QQmlParserStatus
|
||||
class QDeclarativePlayVariation : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QQmlParserStatus)
|
||||
Q_PROPERTY(QString sample READ sample WRITE setSample)
|
||||
Q_PROPERTY(bool looping READ isLooping WRITE setLooping)
|
||||
Q_PROPERTY(qreal maxGain READ maxGain WRITE setMaxGain)
|
||||
@@ -57,9 +56,6 @@ public:
|
||||
QDeclarativePlayVariation(QObject *parent = 0);
|
||||
~QDeclarativePlayVariation();
|
||||
|
||||
void classBegin();
|
||||
void componentComplete();
|
||||
|
||||
QString sample() const;
|
||||
void setSample(const QString& sample);
|
||||
|
||||
@@ -82,9 +78,10 @@ public:
|
||||
|
||||
void applyParameters(QSoundInstance *soundInstance);
|
||||
|
||||
void setEngine(QDeclarativeAudioEngine *engine);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDeclarativePlayVariation);
|
||||
bool m_complete;
|
||||
QString m_sample;
|
||||
bool m_looping;
|
||||
qreal m_maxGain;
|
||||
@@ -92,6 +89,7 @@ private:
|
||||
qreal m_maxPitch;
|
||||
qreal m_minPitch;
|
||||
QDeclarativeAudioSample *m_sampleObject;
|
||||
QDeclarativeAudioEngine *m_engine;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user