2015-12-06 13:47:55 -05: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 //
|
2019-04-11 00:39:30 -04:00
|
|
|
// (at your option) any later version. //
|
2015-12-06 13:47:55 -05:00
|
|
|
// //
|
|
|
|
// 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 02:55:58 -05:00
|
|
|
#ifndef INCLUDE_UDPSRCGUI_H
|
|
|
|
#define INCLUDE_UDPSRCGUI_H
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
#include <QHostAddress>
|
2020-10-04 00:16:15 -04:00
|
|
|
#include "channel/channelgui.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
2017-09-16 16:23:31 -04:00
|
|
|
#include "util/messagequeue.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
|
2018-09-11 18:08:47 -04:00
|
|
|
#include "udpsink.h"
|
|
|
|
#include "udpsinksettings.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
class PluginAPI;
|
2017-10-31 03:24:05 -04:00
|
|
|
class DeviceUISet;
|
2018-09-11 18:08:47 -04:00
|
|
|
class UDPSink;
|
2015-11-18 21:27:37 -05:00
|
|
|
class SpectrumVis;
|
|
|
|
|
|
|
|
namespace Ui {
|
2018-09-11 18:08:47 -04:00
|
|
|
class UDPSinkGUI;
|
2015-11-18 21:27:37 -05:00
|
|
|
}
|
|
|
|
|
2020-10-04 00:16:15 -04:00
|
|
|
class UDPSinkGUI : public ChannelGUI {
|
2015-11-18 21:27:37 -05:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-09-11 18:08:47 -04:00
|
|
|
static UDPSinkGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2017-09-16 16:23:31 -04:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2015-11-18 21:27:37 -05:00
|
|
|
|
2017-11-14 02:35:18 -05:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 16:58:35 -05:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
private:
|
2018-09-11 18:08:47 -04:00
|
|
|
Ui::UDPSinkGUI* ui;
|
2015-11-18 21:27:37 -05:00
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 03:24:05 -04:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2018-09-11 18:08:47 -04:00
|
|
|
UDPSink* m_udpSink;
|
|
|
|
UDPSinkSettings m_settings;
|
2015-11-18 21:27:37 -05:00
|
|
|
ChannelMarker m_channelMarker;
|
2017-08-17 06:57:45 -04:00
|
|
|
MovingAverage<double> m_channelPowerAvg;
|
2017-08-17 14:23:17 -04:00
|
|
|
MovingAverage<double> m_inPowerAvg;
|
2017-08-17 06:57:45 -04:00
|
|
|
uint32_t m_tickCount;
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
// settings
|
|
|
|
bool m_doApplySettings;
|
2017-10-06 23:44:43 -04:00
|
|
|
bool m_rfBandwidthChanged;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
// RF path
|
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
2018-09-11 18:08:47 -04:00
|
|
|
explicit UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
|
|
|
virtual ~UDPSinkGUI();
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
2017-08-18 18:12:56 -04:00
|
|
|
void applySettings(bool force = false);
|
|
|
|
void applySettingsImmediate(bool force = false);
|
2017-08-17 06:57:45 -04:00
|
|
|
void displaySettings();
|
2019-09-22 19:25:17 -04:00
|
|
|
void displayStreamIndex();
|
2017-10-06 23:44:43 -04:00
|
|
|
void setSampleFormat(int index);
|
2018-09-11 18:08:47 -04:00
|
|
|
void setSampleFormatIndex(const UDPSinkSettings::SampleFormat& sampleFormat);
|
2020-10-03 13:51:14 -04:00
|
|
|
bool handleMessage(const Message& message);
|
2016-04-03 12:14:04 -04:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2017-11-14 02:35:18 -05:00
|
|
|
|
|
|
|
private slots:
|
2018-05-25 12:44:24 -04:00
|
|
|
void handleSourceMessages();
|
2017-11-14 02:35:18 -05:00
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
|
|
|
void on_sampleFormat_currentIndexChanged(int index);
|
2018-04-19 17:03:21 -04:00
|
|
|
void on_outputUDPAddress_editingFinished();
|
|
|
|
void on_outputUDPPort_editingFinished();
|
|
|
|
void on_inputUDPAudioPort_editingFinished();
|
2017-11-14 02:35:18 -05:00
|
|
|
void on_sampleRate_textEdited(const QString& arg1);
|
|
|
|
void on_rfBandwidth_textEdited(const QString& arg1);
|
|
|
|
void on_fmDeviation_textEdited(const QString& arg1);
|
|
|
|
void on_audioActive_toggled(bool active);
|
|
|
|
void on_audioStereo_toggled(bool stereo);
|
|
|
|
void on_applyBtn_clicked();
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
|
|
|
void on_gain_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelch_valueChanged(int value);
|
|
|
|
void on_squelchGate_valueChanged(int value);
|
|
|
|
void on_agc_toggled(bool agc);
|
|
|
|
void tick();
|
2015-11-18 21:27:37 -05:00
|
|
|
};
|
|
|
|
|
2015-11-19 02:55:58 -05:00
|
|
|
#endif // INCLUDE_UDPSRCGUI_H
|