mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-03 06:24:48 -04:00
Added reload devices option
This commit is contained in:
@@ -295,6 +295,23 @@ 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<void *>();
|
||||
|
||||
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();
|
||||
@@ -313,6 +330,23 @@ 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<void *>();
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user