diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index b067779fd..3352f74d6 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -443,110 +443,6 @@ int PluginManager::selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI) 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) { qDebug("PluginManager::selectSampleSourceBySequence by sequence: id: %s ser: %s seq: %d", qPrintable(sourceId), qPrintable(sourceSerial), sourceSequence); diff --git a/sdrbase/plugin/pluginmanager.h b/sdrbase/plugin/pluginmanager.h index 9f42823ca..9d77fcccb 100644 --- a/sdrbase/plugin/pluginmanager.h +++ b/sdrbase/plugin/pluginmanager.h @@ -62,12 +62,10 @@ public: int getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI); 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); void selectSampleSourceByDevice(void *devicePtr, DeviceSourceAPI *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); void selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *deviceAPI);