| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2016 Edouard Griffiths, F4EXB                                   //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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 06:57:41 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01: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/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_
 | 
					
						
							|  |  |  | #define PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-26 00:22:08 +02:00
										 |  |  | #include <plugin/plugininstancegui.h>
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | #include <QTimer>
 | 
					
						
							| 
									
										
										
										
											2017-09-03 17:26:32 +02:00
										 |  |  | #include <QWidget>
 | 
					
						
							| 
									
										
										
										
											2016-11-15 18:58:17 +01:00
										 |  |  | #include <vector>
 | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "util/messagequeue.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | #include "sdrplayinput.h"
 | 
					
						
							|  |  |  | #include "sdrplaysettings.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  | class DeviceUISet; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Ui { | 
					
						
							|  |  |  |     class SDRPlayGui; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-26 00:22:08 +02:00
										 |  |  | class SDRPlayGui : public QWidget, public PluginInstanceGUI { | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2017-10-30 00:45:23 +01:00
										 |  |  |     explicit SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent = 0); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     virtual ~SDRPlayGui(); | 
					
						
							| 
									
										
										
										
											2017-09-16 10:45:08 +02:00
										 |  |  |     virtual void destroy(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void setName(const QString& name); | 
					
						
							|  |  |  |     QString getName() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual void resetToDefaults(); | 
					
						
							|  |  |  |     virtual qint64 getCenterFrequency() const; | 
					
						
							|  |  |  |     virtual void setCenterFrequency(qint64 centerFrequency); | 
					
						
							|  |  |  |     virtual QByteArray serialize() const; | 
					
						
							|  |  |  |     virtual bool deserialize(const QByteArray& data); | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  |     virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     virtual bool handleMessage(const Message& message); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     Ui::SDRPlayGui* ui; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  |     DeviceUISet* m_deviceUISet; | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     bool m_doApplySettings; | 
					
						
							| 
									
										
										
										
											2017-10-14 07:02:21 +02:00
										 |  |  |     bool m_forceSettings; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     SDRPlaySettings m_settings; | 
					
						
							|  |  |  |     QTimer m_updateTimer; | 
					
						
							|  |  |  |     QTimer m_statusTimer; | 
					
						
							|  |  |  |     DeviceSampleSource* m_sampleSource; | 
					
						
							|  |  |  |     int m_sampleRate; | 
					
						
							|  |  |  |     quint64 m_deviceCenterFrequency; //!< Center frequency in device
 | 
					
						
							|  |  |  |     int m_lastEngineState; | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  |     MessageQueue m_inputMessageQueue; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     void blockApplySettings(bool block) { m_doApplySettings = !block; } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     void displaySettings(); | 
					
						
							|  |  |  |     void sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     void updateSampleRateAndFrequency(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							|  |  |  |     void updateHardware(); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     void updateStatus(); | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |     void handleInputMessages(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     void on_centerFrequency_changed(quint64 value); | 
					
						
							|  |  |  |     void on_ppm_valueChanged(int value); | 
					
						
							|  |  |  |     void on_dcOffset_toggled(bool checked); | 
					
						
							|  |  |  |     void on_iqImbalance_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     void on_fBand_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     void on_bandwidth_currentIndexChanged(int index); | 
					
						
							|  |  |  |     void on_samplerate_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     void on_ifFrequency_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     void on_decim_currentIndexChanged(int index); | 
					
						
							|  |  |  |     void on_fcPos_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  |     void on_gainTunerOn_toggled(bool checked); | 
					
						
							|  |  |  |     void on_gainTuner_valueChanged(int value); | 
					
						
							|  |  |  |     void on_gainManualOn_toggled(bool checked); | 
					
						
							|  |  |  |     void on_gainLNA_toggled(bool checked); | 
					
						
							|  |  |  |     void on_gainMixer_toggled(bool checked); | 
					
						
							|  |  |  |     void on_gainBaseband_valueChanged(int value); | 
					
						
							| 
									
										
										
										
											2016-11-14 02:24:44 +01:00
										 |  |  |     void on_startStop_toggled(bool checked); | 
					
						
							|  |  |  |     void on_record_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  |     void openDeviceSettingsDialog(const QPoint& p); | 
					
						
							| 
									
										
										
										
											2020-04-01 23:17:26 +02:00
										 |  |  |     void openFileRecordDialog(const QPoint& p); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_ */
 |