2015-12-06 18:47:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-11-19 07:55:58 +00:00
|
|
|
#ifndef INCLUDE_UDPSRCGUI_H
|
|
|
|
#define INCLUDE_UDPSRCGUI_H
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
#include <QHostAddress>
|
|
|
|
#include "gui/rollupwidget.h"
|
|
|
|
#include "plugin/plugingui.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
|
|
|
|
2016-10-02 11:18:07 +00:00
|
|
|
#include "../../channelrx/udpsrc/udpsrc.h"
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
class PluginAPI;
|
2016-10-10 23:17:55 +00:00
|
|
|
class DeviceSourceAPI;
|
2016-10-03 13:55:16 +00:00
|
|
|
class ThreadedBasebandSampleSink;
|
2016-10-02 19:52:39 +00:00
|
|
|
class DownChannelizer;
|
2015-11-19 02:27:37 +00:00
|
|
|
class UDPSrc;
|
|
|
|
class SpectrumVis;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class UDPSrcGUI;
|
|
|
|
}
|
|
|
|
|
|
|
|
class UDPSrcGUI : public RollupWidget, public PluginGUI {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-10-10 23:17:55 +00:00
|
|
|
static UDPSrcGUI* create(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI);
|
2015-11-19 02:27:37 +00:00
|
|
|
void destroy();
|
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
|
|
|
|
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
2016-05-16 17:37:53 +00:00
|
|
|
static const QString m_channelID;
|
|
|
|
|
2015-11-19 02:27:37 +00:00
|
|
|
private slots:
|
|
|
|
void channelMarkerChanged();
|
|
|
|
void on_deltaFrequency_changed(quint64 value);
|
|
|
|
void on_deltaMinus_toggled(bool minus);
|
|
|
|
void on_sampleFormat_currentIndexChanged(int index);
|
|
|
|
void on_sampleRate_textEdited(const QString& arg1);
|
|
|
|
void on_rfBandwidth_textEdited(const QString& arg1);
|
2015-12-02 01:28:31 +00:00
|
|
|
void on_udpAddress_textEdited(const QString& arg1);
|
2015-11-19 02:27:37 +00:00
|
|
|
void on_udpPort_textEdited(const QString& arg1);
|
2015-12-05 03:03:30 +00:00
|
|
|
void on_audioPort_textEdited(const QString& arg1);
|
2016-04-04 01:44:06 +00:00
|
|
|
void on_fmDeviation_textEdited(const QString& arg1);
|
2015-12-05 10:49:24 +00:00
|
|
|
void on_audioActive_toggled(bool active);
|
2015-12-05 11:23:55 +00:00
|
|
|
void on_audioStereo_toggled(bool stereo);
|
2015-11-19 02:27:37 +00:00
|
|
|
void on_applyBtn_clicked();
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDoubleClicked();
|
|
|
|
void on_boost_valueChanged(int value);
|
2015-12-04 02:46:51 +00:00
|
|
|
void on_volume_valueChanged(int value);
|
2015-11-19 02:27:37 +00:00
|
|
|
void tick();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::UDPSrcGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2016-10-10 23:17:55 +00:00
|
|
|
DeviceSourceAPI* m_deviceAPI;
|
2015-11-19 07:55:58 +00:00
|
|
|
UDPSrc* m_udpSrc;
|
2015-11-19 02:27:37 +00:00
|
|
|
ChannelMarker m_channelMarker;
|
|
|
|
MovingAverage<Real> m_channelPowerDbAvg;
|
|
|
|
|
|
|
|
// settings
|
|
|
|
UDPSrc::SampleFormat m_sampleFormat;
|
|
|
|
Real m_outputSampleRate;
|
|
|
|
Real m_rfBandwidth;
|
2016-04-04 01:44:06 +00:00
|
|
|
int m_fmDeviation;
|
2015-11-19 02:27:37 +00:00
|
|
|
int m_boost;
|
2015-12-04 02:46:51 +00:00
|
|
|
bool m_audioActive;
|
2015-12-05 11:23:55 +00:00
|
|
|
bool m_audioStereo;
|
2015-12-04 02:46:51 +00:00
|
|
|
int m_volume;
|
2015-12-02 01:28:31 +00:00
|
|
|
QString m_udpAddress;
|
2015-11-19 07:55:58 +00:00
|
|
|
int m_udpPort;
|
2015-12-05 03:03:30 +00:00
|
|
|
int m_audioPort;
|
2015-11-19 02:27:37 +00:00
|
|
|
bool m_basicSettingsShown;
|
|
|
|
bool m_doApplySettings;
|
|
|
|
|
|
|
|
// RF path
|
2016-10-03 13:55:16 +00:00
|
|
|
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
2016-10-02 19:52:39 +00:00
|
|
|
DownChannelizer* m_channelizer;
|
2015-11-19 02:27:37 +00:00
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
2016-10-10 23:17:55 +00:00
|
|
|
explicit UDPSrcGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = 0);
|
2015-11-19 02:27:37 +00:00
|
|
|
virtual ~UDPSrcGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
|
|
|
void applySettings();
|
2015-12-04 02:46:51 +00:00
|
|
|
void applySettingsImmediate();
|
2016-04-03 16:14:04 +00:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2015-11-19 02:27:37 +00:00
|
|
|
};
|
|
|
|
|
2015-11-19 07:55:58 +00:00
|
|
|
#endif // INCLUDE_UDPSRCGUI_H
|