1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-23 18:52:28 -04:00

Multi device support: interim state #2

This commit is contained in:
f4exb 2016-05-13 18:43:09 +02:00
parent ef81b11640
commit f5a65ddc97
6 changed files with 28 additions and 12 deletions

View File

@ -268,14 +268,19 @@ void MainWindow::removeChannelMarker(ChannelMarker* channelMarker)
m_deviceUIs.back()->m_spectrum->removeChannelMarker(channelMarker); m_deviceUIs.back()->m_spectrum->removeChannelMarker(channelMarker);
} }
void MainWindow::setInputGUI(QWidget* gui) //void MainWindow::setInputGUI(QWidget* gui)
//{
// // FIXME: Ceci est un tres tres gros CACA!
// if(m_inputGUI != 0)
// ui->inputDock->widget()->layout()->removeWidget(m_inputGUI);
// if(gui != 0)
// ui->inputDock->widget()->layout()->addWidget(gui);
// m_inputGUI = gui;
//}
void MainWindow::setInputGUI(int deviceTabIndex, QWidget* gui)
{ {
// FIXME: Ceci est un tres tres gros CACA! ui->stackInputs->addWidget(gui);
if(m_inputGUI != 0)
ui->inputDock->widget()->layout()->removeWidget(m_inputGUI);
if(gui != 0)
ui->inputDock->widget()->layout()->addWidget(gui);
m_inputGUI = gui;
} }
void MainWindow::loadSettings() void MainWindow::loadSettings()

View File

@ -78,7 +78,8 @@ public:
void addChannelMarker(ChannelMarker* channelMarker); void addChannelMarker(ChannelMarker* channelMarker);
void removeChannelMarker(ChannelMarker* channelMarker); void removeChannelMarker(ChannelMarker* channelMarker);
void setInputGUI(QWidget* gui); // void setInputGUI(QWidget* gui);
void setInputGUI(int deviceTabIndex, QWidget* gui);
const QTimer& getMasterTimer() const { return m_masterTimer; } const QTimer& getMasterTimer() const { return m_masterTimer; }
private: private:

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1012</width> <width>1012</width>
<height>621</height> <height>635</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -432,6 +432,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QStackedWidget" name="stackInputs"/>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -21,7 +21,7 @@ MessageQueue* PluginAPI::getMainWindowMessageQueue()
void PluginAPI::setInputGUI(QWidget* inputGUI) void PluginAPI::setInputGUI(QWidget* inputGUI)
{ {
m_mainWindow->setInputGUI(inputGUI); m_pluginManager->setInputGUI(inputGUI);
} }
void PluginAPI::registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action) void PluginAPI::registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action)
@ -46,12 +46,12 @@ void PluginAPI::removeChannelInstance(PluginGUI* pluginGUI)
void PluginAPI::addChannelMarker(ChannelMarker* channelMarker) void PluginAPI::addChannelMarker(ChannelMarker* channelMarker)
{ {
m_mainWindow->addChannelMarker(channelMarker); m_mainWindow->addChannelMarker(channelMarker); // TODO: suspect verify. No ref to main window expected.
} }
void PluginAPI::removeChannelMarker(ChannelMarker* channelMarker) void PluginAPI::removeChannelMarker(ChannelMarker* channelMarker)
{ {
m_mainWindow->removeChannelMarker(channelMarker); m_mainWindow->removeChannelMarker(channelMarker); // TODO: suspect verify. No ref to main window expected.
} }
void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin) void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin)

View File

@ -88,6 +88,12 @@ void PluginManager::registerSampleSource(const QString& sourceName, PluginInterf
m_sampleSourceRegistrations.append(SampleSourceRegistration(sourceName, plugin)); m_sampleSourceRegistrations.append(SampleSourceRegistration(sourceName, plugin));
} }
void PluginManager::setInputGUI(QWidget* gui)
{
//m_mainWindow->setInputGUI(gui);
m_mainWindow->setInputGUI(m_deviceTabIndex, gui);
}
void PluginManager::addSink(SampleSink* sink) void PluginManager::addSink(SampleSink* sink)
{ {
m_dspDeviceEngine->addSink(sink); m_dspDeviceEngine->addSink(sink);

View File

@ -51,6 +51,7 @@ public:
void removeChannelInstance(PluginGUI* pluginGUI); void removeChannelInstance(PluginGUI* pluginGUI);
void registerSampleSource(const QString& sourceName, PluginInterface* plugin); void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
void setInputGUI(QWidget* gui);
void addSink(SampleSink* sink); void addSink(SampleSink* sink);
void removeSink(SampleSink* sink); void removeSink(SampleSink* sink);