mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Replace QAudioDeviceInfo with CAudioDeviceInfo where possible
QAudioDeviceInfo is a low level technical class, which shouldn't be used in higher level code. Remove it from all APIs where possible and just create it in order to interface with QAudio
This commit is contained in:
committed by
Mat Sutcliffe
parent
8656131eb1
commit
a2e3700739
@@ -26,27 +26,6 @@ namespace BlackMisc
|
||||
m_deviceName(name), m_hostName(QHostInfo::localHostName())
|
||||
{ }
|
||||
|
||||
QAudioDeviceInfo CAudioDeviceInfo::toAudioDeviceInfo() const
|
||||
{
|
||||
QList<QAudioDeviceInfo> devices;
|
||||
switch (this->getType())
|
||||
{
|
||||
case InputDevice: devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput); break;
|
||||
case OutputDevice: devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput); break;
|
||||
default:
|
||||
devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
devices += QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
|
||||
break;
|
||||
}
|
||||
|
||||
for (const QAudioDeviceInfo &d : as_const(devices))
|
||||
{
|
||||
if (d.deviceName() == this->getName()) { return d; }
|
||||
}
|
||||
|
||||
return QAudioDeviceInfo();
|
||||
}
|
||||
|
||||
CAudioDeviceInfo::DeviceType CAudioDeviceInfo::fromQtMode(QAudio::Mode m)
|
||||
{
|
||||
switch (m)
|
||||
|
||||
Reference in New Issue
Block a user