mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 13:51:47 -05:00
MainWindow: simplify the constructs new GUI and input object code
This commit is contained in:
parent
6593f141eb
commit
034d1be0f8
@ -858,11 +858,9 @@ void MainWindow::on_sampleSource_confirmClicked(bool checked __attribute__((unus
|
|||||||
|
|
||||||
// constructs new GUI and input object
|
// constructs new GUI and input object
|
||||||
QWidget *gui;
|
QWidget *gui;
|
||||||
PluginManager::SamplingDevice *sampleSourceDevice = (PluginManager::SamplingDevice *) devicePtr;
|
PluginInstanceUI *pluginUI = deviceUI->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(deviceUI->m_deviceSourceAPI->getSampleSourceId(), &gui, deviceUI->m_deviceSourceAPI);
|
||||||
PluginInstanceUI *pluginUI = sampleSourceDevice->m_plugin->createSampleSourcePluginInstanceGUI(sampleSourceDevice->m_deviceId, &gui, deviceUI->m_deviceSourceAPI);
|
|
||||||
|
|
||||||
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(pluginUI);
|
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceUI(pluginUI);
|
||||||
setDeviceGUI(currentSourceTabIndex, gui, sampleSourceDevice->m_displayName);
|
setDeviceGUI(currentSourceTabIndex, gui, deviceUI->m_deviceSourceAPI->getSampleSourceDisplayName());
|
||||||
|
|
||||||
deviceUI->m_deviceSourceAPI->loadSourceSettings(m_settings.getWorkingPreset()); // load new API settings
|
deviceUI->m_deviceSourceAPI->loadSourceSettings(m_settings.getWorkingPreset()); // load new API settings
|
||||||
|
|
||||||
|
@ -557,6 +557,8 @@ void PluginManager::selectSampleSourceByDevice(void *devicePtr, DeviceSourceAPI
|
|||||||
deviceAPI->setHardwareId(sampleSourceDevice->m_hadrwareId);
|
deviceAPI->setHardwareId(sampleSourceDevice->m_hadrwareId);
|
||||||
deviceAPI->setSampleSourceId(sampleSourceDevice->m_deviceId);
|
deviceAPI->setSampleSourceId(sampleSourceDevice->m_deviceId);
|
||||||
deviceAPI->setSampleSourceSerial(sampleSourceDevice->m_deviceSerial);
|
deviceAPI->setSampleSourceSerial(sampleSourceDevice->m_deviceSerial);
|
||||||
|
deviceAPI->setSampleSourceDisplayName(sampleSourceDevice->m_displayName);
|
||||||
|
deviceAPI->setSampleSourcePluginInterface(sampleSourceDevice->m_plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManager::selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *deviceAPI)
|
void PluginManager::selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *deviceAPI)
|
||||||
@ -574,6 +576,8 @@ void PluginManager::selectSampleSinkByDevice(void *devicePtr, DeviceSinkAPI *dev
|
|||||||
deviceAPI->setHardwareId(sampleSinkDevice->m_hadrwareId);
|
deviceAPI->setHardwareId(sampleSinkDevice->m_hadrwareId);
|
||||||
deviceAPI->setSampleSinkId(sampleSinkDevice->m_deviceId);
|
deviceAPI->setSampleSinkId(sampleSinkDevice->m_deviceId);
|
||||||
deviceAPI->setSampleSinkSerial(sampleSinkDevice->m_deviceSerial);
|
deviceAPI->setSampleSinkSerial(sampleSinkDevice->m_deviceSerial);
|
||||||
|
deviceAPI->setSampleSinkDisplayName(sampleSinkDevice->m_displayName);
|
||||||
|
deviceAPI->setSampleSinkPluginInterface(sampleSinkDevice->m_plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManager::loadPlugins(const QDir& dir)
|
void PluginManager::loadPlugins(const QDir& dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user