1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-08-11 18:22:25 -04:00

Single channel API

This commit is contained in:
f4exb 2019-05-09 17:27:12 +02:00
parent 9e628917dc
commit a5e9f251ef
103 changed files with 600 additions and 207 deletions

View File

@ -33,7 +33,7 @@ const QString ChannelAnalyzer::m_channelIdURI = "sdrangel.channel.chanalyzer";
const QString ChannelAnalyzer::m_channelId = "ChannelAnalyzer"; const QString ChannelAnalyzer::m_channelId = "ChannelAnalyzer";
ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) : ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSink(0), m_sampleSink(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)

View File

@ -22,7 +22,7 @@
#include <vector> #include <vector>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/fftcorr.h" #include "dsp/fftcorr.h"
@ -41,7 +41,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class ChannelAnalyzer : public BasebandSampleSink, public ChannelSinkAPI { class ChannelAnalyzer : public BasebandSampleSink, public ChannelAPI {
public: public:
class MsgConfigureChannelAnalyzer : public Message { class MsgConfigureChannelAnalyzer : public Message {
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION
@ -144,6 +144,16 @@ public:
virtual QByteArray serialize() const { return QByteArray(); } virtual QByteArray serialize() const { return QByteArray(); }
virtual bool deserialize(const QByteArray& data) { (void) data; return false; } virtual bool deserialize(const QByteArray& data) { (void) data; return false; }
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_frequency;
}
static const QString m_channelIdURI; static const QString m_channelIdURI;
static const QString m_channelId; static const QString m_channelId;

View File

@ -60,7 +60,7 @@ BasebandSampleSink* ChannelAnalyzerPlugin::createRxChannelBS(DeviceAPI *deviceAP
return new ChannelAnalyzer(deviceAPI); return new ChannelAnalyzer(deviceAPI);
} }
ChannelSinkAPI* ChannelAnalyzerPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* ChannelAnalyzerPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new ChannelAnalyzer(deviceAPI); return new ChannelAnalyzer(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -49,7 +49,7 @@ const QString AMDemod::m_channelId = "AMDemod";
const int AMDemod::m_udpBlockSize = 512; const int AMDemod::m_udpBlockSize = 512;
AMDemod::AMDemod(DeviceAPI *deviceAPI) : AMDemod::AMDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputSampleRate(48000), m_inputSampleRate(48000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -24,7 +24,7 @@
#include <QMutex> #include <QMutex>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "util/movingaverage.h" #include "util/movingaverage.h"
@ -45,7 +45,7 @@ class DownChannelizer;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class fftfilt; class fftfilt;
class AMDemod : public BasebandSampleSink, public ChannelSinkAPI { class AMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureAMDemod : public Message { class MsgConfigureAMDemod : public Message {
@ -110,6 +110,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -54,7 +54,7 @@ BasebandSampleSink* AMDemodPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new AMDemod(deviceAPI); return new AMDemod(deviceAPI);
} }
ChannelSinkAPI* AMDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* AMDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new AMDemod(deviceAPI); return new AMDemod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -40,7 +40,7 @@ const QString ATVDemod::m_channelId = "ATVDemod";
const int ATVDemod::m_ssbFftLen = 1024; const int ATVDemod::m_ssbFftLen = 1024;
ATVDemod::ATVDemod(DeviceAPI *deviceAPI) : ATVDemod::ATVDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_scopeSink(0), m_scopeSink(0),
m_registeredTVScreen(0), m_registeredTVScreen(0),

View File

@ -24,7 +24,7 @@
#include <vector> #include <vector>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/devicesamplesource.h" #include "dsp/devicesamplesource.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "dsp/downchannelizer.h" #include "dsp/downchannelizer.h"
@ -44,7 +44,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class ATVDemod : public BasebandSampleSink, public ChannelSinkAPI class ATVDemod : public BasebandSampleSink, public ChannelAPI
{ {
Q_OBJECT Q_OBJECT
@ -233,6 +233,16 @@ public:
virtual QByteArray serialize() const { return QByteArray(); } virtual QByteArray serialize() const { return QByteArray(); }
virtual bool deserialize(const QByteArray& data) { (void) data; return false; } virtual bool deserialize(const QByteArray& data) { (void) data; return false; }
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_rfRunning.m_intFrequencyOffset;
}
void setTVScreen(TVScreen *objScreen); //!< set by the GUI void setTVScreen(TVScreen *objScreen); //!< set by the GUI
int getSampleRate(); int getSampleRate();
int getEffectiveSampleRate(); int getEffectiveSampleRate();

View File

@ -65,7 +65,7 @@ BasebandSampleSink* ATVDemodPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new ATVDemod(deviceAPI); return new ATVDemod(deviceAPI);
} }
ChannelSinkAPI* ATVDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* ATVDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new ATVDemod(deviceAPI); return new ATVDemod(deviceAPI);
} }

View File

@ -39,7 +39,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_ptrPluginDescriptor; static const PluginDescriptor m_ptrPluginDescriptor;

View File

@ -53,7 +53,7 @@ const Real BFMDemod::default_deemphasis = 50.0; // 50 us
const int BFMDemod::m_udpBlockSize = 512; const int BFMDemod::m_udpBlockSize = 512;
BFMDemod::BFMDemod(DeviceAPI *deviceAPI) : BFMDemod::BFMDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputSampleRate(384000), m_inputSampleRate(384000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -25,7 +25,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/lowpass.h" #include "dsp/lowpass.h"
@ -52,7 +52,7 @@ namespace SWGSDRangel {
class SWGRDSReport; class SWGRDSReport;
} }
class BFMDemod : public BasebandSampleSink, public ChannelSinkAPI { class BFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureBFMDemod : public Message { class MsgConfigureBFMDemod : public Message {
@ -139,6 +139,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
bool getPilotLock() const { return m_pilotPLL.locked(); } bool getPilotLock() const { return m_pilotPLL.locked(); }

View File

@ -73,7 +73,7 @@ BasebandSampleSink* BFMPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new BFMDemod(deviceAPI); return new BFMDemod(deviceAPI);
} }
ChannelSinkAPI* BFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* BFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new BFMDemod(deviceAPI); return new BFMDemod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -37,7 +37,7 @@ MESSAGE_CLASS_DEFINITION(DATVDemod::MsgConfigureDATVDemod, Message)
MESSAGE_CLASS_DEFINITION(DATVDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(DATVDemod::MsgConfigureChannelizer, Message)
DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : DATVDemod::DATVDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_blnNeedConfigUpdate(false), m_blnNeedConfigUpdate(false),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_objRegisteredTVScreen(0), m_objRegisteredTVScreen(0),

View File

@ -44,7 +44,7 @@ class DownChannelizer;
#include "datvideorender.h" #include "datvideorender.h"
#include "datvdemodsettings.h" #include "datvdemodsettings.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "dsp/devicesamplesource.h" #include "dsp/devicesamplesource.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
@ -123,7 +123,7 @@ struct config
} }
}; };
class DATVDemod : public BasebandSampleSink, public ChannelSinkAPI class DATVDemod : public BasebandSampleSink, public ChannelAPI
{ {
Q_OBJECT Q_OBJECT
@ -145,6 +145,16 @@ public:
virtual void stop(); virtual void stop();
virtual bool handleMessage(const Message& cmd); virtual bool handleMessage(const Message& cmd);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_centerFrequency;
}
bool SetTVScreen(TVScreen *objScreen); bool SetTVScreen(TVScreen *objScreen);
DATVideostream * SetVideoRender(DATVideoRender *objScreen); DATVideostream * SetVideoRender(DATVideoRender *objScreen);
bool audioActive(); bool audioActive();

View File

@ -66,7 +66,7 @@ BasebandSampleSink* DATVDemodPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new DATVDemod(deviceAPI); return new DATVDemod(deviceAPI);
} }
ChannelSinkAPI* DATVDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* DATVDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new DATVDemod(deviceAPI); return new DATVDemod(deviceAPI);
} }

View File

@ -40,7 +40,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:

View File

@ -52,7 +52,7 @@ const QString DSDDemod::m_channelId = "DSDDemod";
const int DSDDemod::m_udpBlockSize = 512; const int DSDDemod::m_udpBlockSize = 512;
DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : DSDDemod::DSDDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputSampleRate(48000), m_inputSampleRate(48000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -25,7 +25,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/phasediscri.h" #include "dsp/phasediscri.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -47,7 +47,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class DSDDemod : public BasebandSampleSink, public ChannelSinkAPI { class DSDDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureDSDDemod : public Message { class MsgConfigureDSDDemod : public Message {
@ -115,6 +115,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
double getMagSq() { return m_magsq; } double getMagSq() { return m_magsq; }
bool getSquelchOpen() const { return m_squelchOpen; } bool getSquelchOpen() const { return m_squelchOpen; }

View File

@ -72,7 +72,7 @@ BasebandSampleSink* DSDDemodPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new DSDDemod(deviceAPI); return new DSDDemod(deviceAPI);
} }
ChannelSinkAPI* DSDDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* DSDDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new DSDDemod(deviceAPI); return new DSDDemod(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -145,7 +145,7 @@ void FreeDVDemod::LevelRMS::accumulate(float level)
} }
FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_hiCutoff(6000), m_hiCutoff(6000),
m_lowCutoff(0), m_lowCutoff(0),

View File

@ -24,7 +24,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/fftfilt.h" #include "dsp/fftfilt.h"
@ -49,7 +49,7 @@ namespace FreeDV {
struct freedv; struct freedv;
} }
class FreeDVDemod : public BasebandSampleSink, public ChannelSinkAPI { class FreeDVDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureFreeDVDemod : public Message { class MsgConfigureFreeDVDemod : public Message {
@ -143,6 +143,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
uint32_t getAudioSampleRate() const { return m_audioSampleRate; } uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
uint32_t getModemSampleRate() const { return m_modemSampleRate; } uint32_t getModemSampleRate() const { return m_modemSampleRate; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }

View File

@ -71,7 +71,7 @@ BasebandSampleSink* FreeDVPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new FreeDVDemod(deviceAPI); return new FreeDVDemod(deviceAPI);
} }
ChannelSinkAPI* FreeDVPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* FreeDVPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new FreeDVDemod(deviceAPI); return new FreeDVDemod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -37,7 +37,7 @@ const QString LoRaDemod::m_channelIdURI = "sdrangel.channel.lorademod";
const QString LoRaDemod::m_channelId = "LoRaDemod"; const QString LoRaDemod::m_channelId = "LoRaDemod";
LoRaDemod::LoRaDemod(DeviceAPI* deviceAPI) : LoRaDemod::LoRaDemod(DeviceAPI* deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSink(0), m_sampleSink(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)

View File

@ -23,7 +23,7 @@
#include <vector> #include <vector>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "util/message.h" #include "util/message.h"
@ -41,7 +41,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class LoRaDemod : public BasebandSampleSink, public ChannelSinkAPI { class LoRaDemod : public BasebandSampleSink, public ChannelAPI {
public: public:
class MsgConfigureLoRaDemod : public Message { class MsgConfigureLoRaDemod : public Message {
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION
@ -106,6 +106,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return 0;
}
static const QString m_channelIdURI; static const QString m_channelIdURI;
static const QString m_channelId; static const QString m_channelId;

View File

@ -43,7 +43,7 @@ BasebandSampleSink* LoRaPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new LoRaDemod(deviceAPI); return new LoRaDemod(deviceAPI);
} }
ChannelSinkAPI* LoRaPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* LoRaPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new LoRaDemod(deviceAPI); return new LoRaDemod(deviceAPI);
} }

View File

@ -20,7 +20,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -53,7 +53,7 @@ static const double afSqTones_lowrate[2] = {1000.0, 3500.0};
const int NFMDemod::m_udpBlockSize = 512; const int NFMDemod::m_udpBlockSize = 512;
NFMDemod::NFMDemod(DeviceAPI *devieAPI) : NFMDemod::NFMDemod(DeviceAPI *devieAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(devieAPI), m_deviceAPI(devieAPI),
m_inputSampleRate(48000), m_inputSampleRate(48000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -25,7 +25,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/phasediscri.h" #include "dsp/phasediscri.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -47,7 +47,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class NFMDemod : public BasebandSampleSink, public ChannelSinkAPI { class NFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureNFMDemod : public Message { class MsgConfigureNFMDemod : public Message {
@ -132,6 +132,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -54,7 +54,7 @@ BasebandSampleSink* NFMPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new NFMDemod(deviceAPI); return new NFMDemod(deviceAPI);
} }
ChannelSinkAPI* NFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* NFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new NFMDemod(deviceAPI); return new NFMDemod(deviceAPI);
} }

View File

@ -20,7 +20,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -49,7 +49,7 @@ const QString SSBDemod::m_channelIdURI = "sdrangel.channel.ssbdemod";
const QString SSBDemod::m_channelId = "SSBDemod"; const QString SSBDemod::m_channelId = "SSBDemod";
SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : SSBDemod::SSBDemod(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_audioBinaual(false), m_audioBinaual(false),
m_audioFlipChannels(false), m_audioFlipChannels(false),

View File

@ -25,7 +25,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/fftfilt.h" #include "dsp/fftfilt.h"
@ -45,7 +45,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class SSBDemod : public BasebandSampleSink, public ChannelSinkAPI { class SSBDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureSSBDemod : public Message { class MsgConfigureSSBDemod : public Message {
@ -126,6 +126,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
uint32_t getAudioSampleRate() const { return m_audioSampleRate; } uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
bool getAudioActive() const { return m_audioActive; } bool getAudioActive() const { return m_audioActive; }

View File

@ -54,7 +54,7 @@ BasebandSampleSink* SSBPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new SSBDemod(deviceAPI); return new SSBDemod(deviceAPI);
} }
ChannelSinkAPI* SSBPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* SSBPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new SSBDemod(deviceAPI); return new SSBDemod(deviceAPI);
} }

View File

@ -20,7 +20,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -49,7 +49,7 @@ const QString WFMDemod::m_channelId = "WFMDemod";
const int WFMDemod::m_udpBlockSize = 512; const int WFMDemod::m_udpBlockSize = 512;
WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : WFMDemod::WFMDemod(DeviceAPI* deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputSampleRate(384000), m_inputSampleRate(384000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -25,7 +25,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/lowpass.h" #include "dsp/lowpass.h"
@ -45,7 +45,7 @@ class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class DeviceAPI; class DeviceAPI;
class WFMDemod : public BasebandSampleSink, public ChannelSinkAPI { class WFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureWFMDemod : public Message { class MsgConfigureWFMDemod : public Message {
@ -110,6 +110,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
double getMagSq() const { return m_movingAverage.asDouble(); } double getMagSq() const { return m_movingAverage.asDouble(); }
bool getSquelchOpen() const { return m_squelchOpen; } bool getSquelchOpen() const { return m_squelchOpen; }

View File

@ -55,7 +55,7 @@ BasebandSampleSink* WFMPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new WFMDemod(deviceAPI); return new WFMDemod(deviceAPI);
} }
ChannelSinkAPI* WFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* WFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new WFMDemod(deviceAPI); return new WFMDemod(deviceAPI);
} }

View File

@ -20,7 +20,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -51,7 +51,7 @@ const QString FreqTracker::m_channelId = "FreqTracker";
const int FreqTracker::m_udpBlockSize = 512; const int FreqTracker::m_udpBlockSize = 512;
FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : FreqTracker::FreqTracker(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceSampleRate(48000), m_deviceSampleRate(48000),
m_inputSampleRate(48000), m_inputSampleRate(48000),

View File

@ -24,7 +24,7 @@
#include <QMutex> #include <QMutex>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "util/movingaverage.h" #include "util/movingaverage.h"
@ -46,7 +46,7 @@ class ThreadedBasebandSampleSink;
class QTimer; class QTimer;
class fftfilt; class fftfilt;
class FreqTracker : public BasebandSampleSink, public ChannelSinkAPI { class FreqTracker : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureFreqTracker : public Message { class MsgConfigureFreqTracker : public Message {
@ -133,6 +133,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSink* FreqTrackerPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new FreqTracker(deviceAPI); return new FreqTracker(deviceAPI);
} }
ChannelSinkAPI* FreqTrackerPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* FreqTrackerPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new FreqTracker(deviceAPI); return new FreqTracker(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -46,7 +46,7 @@ const QString LocalSink::m_channelIdURI = "sdrangel.channel.localsink";
const QString LocalSink::m_channelId = "LocalSink"; const QString LocalSink::m_channelId = "LocalSink";
LocalSink::LocalSink(DeviceAPI *deviceAPI) : LocalSink::LocalSink(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_running(false), m_running(false),
m_sinkThread(0), m_sinkThread(0),
@ -250,9 +250,9 @@ DeviceSampleSource *LocalSink::getLocalDevice(uint32_t index)
if (deviceSource->getDeviceDescription() == "LocalInput") if (deviceSource->getDeviceDescription() == "LocalInput")
{ {
if (!getDeviceSourceAPI()) { if (!getDeviceAPI()) {
qDebug("LocalSink::getLocalDevice: the parent device is unset"); qDebug("LocalSink::getLocalDevice: the parent device is unset");
} else if (getDeviceSourceAPI()->getDeviceUID() == deviceSourceEngine->getUID()) { } else if (getDeviceAPI()->getDeviceUID() == deviceSourceEngine->getUID()) {
qDebug("LocalSink::getLocalDevice: source device at index %u is the parent device", index); qDebug("LocalSink::getLocalDevice: source device at index %u is the parent device", index);
} else { } else {
return deviceSource; return deviceSource;

View File

@ -23,7 +23,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "localsinksettings.h" #include "localsinksettings.h"
class DeviceAPI; class DeviceAPI;
@ -34,7 +34,7 @@ class LocalSinkThread;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class LocalSink : public BasebandSampleSink, public ChannelSinkAPI { class LocalSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureLocalSink : public Message { class MsgConfigureLocalSink : public Message {
@ -119,6 +119,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_frequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -72,7 +72,7 @@ BasebandSampleSink* LocalSinkPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new LocalSink(deviceAPI); return new LocalSink(deviceAPI);
} }
ChannelSinkAPI* LocalSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* LocalSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new LocalSink(deviceAPI); return new LocalSink(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -51,7 +51,7 @@ const QString RemoteSink::m_channelIdURI = "sdrangel.channel.remotesink";
const QString RemoteSink::m_channelId = "RemoteSink"; const QString RemoteSink::m_channelId = "RemoteSink";
RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : RemoteSink::RemoteSink(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_running(false), m_running(false),
m_sinkThread(0), m_sinkThread(0),

View File

@ -30,7 +30,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "remotesinksettings.h" #include "remotesinksettings.h"
class QNetworkAccessManager; class QNetworkAccessManager;
@ -40,7 +40,7 @@ class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class RemoteSinkThread; class RemoteSinkThread;
class RemoteSink : public BasebandSampleSink, public ChannelSinkAPI { class RemoteSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureRemoteSink : public Message { class MsgConfigureRemoteSink : public Message {
@ -125,6 +125,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_frequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -72,7 +72,7 @@ BasebandSampleSink* RemoteSinkPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new RemoteSink(deviceAPI); return new RemoteSink(deviceAPI);
} }
ChannelSinkAPI* RemoteSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* RemoteSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new RemoteSink(deviceAPI); return new RemoteSink(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -46,7 +46,7 @@ const QString UDPSink::m_channelIdURI = "sdrangel.channel.udpsink";
const QString UDPSink::m_channelId = "UDPSink"; const QString UDPSink::m_channelId = "UDPSink";
UDPSink::UDPSink(DeviceAPI *deviceAPI) : UDPSink::UDPSink(DeviceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputSampleRate(48000), m_inputSampleRate(48000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -24,7 +24,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/fftfilt.h" #include "dsp/fftfilt.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -45,7 +45,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class UDPSink : public BasebandSampleSink, public ChannelSinkAPI { class UDPSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -118,6 +118,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -72,7 +72,7 @@ BasebandSampleSink* UDPSinkPlugin::createRxChannelBS(DeviceAPI *deviceAPI)
return new UDPSink(deviceAPI); return new UDPSink(deviceAPI);
} }
ChannelSinkAPI* UDPSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* UDPSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI)
{ {
return new UDPSink(deviceAPI); return new UDPSink(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -51,7 +51,7 @@ const QString AMMod::m_channelId ="AMMod";
const int AMMod::m_levelNbSamples = 480; // every 10ms const int AMMod::m_levelNbSamples = 480; // every 10ms
AMMod::AMMod(DeviceAPI *deviceAPI) : AMMod::AMMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(48000), m_basebandSampleRate(48000),
m_outputSampleRate(48000), m_outputSampleRate(48000),

View File

@ -26,7 +26,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -44,7 +44,7 @@ class ThreadedBasebandSampleSource;
class UpChannelizer; class UpChannelizer;
class DeviceAPI; class DeviceAPI;
class AMMod : public BasebandSampleSource, public ChannelSourceAPI { class AMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -218,6 +218,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* AMModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new AMMod(deviceAPI); return new AMMod(deviceAPI);
} }
ChannelSourceAPI* AMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* AMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new AMMod(deviceAPI); return new AMMod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -59,7 +59,7 @@ const int ATVMod::m_cameraFPSTestNbFrames = 100;
const int ATVMod::m_ssbFftLen = 1024; const int ATVMod::m_ssbFftLen = 1024;
ATVMod::ATVMod(DeviceAPI *deviceAPI) : ATVMod::ATVMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_outputSampleRate(1000000), m_outputSampleRate(1000000),
m_inputFrequencyOffset(0), m_inputFrequencyOffset(0),

View File

@ -30,7 +30,7 @@
#include <stdint.h> #include <stdint.h>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "util/movingaverage.h" #include "util/movingaverage.h"
@ -45,7 +45,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSource; class ThreadedBasebandSampleSource;
class UpChannelizer; class UpChannelizer;
class ATVMod : public BasebandSampleSource, public ChannelSourceAPI { class ATVMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -371,6 +371,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* ATVModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new ATVMod(deviceAPI); return new ATVMod(deviceAPI);
} }
ChannelSourceAPI* ATVModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* ATVModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new ATVMod(deviceAPI); return new ATVMod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -55,7 +55,7 @@ const int FreeDVMod::m_levelNbSamples = 80; // every 10ms
const int FreeDVMod::m_ssbFftLen = 1024; const int FreeDVMod::m_ssbFftLen = 1024;
FreeDVMod::FreeDVMod(DeviceAPI *deviceAPI) : FreeDVMod::FreeDVMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(48000), m_basebandSampleRate(48000),
m_outputSampleRate(48000), m_outputSampleRate(48000),

View File

@ -26,7 +26,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -50,7 +50,7 @@ namespace FreeDV {
struct freedv; struct freedv;
} }
class FreeDVMod : public BasebandSampleSource, public ChannelSourceAPI { class FreeDVMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -226,6 +226,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* FreeDVModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new FreeDVMod(deviceAPI); return new FreeDVMod(deviceAPI);
} }
ChannelSourceAPI* FreeDVModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* FreeDVModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new FreeDVMod(deviceAPI); return new FreeDVMod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -53,7 +53,7 @@ const QString NFMMod::m_channelId = "NFMMod";
const int NFMMod::m_levelNbSamples = 480; // every 10ms const int NFMMod::m_levelNbSamples = 480; // every 10ms
NFMMod::NFMMod(DeviceAPI *deviceAPI) : NFMMod::NFMMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(48000), m_basebandSampleRate(48000),
m_outputSampleRate(48000), m_outputSampleRate(48000),

View File

@ -26,7 +26,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -46,7 +46,7 @@ class UpChannelizer;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class NFMMod : public BasebandSampleSource, public ChannelSourceAPI { class NFMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -220,6 +220,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* NFMModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new NFMMod(deviceAPI); return new NFMMod(deviceAPI);
} }
ChannelSourceAPI* NFMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* NFMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new NFMMod(deviceAPI); return new NFMMod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -53,7 +53,7 @@ const int SSBMod::m_levelNbSamples = 480; // every 10ms
const int SSBMod::m_ssbFftLen = 1024; const int SSBMod::m_ssbFftLen = 1024;
SSBMod::SSBMod(DeviceAPI *deviceAPI) : SSBMod::SSBMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(48000), m_basebandSampleRate(48000),
m_outputSampleRate(48000), m_outputSampleRate(48000),

View File

@ -26,7 +26,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -45,7 +45,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSource; class ThreadedBasebandSampleSource;
class UpChannelizer; class UpChannelizer;
class SSBMod : public BasebandSampleSource, public ChannelSourceAPI { class SSBMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -221,6 +221,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* SSBModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new SSBMod(deviceAPI); return new SSBMod(deviceAPI);
} }
ChannelSourceAPI* SSBModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* SSBModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new SSBMod(deviceAPI); return new SSBMod(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -53,7 +53,7 @@ const int WFMMod::m_levelNbSamples = 480; // every 10ms
const int WFMMod::m_rfFilterFFTLength = 1024; const int WFMMod::m_rfFilterFFTLength = 1024;
WFMMod::WFMMod(DeviceAPI *deviceAPI) : WFMMod::WFMMod(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(384000), m_basebandSampleRate(384000),
m_outputSampleRate(384000), m_outputSampleRate(384000),

View File

@ -26,7 +26,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/nco.h" #include "dsp/nco.h"
#include "dsp/ncof.h" #include "dsp/ncof.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
@ -45,7 +45,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSource; class ThreadedBasebandSampleSource;
class UpChannelizer; class UpChannelizer;
class WFMMod : public BasebandSampleSource, public ChannelSourceAPI { class WFMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -219,6 +219,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* WFMModPlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new WFMMod(deviceAPI); return new WFMMod(deviceAPI);
} }
ChannelSourceAPI* WFMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* WFMModPlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new WFMMod(deviceAPI); return new WFMMod(deviceAPI);
} }

View File

@ -36,7 +36,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -47,7 +47,7 @@ const QString RemoteSource::m_channelIdURI = "sdrangel.channeltx.remotesource";
const QString RemoteSource::m_channelId ="RemoteSource"; const QString RemoteSource::m_channelId ="RemoteSource";
RemoteSource::RemoteSource(DeviceAPI *deviceAPI) : RemoteSource::RemoteSource(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sourceThread(0), m_sourceThread(0),
m_running(false), m_running(false),

View File

@ -18,16 +18,17 @@
#ifndef PLUGINS_CHANNELTX_REMOTESRC_REMOTESRC_H_ #ifndef PLUGINS_CHANNELTX_REMOTESRC_REMOTESRC_H_
#define PLUGINS_CHANNELTX_REMOTESRC_REMOTESRC_H_ #define PLUGINS_CHANNELTX_REMOTESRC_REMOTESRC_H_
#include <channel/remotedatablock.h> #include "channel/remotedatablock.h"
#include <channel/remotedataqueue.h> #include "channel/remotedataqueue.h"
#include <channel/remotedatareadqueue.h> #include "channel/remotedatareadqueue.h"
#include <QObject> #include <QObject>
#include <QNetworkRequest> #include <QNetworkRequest>
#include "cm256cc/cm256.h" #include "cm256cc/cm256.h"
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "util/message.h" #include "util/message.h"
#include "../remotesource/remotesourcesettings.h" #include "../remotesource/remotesourcesettings.h"
@ -40,7 +41,7 @@ class RemoteDataBlock;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class RemoteSource : public BasebandSampleSource, public ChannelSourceAPI { class RemoteSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -195,6 +196,16 @@ public:
virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual void getTitle(QString& title) { title = m_settings.m_title; }
virtual qint64 getCenterFrequency() const { return 0; } virtual qint64 getCenterFrequency() const { return 0; }
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return 0;
}
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);

View File

@ -71,7 +71,7 @@ BasebandSampleSource* RemoteSourcePlugin::createTxChannelBS(DeviceAPI *deviceAPI
return new RemoteSource(deviceAPI); return new RemoteSource(deviceAPI);
} }
ChannelSourceAPI* RemoteSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* RemoteSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new RemoteSource(deviceAPI); return new RemoteSource(deviceAPI);
} }

View File

@ -37,7 +37,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -42,7 +42,7 @@ const QString UDPSource::m_channelIdURI = "sdrangel.channeltx.udpsource";
const QString UDPSource::m_channelId = "UDPSource"; const QString UDPSource::m_channelId = "UDPSource";
UDPSource::UDPSource(DeviceAPI *deviceAPI) : UDPSource::UDPSource(DeviceAPI *deviceAPI) :
ChannelSourceAPI(m_channelIdURI), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(48000), m_basebandSampleRate(48000),
m_outputSampleRate(48000), m_outputSampleRate(48000),

View File

@ -22,7 +22,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include "dsp/basebandsamplesource.h" #include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h" #include "channel/channelapi.h"
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "dsp/interpolator.h" #include "dsp/interpolator.h"
#include "dsp/movingaverage.h" #include "dsp/movingaverage.h"
@ -39,7 +39,7 @@ class DeviceAPI;
class ThreadedBasebandSampleSource; class ThreadedBasebandSampleSource;
class UpChannelizer; class UpChannelizer;
class UDPSource : public BasebandSampleSource, public ChannelSourceAPI { class UDPSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT Q_OBJECT
public: public:
@ -108,6 +108,16 @@ public:
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data); virtual bool deserialize(const QByteArray& data);
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
{
(void) streamIndex;
(void) sinkElseSource;
return m_settings.m_inputFrequencyOffset;
}
virtual int webapiSettingsGet( virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage); QString& errorMessage);

View File

@ -73,7 +73,7 @@ BasebandSampleSource* UDPSourcePlugin::createTxChannelBS(DeviceAPI *deviceAPI)
return new UDPSource(deviceAPI); return new UDPSource(deviceAPI);
} }
ChannelSourceAPI* UDPSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) ChannelAPI* UDPSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI)
{ {
return new UDPSource(deviceAPI); return new UDPSource(deviceAPI);
} }

View File

@ -38,7 +38,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI); virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannelCS(DeviceAPI *deviceAPI); virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI);
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;

View File

@ -15,8 +15,9 @@ set(sdrbase_SOURCES
audio/audionetsink.cpp audio/audionetsink.cpp
audio/audioresampler.cpp audio/audioresampler.cpp
channel/channelsinkapi.cpp channel/channelapi.cpp
channel/channelsourceapi.cpp # channel/channelsinkapi.cpp
# channel/channelsourceapi.cpp
channel/remotedataqueue.cpp channel/remotedataqueue.cpp
channel/remotedatareadqueue.cpp channel/remotedatareadqueue.cpp
@ -113,8 +114,9 @@ set(sdrbase_HEADERS
audio/audionetsink.h audio/audionetsink.h
audio/audioresampler.h audio/audioresampler.h
channel/channelsinkapi.h channel/channelapi.h
channel/channelsourceapi.h # channel/channelsinkapi.h
# channel/channelsourceapi.h
channel/remotedataqueue.h channel/remotedataqueue.h
channel/remotedatareadqueue.h channel/remotedatareadqueue.h
channel/remotedatablock.h channel/remotedatablock.h

View File

@ -0,0 +1,29 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
// //
// API for Rx channels //
// //
// 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 //
// (at your option) any later version. //
// //
// 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 "util/uid.h"
#include "channelapi.h"
ChannelAPI::ChannelAPI(const QString& name, StreamType streamType) :
m_name(name),
m_streamType(streamType),
m_indexInDeviceSet(-1),
m_deviceAPI(0),
m_uid(UidCalculator::getNewObjectId())
{ }

View File

@ -0,0 +1,116 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
// //
// API for Rx channels //
// //
// 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 //
// (at your option) any later version. //
// //
// 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 SDRBASE_CHANNEL_CHANNELAPI_H_
#define SDRBASE_CHANNEL_CHANNELAPI_H_
#include <QString>
#include <QByteArray>
#include <stdint.h>
#include "export.h"
class DeviceAPI;
namespace SWGSDRangel
{
class SWGChannelSettings;
class SWGChannelReport;
}
class SDRBASE_API ChannelAPI {
public:
enum StreamType //!< This is the same enum as in PluginInterface
{
StreamSingleSink, //!< Exposes a single sink stream (input, Rx)
StreamSingleSource, //!< Exposes a single source stream (output, Tx)
StreamAny //!< May expose any number of sink and/or source streams
};
ChannelAPI(const QString& name, StreamType streamType);
virtual ~ChannelAPI() {}
virtual void destroy() = 0;
virtual void getIdentifier(QString& id) = 0;
virtual void getTitle(QString& title) = 0;
virtual void setName(const QString& name) { m_name = name; }
virtual const QString& getName() const { return m_name; }
virtual qint64 getCenterFrequency() const = 0; //!< Applies to a default stream
virtual QByteArray serialize() const = 0;
virtual bool deserialize(const QByteArray& data) = 0;
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) force;
(void) channelSettingsKeys;
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
int getDeviceSetIndex() const { return m_deviceSetIndex; }
void setDeviceSetIndex(int deviceSetIndex) { m_deviceSetIndex = deviceSetIndex; }
DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
void setDeviceAPI(DeviceAPI *deviceAPI) { m_deviceAPI = deviceAPI; }
uint64_t getUID() const { return m_uid; }
// MIMO support
StreamType getStreamType() const { return m_streamType; }
virtual int getNbSinkStreams() const = 0;
virtual int getNbSourceStreams() const = 0;
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const = 0;
private:
StreamType m_streamType;
/** Unique identifier in a device set used for sorting. Used when there is no GUI.
* In GUI version it is supported by GUI object name accessed through PluginInstanceGUI.
*/
QString m_name;
int m_indexInDeviceSet;
int m_deviceSetIndex;
DeviceAPI *m_deviceAPI;
uint64_t m_uid;
};
#endif // SDRBASE_CHANNEL_CHANNELAPI_H_

View File

@ -23,8 +23,7 @@
#include "dsp/devicesamplesource.h" #include "dsp/devicesamplesource.h"
#include "dsp/devicesamplesink.h" #include "dsp/devicesamplesink.h"
#include "settings/preset.h" #include "settings/preset.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "channel/channelsourceapi.h"
#include "deviceapi.h" #include "deviceapi.h"
@ -107,14 +106,17 @@ void DeviceAPI::removeChannelSource(ThreadedBasebandSampleSource* source, int st
} }
} }
void DeviceAPI::addChannelSinkAPI(ChannelSinkAPI* channelAPI) void DeviceAPI::addChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex)
{ {
(void) streamIndex;
m_channelSinkAPIs.append(channelAPI); m_channelSinkAPIs.append(channelAPI);
renumerateChannels(); renumerateChannels();
} }
void DeviceAPI::removeChannelSinkAPI(ChannelSinkAPI* channelAPI) void DeviceAPI::removeChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex)
{ {
(void) streamIndex;
if (m_channelSinkAPIs.removeOne(channelAPI)) { if (m_channelSinkAPIs.removeOne(channelAPI)) {
renumerateChannels(); renumerateChannels();
} }
@ -122,14 +124,17 @@ void DeviceAPI::removeChannelSinkAPI(ChannelSinkAPI* channelAPI)
channelAPI->setIndexInDeviceSet(-1); channelAPI->setIndexInDeviceSet(-1);
} }
void DeviceAPI::addChannelSourceAPI(ChannelSourceAPI* channelAPI) void DeviceAPI::addChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex)
{ {
(void) streamIndex;
m_channelSourceAPIs.append(channelAPI); m_channelSourceAPIs.append(channelAPI);
renumerateChannels(); renumerateChannels();
} }
void DeviceAPI::removeChannelSourceAPI(ChannelSourceAPI* channelAPI) void DeviceAPI::removeChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex)
{ {
(void) streamIndex;
if (m_channelSourceAPIs.removeOne(channelAPI)) { if (m_channelSourceAPIs.removeOne(channelAPI)) {
renumerateChannels(); renumerateChannels();
} }
@ -356,8 +361,10 @@ void DeviceAPI::getDeviceEngineStateStr(QString& state)
} }
} }
ChannelSinkAPI *DeviceAPI::getChanelSinkAPIAt(int index) ChannelAPI *DeviceAPI::getChanelSinkAPIAt(int index, int streamIndex)
{ {
(void) streamIndex;
if (m_streamType == StreamSingleRx) if (m_streamType == StreamSingleRx)
{ {
if (index < m_channelSinkAPIs.size()) { if (index < m_channelSinkAPIs.size()) {
@ -372,8 +379,10 @@ ChannelSinkAPI *DeviceAPI::getChanelSinkAPIAt(int index)
} }
} }
ChannelSourceAPI *DeviceAPI::getChanelSourceAPIAt(int index) ChannelAPI *DeviceAPI::getChanelSourceAPIAt(int index, int streamIndex)
{ {
(void) streamIndex;
if (m_streamType == StreamSingleTx) if (m_streamType == StreamSingleTx)
{ {
if (index < m_channelSourceAPIs.size()) { if (index < m_channelSourceAPIs.size()) {
@ -688,7 +697,7 @@ void DeviceAPI::renumerateChannels()
{ {
m_channelSinkAPIs.at(i)->setIndexInDeviceSet(i); m_channelSinkAPIs.at(i)->setIndexInDeviceSet(i);
m_channelSinkAPIs.at(i)->setDeviceSetIndex(m_deviceTabIndex); m_channelSinkAPIs.at(i)->setDeviceSetIndex(m_deviceTabIndex);
//m_channelSinkAPIs.at(i)->setDeviceSourceAPI(this); // FIXME: use generic DeviceAPI in ChannelSinkAPI m_channelSinkAPIs.at(i)->setDeviceAPI(this);
} }
} }
else if (m_streamType == StreamSingleTx) else if (m_streamType == StreamSingleTx)
@ -697,7 +706,7 @@ void DeviceAPI::renumerateChannels()
{ {
m_channelSourceAPIs.at(i)->setIndexInDeviceSet(i); m_channelSourceAPIs.at(i)->setIndexInDeviceSet(i);
m_channelSourceAPIs.at(i)->setDeviceSetIndex(m_deviceTabIndex); m_channelSourceAPIs.at(i)->setDeviceSetIndex(m_deviceTabIndex);
//m_channelSourceAPIs.at(i)->setDeviceSinkAPI(this); // FIXME: use generic DeviceAPI in ChannelSourceAPI m_channelSourceAPIs.at(i)->setDeviceAPI(this);
} }
} }
} }

View File

@ -27,8 +27,7 @@
class BasebandSampleSink; class BasebandSampleSink;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class ThreadedBasebandSampleSource; class ThreadedBasebandSampleSource;
class ChannelSinkAPI; class ChannelAPI;
class ChannelSourceAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceSampleSource; class DeviceSampleSource;
class MessageQueue; class MessageQueue;
@ -72,10 +71,10 @@ public:
void addChannelSource(ThreadedBasebandSampleSource* sink, int streamIndex = 0); //!< Add a channel source (Tx) void addChannelSource(ThreadedBasebandSampleSource* sink, int streamIndex = 0); //!< Add a channel source (Tx)
void removeChannelSource(ThreadedBasebandSampleSource* sink, int streamIndex = 0); //!< Remove a channel source (Tx) void removeChannelSource(ThreadedBasebandSampleSource* sink, int streamIndex = 0); //!< Remove a channel source (Tx)
void addChannelSinkAPI(ChannelSinkAPI* channelAPI); void addChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void removeChannelSinkAPI(ChannelSinkAPI* channelAPI); void removeChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void addChannelSourceAPI(ChannelSourceAPI* channelAPI); void addChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void removeChannelSourceAPI(ChannelSourceAPI* channelAPI); void removeChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void setSampleSource(DeviceSampleSource* source); //!< Set the device sample source (single Rx) void setSampleSource(DeviceSampleSource* source); //!< Set the device sample source (single Rx)
void setSampleSink(DeviceSampleSink* sink); //!< Set the device sample sink (single Tx) void setSampleSink(DeviceSampleSink* sink); //!< Set the device sample sink (single Tx)
@ -149,8 +148,8 @@ public:
void getDeviceEngineStateStr(QString& state); void getDeviceEngineStateStr(QString& state);
ChannelSinkAPI *getChanelSinkAPIAt(int index); ChannelAPI *getChanelSinkAPIAt(int index, int streamIndex = 0);
ChannelSourceAPI *getChanelSourceAPIAt(int index); ChannelAPI *getChanelSourceAPIAt(int index, int streamIndex = 0);
int getNbSourceChannels() const { return m_channelSourceAPIs.size(); } int getNbSourceChannels() const { return m_channelSourceAPIs.size(); }
int getNbSinkChannels() const { return m_channelSinkAPIs.size(); } int getNbSinkChannels() const { return m_channelSinkAPIs.size(); }
@ -205,12 +204,12 @@ protected:
// Single Rx (i.e. source) // Single Rx (i.e. source)
DSPDeviceSourceEngine *m_deviceSourceEngine; DSPDeviceSourceEngine *m_deviceSourceEngine;
QList<ChannelSinkAPI*> m_channelSinkAPIs; QList<ChannelAPI*> m_channelSinkAPIs;
// Single Tx (i.e. sink) // Single Tx (i.e. sink)
DSPDeviceSinkEngine *m_deviceSinkEngine; DSPDeviceSinkEngine *m_deviceSinkEngine;
QList<ChannelSourceAPI*> m_channelSourceAPIs; QList<ChannelAPI*> m_channelSourceAPIs;
private: private:
void renumerateChannels(); void renumerateChannels();

View File

@ -25,8 +25,7 @@ class DeviceSampleSource;
class DeviceSampleSink; class DeviceSampleSink;
class BasebandSampleSink; class BasebandSampleSink;
class BasebandSampleSource; class BasebandSampleSource;
class ChannelSinkAPI; class ChannelAPI;
class ChannelSourceAPI;
class SDRBASE_API PluginInterface { class SDRBASE_API PluginInterface {
public: public:
@ -102,7 +101,7 @@ public:
return nullptr; return nullptr;
} }
virtual ChannelSinkAPI* createRxChannelCS( virtual ChannelAPI* createRxChannelCS(
DeviceAPI *deviceAPI) DeviceAPI *deviceAPI)
{ {
(void) deviceAPI; (void) deviceAPI;
@ -127,7 +126,7 @@ public:
return nullptr; return nullptr;
} }
virtual ChannelSourceAPI* createTxChannelCS( virtual ChannelAPI* createTxChannelCS(
DeviceAPI *deviceAPI) DeviceAPI *deviceAPI)
{ {
(void) deviceAPI; (void) deviceAPI;

View File

@ -65,8 +65,8 @@ SOURCES += audio/audiodevicemanager.cpp\
audio/audioinput.cpp\ audio/audioinput.cpp\
audio/audionetsink.cpp\ audio/audionetsink.cpp\
audio/audioresampler.cpp\ audio/audioresampler.cpp\
channel/channelsinkapi.cpp\ # channel/channelsinkapi.cpp\
channel/channelsourceapi.cpp\ # channel/channelsourceapi.cpp\
channel/remotedataqueue.cpp\ channel/remotedataqueue.cpp\
channel/remotedatareadqueue.cpp\ channel/remotedatareadqueue.cpp\
commands/command.cpp\ commands/command.cpp\
@ -149,8 +149,8 @@ HEADERS += audio/audiodevicemanager.h\
audio/audioinput.h\ audio/audioinput.h\
audio/audionetsink.h\ audio/audionetsink.h\
audio/audioresampler.h\ audio/audioresampler.h\
channel/channelsinkapi.h\ # channel/channelsinkapi.h\
channel/channelsourceapi.h\ # channel/channelsourceapi.h\
channel/remotedataqueue.h\ channel/remotedataqueue.h\
channel/remotedatareadqueue.h\ channel/remotedatareadqueue.h\
channel/remotedatablock.h\ channel/remotedatablock.h\

View File

@ -34,8 +34,7 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#include "plugin/pluginmanager.h" #include "plugin/pluginmanager.h"
#include "channel/channelsinkapi.h" #include "channel/channelapi.h"
#include "channel/channelsourceapi.h"
#include "SWGInstanceSummaryResponse.h" #include "SWGInstanceSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h" #include "SWGInstanceDevicesResponse.h"
@ -1528,7 +1527,7 @@ int WebAPIAdapterGUI::devicesetChannelSettingsGet(
if (deviceSet->m_deviceSourceEngine) // Single Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
ChannelSinkAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1545,7 +1544,7 @@ int WebAPIAdapterGUI::devicesetChannelSettingsGet(
} }
else if (deviceSet->m_deviceSinkEngine) // Single Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
ChannelSourceAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1588,7 +1587,7 @@ int WebAPIAdapterGUI::devicesetChannelReportGet(
if (deviceSet->m_deviceSourceEngine) // Single Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
ChannelSinkAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1605,7 +1604,7 @@ int WebAPIAdapterGUI::devicesetChannelReportGet(
} }
else if (deviceSet->m_deviceSinkEngine) // Single Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
ChannelSourceAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1649,7 +1648,7 @@ int WebAPIAdapterGUI::devicesetChannelSettingsPutPatch(
if (deviceSet->m_deviceSourceEngine) // Single Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
ChannelSinkAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1677,7 +1676,7 @@ int WebAPIAdapterGUI::devicesetChannelSettingsPutPatch(
} }
else if (deviceSet->m_deviceSinkEngine) // Single Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
ChannelSourceAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex); ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
if (channelAPI == 0) if (channelAPI == 0)
{ {
@ -1767,7 +1766,7 @@ void WebAPIAdapterGUI::getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const
{ {
channels->append(new SWGSDRangel::SWGChannel); channels->append(new SWGSDRangel::SWGChannel);
channels->back()->init(); channels->back()->init();
ChannelSourceAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i); ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i);
channels->back()->setDeltaFrequency(channel->getCenterFrequency()); channels->back()->setDeltaFrequency(channel->getCenterFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet()); channels->back()->setIndex(channel->getIndexInDeviceSet());
channels->back()->setUid(channel->getUID()); channels->back()->setUid(channel->getUID());
@ -1799,7 +1798,7 @@ void WebAPIAdapterGUI::getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const
{ {
channels->append(new SWGSDRangel::SWGChannel); channels->append(new SWGSDRangel::SWGChannel);
channels->back()->init(); channels->back()->init();
ChannelSinkAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i); ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i);
channels->back()->setDeltaFrequency(channel->getCenterFrequency()); channels->back()->setDeltaFrequency(channel->getCenterFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet()); channels->back()->setIndex(channel->getIndexInDeviceSet());
channels->back()->setUid(channel->getUID()); channels->back()->setUid(channel->getUID());
@ -1824,7 +1823,7 @@ void WebAPIAdapterGUI::getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channel
{ {
channels->append(new SWGSDRangel::SWGChannel); channels->append(new SWGSDRangel::SWGChannel);
channels->back()->init(); channels->back()->init();
ChannelSourceAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i); ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i);
channels->back()->setDeltaFrequency(channel->getCenterFrequency()); channels->back()->setDeltaFrequency(channel->getCenterFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet()); channels->back()->setIndex(channel->getIndexInDeviceSet());
channels->back()->setUid(channel->getUID()); channels->back()->setUid(channel->getUID());
@ -1850,7 +1849,7 @@ void WebAPIAdapterGUI::getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channel
{ {
channels->append(new SWGSDRangel::SWGChannel); channels->append(new SWGSDRangel::SWGChannel);
channels->back()->init(); channels->back()->init();
ChannelSinkAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i); ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i);
channels->back()->setDeltaFrequency(channel->getCenterFrequency()); channels->back()->setDeltaFrequency(channel->getCenterFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet()); channels->back()->setIndex(channel->getIndexInDeviceSet());
channels->back()->setUid(channel->getUID()); channels->back()->setUid(channel->getUID());

Some files were not shown because too many files have changed in this diff Show More