SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
udpsinkgui.h
Go to the documentation of this file.
1 // Copyright (C) 2015 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef INCLUDE_UDPSRCGUI_H
20 #define INCLUDE_UDPSRCGUI_H
21 
23 #include <QHostAddress>
24 #include "gui/rollupwidget.h"
25 #include "dsp/channelmarker.h"
26 #include "dsp/movingaverage.h"
27 #include "util/messagequeue.h"
28 
29 #include "udpsink.h"
30 #include "udpsinksettings.h"
31 
32 class PluginAPI;
33 class DeviceUISet;
34 class UDPSink;
35 class SpectrumVis;
36 
37 namespace Ui {
38  class UDPSinkGUI;
39 }
40 
41 class UDPSinkGUI : public RollupWidget, public PluginInstanceGUI {
42  Q_OBJECT
43 
44 public:
45  static UDPSinkGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
46  virtual void destroy();
47 
48  void setName(const QString& name);
49  QString getName() const;
50  virtual qint64 getCenterFrequency() const;
51  virtual void setCenterFrequency(qint64 centerFrequency);
52 
53  void resetToDefaults();
54  QByteArray serialize() const;
55  bool deserialize(const QByteArray& data);
56  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
57  virtual bool handleMessage(const Message& message);
58 
59 public slots:
60  void channelMarkerChangedByCursor();
61  void channelMarkerHighlightedByCursor();
62 
63 private:
64  Ui::UDPSinkGUI* ui;
73 
74  // settings
78 
79  // RF path
81 
82  explicit UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
83  virtual ~UDPSinkGUI();
84 
85  void blockApplySettings(bool block);
86  void applySettings(bool force = false);
87  void applySettingsImmediate(bool force = false);
88  void displaySettings();
89  void setSampleFormat(int index);
90  void setSampleFormatIndex(const UDPSinkSettings::SampleFormat& sampleFormat);
91 
92  void leaveEvent(QEvent*);
93  void enterEvent(QEvent*);
94 
95 private slots:
96  void handleSourceMessages();
97  void on_deltaFrequency_changed(qint64 value);
98  void on_sampleFormat_currentIndexChanged(int index);
99  void on_outputUDPAddress_editingFinished();
100  void on_outputUDPPort_editingFinished();
101  void on_inputUDPAudioPort_editingFinished();
102  void on_sampleRate_textEdited(const QString& arg1);
103  void on_rfBandwidth_textEdited(const QString& arg1);
104  void on_fmDeviation_textEdited(const QString& arg1);
105  void on_audioActive_toggled(bool active);
106  void on_audioStereo_toggled(bool stereo);
107  void on_applyBtn_clicked();
108  void onWidgetRolled(QWidget* widget, bool rollDown);
109  void onMenuDialogCalled(const QPoint& p);
110  void on_gain_valueChanged(int value);
111  void on_volume_valueChanged(int value);
112  void on_squelch_valueChanged(int value);
113  void on_squelchGate_valueChanged(int value);
114  void on_agc_toggled(bool agc);
115  void tick();
116 };
117 
118 #endif // INCLUDE_UDPSRCGUI_H
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
MessageQueue m_inputMessageQueue
Definition: udpsinkgui.h:77
bool m_rfBandwidthChanged
Definition: udpsinkgui.h:76
bool m_doApplySettings
Definition: udpsinkgui.h:75
unsigned int uint32_t
Definition: rtptypes_win.h:46
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void * create(QString type)
DeviceUISet * m_deviceUISet
Definition: udpsinkgui.h:66
MovingAverage< double > m_inPowerAvg
Definition: udpsinkgui.h:71
uint32_t m_tickCount
Definition: udpsinkgui.h:72
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
virtual MessageQueue * getInputMessageQueue()
Definition: udpsinkgui.h:56
MovingAverage< double > m_channelPowerAvg
Definition: udpsinkgui.h:70
PluginAPI * m_pluginAPI
Definition: udpsinkgui.h:65
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
SpectrumVis * m_spectrumVis
Definition: udpsinkgui.h:80