1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Server: Web API: /sdrangel/deviceset/{deviceSetIndex}/channel POST implementation and rework in the PluginInterface

This commit is contained in:
f4exb 2017-12-23 05:56:40 +01:00
parent d4ca83ff61
commit 514e408aac
42 changed files with 121 additions and 203 deletions

View File

@ -56,11 +56,7 @@ BasebandSampleSink* ChannelAnalyzerPlugin::createRxChannel(const QString& channe
}
}
void ChannelAnalyzerPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* ChannelAnalyzerPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == ChannelAnalyzer::m_channelIdURI) {
*channelSinkAPI = new ChannelAnalyzer(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new ChannelAnalyzer(deviceAPI);
}

View File

@ -19,9 +19,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -71,12 +71,8 @@ BasebandSampleSink* ChannelAnalyzerNGPlugin::createRxChannel(const QString& chan
}
}
void ChannelAnalyzerNGPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* ChannelAnalyzerNGPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == ChannelAnalyzerNG::m_channelIdURI) {
*channelSinkAPI = new ChannelAnalyzerNG(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new ChannelAnalyzerNG(deviceAPI);
}

View File

@ -35,9 +35,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -56,12 +56,8 @@ BasebandSampleSink* AMDemodPlugin::createRxChannel(const QString& channelName, D
}
}
void AMDemodPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* AMDemodPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == AMDemod::m_channelIdURI) {
*channelSinkAPI = new AMDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new AMDemod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -78,12 +78,8 @@ BasebandSampleSink* ATVDemodPlugin::createRxChannel(const QString& channelName,
}
}
void ATVDemodPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* ATVDemodPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == ATVDemod::m_channelIdURI) {
*channelSinkAPI = new ATVDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new ATVDemod(deviceAPI);
}

View File

@ -36,9 +36,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* ptrPluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& strChannelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& strChannelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_ptrPluginDescriptor;

View File

@ -74,12 +74,8 @@ BasebandSampleSink* BFMPlugin::createRxChannel(const QString& channelName, Devic
}
}
void BFMPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* BFMPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == BFMDemod::m_channelIdURI) {
*channelSinkAPI = new BFMDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new BFMDemod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -73,12 +73,8 @@ BasebandSampleSink* DSDDemodPlugin::createRxChannel(const QString& channelName,
}
}
void DSDDemodPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* DSDDemodPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == DSDDemod::m_channelIdURI) {
*channelSinkAPI = new DSDDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new DSDDemod(deviceAPI);
}

View File

@ -35,9 +35,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -55,12 +55,8 @@ BasebandSampleSink* LoRaPlugin::createRxChannel(const QString& channelName, Devi
}
}
void LoRaPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* LoRaPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == LoRaDemod::m_channelIdURI) {
*channelSinkAPI = new LoRaDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new LoRaDemod(deviceAPI);
}

View File

@ -18,9 +18,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -64,12 +64,8 @@ BasebandSampleSink* NFMPlugin::createRxChannel(const QString& channelName, Devic
}
}
void NFMPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* NFMPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == NFMDemod::m_channelIdURI) {
*channelSinkAPI = new NFMDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new NFMDemod(deviceAPI);
}

View File

@ -18,9 +18,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -56,12 +56,8 @@ BasebandSampleSink* SSBPlugin::createRxChannel(const QString& channelName, Devic
}
}
void SSBPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* SSBPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == SSBDemod::m_channelIdURI) {
*channelSinkAPI = new SSBDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new SSBDemod(deviceAPI);
}

View File

@ -18,9 +18,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -56,12 +56,8 @@ BasebandSampleSink* WFMPlugin::createRxChannel(const QString& channelName, Devic
}
}
void WFMPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* WFMPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == WFMDemod::m_channelIdURI) {
*channelSinkAPI = new WFMDemod(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new WFMDemod(deviceAPI);
}

View File

@ -18,9 +18,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -58,12 +58,8 @@ BasebandSampleSink* TCPSrcPlugin::createRxChannel(const QString& channelName, De
}
}
void TCPSrcPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* TCPSrcPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == TCPSrc::m_channelIdURI) {
*channelSinkAPI = new TCPSrc(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new TCPSrc(deviceAPI);
}

View File

@ -18,9 +18,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -75,12 +75,8 @@ BasebandSampleSink* UDPSrcPlugin::createRxChannel(const QString& channelName, De
}
}
void UDPSrcPlugin::createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI)
ChannelSinkAPI* UDPSrcPlugin::createRxChannel(DeviceSourceAPI *deviceAPI)
{
if(channelName == UDPSrc::m_channelIdURI) {
*channelSinkAPI = new UDPSrc(deviceAPI);
} else {
*channelSinkAPI = 0;
}
return new UDPSrc(deviceAPI);
}

View File

@ -35,9 +35,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
void createRxChannel(ChannelSinkAPI **channelSinkAPI, const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI);
virtual ChannelSinkAPI* createRxChannel(DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -72,12 +72,8 @@ BasebandSampleSource* AMModPlugin::createTxChannel(const QString& channelName, D
}
}
void AMModPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* AMModPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == AMMod::m_channelIdURI) {
*channelSourceAPI = new AMMod(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new AMMod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -72,13 +72,9 @@ BasebandSampleSource* ATVModPlugin::createTxChannel(const QString& channelName,
}
}
void ATVModPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* ATVModPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == ATVMod::m_channelIdURI) {
*channelSourceAPI = new ATVMod(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new ATVMod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -81,13 +81,9 @@ BasebandSampleSource* NFMModPlugin::createTxChannel(const QString& channelName,
}
}
void NFMModPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* NFMModPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == NFMMod::m_channelIdURI) {
*channelSourceAPI = new NFMMod(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new NFMMod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -72,13 +72,9 @@ BasebandSampleSource* SSBModPlugin::createTxChannel(const QString& channelName,
}
}
void SSBModPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* SSBModPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == SSBMod::m_channelIdURI) {
*channelSourceAPI = new SSBMod(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new SSBMod(deviceAPI);
}

View File

@ -34,9 +34,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -72,13 +72,9 @@ BasebandSampleSource* WFMModPlugin::createTxChannel(const QString& channelName,
}
}
void WFMModPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* WFMModPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == WFMMod::m_channelIdURI) {
*channelSourceAPI = new WFMMod(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new WFMMod(deviceAPI);
}

View File

@ -33,9 +33,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -74,13 +74,9 @@ BasebandSampleSource* UDPSinkPlugin::createTxChannel(const QString& channelName,
}
}
void UDPSinkPlugin::createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI)
ChannelSourceAPI* UDPSinkPlugin::createTxChannel(DeviceSinkAPI *deviceAPI)
{
if(channelName == UDPSink::m_channelIdURI) {
*channelSourceAPI = new UDPSink(deviceAPI);
} else {
*channelSourceAPI = 0;
}
return new UDPSink(deviceAPI);
}

View File

@ -35,9 +35,9 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
void createTxChannel(ChannelSourceAPI **channelSourceAPI, const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
virtual BasebandSampleSource* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI);
virtual ChannelSourceAPI* createTxChannel(DeviceSinkAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -89,11 +89,9 @@ public:
DeviceSourceAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
virtual void createRxChannel(
ChannelSinkAPI **channelSinkAPI,
const QString& channelName __attribute__((unused)),
virtual ChannelSinkAPI* createRxChannel(
DeviceSourceAPI *deviceAPI __attribute__((unused)) )
{ *channelSinkAPI = 0; }
{ return 0; }
// channel Tx plugins
@ -108,11 +106,9 @@ public:
DeviceSinkAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
virtual void createTxChannel(
ChannelSourceAPI **channelSourceAPI,
const QString& channelName __attribute__((unused)),
DeviceSourceAPI *deviceAPI __attribute__((unused)) )
{ *channelSourceAPI = 0; }
virtual ChannelSourceAPI* createTxChannel(
DeviceSinkAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
// device source plugins only

View File

@ -199,21 +199,3 @@ void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceUISet
pluginInterface->createTxChannelGUI(m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceUISet, txChannel);
}
}
void PluginManager::createRxChannelServerInstance(int channelPluginIndex, DeviceSourceAPI *deviceAPI)
{
if (channelPluginIndex < m_rxChannelRegistrations.size())
{
PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin;
pluginInterface->createRxChannel(m_rxChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceAPI);
}
}
void PluginManager::createTxChannelServerInstance(int channelPluginIndex, DeviceSinkAPI *deviceAPI)
{
if (channelPluginIndex < m_txChannelRegistrations.size())
{
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
pluginInterface->createTxChannel(m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceAPI);
}
}

View File

@ -57,11 +57,9 @@ public:
PluginAPI::ChannelRegistrations *getTxChannelRegistrations() { return &m_txChannelRegistrations; }
void createRxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet, DeviceSourceAPI *deviceAPI);
void createRxChannelServerInstance(int channelPluginIndex, DeviceSourceAPI *deviceAPI);
void listRxChannels(QList<QString>& list);
void createTxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet, DeviceSinkAPI *deviceAPI);
void createTxChannelServerInstance(int channelPluginIndex, DeviceSinkAPI *deviceAPI);
void listTxChannels(QList<QString>& list);
static const QString& getFileSourceDeviceId() { return m_fileSourceDeviceTypeID; }

View File

@ -99,6 +99,24 @@ void DeviceSet::freeTxChannels()
}
}
void DeviceSet::addRxChannel(int selectedChannelIndex, PluginAPI *pluginAPI)
{
PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getRxChannelRegistrations(); // Available channel plugins
ChannelSinkAPI *rxChannel =(*channelRegistrations)[selectedChannelIndex].m_plugin->createRxChannel(m_deviceSourceAPI);
ChannelInstanceRegistration reg = ChannelInstanceRegistration(rxChannel->getName(), rxChannel);
m_rxChannelInstanceRegistrations.append(reg);
qDebug("DeviceSet::addRxChannel: %s", qPrintable(rxChannel->getName()));
}
void DeviceSet::addTxChannel(int selectedChannelIndex, PluginAPI *pluginAPI)
{
PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getTxChannelRegistrations(); // Available channel plugins
ChannelSourceAPI *txChannel = (*channelRegistrations)[selectedChannelIndex].m_plugin->createTxChannel(m_deviceSinkAPI);
ChannelInstanceRegistration reg = ChannelInstanceRegistration(txChannel->getName(), txChannel);
m_txChannelInstanceRegistrations.append(reg);
qDebug("DeviceSet::addTxChannel: %s", qPrintable(txChannel->getName()));
}
void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI)
{
if (preset->isSourcePreset())
@ -143,11 +161,8 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
{
qDebug("DeviceSet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
ChannelSinkAPI *rxChannel;
(*channelRegistrations)[i].m_plugin->createRxChannel(
&rxChannel, channelConfig.m_channelIdURI, m_deviceSourceAPI);
reg = ChannelInstanceRegistration(
channelConfig.m_channelIdURI, rxChannel);
ChannelSinkAPI *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannel(m_deviceSourceAPI);
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannel);
m_rxChannelInstanceRegistrations.append(reg);
break;
}
@ -242,11 +257,8 @@ void DeviceSet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
{
qDebug("DeviceSet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
ChannelSourceAPI *txChannel;
(*channelRegistrations)[i].m_plugin->createTxChannel(
&txChannel, channelConfig.m_channelIdURI, m_deviceSourceAPI);
reg = ChannelInstanceRegistration(
channelConfig.m_channelIdURI, txChannel);
ChannelSourceAPI *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannel(m_deviceSinkAPI);
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, txChannel);
m_txChannelInstanceRegistrations.append(reg);
break;
}

View File

@ -38,6 +38,8 @@ struct DeviceSet
DeviceSet(int tabIndex);
~DeviceSet();
void addRxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
void addTxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
void registerRxChannelInstance(const QString& channelName, ChannelSinkAPI* channelAPI);
void registerTxChannelInstance(const QString& channelName, ChannelSourceAPI* channelAPI);
void removeRxChannelInstance(ChannelSinkAPI* channelAPI);

View File

@ -476,11 +476,11 @@ void MainCore::addChannel(int deviceSetIndex, int selectedChannelIndex)
if (deviceSet->m_deviceSourceEngine) // source device => Rx channels
{
m_pluginManager->createRxChannelServerInstance(selectedChannelIndex, deviceSet->m_deviceSourceAPI);
deviceSet->addRxChannel(selectedChannelIndex, m_pluginManager->getPluginAPI());
}
else if (deviceSet->m_deviceSinkEngine) // sink device => Tx channels
{
m_pluginManager->createTxChannelServerInstance(selectedChannelIndex, deviceSet->m_deviceSinkAPI);
deviceSet->addTxChannel(selectedChannelIndex, m_pluginManager->getPluginAPI());
}
}
}