mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-12 19:42:34 -04:00
Merge pull request #2461 from srcejon/fix_2456
Add 384000 and maximum supported audio sample rates for Qt 6
This commit is contained in:
commit
05f88acf02
@ -44,7 +44,7 @@ QList<int> AudioDeviceInfo::supportedSampleRates() const
|
|||||||
// QAudioDevice is a bit more flexible than QAudioDeviceInfo, in that it supports
|
// QAudioDevice is a bit more flexible than QAudioDeviceInfo, in that it supports
|
||||||
// min and max rate, rather than a specific list
|
// min and max rate, rather than a specific list
|
||||||
// For now, we just list some common rates.
|
// For now, we just list some common rates.
|
||||||
QList<int> sampleRates = {8000, 11025, 22050, 44100, 48000, 96000, 192000};
|
QList<int> sampleRates = {8000, 11025, 22050, 44100, 48000, 96000, 192000, 384000};
|
||||||
QList<int> supportedRates;
|
QList<int> supportedRates;
|
||||||
for (auto sampleRate : sampleRates)
|
for (auto sampleRate : sampleRates)
|
||||||
{
|
{
|
||||||
@ -52,6 +52,9 @@ QList<int> AudioDeviceInfo::supportedSampleRates() const
|
|||||||
supportedRates.append(sampleRate);
|
supportedRates.append(sampleRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!supportedRates.contains(m_deviceInfo.maximumSampleRate())) {
|
||||||
|
supportedRates.append(m_deviceInfo.maximumSampleRate());
|
||||||
|
}
|
||||||
return supportedRates;
|
return supportedRates;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -126,7 +129,7 @@ const QList<AudioDeviceInfo> &AudioDeviceInfo::availableOutputDevices()
|
|||||||
|
|
||||||
const AudioDeviceInfo &AudioDeviceInfo::defaultOutputDevice()
|
const AudioDeviceInfo &AudioDeviceInfo::defaultOutputDevice()
|
||||||
{
|
{
|
||||||
if (defaultOutputDevice_.m_deviceInfo.isNull())
|
if (defaultOutputDevice_.m_deviceInfo.isNull())
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
defaultOutputDevice_ = AudioDeviceInfo(QMediaDevices::defaultAudioOutput());
|
defaultOutputDevice_ = AudioDeviceInfo(QMediaDevices::defaultAudioOutput());
|
||||||
@ -139,7 +142,7 @@ const AudioDeviceInfo &AudioDeviceInfo::defaultOutputDevice()
|
|||||||
|
|
||||||
const AudioDeviceInfo &AudioDeviceInfo::defaultInputDevice()
|
const AudioDeviceInfo &AudioDeviceInfo::defaultInputDevice()
|
||||||
{
|
{
|
||||||
if (defaultInputDevice_.m_deviceInfo.isNull())
|
if (defaultInputDevice_.m_deviceInfo.isNull())
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
defaultInputDevice_ = AudioDeviceInfo(QMediaDevices::defaultAudioInput());
|
defaultInputDevice_ = AudioDeviceInfo(QMediaDevices::defaultAudioInput());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user