mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Device sink plugins: implemented an init method for initializations to be done when all collaborating objects are created and possibly connected
This commit is contained in:
parent
49d1439981
commit
9213b3c0b2
@ -119,6 +119,11 @@ bool BladerfOutput::openDevice()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BladerfOutput::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
bool BladerfOutput::start()
|
||||
{
|
||||
// QMutexLocker mutexLocker(&m_mutex);
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
virtual ~BladerfOutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -79,6 +79,11 @@ void FileSinkOutput::openFileStream()
|
||||
qDebug() << "FileSinkOutput::openFileStream: " << m_fileName.toStdString().c_str();
|
||||
}
|
||||
|
||||
void FileSinkOutput::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
bool FileSinkOutput::start()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
@ -174,6 +174,7 @@ public:
|
||||
virtual ~FileSinkOutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -104,6 +104,11 @@ bool HackRFOutput::openDevice()
|
||||
return true;
|
||||
}
|
||||
|
||||
void HackRFOutput::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
bool HackRFOutput::start()
|
||||
{
|
||||
if (!m_dev) {
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
virtual ~HackRFOutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -346,6 +346,11 @@ void LimeSDROutput::releaseChannel()
|
||||
m_channelAcquired = false;
|
||||
}
|
||||
|
||||
void LimeSDROutput::init()
|
||||
{
|
||||
applySettings(m_settings, true, false);
|
||||
}
|
||||
|
||||
bool LimeSDROutput::start()
|
||||
{
|
||||
if (!m_deviceShared.m_deviceParams->getDevice()) {
|
||||
|
@ -188,6 +188,7 @@ public:
|
||||
virtual ~LimeSDROutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -59,6 +59,11 @@ void PlutoSDROutput::destroy()
|
||||
delete this;
|
||||
}
|
||||
|
||||
void PlutoSDROutput::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
bool PlutoSDROutput::start()
|
||||
{
|
||||
if (!m_deviceShared.m_deviceParams->getBox()) {
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
~PlutoSDROutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -87,6 +87,11 @@ bool SDRdaemonSinkOutput::start()
|
||||
return true;
|
||||
}
|
||||
|
||||
void SDRdaemonSinkOutput::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
void SDRdaemonSinkOutput::stop()
|
||||
{
|
||||
qDebug() << "SDRdaemonSinkOutput::stop";
|
||||
|
@ -155,6 +155,7 @@ public:
|
||||
virtual ~SDRdaemonSinkOutput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual void init();
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
virtual ~DeviceSampleSink();
|
||||
virtual void destroy() = 0;
|
||||
|
||||
virtual void init() = 0; //!< initializations to be done when all collaborating objects are created and possibly connected
|
||||
virtual bool start() = 0;
|
||||
virtual void stop() = 0;
|
||||
|
||||
|
@ -334,6 +334,7 @@ void MainWindow::addSinkDevice()
|
||||
m_deviceUIs.back());
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI);
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSink()->init();
|
||||
setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkDisplayName(), false);
|
||||
}
|
||||
|
||||
@ -1183,6 +1184,7 @@ void MainWindow::on_sampleSink_changed()
|
||||
deviceUI->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
|
||||
deviceUI->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI);
|
||||
setDeviceGUI(currentSinkTabIndex, gui, deviceUI->m_deviceSinkAPI->getSampleSinkDisplayName(), false);
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSink()->init();
|
||||
|
||||
deviceUI->m_deviceSinkAPI->loadSinkSettings(m_settings.getWorkingPreset()); // load new API settings
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user