2014-05-18 11:52:39 -04: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-16 21:41:01 -04:00
|
|
|
#include <QList>
|
|
|
|
|
2015-10-01 20:22:56 -04:00
|
|
|
#include "settings/mainsettings.h"
|
2015-08-17 20:47:14 -04:00
|
|
|
#include "util/messagequeue.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
#include "util/export.h"
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class QDir;
|
2016-05-14 08:12:57 -04:00
|
|
|
class SamplingDeviceControl;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class AudioDeviceInfo;
|
|
|
|
class DSPEngine;
|
2016-10-03 12:29:05 -04:00
|
|
|
class DSPDeviceSourceEngine;
|
2014-05-18 11:52:39 -04:00
|
|
|
class Indicator;
|
|
|
|
class SpectrumVis;
|
2015-10-06 21:53:25 -04:00
|
|
|
class GLSpectrum;
|
|
|
|
class GLSpectrumGUI;
|
2015-10-07 03:27:44 -04:00
|
|
|
class ChannelWindow;
|
2016-10-02 17:16:40 -04:00
|
|
|
class DeviceSampleSource;
|
2014-05-18 11:52:39 -04:00
|
|
|
class PluginAPI;
|
|
|
|
class PluginGUI;
|
|
|
|
class ChannelMarker;
|
|
|
|
class PluginManager;
|
2016-05-15 19:12:37 -04:00
|
|
|
class DeviceAPI;
|
2014-05-18 11:52:39 -04:00
|
|
|
class PluginInterface;
|
2016-05-16 21:41:01 -04:00
|
|
|
class QWidget;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
2015-08-29 19:26:51 -04:00
|
|
|
class SDRANGEL_API MainWindow : public QMainWindow {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-10-07 03:27:44 -04:00
|
|
|
struct DeviceUISet
|
|
|
|
{
|
|
|
|
SpectrumVis *m_spectrumVis;
|
|
|
|
GLSpectrum *m_spectrum;
|
|
|
|
GLSpectrumGUI *m_spectrumGUI;
|
|
|
|
ChannelWindow *m_channelWindow;
|
2016-05-14 08:12:57 -04:00
|
|
|
SamplingDeviceControl *m_samplingDeviceControl;
|
2016-10-03 12:29:05 -04:00
|
|
|
DSPDeviceSourceEngine *m_deviceEngine;
|
2016-05-15 19:12:37 -04:00
|
|
|
DeviceAPI *m_deviceAPI;
|
2016-05-18 10:24:04 -04:00
|
|
|
QByteArray m_mainWindowState;
|
2015-10-07 03:27:44 -04:00
|
|
|
|
|
|
|
DeviceUISet(QTimer& timer);
|
|
|
|
~DeviceUISet();
|
|
|
|
};
|
|
|
|
|
2015-05-09 04:51:02 -04:00
|
|
|
explicit MainWindow(QWidget* parent = 0);
|
2014-05-18 11:52:39 -04:00
|
|
|
~MainWindow();
|
|
|
|
|
2015-08-17 20:47:14 -04:00
|
|
|
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
void addViewAction(QAction* action);
|
|
|
|
|
2016-05-15 05:26:48 -04:00
|
|
|
void addChannelRollup(int deviceTabIndex, QWidget* widget);
|
2016-05-14 22:38:37 -04:00
|
|
|
void setInputGUI(int deviceTabIndex, QWidget* gui, const QString& sourceDisplayName);
|
2016-05-15 05:26:48 -04:00
|
|
|
|
2015-07-31 21:33:07 -04:00
|
|
|
const QTimer& getMasterTimer() const { return m_masterTimer; }
|
2016-09-28 07:38:38 -04:00
|
|
|
const MainSettings& getMainSettings() const { return m_settings; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
PGroup,
|
|
|
|
PItem
|
|
|
|
};
|
|
|
|
|
2016-05-16 21:41:01 -04:00
|
|
|
struct DeviceWidgetTabData
|
|
|
|
{
|
|
|
|
QWidget *gui;
|
|
|
|
QString displayName;
|
|
|
|
QString tabName;
|
|
|
|
};
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
Ui::MainWindow* ui;
|
|
|
|
AudioDeviceInfo* m_audioDeviceInfo;
|
2015-08-17 20:47:14 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-10-01 20:22:56 -04:00
|
|
|
MainSettings m_settings;
|
2015-10-07 03:27:44 -04:00
|
|
|
std::vector<DeviceUISet*> m_deviceUIs;
|
2016-05-16 21:41:01 -04:00
|
|
|
QList<DeviceWidgetTabData> m_deviceWidgetTabs;
|
2016-05-18 10:24:04 -04:00
|
|
|
int m_masterTabIndex;
|
2015-10-06 21:53:25 -04:00
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
DSPEngine* m_dspEngine;
|
2016-05-16 18:04:27 -04:00
|
|
|
PluginManager* m_pluginManager;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2015-07-31 21:33:07 -04:00
|
|
|
QTimer m_masterTimer;
|
2016-05-12 13:06:38 -04:00
|
|
|
QTimer m_statusTimer;
|
2014-05-18 11:52:39 -04:00
|
|
|
int m_lastEngineState;
|
|
|
|
|
2016-05-12 13:06:38 -04:00
|
|
|
QLabel* m_dateTimeWidget;
|
2016-05-12 13:28:04 -04:00
|
|
|
QLabel* m_showSystemWidget;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
QWidget* m_inputGUI;
|
|
|
|
|
|
|
|
int m_sampleRate;
|
|
|
|
quint64 m_centerFrequency;
|
2015-07-28 17:54:17 -04:00
|
|
|
std::string m_sampleFileName;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
void loadSettings();
|
2016-05-24 16:55:10 -04:00
|
|
|
void loadPresetSettings(const Preset* preset, int tabIndex);
|
|
|
|
void savePresetSettings(Preset* preset, int tabIndex);
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
void createStatusBar();
|
|
|
|
void closeEvent(QCloseEvent*);
|
2015-08-23 18:51:27 -04:00
|
|
|
void updatePresetControls();
|
2014-05-18 11:52:39 -04:00
|
|
|
QTreeWidgetItem* addPresetToTree(const Preset* preset);
|
|
|
|
void applySettings();
|
|
|
|
|
2016-05-13 03:23:33 -04:00
|
|
|
void addDevice();
|
|
|
|
void removeLastDevice();
|
2016-05-11 13:14:23 -04:00
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
private slots:
|
|
|
|
void handleMessages();
|
2016-05-12 13:06:38 -04:00
|
|
|
void updateStatus();
|
2014-05-18 11:52:39 -04:00
|
|
|
void on_action_View_Fullscreen_toggled(bool checked);
|
|
|
|
void on_presetSave_clicked();
|
2015-05-09 04:51:02 -04:00
|
|
|
void on_presetUpdate_clicked();
|
2016-03-29 04:57:50 -04:00
|
|
|
void on_presetExport_clicked();
|
|
|
|
void on_presetImport_clicked();
|
2015-10-02 20:14:26 -04:00
|
|
|
void on_settingsSave_clicked();
|
2014-05-18 11:52:39 -04: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 11:07:26 -04:00
|
|
|
void on_action_Audio_triggered();
|
2016-05-08 00:00:37 -04:00
|
|
|
void on_action_DV_Serial_triggered(bool checked);
|
2016-09-28 11:01:57 -04:00
|
|
|
void on_action_My_Position_triggered();
|
2016-05-17 08:21:27 -04:00
|
|
|
void on_sampleSource_confirmClicked(bool checked);
|
2016-05-17 18:42:35 -04:00
|
|
|
void on_action_Loaded_Plugins_triggered();
|
2014-05-18 11:52:39 -04:00
|
|
|
void on_action_About_triggered();
|
2016-05-13 05:42:03 -04:00
|
|
|
void on_action_addDevice_triggered();
|
|
|
|
void on_action_removeDevice_triggered();
|
2016-05-20 16:14:07 -04:00
|
|
|
void on_action_Exit_triggered();
|
2016-05-13 21:36:28 -04:00
|
|
|
void tabInputViewIndexChanged();
|
2014-05-18 11:52:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_MAINWINDOW_H
|