From 394e2864d2a553505af5644e496bb31a52ccc6cf Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 13 Oct 2017 08:34:38 +0200 Subject: [PATCH] WFM modulator: use settings in GUI (2) --- plugins/channeltx/modnfm/nfmmodgui.cpp | 4 ++- plugins/channeltx/modwfm/wfmmodgui.cpp | 38 +++++++++++++++++++++++++- plugins/channeltx/modwfm/wfmmodgui.h | 1 + 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 401750937..976d9283a 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -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); } diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index d3c3bb7a2..ba8abbe72 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -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); diff --git a/plugins/channeltx/modwfm/wfmmodgui.h b/plugins/channeltx/modwfm/wfmmodgui.h index 6c374b358..0c21d127e 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.h +++ b/plugins/channeltx/modwfm/wfmmodgui.h @@ -114,6 +114,7 @@ private: void blockApplySettings(bool block); void applySettings(); + void displaySettings(); void updateWithStreamData(); void updateWithStreamTime();