Fixed source plugins virtual methods

pull/6/head
f4exb 2015-09-30 08:55:58 +02:00
rodzic a1efdcc8dc
commit 3ced80e198
11 zmienionych plików z 23 dodań i 24 usunięć

Wyświetl plik

@ -182,6 +182,7 @@ Assuming Debian Jessie is used:
- Many other little things...
<h1>To Do</h1>
- Specialize plugins into channel and sample source plugins since both have almost complete different requirements and only little in common
- Enhance presets management (Edit, Move, Import/Export from/to human readable format like JSON).
- Allow arbitrary sample rate for channelizers and demodulators (not multiple of 48 kHz). Prerequisite for polyphase channelizer
- Implement polyphase channelizer

Wyświetl plik

@ -23,12 +23,12 @@ public:
{
QString filename;
QPluginLoader* loader;
PluginInterface* plugin;
PluginInterface* pluginInterface;
Plugin(const QString& _filename, QPluginLoader* pluginLoader, PluginInterface* _plugin) :
filename(_filename),
loader(pluginLoader),
plugin(_plugin)
pluginInterface(_plugin)
{ }
};
@ -137,7 +137,7 @@ private:
static inline bool operator<(const PluginManager::Plugin& a, const PluginManager::Plugin& b)
{
return a.plugin->getPluginDescriptor().displayedName < b.plugin->getPluginDescriptor().displayedName;
return a.pluginInterface->getPluginDescriptor().displayedName < b.pluginInterface->getPluginDescriptor().displayedName;
}
#endif // INCLUDE_PLUGINMANAGER_H

Wyświetl plik

@ -46,7 +46,7 @@ public:
virtual PluginGUI* createChannel(const QString& channelName) { return 0; }
virtual SampleSourceDevices enumSampleSources() { return SampleSourceDevices(); }
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId, const QString& sourceSerial, int sourceSequence) { return 0; }
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId) { return 0; }
};
Q_DECLARE_INTERFACE(PluginInterface, "de.maintech.SDRangelove.PluginInterface/0.1");

Wyświetl plik

@ -74,9 +74,9 @@ PluginInterface::SampleSourceDevices FCDProPlugin::enumSampleSources()
return result;
}
PluginGUI* FCDProPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
PluginGUI* FCDProPlugin::createSampleSourcePluginGUI(const QString& sourceId)
{
if(sourceName == fcd_traits<Pro>::interfaceIID)
if(sourceId == fcd_traits<Pro>::interfaceIID)
{
FCDProGui* gui = new FCDProGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);

Wyświetl plik

@ -17,8 +17,8 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
SampleSourceDevices enumSampleSources();
PluginGUI* createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address);
virtual SampleSourceDevices enumSampleSources();
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId);
static const QString m_deviceTypeID;

Wyświetl plik

@ -69,9 +69,9 @@ PluginInterface::SampleSourceDevices FileSourcePlugin::enumSampleSources()
return result;
}
PluginGUI* FileSourcePlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
PluginGUI* FileSourcePlugin::createSampleSourcePluginGUI(const QString& sourceId)
{
if(sourceName == "org.osmocom.sdr.samplesource.filesource") {
if(sourceId == "org.osmocom.sdr.samplesource.filesource") {
FileSourceGui* gui = new FileSourceGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);
return gui;

Wyświetl plik

@ -31,8 +31,8 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
SampleSourceDevices enumSampleSources();
PluginGUI* createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address);
virtual SampleSourceDevices enumSampleSources();
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId);
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -119,14 +119,14 @@ PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
return result;
}
PluginGUI* HackRFPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
PluginGUI* HackRFPlugin::createSampleSourcePluginGUI(const QString& sourceId)
{
if (!m_pluginAPI)
{
return 0;
}
if(sourceName == m_deviceTypeID)
if(sourceId == m_deviceTypeID)
{
HackRFGui* gui = new HackRFGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);

Wyświetl plik

@ -33,8 +33,8 @@ public:
const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI);
SampleSourceDevices enumSampleSources();
PluginGUI* createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address);
virtual SampleSourceDevices enumSampleSources();
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId);
static const QString m_deviceTypeID;

Wyświetl plik

@ -11,7 +11,7 @@ PluginsDialog::PluginsDialog(PluginManager* pluginManager, QWidget* parent) :
const PluginManager::Plugins& plugins = pluginManager->getPlugins();
for(PluginManager::Plugins::const_iterator it = plugins.constBegin(); it != plugins.constEnd(); ++it) {
QStringList sl;
const PluginDescriptor& desc = it->plugin->getPluginDescriptor();
const PluginDescriptor& desc = it->pluginInterface->getPluginDescriptor();
sl.append(desc.displayedName);
sl.append(desc.version);
if(desc.licenseIsGPL)

Wyświetl plik

@ -17,6 +17,8 @@ PluginManager::PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObje
m_mainWindow(mainWindow),
m_dspEngine(dspEngine),
m_sampleSourceId(),
m_sampleSourceSerial(),
m_sampleSourceSequence(0),
m_sampleSourcePluginGUI(NULL)
{
}
@ -38,7 +40,7 @@ void PluginManager::loadPlugins()
for (Plugins::const_iterator it = m_plugins.begin(); it != m_plugins.end(); ++it)
{
it->plugin->initPlugin(&m_pluginAPI);
it->pluginInterface->initPlugin(&m_pluginAPI);
}
updateSampleSourceDevices();
@ -311,9 +313,7 @@ int PluginManager::selectSampleSource(int index)
<< " ser: " << m_sampleSourceSerial.toStdString().c_str()
<< " seq: " << m_sampleSourceSequence;
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId,
m_sampleSourceSerial,
m_sampleSourceSequence);
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId);
return index;
}
@ -369,9 +369,7 @@ int PluginManager::selectFirstSampleSource(const QString& sourceId)
<< " ser: " << m_sampleSourceSerial.toStdString().c_str()
<< " seq: " << m_sampleSourceSequence;
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId,
m_sampleSourceSerial,
m_sampleSourceSequence);
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId);
return index;
}