mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 20:31:29 +02:00
Switched Sound to NetworkAccessManager
This commit is contained in:
parent
74e7e0a7bf
commit
598c1cb516
2 changed files with 3 additions and 4 deletions
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QNetworkAccessManager>
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QScriptValue>
|
#include <QScriptValue>
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtNetwork/QNetworkAccessManager>
|
|
||||||
#include <QtNetwork/QNetworkRequest>
|
#include <QtNetwork/QNetworkRequest>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
#include <qendian.h>
|
#include <qendian.h>
|
||||||
|
|
||||||
#include <LimitedNodeList.h>
|
#include <LimitedNodeList.h>
|
||||||
|
#include <NetworkAccessManager.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
#include "AudioRingBuffer.h"
|
#include "AudioRingBuffer.h"
|
||||||
|
@ -73,11 +73,11 @@ Sound::Sound(const QUrl& sampleURL, QObject* parent) :
|
||||||
// assume we have a QApplication or QCoreApplication instance and use the
|
// assume we have a QApplication or QCoreApplication instance and use the
|
||||||
// QNetworkAccess manager to grab the raw audio file at the given URL
|
// QNetworkAccess manager to grab the raw audio file at the given URL
|
||||||
|
|
||||||
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
NetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
|
||||||
qDebug() << "Requesting audio file" << sampleURL.toDisplayString();
|
qDebug() << "Requesting audio file" << sampleURL.toDisplayString();
|
||||||
|
|
||||||
QNetworkReply* soundDownload = manager->get(QNetworkRequest(sampleURL));
|
QNetworkReply* soundDownload = networkAccessManager.get(QNetworkRequest(sampleURL));
|
||||||
connect(soundDownload, &QNetworkReply::finished, this, &Sound::replyFinished);
|
connect(soundDownload, &QNetworkReply::finished, this, &Sound::replyFinished);
|
||||||
connect(soundDownload, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(replyError(QNetworkReply::NetworkError)));
|
connect(soundDownload, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(replyError(QNetworkReply::NetworkError)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue