diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index e58950e42..9948f9b3e 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -110,8 +110,10 @@ bool WFMModGUI::handleMessage(const Message& message) } } -void WFMModGUI::channelMarkerChanged() +void WFMModGUI::channelMarkerChangedByCursor() { + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); + m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); applySettings(); } @@ -302,15 +304,22 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); + m_channelMarker.blockSignals(true); + m_channelMarker.setColor(Qt::blue); + m_channelMarker.setBandwidth(125000); + m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("WFM Modulator"); - m_channelMarker.setVisible(true); - - connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); + m_channelMarker.setUDPAddress("127.0.0.1"); + m_channelMarker.setUDPSendPort(9999); + m_channelMarker.blockSignals(false); + m_channelMarker.setVisible(true); // activate signal on the last setting only m_deviceUISet->registerTxChannelInstance(WFMMod::m_channelID, this); m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); + connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + ui->play->setEnabled(false); ui->play->setChecked(false); ui->tone->setChecked(false); @@ -363,14 +372,16 @@ 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); + m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only + setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); blockApplySettings(true); + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); + ui->rfBW->setCurrentIndex(WFMModSettings::getRFBWIndex(m_settings.m_rfBandwidth)); ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0)); @@ -393,16 +404,12 @@ void WFMModGUI::displaySettings() void WFMModGUI::leaveEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(false); - blockApplySettings(false); } void WFMModGUI::enterEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(true); - blockApplySettings(false); } void WFMModGUI::tick() diff --git a/plugins/channeltx/modwfm/wfmmodgui.h b/plugins/channeltx/modwfm/wfmmodgui.h index 6272dc768..ab3502d7a 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.h +++ b/plugins/channeltx/modwfm/wfmmodgui.h @@ -54,30 +54,8 @@ public: virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } virtual bool handleMessage(const Message& message); -private slots: - void channelMarkerChanged(); - void handleSourceMessages(); - - void on_deltaFrequency_changed(qint64 value); - void on_rfBW_currentIndexChanged(int index); - void on_afBW_valueChanged(int value); - void on_fmDev_valueChanged(int value); - void on_toneFrequency_valueChanged(int value); - void on_volume_valueChanged(int value); - void on_channelMute_toggled(bool checked); - void on_tone_toggled(bool checked); - void on_morseKeyer_toggled(bool checked); - void on_mic_toggled(bool checked); - void on_play_toggled(bool checked); - - void on_playLoop_toggled(bool checked); - void on_navTimeSlider_valueChanged(int value); - void on_showFileDialog_clicked(bool checked); - - void onWidgetRolled(QWidget* widget, bool rollDown); - - void configureFileName(); - void tick(); +public slots: + void channelMarkerChangedByCursor(); private: Ui::WFMModGUI* ui; @@ -121,6 +99,30 @@ private: return (3*rfBW)/2; } } + +private slots: + void handleSourceMessages(); + + void on_deltaFrequency_changed(qint64 value); + void on_rfBW_currentIndexChanged(int index); + void on_afBW_valueChanged(int value); + void on_fmDev_valueChanged(int value); + void on_toneFrequency_valueChanged(int value); + void on_volume_valueChanged(int value); + void on_channelMute_toggled(bool checked); + void on_tone_toggled(bool checked); + void on_morseKeyer_toggled(bool checked); + void on_mic_toggled(bool checked); + void on_play_toggled(bool checked); + + void on_playLoop_toggled(bool checked); + void on_navTimeSlider_valueChanged(int value); + void on_showFileDialog_clicked(bool checked); + + void onWidgetRolled(QWidget* widget, bool rollDown); + + void configureFileName(); + void tick(); }; #endif /* PLUGINS_CHANNELTX_MODWFM_WFMMODGUI_H_ */ diff --git a/plugins/channeltx/modwfm/wfmmodplugin.cpp b/plugins/channeltx/modwfm/wfmmodplugin.cpp index ceadbbefa..ef3b71192 100644 --- a/plugins/channeltx/modwfm/wfmmodplugin.cpp +++ b/plugins/channeltx/modwfm/wfmmodplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor WFMModPlugin::m_pluginDescriptor = { QString("WFM Modulator"), - QString("3.8.3"), + QString("3.8.4"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,