mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-05 11:09:13 -04:00
Added a destroy virtual method to all source input plugin main classes
This commit is contained in:
parent
a52ac66710
commit
3606ab2cf2
@ -56,6 +56,11 @@ AirspyInput::~AirspyInput()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void AirspyInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool AirspyInput::openDevice()
|
||||
{
|
||||
if (m_dev != 0)
|
||||
|
@ -90,6 +90,7 @@ public:
|
||||
|
||||
AirspyInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~AirspyInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -60,6 +60,11 @@ BladerfInput::~BladerfInput()
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
}
|
||||
|
||||
void BladerfInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool BladerfInput::openDevice()
|
||||
{
|
||||
if (m_dev != 0)
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
|
||||
BladerfInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~BladerfInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -60,6 +60,11 @@ FCDProInput::~FCDProInput()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void FCDProInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool FCDProInput::openDevice()
|
||||
{
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
|
@ -77,6 +77,7 @@ public:
|
||||
|
||||
FCDProInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~FCDProInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -59,6 +59,11 @@ FCDProPlusInput::~FCDProPlusInput()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void FCDProPlusInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool FCDProPlusInput::openDevice()
|
||||
{
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
|
||||
FCDProPlusInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~FCDProPlusInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -91,6 +91,11 @@ FileSourceInput::~FileSourceInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
void FileSourceInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void FileSourceInput::openFileStream()
|
||||
{
|
||||
//stopInput();
|
||||
|
@ -212,6 +212,7 @@ public:
|
||||
|
||||
FileSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~FileSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -63,6 +63,11 @@ HackRFInput::~HackRFInput()
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
}
|
||||
|
||||
void HackRFInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool HackRFInput::openDevice()
|
||||
{
|
||||
if (m_dev != 0)
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
|
||||
HackRFInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~HackRFInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -67,6 +67,11 @@ LimeSDRInput::~LimeSDRInput()
|
||||
resumeBuddies();
|
||||
}
|
||||
|
||||
void LimeSDRInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool LimeSDRInput::openDevice()
|
||||
{
|
||||
if (!m_sampleFifo.setSize(96000 * 4))
|
||||
|
@ -230,6 +230,7 @@ public:
|
||||
|
||||
LimeSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~LimeSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -58,6 +58,11 @@ PlutoSDRInput::~PlutoSDRInput()
|
||||
resumeBuddies();
|
||||
}
|
||||
|
||||
void PlutoSDRInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool PlutoSDRInput::start()
|
||||
{
|
||||
if (!m_deviceShared.m_deviceParams->getBox()) {
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
|
||||
PlutoSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
~PlutoSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -57,6 +57,11 @@ RTLSDRInput::~RTLSDRInput()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void RTLSDRInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool RTLSDRInput::openDevice()
|
||||
{
|
||||
if (m_dev != 0)
|
||||
|
@ -106,6 +106,7 @@ public:
|
||||
|
||||
RTLSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~RTLSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -69,6 +69,11 @@ SDRdaemonSourceInput::~SDRdaemonSourceInput()
|
||||
delete m_SDRdaemonUDPHandler;
|
||||
}
|
||||
|
||||
void SDRdaemonSourceInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool SDRdaemonSourceInput::start()
|
||||
{
|
||||
qDebug() << "SDRdaemonInput::start";
|
||||
|
@ -305,6 +305,7 @@ public:
|
||||
|
||||
SDRdaemonSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~SDRdaemonSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -58,6 +58,11 @@ SDRPlayInput::~SDRPlayInput()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void SDRPlayInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
bool SDRPlayInput::openDevice()
|
||||
{
|
||||
m_devNumber = m_deviceAPI->getSampleSourceSequence();
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
|
||||
SDRPlayInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~SDRPlayInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
@ -30,6 +30,7 @@ class SDRANGEL_API DeviceSampleSource : public QObject {
|
||||
public:
|
||||
DeviceSampleSource();
|
||||
virtual ~DeviceSampleSource();
|
||||
virtual void destroy() = 0;
|
||||
|
||||
virtual bool start() = 0;
|
||||
virtual void stop() = 0;
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QtPlugin>
|
||||
#include <QString>
|
||||
|
||||
#include "plugininstanceui.h"
|
||||
|
||||
struct PluginDescriptor {
|
||||
// general plugin description
|
||||
const QString displayedName;
|
||||
@ -61,11 +63,13 @@ public:
|
||||
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
|
||||
virtual PluginInstanceUI* createSampleSourcePluginInstanceGUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the input "core"
|
||||
virtual void deleteSampleSourcePluginInstanceGUI(PluginInstanceUI *ui) { ui->destroy(); }
|
||||
|
||||
// device sink plugins only
|
||||
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
|
||||
virtual PluginInstanceUI* createSampleSinkPluginInstanceGUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
|
||||
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the output "core"
|
||||
virtual void deleteSampleSinkPluginInstanceGUI(PluginInstanceUI *ui) { ui->destroy(); }
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
|
||||
|
Loading…
Reference in New Issue
Block a user