1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

Plugins device enumeration optimization

This commit is contained in:
f4exb
2019-09-17 00:34:11 +02:00
parent b7e5e2bbc5
commit e9bbf0b266
64 changed files with 1377 additions and 480 deletions
@@ -30,7 +30,7 @@
const PluginDescriptor FileInputPlugin::m_pluginDescriptor = {
QString("File device input"),
QString("4.11.6"),
QString("4.11.10"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@@ -55,20 +55,45 @@ void FileInputPlugin::initPlugin(PluginAPI* pluginAPI)
pluginAPI->registerSampleSource(m_deviceTypeID, this);
}
PluginInterface::SamplingDevices FileInputPlugin::enumSampleSources()
void FileInputPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices)
{
if (listedHwIds.contains(m_hardwareID)) { // check if it was done
return;
}
originDevices.append(OriginDevice(
"FileInput",
m_hardwareID,
QString::null,
0,
1, // nb Rx
0 // nb Tx
));
listedHwIds.append(m_hardwareID);
}
PluginInterface::SamplingDevices FileInputPlugin::enumSampleSources(const OriginDevices& originDevices)
{
SamplingDevices result;
result.append(SamplingDevice(
"FileInput",
m_hardwareID,
m_deviceTypeID,
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));
for (OriginDevices::const_iterator it = originDevices.begin(); it != originDevices.end(); ++it)
{
if (it->hardwareId == m_hardwareID)
{
result.append(SamplingDevice(
it->displayableName,
m_hardwareID,
m_deviceTypeID,
it->serial,
it->sequence,
PluginInterface::SamplingDevice::BuiltInDevice,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0
));
}
}
return result;
}