| 
									
										
										
										
											2016-06-19 09:56:49 +02: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                  //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 13:42:33 +02:00
										 |  |  | #ifndef INCLUDE_SDRDAEMONSOURCEINPUT_H
 | 
					
						
							|  |  |  | #define INCLUDE_SDRDAEMONSOURCEINPUT_H
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  | #include <QByteArray>
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | #include <QTimer>
 | 
					
						
							|  |  |  | #include <ctime>
 | 
					
						
							|  |  |  | #include <iostream>
 | 
					
						
							|  |  |  | #include <stdint.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  | #include <dsp/devicesamplesource.h>
 | 
					
						
							| 
									
										
										
										
											2017-06-09 13:58:27 +02:00
										 |  |  | #include "sdrdaemonsourcesettings.h"
 | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-11 01:17:55 +02:00
										 |  |  | class DeviceSourceAPI; | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | class SDRdaemonSourceUDPHandler; | 
					
						
							| 
									
										
										
										
											2017-09-05 00:31:45 +02:00
										 |  |  | class FileRecord; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | class SDRdaemonSourceInput : public DeviceSampleSource { | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |     class MsgConfigureSDRdaemonSource : public Message { | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public: | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |         const SDRdaemonSourceSettings& getSettings() const { return m_settings; } | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         bool getForce() const { return m_force; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |         static MsgConfigureSDRdaemonSource* create(const SDRdaemonSourceSettings& settings, bool force = false) | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |             return new MsgConfigureSDRdaemonSource(settings, force); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     private: | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |         SDRdaemonSourceSettings m_settings; | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         bool m_force; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  |         MsgConfigureSDRdaemonSource(const SDRdaemonSourceSettings& settings, bool force) : | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |             Message(), | 
					
						
							|  |  |  |             m_settings(settings), | 
					
						
							|  |  |  |             m_force(force) | 
					
						
							|  |  |  |         { } | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	class MsgConfigureSDRdaemonStreamTiming : public Message { | 
					
						
							|  |  |  | 		MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		static MsgConfigureSDRdaemonStreamTiming* create() | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			return new MsgConfigureSDRdaemonStreamTiming(); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	private: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		MsgConfigureSDRdaemonStreamTiming() : | 
					
						
							|  |  |  | 			Message() | 
					
						
							|  |  |  | 		{ } | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	class MsgReportSDRdaemonAcquisition : public Message { | 
					
						
							|  |  |  | 		MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public: | 
					
						
							|  |  |  | 		bool getAcquisition() const { return m_acquisition; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		static MsgReportSDRdaemonAcquisition* create(bool acquisition) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			return new MsgReportSDRdaemonAcquisition(acquisition); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected: | 
					
						
							|  |  |  | 		bool m_acquisition; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		MsgReportSDRdaemonAcquisition(bool acquisition) : | 
					
						
							|  |  |  | 			Message(), | 
					
						
							|  |  |  | 			m_acquisition(acquisition) | 
					
						
							|  |  |  | 		{ } | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 	class MsgReportSDRdaemonSourceStreamData : public Message { | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public: | 
					
						
							|  |  |  | 		int getSampleRate() const { return m_sampleRate; } | 
					
						
							|  |  |  | 		quint64 getCenterFrequency() const { return m_centerFrequency; } | 
					
						
							|  |  |  | 		uint32_t get_tv_sec() const { return m_tv_sec; } | 
					
						
							|  |  |  | 		uint32_t get_tv_usec() const { return m_tv_usec; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 		static MsgReportSDRdaemonSourceStreamData* create(int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 			return new MsgReportSDRdaemonSourceStreamData(sampleRate, centerFrequency, tv_sec, tv_usec); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected: | 
					
						
							|  |  |  | 		int m_sampleRate; | 
					
						
							|  |  |  | 		quint64 m_centerFrequency; | 
					
						
							|  |  |  | 		uint32_t m_tv_sec; | 
					
						
							|  |  |  | 		uint32_t m_tv_usec; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 		MsgReportSDRdaemonSourceStreamData(int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec) : | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 			Message(), | 
					
						
							|  |  |  | 			m_sampleRate(sampleRate), | 
					
						
							|  |  |  | 			m_centerFrequency(centerFrequency), | 
					
						
							|  |  |  | 			m_tv_sec(tv_sec), | 
					
						
							|  |  |  | 			m_tv_usec(tv_usec) | 
					
						
							|  |  |  | 		{ } | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 	class MsgReportSDRdaemonSourceStreamTiming : public Message { | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public: | 
					
						
							|  |  |  | 		uint32_t get_tv_sec() const { return m_tv_sec; } | 
					
						
							|  |  |  | 		uint32_t get_tv_usec() const { return m_tv_usec; } | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  | 		int getFramesDecodingStatus() const { return m_framesDecodingStatus; } | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  | 		bool allBlocksReceived() const { return m_allBlocksReceived; } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		float getBufferLengthInSecs() const { return m_bufferLenSec; } | 
					
						
							|  |  |  |         int32_t getBufferGauge() const { return m_bufferGauge; } | 
					
						
							| 
									
										
										
										
											2016-07-18 00:39:35 +02:00
										 |  |  |         int getMinNbBlocks() const { return m_minNbBlocks; } | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |         int getMinNbOriginalBlocks() const { return m_minNbOriginalBlocks; } | 
					
						
							|  |  |  |         int getMaxNbRecovery() const { return m_maxNbRecovery; } | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |         float getAvgNbBlocks() const { return m_avgNbBlocks; } | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |         float getAvgNbOriginalBlocks() const { return m_avgNbOriginalBlocks; } | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |         float getAvgNbRecovery() const { return m_avgNbRecovery; } | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |         int getNbOriginalBlocksPerFrame() const { return m_nbOriginalBlocksPerFrame; } | 
					
						
							|  |  |  |         int getNbFECBlocksPerFrame() const { return m_nbFECBlocksPerFrame; } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 		static MsgReportSDRdaemonSourceStreamTiming* create(uint32_t tv_sec, | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 				uint32_t tv_usec, | 
					
						
							|  |  |  | 				float bufferLenSec, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                 int32_t bufferGauge, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                 int framesDecodingStatus, | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  |                 bool allBlocksReceived, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                 int minNbBlocks, | 
					
						
							|  |  |  |                 int minNbOriginalBlocks, | 
					
						
							|  |  |  |                 int maxNbRecovery, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                 float avgNbBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                 float avgNbOriginalBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                 float avgNbRecovery, | 
					
						
							|  |  |  |                 int nbOriginalBlocksPerFrame, | 
					
						
							|  |  |  |                 int nbFECBlocksPerFrame) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 			return new MsgReportSDRdaemonSourceStreamTiming(tv_sec, | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 					tv_usec, | 
					
						
							|  |  |  | 					bufferLenSec, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                     bufferGauge, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                     framesDecodingStatus, | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  |                     allBlocksReceived, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                     minNbBlocks, | 
					
						
							|  |  |  |                     minNbOriginalBlocks, | 
					
						
							|  |  |  |                     maxNbRecovery, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                     avgNbBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                     avgNbOriginalBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                     avgNbRecovery, | 
					
						
							|  |  |  |                     nbOriginalBlocksPerFrame, | 
					
						
							|  |  |  |                     nbFECBlocksPerFrame); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected: | 
					
						
							|  |  |  | 		uint32_t m_tv_sec; | 
					
						
							|  |  |  | 		uint32_t m_tv_usec; | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  | 		int      m_framesDecodingStatus; | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  | 		bool     m_allBlocksReceived; | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  | 		float    m_bufferLenSec; | 
					
						
							|  |  |  |         int32_t  m_bufferGauge; | 
					
						
							| 
									
										
										
										
											2016-07-18 00:39:35 +02:00
										 |  |  |         int      m_minNbBlocks; | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |         int      m_minNbOriginalBlocks; | 
					
						
							| 
									
										
										
										
											2016-07-18 00:39:35 +02:00
										 |  |  |         int      m_maxNbRecovery; | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |         float    m_avgNbBlocks; | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |         float    m_avgNbOriginalBlocks; | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |         float    m_avgNbRecovery; | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |         int      m_nbOriginalBlocksPerFrame; | 
					
						
							|  |  |  |         int      m_nbFECBlocksPerFrame; | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 		MsgReportSDRdaemonSourceStreamTiming(uint32_t tv_sec, | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 				uint32_t tv_usec, | 
					
						
							|  |  |  | 				float bufferLenSec, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                 int32_t bufferGauge, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                 int framesDecodingStatus, | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  |                 bool allBlocksReceived, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                 int minNbBlocks, | 
					
						
							|  |  |  |                 int minNbOriginalBlocks, | 
					
						
							|  |  |  |                 int maxNbRecovery, | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |                 float avgNbBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |                 float avgNbOriginalBlocks, | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |                 float avgNbRecovery, | 
					
						
							|  |  |  |                 int nbOriginalBlocksPerFrame, | 
					
						
							|  |  |  |                 int nbFECBlocksPerFrame) : | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 			Message(), | 
					
						
							|  |  |  | 			m_tv_sec(tv_sec), | 
					
						
							|  |  |  | 			m_tv_usec(tv_usec), | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  | 			m_framesDecodingStatus(framesDecodingStatus), | 
					
						
							| 
									
										
										
										
											2016-07-28 04:49:33 +02:00
										 |  |  | 			m_allBlocksReceived(allBlocksReceived), | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 			m_bufferLenSec(bufferLenSec), | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |             m_bufferGauge(bufferGauge), | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |             m_minNbBlocks(minNbBlocks), | 
					
						
							|  |  |  |             m_minNbOriginalBlocks(minNbOriginalBlocks), | 
					
						
							|  |  |  |             m_maxNbRecovery(maxNbRecovery), | 
					
						
							| 
									
										
										
										
											2016-06-20 00:45:24 +02:00
										 |  |  |             m_avgNbBlocks(avgNbBlocks), | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |             m_avgNbOriginalBlocks(avgNbOriginalBlocks), | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |             m_avgNbRecovery(avgNbRecovery), | 
					
						
							|  |  |  |             m_nbOriginalBlocksPerFrame(nbOriginalBlocksPerFrame), | 
					
						
							|  |  |  |             m_nbFECBlocksPerFrame(nbFECBlocksPerFrame) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		{ } | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-05 00:31:45 +02:00
										 |  |  |     class MsgFileRecord : public Message { | 
					
						
							|  |  |  |         MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public: | 
					
						
							|  |  |  |         bool getStartStop() const { return m_startStop; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         static MsgFileRecord* create(bool startStop) { | 
					
						
							|  |  |  |             return new MsgFileRecord(startStop); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     protected: | 
					
						
							|  |  |  |         bool m_startStop; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         MsgFileRecord(bool startStop) : | 
					
						
							|  |  |  |             Message(), | 
					
						
							|  |  |  |             m_startStop(startStop) | 
					
						
							|  |  |  |         { } | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     class MsgStartStop : public Message { | 
					
						
							|  |  |  |         MESSAGE_CLASS_DECLARATION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public: | 
					
						
							|  |  |  |         bool getStartStop() const { return m_startStop; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         static MsgStartStop* create(bool startStop) { | 
					
						
							|  |  |  |             return new MsgStartStop(startStop); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     protected: | 
					
						
							|  |  |  |         bool m_startStop; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         MsgStartStop(bool startStop) : | 
					
						
							|  |  |  |             Message(), | 
					
						
							|  |  |  |             m_startStop(startStop) | 
					
						
							|  |  |  |         { } | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 13:34:32 +02:00
										 |  |  | 	SDRdaemonSourceInput(DeviceSourceAPI *deviceAPI); | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 	virtual ~SDRdaemonSourceInput(); | 
					
						
							| 
									
										
										
										
											2017-09-15 02:32:30 +02:00
										 |  |  | 	virtual void destroy(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-25 09:10:19 +01:00
										 |  |  |     virtual void init(); | 
					
						
							| 
									
										
										
										
											2017-04-14 03:40:45 +02:00
										 |  |  | 	virtual bool start(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	virtual void stop(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |     virtual QByteArray serialize() const; | 
					
						
							|  |  |  |     virtual bool deserialize(const QByteArray& data); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-24 19:58:26 +01:00
										 |  |  |     virtual void setMessageQueueToGUI(MessageQueue *queue); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	virtual const QString& getDeviceDescription() const; | 
					
						
							|  |  |  | 	virtual int getSampleRate() const; | 
					
						
							|  |  |  | 	virtual quint64 getCenterFrequency() const; | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |     virtual void setCenterFrequency(qint64 centerFrequency); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	std::time_t getStartingTimeStamp() const; | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 	bool isStreaming() const; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	virtual bool handleMessage(const Message& message); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-09 12:41:42 +01:00
										 |  |  |     virtual int webapiRunGet( | 
					
						
							|  |  |  |             SWGSDRangel::SWGDeviceState& response, | 
					
						
							|  |  |  |             QString& errorMessage); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual int webapiRun( | 
					
						
							|  |  |  |             bool run, | 
					
						
							|  |  |  |             SWGSDRangel::SWGDeviceState& response, | 
					
						
							|  |  |  |             QString& errorMessage); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2016-10-11 01:17:55 +02:00
										 |  |  | 	DeviceSourceAPI *m_deviceAPI; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	QMutex m_mutex; | 
					
						
							| 
									
										
										
										
											2017-11-19 18:17:28 +01:00
										 |  |  | 	SDRdaemonSourceSettings m_settings; | 
					
						
							| 
									
										
										
										
											2017-06-09 14:14:32 +02:00
										 |  |  | 	SDRdaemonSourceUDPHandler* m_SDRdaemonUDPHandler; | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     QString m_remoteAddress; | 
					
						
							|  |  |  | 	int m_sender; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	QString m_deviceDescription; | 
					
						
							|  |  |  | 	std::time_t m_startingTimeStamp; | 
					
						
							|  |  |  |     bool m_autoFollowRate; | 
					
						
							|  |  |  |     bool m_autoCorrBuffer; | 
					
						
							| 
									
										
										
										
											2017-09-05 00:31:45 +02:00
										 |  |  |     FileRecord *m_fileSink; //!< File sink to record device I/Q output
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void applySettings(const SDRdaemonSourceSettings& settings, bool force = false); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 13:42:33 +02:00
										 |  |  | #endif // INCLUDE_SDRDAEMONSOURCEINPUT_H
 |