1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Audio UDP/RTP: renamed decimation attribute

This commit is contained in:
f4exb 2019-02-15 07:57:16 +01:00
parent 8e4082f53c
commit fda0690e81
3 changed files with 13 additions and 13 deletions

View File

@ -49,7 +49,7 @@ QDataStream& operator<<(QDataStream& ds, const AudioDeviceManager::OutputDeviceI
<< info.udpUseRTP
<< (int) info.udpChannelMode
<< (int) info.udpChannelCodec
<< info.decimationFactor;
<< info.udpDecimationFactor;
return ds;
}
@ -65,7 +65,7 @@ QDataStream& operator>>(QDataStream& ds, AudioDeviceManager::OutputDeviceInfo& i
>> info.udpUseRTP
>> intChannelMode
>> intChannelCodec
>> info.decimationFactor;
>> info.udpDecimationFactor;
info.udpChannelMode = (AudioOutput::UDPChannelMode) intChannelMode;
info.udpChannelCodec = (AudioOutput::UDPChannelCodec) intChannelCodec;
return ds;
@ -389,7 +389,7 @@ void AudioDeviceManager::startAudioOutput(int outputDeviceIndex)
udpUseRTP = m_audioOutputInfos[deviceName].udpUseRTP;
udpChannelMode = m_audioOutputInfos[deviceName].udpChannelMode;
udpChannelCodec = m_audioOutputInfos[deviceName].udpChannelCodec;
decimationFactor = m_audioOutputInfos[deviceName].decimationFactor;
decimationFactor = m_audioOutputInfos[deviceName].udpDecimationFactor;
}
m_audioOutputs[outputDeviceIndex]->start(outputDeviceIndex, sampleRate);
@ -400,7 +400,7 @@ void AudioDeviceManager::startAudioOutput(int outputDeviceIndex)
m_audioOutputInfos[deviceName].udpUseRTP = udpUseRTP;
m_audioOutputInfos[deviceName].udpChannelMode = udpChannelMode;
m_audioOutputInfos[deviceName].udpChannelCodec = udpChannelCodec;
m_audioOutputInfos[deviceName].decimationFactor = decimationFactor;
m_audioOutputInfos[deviceName].udpDecimationFactor = decimationFactor;
}
else
{
@ -614,7 +614,7 @@ void AudioDeviceManager::setOutputDeviceInfo(int outputDeviceIndex, const Output
audioOutput->setUdpUseRTP(deviceInfo.udpUseRTP);
audioOutput->setUdpChannelMode(deviceInfo.udpChannelMode);
audioOutput->setUdpChannelFormat(deviceInfo.udpChannelCodec, deviceInfo.udpChannelMode == AudioOutput::UDPChannelStereo, deviceInfo.sampleRate);
audioOutput->setUdpDecimation(deviceInfo.decimationFactor);
audioOutput->setUdpDecimation(deviceInfo.udpDecimationFactor);
qDebug("AudioDeviceManager::setOutputDeviceInfo: index: %d device: %s updated",
outputDeviceIndex, qPrintable(deviceName));
@ -784,6 +784,6 @@ void AudioDeviceManager::debugAudioOutputInfos() const
<< " udpUseRTP: " << it.value().udpUseRTP
<< " udpChannelMode: " << (int) it.value().udpChannelMode
<< " udpChannelCodec: " << (int) it.value().udpChannelCodec
<< " decimationFactor: " << it.value().decimationFactor;
<< " decimationFactor: " << it.value().udpDecimationFactor;
}
}

View File

@ -61,7 +61,7 @@ public:
udpUseRTP(false),
udpChannelMode(AudioOutput::UDPChannelLeft),
udpChannelCodec(AudioOutput::UDPCodecL16),
decimationFactor(1)
udpDecimationFactor(1)
{}
void resetToDefaults() {
sampleRate = m_defaultAudioSampleRate;
@ -71,7 +71,7 @@ public:
udpUseRTP = false;
udpChannelMode = AudioOutput::UDPChannelLeft;
udpChannelCodec = AudioOutput::UDPCodecL16;
decimationFactor = 1;
udpDecimationFactor = 1;
}
unsigned int sampleRate;
QString udpAddress;
@ -80,7 +80,7 @@ public:
bool udpUseRTP;
AudioOutput::UDPChannelMode udpChannelMode;
AudioOutput::UDPChannelCodec udpChannelCodec;
uint32_t decimationFactor;
uint32_t udpDecimationFactor;
friend QDataStream& operator<<(QDataStream& ds, const OutputDeviceInfo& info);
friend QDataStream& operator>>(QDataStream& ds, OutputDeviceInfo& info);
};

View File

@ -219,7 +219,7 @@ void AudioDialogX::on_outputSampleRate_valueChanged(int value)
void AudioDialogX::on_decimationFactor_currentIndexChanged(int index)
{
m_outputDeviceInfo.decimationFactor = index + 1;
m_outputDeviceInfo.udpDecimationFactor = index + 1;
updateOutputSDPString();
}
@ -244,7 +244,7 @@ void AudioDialogX::updateOutputDisplay()
ui->outputUDPUseRTP->setChecked(m_outputDeviceInfo.udpUseRTP);
ui->outputUDPChannelMode->setCurrentIndex((int) m_outputDeviceInfo.udpChannelMode);
ui->outputUDPChannelCodec->setCurrentIndex((int) m_outputDeviceInfo.udpChannelCodec);
ui->decimationFactor->setCurrentIndex(m_outputDeviceInfo.decimationFactor == 0 ? 0 : m_outputDeviceInfo.decimationFactor - 1);
ui->decimationFactor->setCurrentIndex(m_outputDeviceInfo.udpDecimationFactor == 0 ? 0 : m_outputDeviceInfo.udpDecimationFactor - 1);
updateOutputSDPString();
}
@ -257,7 +257,7 @@ void AudioDialogX::updateOutputDeviceInfo()
m_outputDeviceInfo.udpUseRTP = ui->outputUDPUseRTP->isChecked();
m_outputDeviceInfo.udpChannelMode = (AudioOutput::UDPChannelMode) ui->outputUDPChannelMode->currentIndex();
m_outputDeviceInfo.udpChannelCodec = (AudioOutput::UDPChannelCodec) ui->outputUDPChannelCodec->currentIndex();
m_outputDeviceInfo.decimationFactor = ui->decimationFactor->currentIndex() + 1;
m_outputDeviceInfo.udpDecimationFactor = ui->decimationFactor->currentIndex() + 1;
}
void AudioDialogX::updateOutputSDPString()
@ -282,7 +282,7 @@ void AudioDialogX::updateOutputSDPString()
}
int nChannels = m_outputDeviceInfo.udpChannelMode == AudioOutput::UDPChannelStereo ? 2 : 1;
uint32_t decimationFactor = m_outputDeviceInfo.decimationFactor == 0 ? 1 : m_outputDeviceInfo.decimationFactor;
uint32_t decimationFactor = m_outputDeviceInfo.udpDecimationFactor == 0 ? 1 : m_outputDeviceInfo.udpDecimationFactor;
ui->outputSDPText->setText(tr("%1/%2/%3").arg(format).arg(m_outputDeviceInfo.sampleRate/decimationFactor).arg(nChannels));
}