2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								///////////////////////////////////////////////////////////////////////////////////
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Copyright (C) 2017 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 04:39:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// (at your option) any later version.                                           //
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00: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/>.          //
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								///////////////////////////////////////////////////////////////////////////////////
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifndef INCLUDE_REMOTEOUTPUT_H
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define INCLUDE_REMOTEOUTPUT_H
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <ctime>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <iostream>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <fstream>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 16:13:57 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <QObject>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <QString>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <QTimer>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <QNetworkRequest>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "dsp/devicesamplesink.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "remoteoutputsettings.h"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class RemoteOutputThread;
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-08 20:11:53 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class DeviceAPI;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class QNetworkAccessManager;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class QNetworkReply;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class QJsonObject;
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class RemoteOutput : public DeviceSampleSink {
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 16:13:57 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Q_OBJECT
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								public:
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									class MsgConfigureRemoteOutput : public Message {
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										MESSAGE_CLASS_DECLARATION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									public:
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										const RemoteOutputSettings& getSettings() const { return m_settings; }
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										bool getForce() const { return m_force; }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										static MsgConfigureRemoteOutput* create(const RemoteOutputSettings& settings, bool force = false)
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											return new MsgConfigureRemoteOutput(settings, force);
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									private:
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										RemoteOutputSettings m_settings;
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										bool m_force;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										MsgConfigureRemoteOutput(const RemoteOutputSettings& settings, bool force) :
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Message(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											m_settings(settings),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											m_force(force)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{ }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									class MsgConfigureRemoteOutputWork : public Message {
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										MESSAGE_CLASS_DECLARATION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									public:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										bool isWorking() const { return m_working; }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										static MsgConfigureRemoteOutputWork* create(bool working)
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											return new MsgConfigureRemoteOutputWork(working);
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									private:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										bool m_working;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										MsgConfigureRemoteOutputWork(bool working) :
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Message(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											m_working(working)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{ }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    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)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        { }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    class MsgConfigureRemoteOutputChunkCorrection : public Message {
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        MESSAGE_CLASS_DECLARATION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    public:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        int getChunkCorrection() const { return m_chunkCorrection; }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        static MsgConfigureRemoteOutputChunkCorrection* create(int chunkCorrection)
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        {
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            return new MsgConfigureRemoteOutputChunkCorrection(chunkCorrection);
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    private:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        int m_chunkCorrection;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        MsgConfigureRemoteOutputChunkCorrection(int chunkCorrection) :
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            Message(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            m_chunkCorrection(chunkCorrection)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        { }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-08 20:11:53 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									RemoteOutput(DeviceAPI *deviceAPI);
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual ~RemoteOutput();
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual void destroy();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-25 11:59:44 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual void init();
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual bool start();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual void stop();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-28 03:04:50 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual QByteArray serialize() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual bool deserialize(const QByteArray& data);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-24 18:58:26 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual const QString& getDeviceDescription() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual int getSampleRate() const;
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-09 22:34:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    virtual void setSampleRate(int sampleRate) { (void) sampleRate; }
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual quint64 getCenterFrequency() const;
							 | 
						
					
						
							
								
									
										
										
										
											2018-11-13 07:51:14 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual void setCenterFrequency(qint64 centerFrequency) { (void) centerFrequency; }
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									std::time_t getStartingTimeStamp() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									virtual bool handleMessage(const Message& message);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-27 22:40:33 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual int webapiSettingsGet(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                SWGSDRangel::SWGDeviceSettings& response,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                QString& errorMessage);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual int webapiSettingsPutPatch(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                bool force,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                const QStringList& deviceSettingsKeys,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                SWGSDRangel::SWGDeviceSettings& response, // query + response
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                QString& errorMessage);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual int webapiReportGet(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            SWGSDRangel::SWGDeviceReport& response,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            QString& errorMessage);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:22:45 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual int webapiRunGet(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            SWGSDRangel::SWGDeviceState& response,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            QString& errorMessage);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    virtual int webapiRun(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            bool run,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            SWGSDRangel::SWGDeviceState& response,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            QString& errorMessage);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								private:
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-08 20:11:53 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    DeviceAPI *m_deviceAPI;
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									QMutex m_mutex;
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									RemoteOutputSettings m_settings;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-06 22:58:09 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									uint64_t m_centerFrequency;
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									RemoteOutputThread* m_remoteOutputThread;
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									QString m_deviceDescription;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									std::time_t m_startingTimeStamp;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									const QTimer& m_masterTimer;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									uint32_t m_tickCount;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 16:13:57 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint32_t m_tickMultiplier;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    QNetworkAccessManager *m_networkManager;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    QNetworkRequest m_networkRequest;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-04 06:43:07 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint32_t m_lastRemoteSampleCount;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint32_t m_lastSampleCount;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-04 06:43:07 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint64_t m_lastRemoteTimestampRateCorrection;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint64_t m_lastTimestampRateCorrection;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-07 07:22:17 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int m_lastQueueLength;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-04 06:43:07 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint32_t m_nbRemoteSamplesSinceRateCorrection;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint32_t m_nbSamplesSinceRateCorrection;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int m_chunkSizeCorrection;
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 16:13:57 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    static const uint32_t NbSamplesForRateCorrection;
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									void applySettings(const RemoteOutputSettings& settings, bool force = false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RemoteOutputSettings& settings);
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-27 22:40:33 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-26 21:30:35 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void analyzeApiReply(const QJsonObject& jsonObject, const QString& answer);
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-04 06:43:07 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void sampleRateCorrection(double remoteTimeDeltaUs, double timeDeltaUs, uint32_t remoteSampleCount, uint32_t sampleCount);
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const RemoteOutputSettings& settings, bool force);
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-26 21:30:35 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void webapiReverseSendStartStop(bool start);
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-03 07:17:29 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								private slots:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void tick();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void networkManagerFinished(QNetworkReply *reply);
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-14 17:02:49 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-02 21:58:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif // INCLUDE_REMOTEOUTPUT_H
							 |