mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-08 08:54:49 -04:00
Modulator plugins with configurable audio: fixed audio sample rate handling
This commit is contained in:
@@ -411,6 +411,8 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_recordLength(0),
|
||||
m_recordSampleRate(48000),
|
||||
m_samplesCount(0),
|
||||
m_audioSampleRate(-1),
|
||||
m_feedbackAudioSampleRate(-1),
|
||||
m_tickCount(0),
|
||||
m_enableNavTime(false)
|
||||
{
|
||||
@@ -769,6 +771,32 @@ void SSBModGUI::tick()
|
||||
m_channelPowerDbAvg(powDb);
|
||||
ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
|
||||
|
||||
int audioSampleRate = m_ssbMod->getAudioSampleRate();
|
||||
|
||||
if (audioSampleRate != m_audioSampleRate)
|
||||
{
|
||||
if (audioSampleRate < 0) {
|
||||
ui->mic->setColor(QColor("red"));
|
||||
} else {
|
||||
ui->mic->resetColor();
|
||||
}
|
||||
|
||||
m_audioSampleRate = audioSampleRate;
|
||||
}
|
||||
|
||||
int feedbackAudioSampleRate = m_ssbMod->getFeedbackAudioSampleRate();
|
||||
|
||||
if (feedbackAudioSampleRate != m_feedbackAudioSampleRate)
|
||||
{
|
||||
if (feedbackAudioSampleRate < 0) {
|
||||
ui->feedbackEnable->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->feedbackEnable->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
m_feedbackAudioSampleRate = feedbackAudioSampleRate;
|
||||
}
|
||||
|
||||
if (((++m_tickCount & 0xf) == 0) && (m_settings.m_modAFInput == SSBModSettings::SSBModInputFile))
|
||||
{
|
||||
SSBMod::MsgConfigureFileSourceStreamTiming* message = SSBMod::MsgConfigureFileSourceStreamTiming::create();
|
||||
|
||||
Reference in New Issue
Block a user