Showing the changes to libraries/script-engine/src/RecordingScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -177,8 +177,7 @@ void RecordingScriptingInterface::saveRecording(const QString& filename) { · 176 unmodified lines | ||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUrl) { |
| 180 | − | |
| 181 | − if (!getClipAtpUrl.isFunction()) | |
| 180 | + if (!getClipAtpUrl.isFunction()) | |
| 182 | 181 | return false; |
| 183 | 182 | |
| 184 | 183 | if (QThread::currentThread() != thread()) { |
| @@ -192,13 +191,14 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr · 7 unmodified lines | ||
| 192 | 191 | return false; |
| 193 | 192 | } |
| 194 | 193 | |
| 195 | − QString filename = "./temp.hfr"; | |
| 196 | − recording::Clip::toFile(filename, _lastClip); | |
| 197 | − | |
| 198 | − QUrl url{ filename }; | |
| 194 | + //QString filename = "./temp.hfr"; | |
| 195 | + //recording::Clip::toFile(filename, _lastClip); | |
| 199 | 196 | |
| 200 | − if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) { // Here we should use the other implementation of createUpload, but we need the QByteArray of the _lastClip | |
| 197 | + //QUrl url{ filename }; | |
| 201 | 198 | |
| 199 | + //if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) { | |
| 200 | + | |
| 201 | + if (auto upload = DependencyManager::get<AssetClient>()->createUpload(recording::Clip::toBuffer(_lastClip), HFR_EXTENSION)) { | |
| 202 | 202 | QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable { |
| 203 | 203 | auto filename = QFileInfo(upload->getFilename()).fileName(); |
| 204 | 204 | QString clip_atp_url = ""; |
| @@ -215,18 +215,13 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr · 10 unmodified lines | ||
| 215 | 215 | args << clip_atp_url; |
| 216 | 216 | getClipAtpUrl.call(QScriptValue(), args); |
| 217 | 217 | }); |
| 218 | − | |
| 219 | − // start the upload now | |
| 220 | 218 | upload->start(); |
| 221 | 219 | return true; |
| 222 | − | |
| 223 | − } | |
| 220 | + } | |
| 224 | 221 | |
| 225 | 222 | return false; |
| 226 | − | |
| 227 | 223 | } |
| 228 | 224 | |
| 229 | − | |
| 230 | 225 | void RecordingScriptingInterface::loadLastRecording() { |
| 231 | 226 | if (QThread::currentThread() != thread()) { |
| 232 | 227 | QMetaObject::invokeMethod(this, "loadLastRecording", Qt::BlockingQueuedConnection); |