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.
wfmmodgui.h
Go to the documentation of this file.
1 // Copyright (C) 2016 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef PLUGINS_CHANNELTX_MODWFM_WFMMODGUI_H_
19 #define PLUGINS_CHANNELTX_MODWFM_WFMMODGUI_H_
20 
22 #include "gui/rollupwidget.h"
23 #include "dsp/channelmarker.h"
24 #include "util/movingaverage.h"
25 #include "util/messagequeue.h"
26 
27 #include "wfmmod.h"
28 #include "wfmmodsettings.h"
29 
30 class PluginAPI;
31 class DeviceUISet;
34 class UpChannelizer;
35 
36 namespace Ui {
37  class WFMModGUI;
38 }
39 
40 class WFMModGUI : public RollupWidget, public PluginInstanceGUI {
41  Q_OBJECT
42 
43 public:
44  static WFMModGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx);
45  virtual void destroy();
46 
47  void setName(const QString& name);
48  QString getName() const;
49  virtual qint64 getCenterFrequency() const;
50  virtual void setCenterFrequency(qint64 centerFrequency);
51 
52  void resetToDefaults();
53  QByteArray serialize() const;
54  bool deserialize(const QByteArray& data);
55  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
56  virtual bool handleMessage(const Message& message);
57 
58 public slots:
59  void channelMarkerChangedByCursor();
60 
61 private:
62  Ui::WFMModGUI* ui;
68 
69 // ThreadedBasebandSampleSource* m_threadedChannelizer;
70 // UpChannelizer* m_channelizer;
73 
74  QString m_fileName;
75  quint32 m_recordLength;
78  std::size_t m_tickCount;
81 
82  explicit WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = 0);
83  virtual ~WFMModGUI();
84 
85  void blockApplySettings(bool block);
86  void applySettings(bool force = false);
87  void displaySettings();
88  void updateWithStreamData();
89  void updateWithStreamTime();
90 
91  void leaveEvent(QEvent*);
92  void enterEvent(QEvent*);
93 
94  static int requiredBW(int rfBW)
95  {
96  if (rfBW <= 96000) {
97  return 96000;
98  } else {
99  return (3*rfBW)/2;
100  }
101  }
102 
103 private slots:
104  void handleSourceMessages();
105 
106  void on_deltaFrequency_changed(qint64 value);
107  void on_rfBW_currentIndexChanged(int index);
108  void on_afBW_valueChanged(int value);
109  void on_fmDev_valueChanged(int value);
110  void on_toneFrequency_valueChanged(int value);
111  void on_volume_valueChanged(int value);
112  void on_channelMute_toggled(bool checked);
113  void on_tone_toggled(bool checked);
114  void on_morseKeyer_toggled(bool checked);
115  void on_mic_toggled(bool checked);
116  void on_play_toggled(bool checked);
117 
118  void on_playLoop_toggled(bool checked);
119  void on_navTimeSlider_valueChanged(int value);
120  void on_showFileDialog_clicked(bool checked);
121 
122  void onWidgetRolled(QWidget* widget, bool rollDown);
123  void onMenuDialogCalled(const QPoint& p);
124 
125  void configureFileName();
126  void audioSelect();
127  void tick();
128 };
129 
130 #endif /* PLUGINS_CHANNELTX_MODWFM_WFMMODGUI_H_ */
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
Definition: wfmmodgui.h:72
bool m_doApplySettings
Definition: wfmmodgui.h:67
int m_samplesCount
Definition: wfmmodgui.h:77
Ui::WFMModGUI * ui
Definition: wfmmodgui.h:62
WFMModSettings m_settings
Definition: wfmmodgui.h:66
Definition: wfmmod.h:48
virtual MessageQueue * getInputMessageQueue()
Definition: wfmmodgui.h:55
void * create(QString type)
static int requiredBW(int rfBW)
Definition: wfmmodgui.h:94
WFMMod * m_wfmMod
Definition: wfmmodgui.h:71
DeviceUISet * m_deviceUISet
Definition: wfmmodgui.h:64
PluginAPI * m_pluginAPI
Definition: wfmmodgui.h:63
int m_recordSampleRate
Definition: wfmmodgui.h:76
bool m_enableNavTime
Definition: wfmmodgui.h:79
QString m_fileName
Definition: wfmmodgui.h:74
quint32 m_recordLength
Definition: wfmmodgui.h:75
MessageQueue m_inputMessageQueue
Definition: wfmmodgui.h:80
ChannelMarker m_channelMarker
Definition: wfmmodgui.h:65
std::size_t m_tickCount
Definition: wfmmodgui.h:78