1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

GUI segregation: renamed methods and attributes

This commit is contained in:
f4exb 2017-09-03 20:24:17 +02:00
parent c4c8bf8441
commit 4d5fdfc913
42 changed files with 97 additions and 97 deletions

View File

@ -158,7 +158,7 @@ The lifecycle of the GUI is controlled from the "Sampling Device Control" device
Here is the relevant par ot the code (source side) in the `MainWindow::on_sampleSource_confirmClicked` method:
deviceUI->m_deviceSourceAPI->stopAcquisition();
deviceUI->m_deviceSourceAPI->setSampleSourcePluginGUI(0); // deletes old GUI and input object
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(0); // deletes old UI and input object
deviceUI->m_deviceSourceAPI->clearBuddiesLists(); // clear old API buddies lists
m_pluginManager->selectSampleSourceByDevice(devicePtr, deviceUI->m_deviceSourceAPI); // sets the new API
// add to buddies list
@ -166,8 +166,8 @@ Here is the relevant par ot the code (source side) in the `MainWindow::on_sample
// constructs new GUI and input object
QWidget *gui;
PluginManager::SamplingDevice *sampleSourceDevice = (PluginManager::SamplingDevice *) devicePtr; // lightweight representation of the device
PluginGUI *pluginGUI = sampleSourceDevice->m_plugin->createSampleSourcePluginGUI(sampleSourceDevice->m_deviceId, &gui, deviceUI->m_deviceSourceAPI);
deviceUI->m_deviceSourceAPI->setSampleSourcePluginGUI(pluginGUI);
PluginInstanceUI *pluginUI = sampleSourceDevice->m_plugin->createSampleSourcePluginInstanceUI(sampleSourceDevice->m_deviceId, &gui, deviceUI->m_deviceSourceAPI);
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(pluginUI);
deviceUI->m_deviceSourceAPI->setInputGUI(gui, sampleSourceDevice->m_displayName);
<h3>SISO and MIMO devices support</h3>

View File

@ -77,7 +77,7 @@ PluginInterface::SamplingDevices BladerfOutputPlugin::enumSampleSinks()
return result;
}
PluginInstanceUI* BladerfOutputPlugin::createSampleSinkPluginGUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI)
PluginInstanceUI* BladerfOutputPlugin::createSampleSinkPluginInstanceUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI)
{
if(sinkId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -69,7 +69,7 @@ PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
return result;
}
PluginInstanceUI* FileSinkPlugin::createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
PluginInstanceUI* FileSinkPlugin::createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
{
if(sinkId == m_deviceTypeID)
{

View File

@ -37,7 +37,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -116,7 +116,7 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
return result;
}
PluginInstanceUI* HackRFOutputPlugin::createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
PluginInstanceUI* HackRFOutputPlugin::createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
{
if(sinkId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -96,7 +96,7 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks()
return result;
}
PluginInstanceUI* LimeSDROutputPlugin::createSampleSinkPluginGUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI)
PluginInstanceUI* LimeSDROutputPlugin::createSampleSinkPluginInstanceUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI)
{
if(sinkId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -70,7 +70,7 @@ PluginInterface::SamplingDevices SDRdaemonSinkPlugin::enumSampleSinks()
return result;
}
PluginInstanceUI* SDRdaemonSinkPlugin::createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
PluginInstanceUI* SDRdaemonSinkPlugin::createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI)
{
if(sinkId == m_deviceTypeID)
{

View File

@ -37,7 +37,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -119,7 +119,7 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* AirspyPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* AirspyPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if (sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* BlderfInputPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* BlderfInputPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -74,7 +74,7 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* FCDProPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* FCDProPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == fcd_traits<Pro>::interfaceIID)
{

View File

@ -20,7 +20,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -76,7 +76,7 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* FCDProPlusPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* FCDProPlusPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
{

View File

@ -20,7 +20,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_deviceTypeID;

View File

@ -69,7 +69,7 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
return result;
}
PluginInstanceUI* FileSourcePlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* FileSourcePlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -117,7 +117,7 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* HackRFInputPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* HackRFInputPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -97,7 +97,7 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* LimeSDRInputPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -80,7 +80,7 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* PlutoSDRInputPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -62,7 +62,7 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* RTLSDRPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* RTLSDRPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID) {
RTLSDRGui* gui = new RTLSDRGui(deviceAPI);

View File

@ -20,7 +20,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -69,7 +69,7 @@ PluginInterface::SamplingDevices SDRdaemonPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* SDRdaemonPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* SDRdaemonPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -70,7 +70,7 @@ PluginInterface::SamplingDevices SDRdaemonSourcePlugin::enumSampleSources()
return result;
}
PluginInstanceUI* SDRdaemonSourcePlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -83,7 +83,7 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
return result;
}
PluginInstanceUI* SDRPlayPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
PluginInstanceUI* SDRPlayPlugin::createSampleSourcePluginInstanceUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
{
if(sourceId == m_deviceTypeID)
{

View File

@ -36,7 +36,7 @@ public:
void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources();
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID;
static const QString m_deviceTypeID;

View File

@ -35,7 +35,7 @@ DeviceSinkAPI::DeviceSinkAPI(MainWindow *mainWindow,
m_spectrum(glSpectrum),
m_channelWindow(channelWindow),
m_sampleSinkSequence(0),
m_sampleSinkPluginGUI(0),
m_sampleSinkPluginInstanceUI(0),
m_buddySharedPtr(0),
m_isBuddyLeader(false)
{
@ -170,15 +170,15 @@ void DeviceSinkAPI::setSampleSinkSequence(int sequence)
m_deviceSinkEngine->setSinkSequence(sequence);
}
void DeviceSinkAPI::setSampleSinkPluginGUI(PluginInstanceUI *gui)
void DeviceSinkAPI::setSampleSinkPluginInstanceUI(PluginInstanceUI *gui)
{
if (m_sampleSinkPluginGUI != 0)
if (m_sampleSinkPluginInstanceUI != 0)
{
m_sampleSinkPluginGUI->destroy();
m_sampleSinkPluginInstanceUI->destroy();
m_sampleSinkId.clear();
}
m_sampleSinkPluginGUI = gui;
m_sampleSinkPluginInstanceUI = gui;
}
void DeviceSinkAPI::registerChannelInstance(const QString& channelName, PluginInstanceUI* pluginGUI)
@ -218,12 +218,12 @@ void DeviceSinkAPI::freeAll()
}
if(m_sampleSinkPluginGUI != 0)
if(m_sampleSinkPluginInstanceUI != 0)
{
qDebug("DeviceSinkAPI::freeAll: destroying m_sampleSourcePluginGUI");
m_deviceSinkEngine->setSink(0);
m_sampleSinkPluginGUI->destroy();
m_sampleSinkPluginGUI = 0;
m_sampleSinkPluginInstanceUI->destroy();
m_sampleSinkPluginInstanceUI = 0;
m_sampleSinkId.clear();
}
}
@ -238,18 +238,18 @@ void DeviceSinkAPI::loadSinkSettings(const Preset* preset)
{
qDebug("DeviceSinkAPI::loadSinkSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
if(m_sampleSinkPluginGUI != 0)
if(m_sampleSinkPluginInstanceUI != 0)
{
const QByteArray* sourceConfig = preset->findBestDeviceConfig(m_sampleSinkId, m_sampleSinkSerial, m_sampleSinkSequence);
if (sourceConfig != 0)
{
qDebug("DeviceSinkAPI::loadSinkSettings: deserializing sink: %s", qPrintable(m_sampleSinkId));
m_sampleSinkPluginGUI->deserialize(*sourceConfig);
m_sampleSinkPluginInstanceUI->deserialize(*sourceConfig);
}
qint64 centerFrequency = preset->getCenterFrequency();
m_sampleSinkPluginGUI->setCenterFrequency(centerFrequency);
m_sampleSinkPluginInstanceUI->setCenterFrequency(centerFrequency);
}
}
}
@ -262,11 +262,11 @@ void DeviceSinkAPI::saveSinkSettings(Preset* preset)
}
else
{
if(m_sampleSinkPluginGUI != NULL)
if(m_sampleSinkPluginInstanceUI != NULL)
{
qDebug("DeviceSinkAPI::saveSourceSettings: %s saved", qPrintable(m_sampleSinkPluginGUI->getName()));
preset->addOrUpdateDeviceConfig(m_sampleSinkId, m_sampleSinkSerial, m_sampleSinkSequence, m_sampleSinkPluginGUI->serialize());
preset->setCenterFrequency(m_sampleSinkPluginGUI->getCenterFrequency());
qDebug("DeviceSinkAPI::saveSourceSettings: %s saved", qPrintable(m_sampleSinkPluginInstanceUI->getName()));
preset->addOrUpdateDeviceConfig(m_sampleSinkId, m_sampleSinkSerial, m_sampleSinkSequence, m_sampleSinkPluginInstanceUI->serialize());
preset->setCenterFrequency(m_sampleSinkPluginInstanceUI->getCenterFrequency());
}
else
{

View File

@ -69,7 +69,7 @@ public:
void setSampleSinkId(const QString& id);
void setSampleSinkSerial(const QString& serial);
void setSampleSinkSequence(int sequence);
void setSampleSinkPluginGUI(PluginInstanceUI *gui);
void setSampleSinkPluginInstanceUI(PluginInstanceUI *gui);
const QString& getHardwareId() const { return m_hardwareId; }
const QString& getSampleSinkId() const { return m_sampleSinkId; }
@ -141,7 +141,7 @@ protected:
QString m_sampleSinkId;
QString m_sampleSinkSerial;
uint32_t m_sampleSinkSequence;
PluginInstanceUI* m_sampleSinkPluginGUI;
PluginInstanceUI* m_sampleSinkPluginInstanceUI;
ChannelInstanceRegistrations m_channelInstanceRegistrations;

View File

@ -35,7 +35,7 @@ DeviceSourceAPI::DeviceSourceAPI(MainWindow *mainWindow,
m_spectrum(glSpectrum),
m_channelWindow(channelWindow),
m_sampleSourceSequence(0),
m_sampleSourcePluginGUI(0),
m_sampleSourcePluginInstanceUI(0),
m_buddySharedPtr(0),
m_isBuddyLeader(false)
{
@ -161,15 +161,15 @@ void DeviceSourceAPI::setSampleSourceSequence(int sequence)
m_deviceSourceEngine->setSourceSequence(sequence);
}
void DeviceSourceAPI::setSampleSourcePluginGUI(PluginInstanceUI *gui)
void DeviceSourceAPI::setSampleSourcePluginInstanceUI(PluginInstanceUI *gui)
{
if (m_sampleSourcePluginGUI != 0)
if (m_sampleSourcePluginInstanceUI != 0)
{
m_sampleSourcePluginGUI->destroy();
m_sampleSourcePluginInstanceUI->destroy();
m_sampleSourceId.clear();
}
m_sampleSourcePluginGUI = gui;
m_sampleSourcePluginInstanceUI = gui;
}
void DeviceSourceAPI::registerChannelInstance(const QString& channelName, PluginInstanceUI* pluginGUI)
@ -215,12 +215,12 @@ void DeviceSourceAPI::freeAll()
}
if(m_sampleSourcePluginGUI != 0)
if(m_sampleSourcePluginInstanceUI != 0)
{
qDebug("DeviceSourceAPI::freeAll: destroying m_sampleSourcePluginGUI");
m_deviceSourceEngine->setSource(0);
m_sampleSourcePluginGUI->destroy();
m_sampleSourcePluginGUI = 0;
m_sampleSourcePluginInstanceUI->destroy();
m_sampleSourcePluginInstanceUI = 0;
m_sampleSourceId.clear();
}
}
@ -231,18 +231,18 @@ void DeviceSourceAPI::loadSourceSettings(const Preset* preset)
{
qDebug("DeviceSourceAPI::loadSourceSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
if(m_sampleSourcePluginGUI != 0)
if(m_sampleSourcePluginInstanceUI != 0)
{
const QByteArray* sourceConfig = preset->findBestDeviceConfig(m_sampleSourceId, m_sampleSourceSerial, m_sampleSourceSequence);
if (sourceConfig != 0)
{
qDebug("DeviceSourceAPI::loadSettings: deserializing source %s", qPrintable(m_sampleSourceId));
m_sampleSourcePluginGUI->deserialize(*sourceConfig);
m_sampleSourcePluginInstanceUI->deserialize(*sourceConfig);
}
qint64 centerFrequency = preset->getCenterFrequency();
m_sampleSourcePluginGUI->setCenterFrequency(centerFrequency);
m_sampleSourcePluginInstanceUI->setCenterFrequency(centerFrequency);
}
}
else
@ -255,11 +255,11 @@ void DeviceSourceAPI::saveSourceSettings(Preset* preset)
{
if (preset->isSourcePreset())
{
if(m_sampleSourcePluginGUI != NULL)
if(m_sampleSourcePluginInstanceUI != NULL)
{
qDebug("DeviceSourceAPI::saveSourceSettings: %s saved", qPrintable(m_sampleSourcePluginGUI->getName()));
preset->addOrUpdateDeviceConfig(m_sampleSourceId, m_sampleSourceSerial, m_sampleSourceSequence, m_sampleSourcePluginGUI->serialize());
preset->setCenterFrequency(m_sampleSourcePluginGUI->getCenterFrequency());
qDebug("DeviceSourceAPI::saveSourceSettings: %s saved", qPrintable(m_sampleSourcePluginInstanceUI->getName()));
preset->addOrUpdateDeviceConfig(m_sampleSourceId, m_sampleSourceSerial, m_sampleSourceSequence, m_sampleSourcePluginInstanceUI->serialize());
preset->setCenterFrequency(m_sampleSourcePluginInstanceUI->getCenterFrequency());
}
else
{

View File

@ -70,7 +70,7 @@ public:
void setSampleSourceId(const QString& id);
void setSampleSourceSerial(const QString& serial);
void setSampleSourceSequence(int sequence);
void setSampleSourcePluginGUI(PluginInstanceUI *gui);
void setSampleSourcePluginInstanceUI(PluginInstanceUI *gui);
const QString& getHardwareId() const { return m_hardwareId; }
const QString& getSampleSourceId() const { return m_sampleSourceId; }
@ -142,7 +142,7 @@ protected:
QString m_sampleSourceId;
QString m_sampleSourceSerial;
uint32_t m_sampleSourceSequence;
PluginInstanceUI* m_sampleSourcePluginGUI;
PluginInstanceUI* m_sampleSourcePluginInstanceUI;
ChannelInstanceRegistrations m_channelInstanceRegistrations;

View File

@ -798,7 +798,7 @@ void MainWindow::on_sampleSource_confirmClicked(bool checked __attribute__((unus
void *devicePtr = deviceUI->m_samplingDeviceControl->getDeviceSelector()->itemData(selectedComboIndex).value<void *>();
deviceUI->m_deviceSourceAPI->stopAcquisition();
deviceUI->m_deviceSourceAPI->setSampleSourcePluginGUI(0); // deletes old GUI and input object
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(0); // deletes old UI and input object
deviceUI->m_deviceSourceAPI->clearBuddiesLists(); // clear old API buddies lists
m_pluginManager->selectSampleSourceByDevice(devicePtr, deviceUI->m_deviceSourceAPI); // sets the new API
@ -840,9 +840,9 @@ void MainWindow::on_sampleSource_confirmClicked(bool checked __attribute__((unus
// constructs new GUI and input object
QWidget *gui;
PluginManager::SamplingDevice *sampleSourceDevice = (PluginManager::SamplingDevice *) devicePtr;
PluginInstanceUI *pluginGUI = sampleSourceDevice->m_plugin->createSampleSourcePluginGUI(sampleSourceDevice->m_deviceId, &gui, deviceUI->m_deviceSourceAPI);
PluginInstanceUI *pluginUI = sampleSourceDevice->m_plugin->createSampleSourcePluginInstanceUI(sampleSourceDevice->m_deviceId, &gui, deviceUI->m_deviceSourceAPI);
deviceUI->m_deviceSourceAPI->setSampleSourcePluginGUI(pluginGUI);
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(pluginUI);
deviceUI->m_deviceSourceAPI->setInputGUI(gui, sampleSourceDevice->m_displayName);
deviceUI->m_deviceSourceAPI->loadSourceSettings(m_settings.getWorkingPreset()); // load new API settings
@ -868,7 +868,7 @@ void MainWindow::on_sampleSink_confirmClicked(bool checked __attribute__((unused
void *devicePtr = deviceUI->m_samplingDeviceControl->getDeviceSelector()->itemData(selectedComboIndex).value<void *>();
deviceUI->m_deviceSinkAPI->stopGeneration();
deviceUI->m_deviceSinkAPI->setSampleSinkPluginGUI(0); // deletes old GUI and input object
deviceUI->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(0); // deletes old GUI and input object
deviceUI->m_deviceSinkAPI->clearBuddiesLists(); // remove old API from buddies lists
m_pluginManager->selectSampleSinkByDevice(devicePtr, deviceUI->m_deviceSinkAPI); // sets the new API
@ -910,9 +910,9 @@ void MainWindow::on_sampleSink_confirmClicked(bool checked __attribute__((unused
// constructs new GUI and output object
QWidget *gui;
PluginManager::SamplingDevice *sampleSinkDevice = (PluginManager::SamplingDevice *) devicePtr;
PluginInstanceUI *pluginGUI = sampleSinkDevice->m_plugin->createSampleSinkPluginGUI(sampleSinkDevice->m_deviceId, &gui, deviceUI->m_deviceSinkAPI);
PluginInstanceUI *pluginUI = sampleSinkDevice->m_plugin->createSampleSinkPluginInstanceUI(sampleSinkDevice->m_deviceId, &gui, deviceUI->m_deviceSinkAPI);
deviceUI->m_deviceSinkAPI->setSampleSinkPluginGUI(pluginGUI);
deviceUI->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI);
deviceUI->m_deviceSinkAPI->setOutputGUI(gui, sampleSinkDevice->m_displayName);
deviceUI->m_deviceSinkAPI->loadSinkSettings(m_settings.getWorkingPreset()); // load new API settings

View File

@ -57,11 +57,11 @@ public:
// device source plugins only
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
virtual PluginInstanceUI* createSampleSourcePluginGUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
// device sink plugins only
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
virtual PluginInstanceUI* createSampleSinkPluginGUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
};
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");

View File

@ -384,7 +384,7 @@ int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceA
<< " seq: " << m_sampleSourceDevices[index].m_deviceSequence;
deviceAPI->stopAcquisition();
deviceAPI->setSampleSourcePluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSourcePluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSourceSequence(m_sampleSourceDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSourceDevices[index].m_hadrwareId);
@ -392,10 +392,10 @@ int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceA
deviceAPI->setSampleSourceSerial(m_sampleSourceDevices[index].m_deviceSerial);
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginInstanceUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSourcePluginGUI(pluginGUI);
deviceAPI->setSampleSourcePluginInstanceUI(pluginGUI);
deviceAPI->setInputGUI(gui, m_sampleSourceDevices[index].m_displayName);
return index;
@ -427,17 +427,17 @@ int PluginManager::selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI)
<< " seq: " << m_sampleSinkDevices[index].m_deviceSequence;
deviceAPI->stopGeneration();
deviceAPI->setSampleSinkPluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSinkPluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginGUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSinkSequence(m_sampleSinkDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSinkDevices[index].m_hadrwareId);
deviceAPI->setSampleSinkId(m_sampleSinkDevices[index].m_deviceId);
deviceAPI->setSampleSinkSerial(m_sampleSinkDevices[index].m_deviceSerial);
deviceAPI->setSampleSinkPluginGUI(pluginGUI);
deviceAPI->setSampleSinkPluginInstanceUI(pluginGUI);
deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
return index;
@ -479,17 +479,17 @@ int PluginManager::selectFirstSampleSource(const QString& sourceId, DeviceSource
<< " seq: " << m_sampleSourceDevices[index].m_deviceSequence;
deviceAPI->stopAcquisition();
deviceAPI->setSampleSourcePluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSourcePluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginInstanceUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSourceSequence(m_sampleSourceDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSourceDevices[index].m_hadrwareId);
deviceAPI->setSampleSourceId(m_sampleSourceDevices[index].m_deviceId);
deviceAPI->setSampleSourceSerial(m_sampleSourceDevices[index].m_deviceSerial);
deviceAPI->setSampleSourcePluginGUI(pluginGUI);
deviceAPI->setSampleSourcePluginInstanceUI(pluginGUI);
deviceAPI->setInputGUI(gui, m_sampleSourceDevices[index].m_displayName);
return index;
@ -531,17 +531,17 @@ int PluginManager::selectFirstSampleSink(const QString& sinkId, DeviceSinkAPI *d
<< " seq: " << m_sampleSinkDevices[index].m_deviceSequence;
deviceAPI->stopGeneration();
deviceAPI->setSampleSinkPluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSinkPluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginGUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSinkSequence(m_sampleSinkDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSinkDevices[index].m_hadrwareId);
deviceAPI->setSampleSinkId(m_sampleSinkDevices[index].m_deviceId);
deviceAPI->setSampleSinkSerial(m_sampleSinkDevices[index].m_deviceSerial);
deviceAPI->setSampleSinkPluginGUI(pluginGUI);
deviceAPI->setSampleSinkPluginInstanceUI(pluginGUI);
deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
return index;
@ -607,17 +607,17 @@ int PluginManager::selectSampleSourceBySerialOrSequence(const QString& sourceId,
<< " seq: " << m_sampleSourceDevices[index].m_deviceSequence;
deviceAPI->stopAcquisition();
deviceAPI->setSampleSourcePluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSourcePluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginInstanceUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSourceSequence(m_sampleSourceDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSourceDevices[index].m_hadrwareId);
deviceAPI->setSampleSourceId(m_sampleSourceDevices[index].m_deviceId);
deviceAPI->setSampleSourceSerial(m_sampleSourceDevices[index].m_deviceSerial);
deviceAPI->setSampleSourcePluginGUI(pluginGUI);
deviceAPI->setSampleSourcePluginInstanceUI(pluginGUI);
deviceAPI->setInputGUI(gui, m_sampleSourceDevices[index].m_displayName);
return index;
@ -683,17 +683,17 @@ int PluginManager::selectSampleSinkBySerialOrSequence(const QString& sinkId, con
<< " seq: " << m_sampleSinkDevices[index].m_deviceSequence;
deviceAPI->stopGeneration();
deviceAPI->setSampleSinkPluginGUI(0); // this effectively destroys the previous GUI if it exists
deviceAPI->setSampleSinkPluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginGUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
// m_sampleSourcePluginGUI = pluginGUI;
deviceAPI->setSampleSinkSequence(m_sampleSinkDevices[index].m_deviceSequence);
deviceAPI->setHardwareId(m_sampleSinkDevices[index].m_hadrwareId);
deviceAPI->setSampleSinkId(m_sampleSinkDevices[index].m_deviceId);
deviceAPI->setSampleSinkSerial(m_sampleSinkDevices[index].m_deviceSerial);
deviceAPI->setSampleSinkPluginGUI(pluginGUI);
deviceAPI->setSampleSinkPluginInstanceUI(pluginGUI);
deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
return index;