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>
|
|
|
|
#include "settings/settings.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;
|
|
|
|
|
|
|
|
class AudioDeviceInfo;
|
|
|
|
class DSPEngine;
|
|
|
|
class Indicator;
|
|
|
|
class SpectrumVis;
|
2015-07-28 17:54:17 -04:00
|
|
|
class FileSink;
|
2014-05-18 11:52:39 -04:00
|
|
|
class SampleSource;
|
|
|
|
class PluginAPI;
|
|
|
|
class PluginGUI;
|
|
|
|
class ChannelMarker;
|
|
|
|
class PluginManager;
|
|
|
|
class PluginInterface;
|
|
|
|
|
|
|
|
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-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 addChannelCreateAction(QAction* action);
|
|
|
|
void addChannelRollup(QWidget* widget);
|
|
|
|
void addViewAction(QAction* action);
|
|
|
|
|
|
|
|
void addChannelMarker(ChannelMarker* channelMarker);
|
|
|
|
void removeChannelMarker(ChannelMarker* channelMarker);
|
|
|
|
|
|
|
|
void setInputGUI(QWidget* gui);
|
2015-07-31 21:33:07 -04:00
|
|
|
const QTimer& getMasterTimer() const { return m_masterTimer; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
PGroup,
|
|
|
|
PItem
|
|
|
|
};
|
|
|
|
|
|
|
|
Ui::MainWindow* ui;
|
|
|
|
|
|
|
|
AudioDeviceInfo* m_audioDeviceInfo;
|
|
|
|
|
2015-08-17 20:47:14 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
Settings m_settings;
|
|
|
|
|
|
|
|
SpectrumVis* m_spectrumVis;
|
2015-07-28 17:54:17 -04:00
|
|
|
FileSink *m_fileSink;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
DSPEngine* m_dspEngine;
|
|
|
|
|
2015-07-31 21:33:07 -04:00
|
|
|
QTimer m_masterTimer;
|
2014-05-18 11:52:39 -04:00
|
|
|
QTimer m_statusTimer;
|
|
|
|
int m_lastEngineState;
|
|
|
|
|
|
|
|
QLabel* m_sampleRateWidget;
|
2015-07-28 17:54:17 -04:00
|
|
|
Indicator* m_recording;
|
2014-05-18 11:52:39 -04:00
|
|
|
Indicator* m_engineIdle;
|
|
|
|
Indicator* m_engineRunning;
|
|
|
|
Indicator* m_engineError;
|
|
|
|
|
|
|
|
bool m_startOsmoSDRUpdateAfterStop;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
|
|
|
|
void loadSettings();
|
2015-08-23 18:51:27 -04:00
|
|
|
void loadPresetSettings(const Preset* preset);
|
|
|
|
void savePresetSettings(Preset* preset);
|
2014-05-18 11:52:39 -04:00
|
|
|
void saveSettings();
|
|
|
|
|
|
|
|
void createStatusBar();
|
|
|
|
void closeEvent(QCloseEvent*);
|
|
|
|
void updateCenterFreqDisplay();
|
|
|
|
void updateSampleRate();
|
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();
|
|
|
|
|
|
|
|
private slots:
|
2015-08-08 22:09:05 -04:00
|
|
|
void handleDSPMessages();
|
2014-05-18 11:52:39 -04:00
|
|
|
void handleMessages();
|
|
|
|
void updateStatus();
|
|
|
|
void on_action_Start_triggered();
|
|
|
|
void on_action_Stop_triggered();
|
2015-07-28 17:54:17 -04:00
|
|
|
void on_action_Start_Recording_triggered();
|
|
|
|
void on_action_Stop_Recording_triggered();
|
2014-05-18 11:52:39 -04:00
|
|
|
void on_dcOffset_toggled(bool checked);
|
|
|
|
void on_iqImbalance_toggled(bool checked);
|
|
|
|
void on_action_View_Fullscreen_toggled(bool checked);
|
|
|
|
void on_presetSave_clicked();
|
2015-05-09 04:51:02 -04:00
|
|
|
void on_presetUpdate_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);
|
|
|
|
void on_action_Loaded_Plugins_triggered();
|
|
|
|
void on_action_Preferences_triggered();
|
|
|
|
void on_sampleSource_currentIndexChanged(int index);
|
|
|
|
void on_action_About_triggered();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_MAINWINDOW_H
|