1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

USe DeviceUISet new struct in main window

This commit is contained in:
f4exb 2017-10-24 18:34:39 +02:00
parent b4fe1f64c1
commit ec225344d3
3 changed files with 8 additions and 53 deletions

View File

@ -30,7 +30,7 @@ class DeviceSourceAPI;
class DSPDeviceSinkEngine;
class DeviceSinkAPI;
class DeviceUISet
struct DeviceUISet
{
SpectrumVis *m_spectrumVis;
GLSpectrum *m_spectrum;

View File

@ -15,8 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <plugin/plugininstancegui.h>
#include <plugin/plugininstancegui.h>
#include <QInputDialog>
#include <QMessageBox>
#include <QLabel>
@ -27,10 +25,11 @@
#include <QDateTime>
#include <QSysInfo>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <plugin/plugininstancegui.h>
#include <plugin/plugininstancegui.h>
#include "device/devicesourceapi.h"
#include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "audio/audiodeviceinfo.h"
#include "gui/indicator.h"
#include "gui/presetitem.h"
@ -51,6 +50,9 @@
#include "gui/glspectrum.h"
#include "gui/glspectrumgui.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <string>
#include <QDebug>
@ -1131,34 +1133,3 @@ void MainWindow::updateStatus()
{
m_dateTimeWidget->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss t"));
}
MainWindow::DeviceUISet::DeviceUISet(QTimer& timer)
{
m_spectrum = new GLSpectrum;
m_spectrumVis = new SpectrumVis(m_spectrum);
m_spectrum->connectTimer(timer);
m_spectrumGUI = new GLSpectrumGUI;
m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum);
m_channelWindow = new ChannelWindow;
m_samplingDeviceControl = new SamplingDeviceControl;
m_deviceSourceEngine = 0;
m_deviceSourceAPI = 0;
m_deviceSinkEngine = 0;
m_deviceSinkAPI = 0;
// m_spectrum needs to have its font to be set since it cannot be inherited from the main window
QFont font;
font.setFamily(QStringLiteral("Sans Serif"));
font.setPointSize(9);
m_spectrum->setFont(font);
}
MainWindow::DeviceUISet::~DeviceUISet()
{
delete m_samplingDeviceControl;
delete m_channelWindow;
delete m_spectrumGUI;
delete m_spectrumVis;
delete m_spectrum;
}

View File

@ -46,6 +46,7 @@ class ChannelMarker;
class PluginManager;
class DeviceSourceAPI;
class DeviceSinkAPI;
class DeviceUISet;
class PluginInterface;
class QWidget;
@ -57,23 +58,6 @@ class SDRANGEL_API MainWindow : public QMainWindow {
Q_OBJECT
public:
struct DeviceUISet
{
SpectrumVis *m_spectrumVis;
GLSpectrum *m_spectrum;
GLSpectrumGUI *m_spectrumGUI;
ChannelWindow *m_channelWindow;
SamplingDeviceControl *m_samplingDeviceControl;
DSPDeviceSourceEngine *m_deviceSourceEngine;
DeviceSourceAPI *m_deviceSourceAPI;
DSPDeviceSinkEngine *m_deviceSinkEngine;
DeviceSinkAPI *m_deviceSinkAPI;
QByteArray m_mainWindowState;
DeviceUISet(QTimer& timer);
~DeviceUISet();
};
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
static MainWindow *getInstance() { return m_instance; } // Main Window is de facto a singleton so this just returns its reference