2016-10-02 17:21:53 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_SAMPLESOURCE_H
|
|
|
|
#define INCLUDE_SAMPLESOURCE_H
|
|
|
|
|
|
|
|
#include <QtGlobal>
|
2016-10-06 13:18:02 -04:00
|
|
|
|
|
|
|
#include "samplesinkfifo.h"
|
2016-10-02 17:21:53 -04:00
|
|
|
#include "util/message.h"
|
|
|
|
#include "util/messagequeue.h"
|
|
|
|
#include "util/export.h"
|
|
|
|
|
|
|
|
class SDRANGEL_API DeviceSampleSource : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DeviceSampleSource();
|
|
|
|
virtual ~DeviceSampleSource();
|
2017-09-14 20:32:30 -04:00
|
|
|
virtual void destroy() = 0;
|
2016-10-02 17:21:53 -04:00
|
|
|
|
2017-04-13 21:40:45 -04:00
|
|
|
virtual bool start() = 0;
|
2016-10-02 17:21:53 -04:00
|
|
|
virtual void stop() = 0;
|
|
|
|
|
|
|
|
virtual const QString& getDeviceDescription() const = 0;
|
|
|
|
virtual int getSampleRate() const = 0; //!< Sample rate exposed by the source
|
|
|
|
virtual quint64 getCenterFrequency() const = 0; //!< Center frequency exposed by the source
|
|
|
|
|
|
|
|
virtual bool handleMessage(const Message& message) = 0;
|
2017-04-12 17:10:22 -04:00
|
|
|
|
2016-10-02 17:21:53 -04:00
|
|
|
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2017-09-22 23:51:29 -04:00
|
|
|
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
2017-09-16 17:44:00 -04:00
|
|
|
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
2016-10-06 13:18:02 -04:00
|
|
|
SampleSinkFifo* getSampleFifo() { return &m_sampleFifo; }
|
2016-10-02 17:21:53 -04:00
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void handleInputMessages();
|
|
|
|
|
|
|
|
protected:
|
2016-10-06 13:18:02 -04:00
|
|
|
SampleSinkFifo m_sampleFifo;
|
2016-10-02 17:21:53 -04:00
|
|
|
MessageQueue m_inputMessageQueue; //!< Input queue to the source
|
2017-09-16 17:44:00 -04:00
|
|
|
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
2016-10-02 17:21:53 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_SAMPLESOURCE_H
|