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.
filesourcegui.h
Go to the documentation of this file.
1 // Copyright (C) 2019 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_FILESOURCE_FILESOURCEGUI_H_
19 #define PLUGINS_CHANNELTX_FILESOURCE_FILESOURCEGUI_H_
20 
21 #include <QTime>
22 
24 #include "dsp/channelmarker.h"
25 #include "gui/rollupwidget.h"
26 #include "util/messagequeue.h"
27 
28 #include "filesourcesettings.h"
29 
30 class PluginAPI;
31 class DeviceUISet;
33 class FileSource;
34 
35 namespace Ui {
36  class FileSourceGUI;
37 }
38 
40  Q_OBJECT
41 
42 public:
43  static FileSourceGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx);
44  virtual void destroy();
45 
46  void setName(const QString& name);
47  QString getName() const;
48  virtual qint64 getCenterFrequency() const;
49  virtual void setCenterFrequency(qint64 centerFrequency);
50 
51  void resetToDefaults();
52  QByteArray serialize() const;
53  bool deserialize(const QByteArray& data);
54  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
55  virtual bool handleMessage(const Message& message);
56 
57 public slots:
58  void channelMarkerChangedByCursor();
59 
60 private:
61  Ui::FileSourceGUI* ui;
68  QString m_fileName;
71  quint64 m_recordLength;
73  quint64 m_samplesCount;
77 
80 
81  QTime m_time;
83 
84  explicit FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = nullptr);
85  virtual ~FileSourceGUI();
86 
87  void blockApplySettings(bool block);
88  void applySettings(bool force = false);
89  void applyChannelSettings();
90  void configureFileName();
91  void updateWithAcquisition();
92  void updateWithStreamData();
93  void updateWithStreamTime();
94  void displaySettings();
95  void displayRateAndShift();
96 
97  void leaveEvent(QEvent*);
98  void enterEvent(QEvent*);
99 
100  void applyInterpolation();
101  void applyPosition();
102 
103 private slots:
104  void handleSourceMessages();
105  void onWidgetRolled(QWidget* widget, bool rollDown);
106  void onMenuDialogCalled(const QPoint& p);
107  void on_interpolationFactor_currentIndexChanged(int index);
108  void on_position_valueChanged(int value);
109  void on_gain_valueChanged(int value);
110  void on_showFileDialog_clicked(bool checked);
111  void on_playLoop_toggled(bool checked);
112  void on_play_toggled(bool checked);
113  void on_navTime_valueChanged(int value);
114 
115  void tick();
116 };
117 
118 
119 #endif /* PLUGINS_CHANNELTX_FILESOURCE_FILESOURCEGUI_H_ */
quint64 m_startingTimeStamp
Definition: filesourcegui.h:72
quint32 m_fileSampleSize
Definition: filesourcegui.h:70
unsigned int uint32_t
Definition: rtptypes_win.h:46
MessageQueue m_inputMessageQueue
Definition: filesourcegui.h:79
void * create(QString type)
uint32_t m_tickCount
Definition: filesourcegui.h:82
quint64 m_samplesCount
Definition: filesourcegui.h:73
FileSourceSettings m_settings
Definition: filesourcegui.h:65
quint64 m_recordLength
Definition: filesourcegui.h:71
bool m_enableNavTime
Definition: filesourcegui.h:75
Ui::FileSourceGUI * ui
Definition: filesourcegui.h:61
bool m_doApplySettings
Definition: filesourcegui.h:76
FileSource * m_fileSource
Definition: filesourcegui.h:78
ChannelMarker m_channelMarker
Definition: filesourcegui.h:64
double m_shiftFrequencyFactor
Channel frequency shift factor.
Definition: filesourcegui.h:67
virtual MessageQueue * getInputMessageQueue()
Definition: filesourcegui.h:54
PluginAPI * m_pluginAPI
Definition: filesourcegui.h:62
QString m_fileName
Definition: filesourcegui.h:68
DeviceUISet * m_deviceUISet
Definition: filesourcegui.h:63