audio: don't use a shared QIODevice

This system was kind of janky anyway. It makes more sense ultimately for the
audio management classes to contain the file handle rather than the renderer.
This commit is contained in:
itsmattkc
2020-04-21 17:55:55 +10:00
parent 1d3b9bbf13
commit 05eae1e28a
10 changed files with 51 additions and 49 deletions
+3 -3
View File
@@ -82,9 +82,9 @@ void AudioOutputManager::SetParameters(const AudioRenderingParams &params)
device_proxy_.SetParameters(params);
}
void AudioOutputManager::PullFromDevice(QIODevice *device, int playback_speed)
void AudioOutputManager::PullFromDevice(const QString &filename, qint64 offset, int playback_speed)
{
if (!output_ || !device) {
if (!output_) {
return;
}
@@ -94,7 +94,7 @@ void AudioOutputManager::PullFromDevice(QIODevice *device, int playback_speed)
pushed_samples_.clear();
// Pull from the device
device_proxy_.SetDevice(device, playback_speed);
device_proxy_.SetDevice(filename, offset, playback_speed);
device_proxy_.open(QIODevice::ReadOnly);
output_->start(&device_proxy_);
}