2014-05-18 15:52:39 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_MAINWINDOW_H
|
|
|
|
#define INCLUDE_MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QTimer>
|
2016-05-17 01:41:01 +00:00
|
|
|
#include <QList>
|
|
|
|
|
2015-10-02 00:22:56 +00:00
|
|
|
#include "settings/mainsettings.h"
|
2015-08-18 00:47:14 +00:00
|
|
|
#include "util/messagequeue.h"
|
2014-05-18 15:52:39 +00:00
|
|
|
#include "util/export.h"
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class QDir;
|
2016-05-14 12:12:57 +00:00
|
|
|
class SamplingDeviceControl;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
class AudioDeviceInfo;
|
|
|
|
class DSPEngine;
|
2016-05-11 18:02:45 +00:00
|
|
|
class DSPDeviceEngine;
|
2014-05-18 15:52:39 +00:00
|
|
|
class Indicator;
|
|
|
|
class SpectrumVis;
|
2015-10-07 01:53:25 +00:00
|
|
|
class GLSpectrum;
|
|
|
|
class GLSpectrumGUI;
|
2015-10-07 07:27:44 +00:00
|
|
|
class ChannelWindow;
|
2014-05-18 15:52:39 +00:00
|
|
|
class SampleSource;
|
|
|
|
class PluginAPI;
|
|
|
|
class PluginGUI;
|
|
|
|
class ChannelMarker;
|
|
|
|
class PluginManager;
|
2016-05-15 23:12:37 +00:00
|
|
|
class DeviceAPI;
|
2014-05-18 15:52:39 +00:00
|
|
|
class PluginInterface;
|
2016-05-17 01:41:01 +00:00
|
|
|
class QWidget;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
2015-08-29 23:26:51 +00:00
|
|
|
class SDRANGEL_API MainWindow : public QMainWindow {
|
2014-05-18 15:52:39 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-10-07 07:27:44 +00:00
|
|
|
struct DeviceUISet
|
|
|
|
{
|
|
|
|
SpectrumVis *m_spectrumVis;
|
|
|
|
GLSpectrum *m_spectrum;
|
|
|
|
GLSpectrumGUI *m_spectrumGUI;
|
|
|
|
ChannelWindow *m_channelWindow;
|
2016-05-14 12:12:57 +00:00
|
|
|
SamplingDeviceControl *m_samplingDeviceControl;
|
2016-05-11 18:02:45 +00:00
|
|
|
DSPDeviceEngine *m_deviceEngine;
|
2016-05-15 23:12:37 +00:00
|
|
|
DeviceAPI *m_deviceAPI;
|
2016-05-18 14:24:04 +00:00
|
|
|
QByteArray m_mainWindowState;
|
2015-10-07 07:27:44 +00:00
|
|
|
|
|
|
|
DeviceUISet(QTimer& timer);
|
|
|
|
~DeviceUISet();
|
|
|
|
};
|
|
|
|
|
2015-05-09 08:51:02 +00:00
|
|
|
explicit MainWindow(QWidget* parent = 0);
|
2014-05-18 15:52:39 +00:00
|
|
|
~MainWindow();
|
|
|
|
|
2015-08-18 00:47:14 +00:00
|
|
|
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
void addViewAction(QAction* action);
|
|
|
|
|
2016-05-15 09:26:48 +00:00
|
|
|
void addChannelRollup(int deviceTabIndex, QWidget* widget);
|
2016-05-15 02:38:37 +00:00
|
|
|
void setInputGUI(int deviceTabIndex, QWidget* gui, const QString& sourceDisplayName);
|
2016-05-15 09:26:48 +00:00
|
|
|
|
2015-08-01 01:33:07 +00:00
|
|
|
const QTimer& getMasterTimer() const { return m_masterTimer; }
|
2016-09-28 11:38:38 +00:00
|
|
|
const MainSettings& getMainSettings() const { return m_settings; }
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
PGroup,
|
|
|
|
PItem
|
|
|
|
};
|
|
|
|
|
2016-05-17 01:41:01 +00:00
|
|
|
struct DeviceWidgetTabData
|
|
|
|
{
|
|
|
|
QWidget *gui;
|
|
|
|
QString displayName;
|
|
|
|
QString tabName;
|
|
|
|
};
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
Ui::MainWindow* ui;
|
|
|
|
AudioDeviceInfo* m_audioDeviceInfo;
|
2015-08-18 00:47:14 +00:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-10-02 00:22:56 +00:00
|
|
|
MainSettings m_settings;
|
2015-10-07 07:27:44 +00:00
|
|
|
std::vector<DeviceUISet*> m_deviceUIs;
|
2016-05-17 01:41:01 +00:00
|
|
|
QList<DeviceWidgetTabData> m_deviceWidgetTabs;
|
2016-05-18 14:24:04 +00:00
|
|
|
int m_masterTabIndex;
|
2015-10-07 01:53:25 +00:00
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
DSPEngine* m_dspEngine;
|
2016-05-16 22:04:27 +00:00
|
|
|
PluginManager* m_pluginManager;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2015-08-01 01:33:07 +00:00
|
|
|
QTimer m_masterTimer;
|
2016-05-12 17:06:38 +00:00
|
|
|
QTimer m_statusTimer;
|
2014-05-18 15:52:39 +00:00
|
|
|
int m_lastEngineState;
|
|
|
|
|
2016-05-12 17:06:38 +00:00
|
|
|
QLabel* m_dateTimeWidget;
|
2016-05-12 17:28:04 +00:00
|
|
|
QLabel* m_showSystemWidget;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
QWidget* m_inputGUI;
|
|
|
|
|
|
|
|
int m_sampleRate;
|
|
|
|
quint64 m_centerFrequency;
|
2015-07-28 21:54:17 +00:00
|
|
|
std::string m_sampleFileName;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
void loadSettings();
|
2016-05-24 20:55:10 +00:00
|
|
|
void loadPresetSettings(const Preset* preset, int tabIndex);
|
|
|
|
void savePresetSettings(Preset* preset, int tabIndex);
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
void createStatusBar();
|
|
|
|
void closeEvent(QCloseEvent*);
|
2015-08-23 22:51:27 +00:00
|
|
|
void updatePresetControls();
|
2014-05-18 15:52:39 +00:00
|
|
|
QTreeWidgetItem* addPresetToTree(const Preset* preset);
|
|
|
|
void applySettings();
|
|
|
|
|
2016-05-13 07:23:33 +00:00
|
|
|
void addDevice();
|
|
|
|
void removeLastDevice();
|
2016-05-11 17:14:23 +00:00
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
private slots:
|
|
|
|
void handleMessages();
|
2016-05-12 17:06:38 +00:00
|
|
|
void updateStatus();
|
2014-05-18 15:52:39 +00:00
|
|
|
void on_action_View_Fullscreen_toggled(bool checked);
|
|
|
|
void on_presetSave_clicked();
|
2015-05-09 08:51:02 +00:00
|
|
|
void on_presetUpdate_clicked();
|
2016-03-29 08:57:50 +00:00
|
|
|
void on_presetExport_clicked();
|
|
|
|
void on_presetImport_clicked();
|
2015-10-03 00:14:26 +00:00
|
|
|
void on_settingsSave_clicked();
|
2014-05-18 15:52:39 +00:00
|
|
|
void on_presetLoad_clicked();
|
|
|
|
void on_presetDelete_clicked();
|
|
|
|
void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
|
|
|
void on_presetTree_itemActivated(QTreeWidgetItem *item, int column);
|
2016-05-04 15:07:26 +00:00
|
|
|
void on_action_Audio_triggered();
|
2016-05-08 04:00:37 +00:00
|
|
|
void on_action_DV_Serial_triggered(bool checked);
|
2016-05-17 12:21:27 +00:00
|
|
|
void on_sampleSource_confirmClicked(bool checked);
|
2016-05-17 22:42:35 +00:00
|
|
|
void on_action_Loaded_Plugins_triggered();
|
2014-05-18 15:52:39 +00:00
|
|
|
void on_action_About_triggered();
|
2016-05-13 09:42:03 +00:00
|
|
|
void on_action_addDevice_triggered();
|
|
|
|
void on_action_removeDevice_triggered();
|
2016-05-20 20:14:07 +00:00
|
|
|
void on_action_Exit_triggered();
|
2016-05-14 01:36:28 +00:00
|
|
|
void tabInputViewIndexChanged();
|
2014-05-18 15:52:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_MAINWINDOW_H
|