mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 20:26:30 +01:00
[Summary] Fixed issue when device supports only 0 sample rate
[Details] Removed commented out code
This commit is contained in:
parent
73e30f17ab
commit
7d467ecc66
1 changed files with 21 additions and 23 deletions
|
|
@ -941,21 +941,6 @@ WTErr WCMRCoreAudioDevice::SetAndCheckCurrentSamplingRate (int newRate)
|
||||||
OSStatus err = kAudioHardwareNoError;
|
OSStatus err = kAudioHardwareNoError;
|
||||||
UInt32 propSize = 0;
|
UInt32 propSize = 0;
|
||||||
|
|
||||||
// Check current sample rate
|
|
||||||
/*
|
|
||||||
propSize = sizeof (Float64);
|
|
||||||
Float64 currentSamplingRate = 0.0;
|
|
||||||
err = AudioDeviceGetProperty(m_DeviceID, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, ¤tSamplingRate);
|
|
||||||
if (err == kAudioHardwareNoError)
|
|
||||||
{
|
|
||||||
if (currentSamplingRate == newRate)
|
|
||||||
{
|
|
||||||
// nothing to do
|
|
||||||
return (retVal);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
// 1. Set new sampling rate
|
// 1. Set new sampling rate
|
||||||
Float64 newNominalRate = newRate;
|
Float64 newNominalRate = newRate;
|
||||||
propSize = sizeof (Float64);
|
propSize = sizeof (Float64);
|
||||||
|
|
@ -1016,6 +1001,16 @@ WTErr WCMRCoreAudioDevice::SetAndCheckCurrentSamplingRate (int newRate)
|
||||||
// If sample rate did not change after time out
|
// If sample rate did not change after time out
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Check if current device sample rate is supported
|
||||||
|
bool found = false;
|
||||||
|
for(int i = 0; gAllSampleRates[i] > 0; i++)
|
||||||
|
{
|
||||||
|
if (gAllSampleRates[i] - actualSamplingRate < 0.01) {
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found) {
|
||||||
// Update member with last read value
|
// Update member with last read value
|
||||||
m_CurrentSamplingRate = static_cast<int>(actualSamplingRate);
|
m_CurrentSamplingRate = static_cast<int>(actualSamplingRate);
|
||||||
|
|
||||||
|
|
@ -1025,6 +1020,9 @@ WTErr WCMRCoreAudioDevice::SetAndCheckCurrentSamplingRate (int newRate)
|
||||||
|
|
||||||
float sample_rate_update = actualSamplingRate;
|
float sample_rate_update = actualSamplingRate;
|
||||||
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::SamplingRateChanged, (void *)&sample_rate_update);
|
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::SamplingRateChanged, (void *)&sample_rate_update);
|
||||||
|
} else {
|
||||||
|
retVal = eGenericErr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue