mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-10-01 01:06:35 -04:00
NFM demod: implemented basic channel settings dialog
This commit is contained in:
parent
64e1389222
commit
939e423c02
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
||||||
QString("AM Demodulator"),
|
QString("AM Demodulator"),
|
||||||
QString("3.6.0"),
|
QString("3.6.1"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "plugin/pluginapi.h"
|
#include "plugin/pluginapi.h"
|
||||||
#include "util/simpleserializer.h"
|
#include "util/simpleserializer.h"
|
||||||
#include "util/db.h"
|
#include "util/db.h"
|
||||||
#include "gui/basicchannelsettingswidget.h"
|
#include "gui/basicchannelsettingsdialog.h"
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "nfmdemod.h"
|
#include "nfmdemod.h"
|
||||||
@ -90,6 +90,7 @@ QByteArray NFMDemodGUI::serialize() const
|
|||||||
s.writeBool(10, ui->audioMute->isChecked());
|
s.writeBool(10, ui->audioMute->isChecked());
|
||||||
s.writeS32(11, ui->squelchGate->value());
|
s.writeS32(11, ui->squelchGate->value());
|
||||||
s.writeBool(12, ui->deltaSquelch->isChecked());
|
s.writeBool(12, ui->deltaSquelch->isChecked());
|
||||||
|
s.writeBlob(13, m_channelMarker.serialize());
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +114,9 @@ bool NFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
m_channelMarker.blockSignals(true);
|
m_channelMarker.blockSignals(true);
|
||||||
|
|
||||||
|
d.readBlob(13, &bytetmp);
|
||||||
|
m_channelMarker.deserialize(bytetmp);
|
||||||
|
|
||||||
d.readS32(1, &tmp, 0);
|
d.readS32(1, &tmp, 0);
|
||||||
m_channelMarker.setCenterFrequency(tmp);
|
m_channelMarker.setCenterFrequency(tmp);
|
||||||
d.readS32(2, &tmp, 4);
|
d.readS32(2, &tmp, 4);
|
||||||
@ -140,6 +144,9 @@ bool NFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
d.readBool(12, &boolTmp, false);
|
d.readBool(12, &boolTmp, false);
|
||||||
ui->deltaSquelch->setChecked(boolTmp);
|
ui->deltaSquelch->setChecked(boolTmp);
|
||||||
|
|
||||||
|
this->setWindowTitle(m_channelMarker.getTitle());
|
||||||
|
displayUDPAddress();
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
|
|
||||||
@ -158,9 +165,11 @@ bool NFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMDemodGUI::viewChanged()
|
void NFMDemodGUI::channelMarkerChanged()
|
||||||
{
|
{
|
||||||
applySettings();
|
this->setWindowTitle(m_channelMarker.getTitle());
|
||||||
|
displayUDPAddress();
|
||||||
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMDemodGUI::on_deltaFrequency_changed(qint64 value)
|
void NFMDemodGUI::on_deltaFrequency_changed(qint64 value)
|
||||||
@ -254,14 +263,11 @@ void NFMDemodGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool r
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMDemodGUI::onMenuDoubleClicked()
|
void NFMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||||
{
|
{
|
||||||
if (!m_basicSettingsShown)
|
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||||
{
|
dialog.move(p);
|
||||||
m_basicSettingsShown = true;
|
dialog.exec();
|
||||||
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this);
|
|
||||||
bcsw->show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||||
@ -286,7 +292,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
|
|||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
|
|
||||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||||
connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked()));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||||
|
|
||||||
m_nfmDemod = new NFMDemod();
|
m_nfmDemod = new NFMDemod();
|
||||||
m_nfmDemod->registerGUI(this);
|
m_nfmDemod->registerGUI(this);
|
||||||
@ -319,8 +325,13 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
|
|||||||
m_channelMarker.setBandwidth(12500);
|
m_channelMarker.setBandwidth(12500);
|
||||||
m_channelMarker.setCenterFrequency(0);
|
m_channelMarker.setCenterFrequency(0);
|
||||||
m_channelMarker.setVisible(true);
|
m_channelMarker.setVisible(true);
|
||||||
|
m_channelMarker.setTitle("NFM Demodulator");
|
||||||
|
m_channelMarker.setUDPAddress("127.0.0.1");
|
||||||
|
m_channelMarker.setUDPSendPort(9999);
|
||||||
|
m_channelMarker.setVisible(true);
|
||||||
|
setTitleColor(m_channelMarker.getColor());
|
||||||
|
|
||||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
|
||||||
|
|
||||||
m_deviceAPI->registerChannelInstance(m_channelID, this);
|
m_deviceAPI->registerChannelInstance(m_channelID, this);
|
||||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||||
@ -371,6 +382,11 @@ void NFMDemodGUI::applySettings(bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NFMDemodGUI::displayUDPAddress()
|
||||||
|
{
|
||||||
|
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
|
||||||
|
}
|
||||||
|
|
||||||
void NFMDemodGUI::leaveEvent(QEvent*)
|
void NFMDemodGUI::leaveEvent(QEvent*)
|
||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
static const QString m_channelID;
|
static const QString m_channelID;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void viewChanged();
|
void channelMarkerChanged();
|
||||||
void on_deltaFrequency_changed(qint64 value);
|
void on_deltaFrequency_changed(qint64 value);
|
||||||
void on_rfBW_currentIndexChanged(int index);
|
void on_rfBW_currentIndexChanged(int index);
|
||||||
void on_afBW_valueChanged(int value);
|
void on_afBW_valueChanged(int value);
|
||||||
@ -52,7 +52,7 @@ private slots:
|
|||||||
void on_ctcssOn_toggled(bool checked);
|
void on_ctcssOn_toggled(bool checked);
|
||||||
void on_audioMute_toggled(bool checked);
|
void on_audioMute_toggled(bool checked);
|
||||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||||
void onMenuDoubleClicked();
|
void onMenuDialogCalled(const QPoint& p);
|
||||||
void tick();
|
void tick();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -80,6 +80,7 @@ private:
|
|||||||
|
|
||||||
void blockApplySettings(bool block);
|
void blockApplySettings(bool block);
|
||||||
void applySettings(bool force = false);
|
void applySettings(bool force = false);
|
||||||
|
void displayUDPAddress();
|
||||||
|
|
||||||
void leaveEvent(QEvent*);
|
void leaveEvent(QEvent*);
|
||||||
void enterEvent(QEvent*);
|
void enterEvent(QEvent*);
|
||||||
|
@ -598,6 +598,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="ButtonSwitch" name="copyAudioToUDP">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Copy audio to UDP</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>U</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user