Showing the changes to libraries/script-engine/src/Script.cpp (1 of 8 files). Show all
Unified · Split
| @@ -0,0 +1,49 @@ | ||
| 1 | +// | |
| 2 | +// Script.cpp | |
| 3 | +// libraries/script-engine/src | |
| 4 | +// | |
| 5 | +// Created by Brad Hefta-Gaub on 2015-03-30 | |
| 6 | +// Copyright 2015 High Fidelity, Inc. | |
| 7 | +// | |
| 8 | +// Distributed under the Apache License, Version 2.0. | |
| 9 | +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | |
| 10 | +// | |
| 11 | + | |
| 12 | +/* | |
| 13 | +#include <stdint.h> | |
| 14 | + | |
| 15 | +#include <glm/glm.hpp> | |
| 16 | + | |
| 17 | +#include <QDataStream> | |
| 18 | +#include <QtCore/QDebug> | |
| 19 | +#include <QtNetwork/QNetworkRequest> | |
| 20 | +#include <QtNetwork/QNetworkReply> | |
| 21 | +#include <qendian.h> | |
| 22 | + | |
| 23 | +#include <LimitedNodeList.h> | |
| 24 | +#include <NetworkAccessManager.h> | |
| 25 | +#include <SharedUtil.h> | |
| 26 | + | |
| 27 | +#include "AudioRingBuffer.h" | |
| 28 | +#include "AudioFormat.h" | |
| 29 | +#include "AudioBuffer.h" | |
| 30 | +#include "AudioEditBuffer.h" | |
| 31 | +*/ | |
| 32 | + | |
| 33 | +#include "Script.h" | |
| 34 | + | |
| 35 | +Script::Script(const QUrl& url) : | |
| 36 | + Resource(url), | |
| 37 | + _isReady(false) | |
| 38 | +{ | |
| 39 | + | |
| 40 | +} | |
| 41 | + | |
| 42 | +void Script::downloadFinished(QNetworkReply* reply) { | |
| 43 | + // replace our byte array with the downloaded data | |
| 44 | + _contents = reply->readAll(); | |
| 45 | + qDebug() << "Script downloaded from:" << getURL(); | |
| 46 | + _isReady = true; | |
| 47 | + reply->deleteLater(); | |
| 48 | +} | |
| 49 | + | |