Sound and AudioInjector tweaks

This commit is contained in:
Atlante45 2014-08-18 12:28:44 -07:00
parent 47685b0e88
commit 2eb1321cc2
3 changed files with 15 additions and 2 deletions

View file

@ -37,8 +37,8 @@ public:
float getVolume() const { return _volume; }
void setVolume(float volume) { _volume = volume; }
float getLoop() const { return _loop; }
void setLoop(float loop) { _loop = loop; }
bool getLoop() const { return _loop; }
void setLoop(bool loop) { _loop = loop; }
const glm::quat& getOrientation() const { return _orientation; }
void setOrientation(const glm::quat& orientation) { _orientation = orientation; }

View file

@ -82,6 +82,17 @@ Sound::Sound(const QUrl& sampleURL, QObject* parent) :
connect(soundDownload, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(replyError(QNetworkReply::NetworkError)));
}
Sound::Sound(const QByteArray byteArray, QObject* parent) :
QObject(parent),
_byteArray(byteArray),
_hasDownloaded(true)
{
}
void Sound::append(const QByteArray byteArray) {
_byteArray.append(byteArray);
}
void Sound::replyFinished() {
QNetworkReply* reply = reinterpret_cast<QNetworkReply*>(sender());

View file

@ -22,6 +22,8 @@ class Sound : public QObject {
public:
Sound(const QUrl& sampleURL, QObject* parent = NULL);
Sound(float volume, float frequency, float duration, float decay, QObject* parent = NULL);
Sound(const QByteArray byteArray, QObject* parent = NULL);
void append(const QByteArray byteArray);
bool hasDownloaded() const { return _hasDownloaded; }