1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-24 11:12:27 -04:00

Dynamic input tab allocation. Interim state #1

This commit is contained in:
f4exb 2015-10-07 23:27:56 +02:00
parent ce8dd29c0a
commit 6e3e273b68
3 changed files with 26 additions and 11 deletions

View File

@ -8,9 +8,9 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
project(sdrangel) project(sdrangel)
set(CMAKE_BUILD_TYPE "Release") #set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo") #set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo")
#set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_BUILD_TYPE "Debug")
set(QT_USE_QTOPENGL TRUE) set(QT_USE_QTOPENGL TRUE)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
@ -33,8 +33,8 @@ ENDIF()
############################################################################## ##############################################################################
#include(${QT_USE_FILE}) #include(${QT_USE_FILE})
set( QT_DEFINITIONS "${QT_DEFINITIONS} -DQT_NO_DEBUG_OUTPUT" ) #set( QT_DEFINITIONS "${QT_DEFINITIONS} -DQT_NO_DEBUG_OUTPUT" )
#set( QT_DEFINITIONS "${QT_DEFINITIONS}" ) set( QT_DEFINITIONS "${QT_DEFINITIONS}" )
add_definitions(${QT_DEFINITIONS}) add_definitions(${QT_DEFINITIONS})
if(MSVC) if(MSVC)

View File

@ -27,6 +27,7 @@
class QLabel; class QLabel;
class QTreeWidgetItem; class QTreeWidgetItem;
class QDir; class QDir;
class QComboBox;
class AudioDeviceInfo; class AudioDeviceInfo;
class DSPEngine; class DSPEngine;
@ -57,6 +58,7 @@ public:
GLSpectrum *m_spectrum; GLSpectrum *m_spectrum;
GLSpectrumGUI *m_spectrumGUI; GLSpectrumGUI *m_spectrumGUI;
ChannelWindow *m_channelWindow; ChannelWindow *m_channelWindow;
QComboBox *m_sampleSource;
DeviceUISet(QTimer& timer); DeviceUISet(QTimer& timer);
~DeviceUISet(); ~DeviceUISet();

View File

@ -18,6 +18,7 @@
#include <QInputDialog> #include <QInputDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QLabel> #include <QLabel>
#include <QComboBox>
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "audio/audiodeviceinfo.h" #include "audio/audiodeviceinfo.h"
@ -99,9 +100,9 @@ MainWindow::MainWindow(QWidget* parent) :
m_pluginManager->loadPlugins(); m_pluginManager->loadPlugins();
bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true); //bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true);
m_pluginManager->fillSampleSourceSelector(ui->sampleSource); //m_pluginManager->fillSampleSourceSelector(ui->sampleSource);
ui->sampleSource->blockSignals(sampleSourceSignalsBlocked); //ui->sampleSource->blockSignals(sampleSourceSignalsBlocked);
//m_rxSpectrumVis = new SpectrumVis(ui->rxSpectrum); //m_rxSpectrumVis = new SpectrumVis(ui->rxSpectrum);
//ui->rxSpectrum->connectTimer(m_masterTimer); //ui->rxSpectrum->connectTimer(m_masterTimer);
@ -109,11 +110,16 @@ MainWindow::MainWindow(QWidget* parent) :
//m_dspEngine-> //m_dspEngine->
m_deviceUIs.push_back(new DeviceUISet(m_masterTimer)); m_deviceUIs.push_back(new DeviceUISet(m_masterTimer));
ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, "X0"); ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, "X0");
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, "X0"); ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, "X0");
m_dspEngine->addSink(m_deviceUIs.back()->m_spectrumVis); m_dspEngine->addSink(m_deviceUIs.back()->m_spectrumVis);
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, "X0"); ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, "X0");
ui->tabChannels->removeTab(0); ui->tabChannels->removeTab(0);
bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
m_pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_sampleSource);
m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
ui->tabInputs->addTab(m_deviceUIs.back()->m_sampleSource, "X0");
m_fileSink = new FileSink(); m_fileSink = new FileSink();
m_dspEngine->addSink(m_fileSink); m_dspEngine->addSink(m_fileSink);
@ -129,9 +135,13 @@ MainWindow::MainWindow(QWidget* parent) :
if (sampleSourceIndex >= 0) if (sampleSourceIndex >= 0)
{ {
bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true); //bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true);
ui->sampleSource->setCurrentIndex(sampleSourceIndex); //ui->sampleSource->setCurrentIndex(sampleSourceIndex);
ui->sampleSource->blockSignals(sampleSourceSignalsBlocked); //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);
} }
qDebug() << "MainWindow::MainWindow: load current preset settings..."; qDebug() << "MainWindow::MainWindow: load current preset settings...";
@ -585,7 +595,8 @@ void MainWindow::on_sampleSource_currentIndexChanged(int index)
{ {
m_pluginManager->saveSourceSettings(m_settings.getWorkingPreset()); m_pluginManager->saveSourceSettings(m_settings.getWorkingPreset());
m_pluginManager->selectSampleSourceByIndex(ui->sampleSource->currentIndex()); m_pluginManager->selectSampleSourceByIndex(ui->sampleSource->currentIndex());
m_settings.setSourceIndex(ui->sampleSource->currentIndex()); //m_settings.setSourceIndex(ui->sampleSource->currentIndex());
m_settings.setSourceIndex(m_deviceUIs.back()->m_sampleSource->currentIndex());
m_pluginManager->loadSourceSettings(m_settings.getWorkingPreset()); m_pluginManager->loadSourceSettings(m_settings.getWorkingPreset());
} }
@ -603,10 +614,12 @@ MainWindow::DeviceUISet::DeviceUISet(QTimer& timer)
m_spectrumGUI = new GLSpectrumGUI; m_spectrumGUI = new GLSpectrumGUI;
m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum); m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum);
m_channelWindow = new ChannelWindow; m_channelWindow = new ChannelWindow;
m_sampleSource = new QComboBox;
} }
MainWindow::DeviceUISet::~DeviceUISet() MainWindow::DeviceUISet::~DeviceUISet()
{ {
delete m_sampleSource;
delete m_channelWindow; delete m_channelWindow;
delete m_spectrumGUI; delete m_spectrumGUI;
delete m_spectrumVis; delete m_spectrumVis;