diff --git a/plugins/channeltx/modam/ammodgui.cpp b/plugins/channeltx/modam/ammodgui.cpp index afb7b05b0..19b2b7c94 100644 --- a/plugins/channeltx/modam/ammodgui.cpp +++ b/plugins/channeltx/modam/ammodgui.cpp @@ -110,8 +110,10 @@ bool AMModGUI::handleMessage(const Message& message) } } -void AMModGUI::channelMarkerChanged() +void AMModGUI::channelMarkerChangedByCursor() { + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); + m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); applySettings(); } @@ -285,18 +287,25 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); + m_channelMarker.blockSignals(true); + m_channelMarker.setColor(Qt::yellow); + m_channelMarker.setBandwidth(5000); + m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("AM Modulator"); - m_channelMarker.setVisible(true); + 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_settings.setChannelMarker(&m_channelMarker); m_settings.setCWKeyerGUI(ui->cwKeyerGUI); - connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); - m_deviceUISet->registerTxChannelInstance(AMMod::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); @@ -334,8 +343,6 @@ void AMModGUI::applySettings(bool force __attribute((unused))) 48000, m_channelMarker.getCenterFrequency()); m_amMod->getInputMessageQueue()->push(msgConfigure); - ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); - AMMod::MsgConfigureAMMod* message = AMMod::MsgConfigureAMMod::create( m_settings, force); m_amMod->getInputMessageQueue()->push(message); } @@ -346,12 +353,16 @@ void AMModGUI::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->setValue(roundf(m_settings.m_rfBandwidth / 100.0)); ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); @@ -373,16 +384,12 @@ void AMModGUI::displaySettings() void AMModGUI::leaveEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(false); - blockApplySettings(false); } void AMModGUI::enterEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(true); - blockApplySettings(false); } void AMModGUI::tick() diff --git a/plugins/channeltx/modam/ammodgui.h b/plugins/channeltx/modam/ammodgui.h index 86a25c78b..bcfddced8 100644 --- a/plugins/channeltx/modam/ammodgui.h +++ b/plugins/channeltx/modam/ammodgui.h @@ -54,29 +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_valueChanged(int value); - void on_modPercent_valueChanged(int value); - void on_volume_valueChanged(int value); - void on_channelMute_toggled(bool checked); - void on_tone_toggled(bool checked); - void on_toneFrequency_valueChanged(int value); - void on_mic_toggled(bool checked); - void on_play_toggled(bool checked); - void on_morseKeyer_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::AMModGUI* ui; @@ -109,6 +88,29 @@ private: void leaveEvent(QEvent*); void enterEvent(QEvent*); + +private slots: + void handleSourceMessages(); + + void on_deltaFrequency_changed(qint64 value); + void on_rfBW_valueChanged(int value); + void on_modPercent_valueChanged(int value); + void on_volume_valueChanged(int value); + void on_channelMute_toggled(bool checked); + void on_tone_toggled(bool checked); + void on_toneFrequency_valueChanged(int value); + void on_mic_toggled(bool checked); + void on_play_toggled(bool checked); + void on_morseKeyer_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_MODAM_AMMODGUI_H_ */ diff --git a/plugins/channeltx/modam/ammodplugin.cpp b/plugins/channeltx/modam/ammodplugin.cpp index 501121d21..1010af8e7 100644 --- a/plugins/channeltx/modam/ammodplugin.cpp +++ b/plugins/channeltx/modam/ammodplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor AMModPlugin::m_pluginDescriptor = { QString("AM Modulator"), - QString("3.8.3"), + QString("3.8.4"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index bec4efbd7..bdb161ac3 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -151,8 +151,10 @@ bool ATVModGUI::handleMessage(const Message& message) } } -void ATVModGUI::channelMarkerChanged() +void ATVModGUI::channelMarkerChangedByCursor() { + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); + m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); applySettings(); } @@ -344,6 +346,7 @@ void ATVModGUI::handleSourceMessages() void ATVModGUI::on_deltaFrequency_changed(qint64 value) { m_channelMarker.setCenterFrequency(value); + applySettings(); } void ATVModGUI::on_modulation_currentIndexChanged(int index) @@ -605,20 +608,25 @@ ATVModGUI::ATVModGUI(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(m_settings.m_rgbColor); - m_channelMarker.setTitle("ATV Modulator"); m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); - m_channelMarker.setVisible(true); + m_channelMarker.setTitle("ATV Modulator"); + 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 + setTitleColor(m_channelMarker.getColor()); m_settings.setChannelMarker(&m_channelMarker); - connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); - m_deviceUISet->registerTxChannelInstance(ATVMod::m_channelID, this); m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); + connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); + resetToDefaults(); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); @@ -667,14 +675,17 @@ void ATVModGUI::displaySettings() { m_channelMarker.blockSignals(true); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); - m_channelMarker.setColor(m_settings.m_rgbColor); + setChannelMarkerBandwidth(); 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_settings.m_inputFrequencyOffset); + ui->modulation->setCurrentIndex((int) m_settings.m_atvModulation); setRFFiltersSlidersRange(m_atvMod->getEffectiveSampleRate()); @@ -684,9 +695,6 @@ void ATVModGUI::displaySettings() ui->rfOppBW->setValue(roundf(m_settings.m_rfOppBandwidth / m_rfSliderDivisor)); ui->rfOppBWText->setText(QString("%1k").arg((ui->rfOppBW->value()*m_rfSliderDivisor) / 1000.0, 0, 'f', 0)); - setChannelMarkerBandwidth(); - - ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset); ui->forceDecimator->setChecked(m_settings.m_forceDecimator); ui->channelMute->setChecked(m_settings.m_channelMute); @@ -722,16 +730,12 @@ void ATVModGUI::displaySettings() void ATVModGUI::leaveEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(false); - blockApplySettings(false); } void ATVModGUI::enterEvent(QEvent*) { - blockApplySettings(true); m_channelMarker.setHighlighted(true); - blockApplySettings(false); } void ATVModGUI::tick() diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h index 3f5c0fa18..f89dbb6dc 100644 --- a/plugins/channeltx/modatv/atvmodgui.h +++ b/plugins/channeltx/modatv/atvmodgui.h @@ -53,44 +53,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_channelMute_toggled(bool checked); - void on_forceDecimator_toggled(bool checked); - void on_modulation_currentIndexChanged(int index); - void on_rfScaling_valueChanged(int value); - void on_fmExcursion_valueChanged(int value); - void on_rfBW_valueChanged(int value); - void on_rfOppBW_valueChanged(int value); - void on_nbLines_currentIndexChanged(int index); - void on_fps_currentIndexChanged(int index); - void on_standard_currentIndexChanged(int index); - void on_invertVideo_clicked(bool checked); - void on_uniformLevel_valueChanged(int value); - void on_inputSelect_currentIndexChanged(int index); - void on_imageFileDialog_clicked(bool checked); - void on_videoFileDialog_clicked(bool checked); - - void on_playVideo_toggled(bool checked); - void on_playLoop_toggled(bool checked); - void on_navTimeSlider_valueChanged(int value); - - void on_playCamera_toggled(bool checked); - void on_camSelect_currentIndexChanged(int index); - void on_cameraManualFPSEnable_toggled(bool checked); - void on_cameraManualFPS_valueChanged(int value); - - void on_overlayTextShow_toggled(bool checked); - void on_overlayText_textEdited(const QString& arg1); - - void onWidgetRolled(QWidget* widget, bool rollDown); - - void configureImageFileName(); - void configureVideoFileName(); - void tick(); +public slots: + void channelMarkerChangedByCursor(); private: Ui::ATVModGUI* ui; @@ -131,6 +95,44 @@ private: void leaveEvent(QEvent*); void enterEvent(QEvent*); + +private slots: + void handleSourceMessages(); + + void on_deltaFrequency_changed(qint64 value); + void on_channelMute_toggled(bool checked); + void on_forceDecimator_toggled(bool checked); + void on_modulation_currentIndexChanged(int index); + void on_rfScaling_valueChanged(int value); + void on_fmExcursion_valueChanged(int value); + void on_rfBW_valueChanged(int value); + void on_rfOppBW_valueChanged(int value); + void on_nbLines_currentIndexChanged(int index); + void on_fps_currentIndexChanged(int index); + void on_standard_currentIndexChanged(int index); + void on_invertVideo_clicked(bool checked); + void on_uniformLevel_valueChanged(int value); + void on_inputSelect_currentIndexChanged(int index); + void on_imageFileDialog_clicked(bool checked); + void on_videoFileDialog_clicked(bool checked); + + void on_playVideo_toggled(bool checked); + void on_playLoop_toggled(bool checked); + void on_navTimeSlider_valueChanged(int value); + + void on_playCamera_toggled(bool checked); + void on_camSelect_currentIndexChanged(int index); + void on_cameraManualFPSEnable_toggled(bool checked); + void on_cameraManualFPS_valueChanged(int value); + + void on_overlayTextShow_toggled(bool checked); + void on_overlayText_textEdited(const QString& arg1); + + void onWidgetRolled(QWidget* widget, bool rollDown); + + void configureImageFileName(); + void configureVideoFileName(); + void tick(); }; #endif /* PLUGINS_CHANNELTX_MODAM_AMMODGUI_H_ */ diff --git a/plugins/channeltx/modatv/atvmodplugin.cpp b/plugins/channeltx/modatv/atvmodplugin.cpp index 49f44bf51..eb35b324c 100644 --- a/plugins/channeltx/modatv/atvmodplugin.cpp +++ b/plugins/channeltx/modatv/atvmodplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor ATVModPlugin::m_pluginDescriptor = { QString("ATV Modulator"), - QString("3.8.3"), + QString("3.8.4"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,