1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 08:28:36 -05:00

Multi device support: moved loaded plugins dialog to devices control

This commit is contained in:
f4exb 2016-05-14 14:56:41 +02:00
parent 942bd0a733
commit f2872ae0ed
3 changed files with 1 additions and 56 deletions

View File

@ -18,7 +18,6 @@
#include <QInputDialog> #include <QInputDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QLabel> #include <QLabel>
//#include <QComboBox>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QFileDialog> #include <QFileDialog>
@ -141,14 +140,6 @@ MainWindow::MainWindow(QWidget* parent) :
if (sampleSourceIndex >= 0) if (sampleSourceIndex >= 0)
{ {
//bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true);
//ui->sampleSource->setCurrentIndex(sampleSourceIndex);
//ui->sampleSource->blockSignals(sampleSourceSignalsBlocked);
// bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
// m_deviceUIs.back()->m_sampleSource->setCurrentIndex(sampleSourceIndex);
// m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(true); bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(true);
m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->setCurrentIndex(sampleSourceIndex); m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->setCurrentIndex(sampleSourceIndex);
m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(sampleSourceSignalsBlocked); m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(sampleSourceSignalsBlocked);
@ -180,17 +171,6 @@ MainWindow::~MainWindow()
removeLastDevice(); removeLastDevice();
} }
// m_dspEngine->stopAllAcquisitions(); // FIXME: also present in m_pluginManager->freeAll()
// //m_pluginManager->freeAll();
// for (int i = 0; i < m_deviceUIs.size(); i++)
// {
// m_deviceUIs[i]->m_pluginManager->freeAll();
// delete m_deviceUIs[i];
// }
//
// m_dspEngine->stopAllDeviceEngines();
//
// //delete m_pluginManager;
delete m_dateTimeWidget; delete m_dateTimeWidget;
delete m_showSystemWidget; delete m_showSystemWidget;
@ -211,6 +191,7 @@ void MainWindow::addDevice()
PluginManager *pluginManager = new PluginManager(this, m_deviceUIs.size()-1, dspDeviceEngine, m_deviceUIs.back()->m_spectrum); PluginManager *pluginManager = new PluginManager(this, m_deviceUIs.size()-1, dspDeviceEngine, m_deviceUIs.back()->m_spectrum);
m_deviceUIs.back()->m_pluginManager = pluginManager; m_deviceUIs.back()->m_pluginManager = pluginManager;
m_deviceUIs.back()->m_samplingDeviceControl->setPluginManager(pluginManager);
pluginManager->loadPlugins(); pluginManager->loadPlugins();
dspDeviceEngine->addSink(m_deviceUIs.back()->m_spectrumVis); dspDeviceEngine->addSink(m_deviceUIs.back()->m_spectrumVis);
@ -218,23 +199,11 @@ void MainWindow::addDevice()
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, tabNameCStr); ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, tabNameCStr);
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, tabNameCStr); ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, tabNameCStr);
// bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
// pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_sampleSource);
// connect(m_deviceUIs.back()->m_sampleSource, SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int)));
// m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
// int tabInputsSelectIndex = ui->tabInputsSelect->addTab(m_deviceUIs.back()->m_sampleSource, tabNameCStr);
bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(true); bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(true);
pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()); pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector());
connect(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector(), SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int))); connect(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector(), SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int)));
m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(sampleSourceSignalsBlocked); m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->blockSignals(sampleSourceSignalsBlocked);
// ui->tabInputsSelect->addTab(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector(), tabNameCStr);
ui->tabInputsSelect->addTab(m_deviceUIs.back()->m_samplingDeviceControl, tabNameCStr); ui->tabInputsSelect->addTab(m_deviceUIs.back()->m_samplingDeviceControl, tabNameCStr);
// if (dspDeviceEngineUID == 0)
// {
// m_pluginManager = pluginManager;
// }
} }
void MainWindow::removeLastDevice() void MainWindow::removeLastDevice()
@ -345,9 +314,6 @@ void MainWindow::loadPresetSettings(const Preset* preset)
deviceUI->m_pluginManager->loadSettings(preset); deviceUI->m_pluginManager->loadSettings(preset);
} }
// m_deviceUIs.back()->m_spectrumGUI->deserialize(preset->getSpectrumConfig());
// m_pluginManager->loadSettings(preset);
// has to be last step // has to be last step
restoreState(preset->getLayout()); restoreState(preset->getLayout());
} }
@ -658,16 +624,6 @@ void MainWindow::on_presetTree_itemActivated(QTreeWidgetItem *item, int column)
on_presetLoad_clicked(); on_presetLoad_clicked();
} }
void MainWindow::on_action_Loaded_Plugins_triggered() // TODO: to be moved to a tabbed UI
{
if (m_deviceUIs.size() > 0)
{
DeviceUISet *deviceUISet = m_deviceUIs[0];
PluginsDialog pluginsDialog(deviceUISet->m_pluginManager, this);
pluginsDialog.exec();
}
}
void MainWindow::on_action_Audio_triggered() void MainWindow::on_action_Audio_triggered()
{ {
AudioDialog audioDialog(m_audioDeviceInfo, this); AudioDialog audioDialog(m_audioDeviceInfo, this);
@ -716,10 +672,6 @@ void MainWindow::on_sampleSource_currentIndexChanged(int index)
{ {
DeviceUISet *deviceUI = m_deviceUIs[currentSourceTabIndex]; DeviceUISet *deviceUI = m_deviceUIs[currentSourceTabIndex];
deviceUI->m_pluginManager->saveSourceSettings(m_settings.getWorkingPreset()); deviceUI->m_pluginManager->saveSourceSettings(m_settings.getWorkingPreset());
// deviceUI->m_pluginManager->selectSampleSourceByIndex(m_deviceUIs.back()->m_sampleSource->currentIndex());
// m_settings.setSourceIndex(deviceUI->m_sampleSource->currentIndex());
deviceUI->m_pluginManager->selectSampleSourceByIndex(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->currentIndex()); deviceUI->m_pluginManager->selectSampleSourceByIndex(m_deviceUIs.back()->m_samplingDeviceControl->getDeviceSelector()->currentIndex());
m_settings.setSourceIndex(deviceUI->m_samplingDeviceControl->getDeviceSelector()->currentIndex()); m_settings.setSourceIndex(deviceUI->m_samplingDeviceControl->getDeviceSelector()->currentIndex());

View File

@ -27,7 +27,6 @@
class QLabel; class QLabel;
class QTreeWidgetItem; class QTreeWidgetItem;
class QDir; class QDir;
//class QComboBox;
class SamplingDeviceControl; class SamplingDeviceControl;
class AudioDeviceInfo; class AudioDeviceInfo;
@ -59,7 +58,6 @@ public:
GLSpectrum *m_spectrum; GLSpectrum *m_spectrum;
GLSpectrumGUI *m_spectrumGUI; GLSpectrumGUI *m_spectrumGUI;
ChannelWindow *m_channelWindow; ChannelWindow *m_channelWindow;
// QComboBox *m_sampleSource;
SamplingDeviceControl *m_samplingDeviceControl; SamplingDeviceControl *m_samplingDeviceControl;
DSPDeviceEngine *m_deviceEngine; DSPDeviceEngine *m_deviceEngine;
PluginManager *m_pluginManager; PluginManager *m_pluginManager;
@ -114,8 +112,6 @@ private:
quint64 m_centerFrequency; quint64 m_centerFrequency;
std::string m_sampleFileName; std::string m_sampleFileName;
// PluginManager* m_pluginManager;
void loadSettings(); void loadSettings();
void loadPresetSettings(const Preset* preset); void loadPresetSettings(const Preset* preset);
void savePresetSettings(Preset* preset); void savePresetSettings(Preset* preset);
@ -143,7 +139,6 @@ private slots:
void on_presetDelete_clicked(); void on_presetDelete_clicked();
void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_presetTree_itemActivated(QTreeWidgetItem *item, int column); void on_presetTree_itemActivated(QTreeWidgetItem *item, int column);
void on_action_Loaded_Plugins_triggered(); // TODO: to be moved to a tabbed UI
void on_action_Audio_triggered(); void on_action_Audio_triggered();
void on_action_DV_Serial_triggered(bool checked); void on_action_DV_Serial_triggered(bool checked);
void on_sampleSource_currentIndexChanged(int index); void on_sampleSource_currentIndexChanged(int index);

View File

@ -116,8 +116,6 @@
<property name="title"> <property name="title">
<string>&amp;Help</string> <string>&amp;Help</string>
</property> </property>
<addaction name="action_Loaded_Plugins"/>
<addaction name="separator"/>
<addaction name="action_About"/> <addaction name="action_About"/>
</widget> </widget>
<widget class="QMenu" name="menu_Channels"> <widget class="QMenu" name="menu_Channels">