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