mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-18 02:46:35 -04:00
79 lines
2.8 KiB
C++
79 lines
2.8 KiB
C++
///////////////////////////////////////////////////////////////////////////////////
|
|
// Copyright (C) 2018 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/>. //
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "dsp/basebandsamplesource.h"
|
|
#include "channel/channelsourceapi.h"
|
|
#include "util/message.h"
|
|
|
|
#include "daemonsrcsettings.h"
|
|
|
|
class DeviceSinkAPI;
|
|
class ThreadedBasebandSampleSource;
|
|
class UpChannelizer;
|
|
|
|
class DaemonSrc : public BasebandSampleSource, public ChannelSourceAPI {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
class MsgSampleRateNotification : public Message {
|
|
MESSAGE_CLASS_DECLARATION
|
|
|
|
public:
|
|
static MsgSampleRateNotification* create(int sampleRate) {
|
|
return new MsgSampleRateNotification(sampleRate);
|
|
}
|
|
|
|
int getSampleRate() const { return m_sampleRate; }
|
|
|
|
private:
|
|
|
|
MsgSampleRateNotification(int sampleRate) :
|
|
Message(),
|
|
m_sampleRate(sampleRate)
|
|
{ }
|
|
|
|
int m_sampleRate;
|
|
};
|
|
|
|
DaemonSrc(DeviceSinkAPI *deviceAPI);
|
|
~DaemonSrc();
|
|
|
|
virtual void destroy() { delete this; }
|
|
|
|
virtual void pull(Sample& sample);
|
|
virtual void pullAudio(int nbSamples);
|
|
virtual void start();
|
|
virtual void stop();
|
|
virtual bool handleMessage(const Message& cmd);
|
|
|
|
virtual void getIdentifier(QString& id) { id = objectName(); }
|
|
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
|
virtual qint64 getCenterFrequency() const { return 0; }
|
|
|
|
virtual QByteArray serialize() const;
|
|
virtual bool deserialize(const QByteArray& data);
|
|
|
|
static const QString m_channelIdURI;
|
|
static const QString m_channelId;
|
|
|
|
private:
|
|
DeviceSinkAPI* m_deviceAPI;
|
|
ThreadedBasebandSampleSource* m_threadedChannelizer;
|
|
UpChannelizer* m_channelizer;
|
|
|
|
DaemonSrcSettings m_settings;
|
|
};
|