1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 21:01:45 -05:00

Plugin manager: removed useless select first sample source/sink methods

This commit is contained in:
f4exb 2017-09-15 00:11:43 +02:00
parent 3cddc772b1
commit b2d3c6c2a6
2 changed files with 0 additions and 106 deletions

View File

@ -443,110 +443,6 @@ int PluginManager::selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI)
return index; return index;
} }
int PluginManager::selectFirstSampleSource(const QString& sourceId, DeviceSourceAPI *deviceAPI)
{
qDebug("PluginManager::selectFirstSampleSource by id: [%s]", qPrintable(sourceId));
int index = -1;
for (int i = 0; i < m_sampleSourceDevices.count(); i++)
{
qDebug("*** %s vs %s", qPrintable(m_sampleSourceDevices[i].m_deviceId), qPrintable(sourceId));
if(m_sampleSourceDevices[i].m_deviceId == sourceId)
{
index = i;
break;
}
}
if(index == -1)
{
if(m_sampleSourceDevices.count() > 0)
{
index = 0;
}
else
{
return -1;
}
}
qDebug() << "PluginManager::selectFirstSampleSource: m_sampleSource at index " << index
<< " hid: " << m_sampleSourceDevices[index].m_hadrwareId.toStdString().c_str()
<< " id: " << m_sampleSourceDevices[index].m_deviceId.toStdString().c_str()
<< " ser: " << m_sampleSourceDevices[index].m_deviceSerial.toStdString().c_str()
<< " seq: " << m_sampleSourceDevices[index].m_deviceSequence;
deviceAPI->stopAcquisition();
deviceAPI->setSampleSourcePluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginInstanceGUI(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->setSampleSourcePluginInstanceUI(pluginGUI);
deviceAPI->setInputGUI(gui, m_sampleSourceDevices[index].m_displayName);
return index;
}
int PluginManager::selectFirstSampleSink(const QString& sinkId, DeviceSinkAPI *deviceAPI)
{
qDebug("PluginManager::selectFirstSampleSink by id: [%s]", qPrintable(sinkId));
int index = -1;
for (int i = 0; i < m_sampleSinkDevices.count(); i++)
{
qDebug("*** %s vs %s", qPrintable(m_sampleSinkDevices[i].m_deviceId), qPrintable(sinkId));
if(m_sampleSinkDevices[i].m_deviceId == sinkId)
{
index = i;
break;
}
}
if(index == -1)
{
if(m_sampleSinkDevices.count() > 0)
{
index = 0;
}
else
{
return -1;
}
}
qDebug() << "PluginManager::selectFirstSampleSink: m_sampleSink at index " << index
<< " hid: " << m_sampleSinkDevices[index].m_hadrwareId.toStdString().c_str()
<< " id: " << m_sampleSinkDevices[index].m_deviceId.toStdString().c_str()
<< " ser: " << m_sampleSinkDevices[index].m_deviceSerial.toStdString().c_str()
<< " seq: " << m_sampleSinkDevices[index].m_deviceSequence;
deviceAPI->stopGeneration();
deviceAPI->setSampleSinkPluginInstanceUI(0); // this effectively destroys the previous GUI if it exists
QWidget *gui;
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceGUI(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->setSampleSinkPluginInstanceUI(pluginGUI);
deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
return index;
}
int PluginManager::selectSampleSourceBySerialOrSequence(const QString& sourceId, const QString& sourceSerial, uint32_t sourceSequence, DeviceSourceAPI *deviceAPI) int PluginManager::selectSampleSourceBySerialOrSequence(const QString& sourceId, const QString& sourceSerial, uint32_t sourceSequence, DeviceSourceAPI *deviceAPI)
{ {
qDebug("PluginManager::selectSampleSourceBySequence by sequence: id: %s ser: %s seq: %d", qPrintable(sourceId), qPrintable(sourceSerial), sourceSequence); qDebug("PluginManager::selectSampleSourceBySequence by sequence: id: %s ser: %s seq: %d", qPrintable(sourceId), qPrintable(sourceSerial), sourceSequence);

View File

@ -62,12 +62,10 @@ public:
int getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI); int getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI);
int selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI); int selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI);
int selectFirstSampleSource(const QString& sourceId, DeviceSourceAPI *deviceAPI);
int selectSampleSourceBySerialOrSequence(const QString& sourceId, const QString& sourceSerial, uint32_t sourceSequence, DeviceSourceAPI *deviceAPI); int selectSampleSourceBySerialOrSequence(const QString& sourceId, const QString& sourceSerial, uint32_t sourceSequence, DeviceSourceAPI *deviceAPI);
void selectSampleSourceByDevice(void *devicePtr, DeviceSourceAPI *deviceAPI); void selectSampleSourceByDevice(void *devicePtr, DeviceSourceAPI *deviceAPI);
int selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI); int selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI);
int selectFirstSampleSink(const QString& sourceId, DeviceSinkAPI *deviceAPI);
int selectSampleSinkBySerialOrSequence(const QString& sinkId, const QString& sinkSerial, uint32_t sinkSequence, DeviceSinkAPI *deviceAPI); int selectSampleSinkBySerialOrSequence(const QString& sinkId, const QString& sinkSerial, uint32_t sinkSequence, DeviceSinkAPI *deviceAPI);
void selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *deviceAPI); void selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *deviceAPI);