diff --git a/sdrgui/plugin/pluginmanager.cpp b/sdrgui/plugin/pluginmanager.cpp index 8c41399fa..29fc2deb4 100644 --- a/sdrgui/plugin/pluginmanager.cpp +++ b/sdrgui/plugin/pluginmanager.cpp @@ -71,6 +71,7 @@ void PluginManager::loadPlugins() it->pluginInterface->initPlugin(&m_pluginAPI); } + // TODO: enumerate with DeviceEnumerator updateSampleSourceDevices(); updateSampleSinkDevices(); } @@ -281,23 +282,6 @@ void PluginManager::fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID } } -int PluginManager::getSampleSourceSelectorIndex(QComboBox* comboBox, DeviceSourceAPI *deviceSourceAPI) -{ - for (int i = 0; i < comboBox->count(); i++) - { - SamplingDevice *samplingDevice = (SamplingDevice*) (comboBox->itemData(i)).value(); - - if ((samplingDevice->m_deviceId == deviceSourceAPI->getSampleSourceId()) && - (samplingDevice->m_deviceSerial == deviceSourceAPI->getSampleSourceSerial()) && - (samplingDevice->m_deviceSequence == deviceSourceAPI->getSampleSourceSequence())) - { - return i; - } - } - - return 0; // default to first item -} - void PluginManager::fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID) { comboBox->clear(); @@ -316,23 +300,6 @@ void PluginManager::fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID) } } -int PluginManager::getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI) -{ - for (int i = 0; i < comboBox->count(); i++) - { - SamplingDevice *samplingDevice = (SamplingDevice*) (comboBox->itemData(i)).value(); - - if ((samplingDevice->m_deviceId == deviceSinkAPI->getSampleSinkId()) && - (samplingDevice->m_deviceSerial == deviceSinkAPI->getSampleSinkSerial()) && - (samplingDevice->m_deviceSequence == deviceSinkAPI->getSampleSinkSequence())) - { - return i; - } - } - - return 0; // default to first item -} - int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI) { qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index); diff --git a/sdrgui/plugin/pluginmanager.h b/sdrgui/plugin/pluginmanager.h index 644581edb..c0abb24e9 100644 --- a/sdrgui/plugin/pluginmanager.h +++ b/sdrgui/plugin/pluginmanager.h @@ -57,12 +57,10 @@ public: void updateSampleSourceDevices(); void duplicateLocalSampleSourceDevices(uint deviceUID); void fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID); - int getSampleSourceSelectorIndex(QComboBox* comboBox, DeviceSourceAPI *deviceSourceAPI); void updateSampleSinkDevices(); void duplicateLocalSampleSinkDevices(uint deviceUID); void fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID); - int getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI); int selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI); int selectSampleSourceBySerialOrSequence(const QString& sourceId, const QString& sourceSerial, uint32_t sourceSequence, DeviceSourceAPI *deviceAPI);