removed reliance on Qt multimedia
This commit is contained in:
@@ -48,21 +48,6 @@ AudioManager *AudioManager::instance()
|
||||
|
||||
void AudioManager::RefreshDevices()
|
||||
{
|
||||
if (!is_refreshing_outputs_) {
|
||||
QFutureWatcher< QList<QAudioDeviceInfo> >* output_watcher = new QFutureWatcher< QList<QAudioDeviceInfo> >();
|
||||
connect(output_watcher, &QFutureWatcher< QList<QAudioDeviceInfo> >::finished, this, &AudioManager::OutputDevicesRefreshed);
|
||||
output_watcher->setFuture(QtConcurrent::run(QAudioDeviceInfo::availableDevices, QAudio::AudioOutput));
|
||||
|
||||
is_refreshing_outputs_ = true;
|
||||
}
|
||||
|
||||
if (!is_refreshing_inputs_) {
|
||||
QFutureWatcher< QList<QAudioDeviceInfo> >* input_watcher = new QFutureWatcher< QList<QAudioDeviceInfo> >();
|
||||
connect(input_watcher, &QFutureWatcher< QList<QAudioDeviceInfo> >::finished, this, &AudioManager::InputDevicesRefreshed);
|
||||
input_watcher->setFuture(QtConcurrent::run(QAudioDeviceInfo::availableDevices, QAudio::AudioInput));
|
||||
|
||||
is_refreshing_inputs_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool AudioManager::IsRefreshingOutputs()
|
||||
@@ -209,16 +194,6 @@ void AudioManager::SetInputDevice(PaDeviceIndex device)
|
||||
input_device_ = device;
|
||||
}
|
||||
|
||||
const QList<QAudioDeviceInfo> &AudioManager::ListInputDevices()
|
||||
{
|
||||
return input_devices_;
|
||||
}
|
||||
|
||||
const QList<QAudioDeviceInfo> &AudioManager::ListOutputDevices()
|
||||
{
|
||||
return output_devices_;
|
||||
}
|
||||
|
||||
AudioManager::AudioManager() :
|
||||
is_refreshing_inputs_(false),
|
||||
is_refreshing_outputs_(false),
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define AUDIOMANAGER_H
|
||||
|
||||
#include <memory>
|
||||
#include <QAudioInput>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
#include <QThread>
|
||||
#include <portaudio.h>
|
||||
@@ -68,9 +67,6 @@ public:
|
||||
|
||||
void SetInputDevice(PaDeviceIndex device);
|
||||
|
||||
const QList<QAudioDeviceInfo>& ListInputDevices();
|
||||
const QList<QAudioDeviceInfo>& ListOutputDevices();
|
||||
|
||||
signals:
|
||||
void OutputListReady();
|
||||
|
||||
@@ -87,9 +83,6 @@ private:
|
||||
|
||||
void CloseOutputStream();
|
||||
|
||||
QList<QAudioDeviceInfo> input_devices_;
|
||||
QList<QAudioDeviceInfo> output_devices_;
|
||||
|
||||
bool is_refreshing_inputs_;
|
||||
bool is_refreshing_outputs_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user