2014-05-18 11:52:39 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2015-08-13 23:00:28 -04:00
|
|
|
// Copyright (C) 2015 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
2014-05-18 11:52:39 -04:00
|
|
|
// //
|
|
|
|
// 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>
|
|
|
|
#include "dsp/samplefifo.h"
|
|
|
|
#include "util/message.h"
|
2015-08-13 23:00:28 -04:00
|
|
|
#include "util/messagequeue.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
#include "util/export.h"
|
|
|
|
|
|
|
|
class SDRANGELOVE_API SampleSource {
|
|
|
|
public:
|
2015-08-13 23:00:28 -04:00
|
|
|
SampleSource();
|
2014-05-18 11:52:39 -04:00
|
|
|
virtual ~SampleSource();
|
|
|
|
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual bool init(const Message& cmd) = 0;
|
2015-08-13 23:00:28 -04:00
|
|
|
virtual bool start(int device) = 0;
|
|
|
|
virtual void stop() = 0;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
virtual const QString& getDeviceDescription() const = 0;
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual int getSampleRate() const = 0; //!< Sample rate exposed by the source
|
|
|
|
virtual quint64 getCenterFrequency() const = 0; //!< Center frequency exposed by the source
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2015-08-13 23:00:28 -04:00
|
|
|
virtual bool handleMessage(const Message& message) = 0;
|
|
|
|
|
|
|
|
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
|
|
|
MessageQueue *getOutputMessageQueue() { return &m_outputMessageQueue; }
|
|
|
|
SampleFifo* getSampleFifo() { return &m_sampleFifo; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
protected:
|
2015-08-13 23:00:28 -04:00
|
|
|
SampleFifo m_sampleFifo;
|
|
|
|
MessageQueue m_inputMessageQueue;
|
|
|
|
MessageQueue m_outputMessageQueue;
|
2014-05-18 11:52:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_SAMPLESOURCE_H
|