mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 05:41:56 -05:00
PluginManager::selectSampleSinkBySerialOrSequence: removed GUI interaction
This commit is contained in:
parent
03e491db45
commit
ff0c2c30fd
@ -36,6 +36,7 @@ DeviceSinkAPI::DeviceSinkAPI(MainWindow *mainWindow,
|
||||
m_spectrum(glSpectrum),
|
||||
m_channelWindow(channelWindow),
|
||||
m_sampleSinkSequence(0),
|
||||
m_pluginInterface(0),
|
||||
m_sampleSinkPluginInstanceUI(0),
|
||||
m_buddySharedPtr(0),
|
||||
m_isBuddyLeader(false),
|
||||
@ -166,12 +167,22 @@ void DeviceSinkAPI::setSampleSinkSerial(const QString& serial)
|
||||
m_sampleSinkSerial = serial;
|
||||
}
|
||||
|
||||
void DeviceSinkAPI::setSampleSinkDisplayName(const QString& name)
|
||||
{
|
||||
m_sampleSinkDisplayName = name;
|
||||
}
|
||||
|
||||
void DeviceSinkAPI::setSampleSinkSequence(int sequence)
|
||||
{
|
||||
m_sampleSinkSequence = sequence;
|
||||
m_deviceSinkEngine->setSinkSequence(sequence);
|
||||
}
|
||||
|
||||
void DeviceSinkAPI::setSampleSinkPluginInterface(PluginInterface *interface)
|
||||
{
|
||||
m_pluginInterface = interface;
|
||||
}
|
||||
|
||||
void DeviceSinkAPI::setSampleSinkPluginInstanceUI(PluginInstanceUI *gui)
|
||||
{
|
||||
if (m_sampleSinkPluginInstanceUI != 0)
|
||||
|
@ -34,6 +34,7 @@ class ChannelMarker;
|
||||
class QWidget;
|
||||
class PluginInstanceUI;
|
||||
class PluginAPI;
|
||||
class PluginInterface;
|
||||
class Preset;
|
||||
class DeviceSourceAPI;
|
||||
|
||||
@ -68,12 +69,16 @@ public:
|
||||
void setHardwareId(const QString& id);
|
||||
void setSampleSinkId(const QString& id);
|
||||
void setSampleSinkSerial(const QString& serial);
|
||||
void setSampleSinkDisplayName(const QString& serial);
|
||||
void setSampleSinkSequence(int sequence);
|
||||
void setSampleSinkPluginInterface(PluginInterface *interface);
|
||||
void setSampleSinkPluginInstanceUI(PluginInstanceUI *gui);
|
||||
|
||||
const QString& getHardwareId() const { return m_hardwareId; }
|
||||
const QString& getSampleSinkId() const { return m_sampleSinkId; }
|
||||
const QString& getSampleSinkSerial() const { return m_sampleSinkSerial; }
|
||||
const QString& getSampleSinkDisplayName() const { return m_sampleSinkDisplayName; }
|
||||
PluginInterface *getSampleSinkPluginInterface() { return m_pluginInterface; }
|
||||
uint32_t getSampleSinkSequence() const { return m_sampleSinkSequence; }
|
||||
|
||||
void registerChannelInstance(const QString& channelName, PluginInstanceUI* pluginGUI);
|
||||
@ -142,7 +147,9 @@ protected:
|
||||
QString m_hardwareId;
|
||||
QString m_sampleSinkId;
|
||||
QString m_sampleSinkSerial;
|
||||
QString m_sampleSinkDisplayName;
|
||||
uint32_t m_sampleSinkSequence;
|
||||
PluginInterface* m_pluginInterface;
|
||||
PluginInstanceUI* m_sampleSinkPluginInstanceUI;
|
||||
|
||||
ChannelInstanceRegistrations m_channelInstanceRegistrations;
|
||||
|
@ -36,6 +36,7 @@ DeviceSourceAPI::DeviceSourceAPI(MainWindow *mainWindow,
|
||||
m_spectrum(glSpectrum),
|
||||
m_channelWindow(channelWindow),
|
||||
m_sampleSourceSequence(0),
|
||||
m_pluginInterface(0),
|
||||
m_sampleSourcePluginInstanceUI(0),
|
||||
m_buddySharedPtr(0),
|
||||
m_isBuddyLeader(false),
|
||||
|
@ -270,6 +270,12 @@ void MainWindow::addSinkDevice()
|
||||
ui->tabInputsSelect->setTabToolTip(deviceTabIndex, QString(uidCStr));
|
||||
|
||||
m_pluginManager->selectSampleSinkBySerialOrSequence("sdrangel.samplesink.filesink", "0", 0, m_deviceUIs.back()->m_deviceSinkAPI);
|
||||
|
||||
QWidget *gui;
|
||||
PluginInstanceUI *pluginGUI = m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkPluginInterface()->createSampleSinkPluginInstanceGUI(
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkId(), &gui, m_deviceUIs.back()->m_deviceSinkAPI);
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginGUI);
|
||||
m_deviceUIs.back()->m_deviceSinkAPI->setOutputGUI(gui, m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkDisplayName());
|
||||
}
|
||||
|
||||
void MainWindow::removeLastDevice()
|
||||
|
@ -393,11 +393,6 @@ int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceA
|
||||
deviceAPI->setSampleSourceDisplayName(m_sampleSourceDevices[index].m_displayName);
|
||||
deviceAPI->setSampleSourcePluginInterface(m_sampleSourceDevices[index].m_plugin);
|
||||
|
||||
// QWidget *gui;
|
||||
// PluginInstanceUI *pluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginInstanceGUI(m_sampleSourceDevices[index].m_deviceId, &gui, deviceAPI);
|
||||
// deviceAPI->setSampleSourcePluginInstanceUI(pluginGUI);
|
||||
// deviceAPI->setInputGUI(gui, m_sampleSourceDevices[index].m_displayName);
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -434,11 +429,8 @@ int PluginManager::selectSampleSinkByIndex(int index, DeviceSinkAPI *deviceAPI)
|
||||
deviceAPI->setHardwareId(m_sampleSinkDevices[index].m_hadrwareId);
|
||||
deviceAPI->setSampleSinkId(m_sampleSinkDevices[index].m_deviceId);
|
||||
deviceAPI->setSampleSinkSerial(m_sampleSinkDevices[index].m_deviceSerial);
|
||||
|
||||
QWidget *gui;
|
||||
PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceGUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
|
||||
deviceAPI->setSampleSinkPluginInstanceUI(pluginGUI);
|
||||
deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
|
||||
deviceAPI->setSampleSinkDisplayName(m_sampleSinkDevices[index].m_displayName);
|
||||
deviceAPI->setSampleSinkPluginInterface(m_sampleSinkDevices[index].m_plugin);
|
||||
|
||||
return index;
|
||||
}
|
||||
@ -583,11 +575,8 @@ int PluginManager::selectSampleSinkBySerialOrSequence(const QString& sinkId, con
|
||||
deviceAPI->setHardwareId(m_sampleSinkDevices[index].m_hadrwareId);
|
||||
deviceAPI->setSampleSinkId(m_sampleSinkDevices[index].m_deviceId);
|
||||
deviceAPI->setSampleSinkSerial(m_sampleSinkDevices[index].m_deviceSerial);
|
||||
|
||||
// QWidget *gui;
|
||||
// PluginInstanceUI *pluginGUI = m_sampleSinkDevices[index].m_plugin->createSampleSinkPluginInstanceGUI(m_sampleSinkDevices[index].m_deviceId, &gui, deviceAPI);
|
||||
// deviceAPI->setSampleSinkPluginInstanceUI(pluginGUI);
|
||||
// deviceAPI->setOutputGUI(gui, m_sampleSinkDevices[index].m_displayName);
|
||||
deviceAPI->setSampleSinkDisplayName(m_sampleSinkDevices[index].m_displayName);
|
||||
deviceAPI->setSampleSinkPluginInterface(m_sampleSinkDevices[index].m_plugin);
|
||||
|
||||
return index;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user