mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 13:21:50 -05:00
Multi device support: restored AM demod plugin
This commit is contained in:
parent
f0b7f6bf4e
commit
8d480c899d
@ -1,6 +1,7 @@
|
||||
#include "amplugin.h"
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QAction>
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "amdemodgui.h"
|
||||
|
||||
@ -34,16 +35,18 @@ void AMPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
PluginGUI* AMPlugin::createChannel(const QString& channelName)
|
||||
{
|
||||
if(channelName == "de.maintech.sdrangelove.channel.am") {
|
||||
return createInstanceAM();
|
||||
AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PluginGUI* AMPlugin::createInstanceAM()
|
||||
void AMPlugin::createInstanceAM()
|
||||
{
|
||||
AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
PluginAPI* m_pluginAPI;
|
||||
PluginGUI* createInstanceAM();
|
||||
|
||||
private slots:
|
||||
void createInstanceAM();
|
||||
};
|
||||
|
||||
#endif // INCLUDE_AMPLUGIN_H
|
||||
|
@ -333,17 +333,13 @@ void MainWindow::savePresetSettings(Preset* preset)
|
||||
qPrintable(preset->getGroup()),
|
||||
qPrintable(preset->getDescription()));
|
||||
|
||||
preset->setSpectrumConfig(m_deviceUIs.back()->m_spectrumGUI->serialize());
|
||||
preset->clearChannels();
|
||||
|
||||
// Save from currently selected source tab
|
||||
int currentSourceTabIndex = ui->tabInputsView->currentIndex();
|
||||
|
||||
if (currentSourceTabIndex >= 0)
|
||||
{
|
||||
DeviceUISet *deviceUI = m_deviceUIs[currentSourceTabIndex];
|
||||
|
||||
preset->setSpectrumConfig(deviceUI->m_spectrumGUI->serialize());
|
||||
preset->clearChannels();
|
||||
deviceUI->m_pluginManager->saveSettings(preset);
|
||||
}
|
||||
|
||||
preset->setLayout(saveState());
|
||||
}
|
||||
@ -674,7 +670,7 @@ void MainWindow::on_sampleSource_currentIndexChanged(int index)
|
||||
{
|
||||
DeviceUISet *deviceUI = m_deviceUIs[currentSourceTabIndex];
|
||||
deviceUI->m_pluginManager->saveSourceSettings(m_settings.getWorkingPreset());
|
||||
deviceUI->m_pluginManager->selectSampleSourceByIndex(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->currentIndex());
|
||||
deviceUI->m_pluginManager->selectSampleSourceByIndex(deviceUI->m_samplingDeviceControl->getDeviceSelector()->currentIndex());
|
||||
m_settings.setSourceIndex(deviceUI->m_samplingDeviceControl->getDeviceSelector()->currentIndex());
|
||||
|
||||
deviceUI->m_pluginManager->loadSourceSettings(m_settings.getWorkingPreset());
|
||||
|
Loading…
Reference in New Issue
Block a user