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.
filesinkgui.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 INCLUDE_FILESINKGUI_H
19 #define INCLUDE_FILESINKGUI_H
20 
22 #include <QTimer>
23 #include <QWidget>
24 
25 #include "util/messagequeue.h"
26 
27 #include "filesinkoutput.h"
28 #include "filesinksettings.h"
29 
30 
31 class DeviceSampleSink;
32 class DeviceUISet;
33 
34 namespace Ui {
35  class FileSinkGui;
36 }
37 
38 class FileSinkGui : public QWidget, public PluginInstanceGUI {
39  Q_OBJECT
40 
41 public:
42  explicit FileSinkGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
43  virtual ~FileSinkGui();
44  virtual void destroy();
45 
46  void setName(const QString& name);
47  QString getName() const;
48 
49  void resetToDefaults();
50  virtual qint64 getCenterFrequency() const;
51  virtual void setCenterFrequency(qint64 centerFrequency);
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 private:
58  Ui::FileSinkGui* ui;
59 
64  QString m_fileName;
65  QTimer m_updateTimer;
66  QTimer m_statusTimer;
71  std::time_t m_startingTimeStamp;
73  std::size_t m_tickCount;
76 
77  void blockApplySettings(bool block) { m_doApplySettings = !block; }
78  void displaySettings();
79  void displayTime();
80  void sendSettings();
81  void configureFileName();
82  void updateWithGeneration();
83  void updateWithStreamTime();
84  void updateSampleRateAndFrequency();
85 
86 private slots:
87  void handleInputMessages();
88  void on_centerFrequency_changed(quint64 value);
89  void on_sampleRate_changed(quint64 value);
90  void on_startStop_toggled(bool checked);
91  void on_showFileDialog_clicked(bool checked);
92  void on_interp_currentIndexChanged(int index);
93  void updateHardware();
94  void updateStatus();
95  void tick();
96 };
97 
98 #endif // INCLUDE_FILESINKGUI_H
QString m_fileName
Definition: filesinkgui.h:64
DeviceUISet * m_deviceUISet
Definition: filesinkgui.h:60
std::time_t m_startingTimeStamp
Definition: filesinkgui.h:71
bool m_generation
Definition: filesinkgui.h:70
MessageQueue m_inputMessageQueue
Definition: filesinkgui.h:75
FileSinkSettings m_settings
Definition: filesinkgui.h:63
QTimer m_statusTimer
Definition: filesinkgui.h:66
DeviceSampleSink * m_deviceSampleSink
Definition: filesinkgui.h:67
int m_lastEngineState
Definition: filesinkgui.h:74
std::size_t m_tickCount
Definition: filesinkgui.h:73
int m_sampleRate
Definition: filesinkgui.h:68
QTimer m_updateTimer
Definition: filesinkgui.h:65
void blockApplySettings(bool block)
Definition: filesinkgui.h:77
Ui::FileSinkGui * ui
Definition: filesinkgui.h:58
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: filesinkgui.h:69
int m_samplesCount
Definition: filesinkgui.h:72
virtual MessageQueue * getInputMessageQueue()
Definition: filesinkgui.h:54
bool m_doApplySettings
Definition: filesinkgui.h:61
bool m_forceSettings
Definition: filesinkgui.h:62