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

WFM modulator: use settings in GUI (2)

This commit is contained in:
f4exb 2017-10-13 08:34:38 +02:00
parent 5746aa1189
commit 394e2864d2
3 changed files with 41 additions and 2 deletions

View File

@ -414,9 +414,11 @@ void NFMModGUI::displaySettings()
ui->toneFrequency->setValue(m_settings.m_toneFrequency / 10.0);
ui->ctcssOn->setChecked(m_settings.m_ctcssOn);
ui->channelMute->setChecked(m_settings.m_channelMute);
ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex);
ui->channelMute->setChecked(m_settings.m_channelMute);
ui->playLoop->setChecked(m_settings.m_playLoop);
blockApplySettings(false);
}

View File

@ -399,10 +399,13 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
ui->cwKeyerGUI->setBuddies(m_wfmMod->getInputMessageQueue(), m_wfmMod->getCWKeyer());
applySettings();
m_settings.setChannelMarker(&m_channelMarker);
m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
connect(m_wfmMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
applySettings();
}
WFMModGUI::~WFMModGUI()
@ -453,6 +456,39 @@ void WFMModGUI::applySettings()
}
}
void WFMModGUI::displaySettings()
{
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->rfBW->setCurrentIndex(WFMModSettings::getRFBWIndex(m_settings.m_rfBandwidth));
ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0));
ui->afBW->setValue(m_settings.m_afBandwidth / 1000.0);
ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0));
ui->fmDev->setValue(m_settings.m_fmDeviation / 1000.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
ui->volume->setValue(m_settings.m_volumeFactor * 10.0);
ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
ui->toneFrequency->setValue(m_settings.m_toneFrequency / 10.0);
ui->channelMute->setChecked(m_settings.m_channelMute);
ui->playLoop->setChecked(m_settings.m_playLoop);
blockApplySettings(false);
}
void WFMModGUI::leaveEvent(QEvent*)
{
blockApplySettings(true);

View File

@ -114,6 +114,7 @@ private:
void blockApplySettings(bool block);
void applySettings();
void displaySettings();
void updateWithStreamData();
void updateWithStreamTime();