forked from gqrx-sdr/gqrx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
161 lines (132 loc) · 4.59 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* -*- c++ -*- */
/*
* Copyright 2011-2012 Alexandru Csete OZ9AEC.
* Copyright 2012 Mathis Schmieder <[email protected]>
*
* Gqrx 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; either version 3, or (at your option)
* any later version.
*
* Gqrx 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 for more details.
*
* You should have received a copy of the GNU General Public License
* along with Gqrx; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QPointer>
#include <QSettings>
#include <QString>
#include <QTimer>
#include "qtgui/dockrxopt.h"
#include "qtgui/dockaudio.h"
#include "qtgui/dockfcdctl.h"
#include "qtgui/dockiqplayer.h"
#include "qtgui/dockfft.h"
#include "qtgui/afsk1200win.h"
#include "qtgui/bpsk1000win.h"
#include <receiver.h>
namespace Ui {
class MainWindow; /*! The main window UI */
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(const QString cfgfile="default.conf", QWidget *parent = 0);
~MainWindow();
bool loadConfig(const QString cfgfile);
bool saveConfig(const QString cfgfile);
signals:
void configChanged(QSettings *settings); /*!< New configuration has been loaded. */
public slots:
void setNewFrequency(qint64 freq);
private:
QPointer<QSettings> m_settings; /*!< Application wide settings. */
QString m_cfg_dir; /*!< Default config dir, e.g. XDG_CONFIG_HOME. */
QString m_last_dir;
qint64 d_lnb_lo; /* LNB LO in Hz. */
enum receiver::filter_shape d_filter_shape;
std::complex<float>* d_fftData;
double *d_realFftData;
//double *d_audioFttData;
Ui::MainWindow *ui;
/* dock widgets */
DockRxOpt *uiDockRxOpt;
DockAudio *uiDockAudio;
DockFcdCtl *uiDockFcdCtl;
//DockIqPlayer *uiDockIqPlay;
DockFft *uiDockFft;
/* data decoders */
Afsk1200Win *dec_afsk1200;
Bpsk1000Win *dec_bpsk1000;
QTimer *dec_timer;
QTimer *meter_timer;
QTimer *iq_fft_timer;
QTimer *audio_fft_timer;
receiver *rx;
private slots:
/* rf */
void setLnbLo(double freq_mhz);
/* baseband receiver */
void setFilterOffset(qint64 freq_hz);
void setRfGain(float gain);
void setRfGainMode(int gain_mode);
void setFreqCorr(int ppm);
void setDcCorr(double dci, double dcq);
void setIqCorr(double gain, double phase);
void selectDemod(int index);
void setFmMaxdev(float max_dev);
void setFmEmph(double tau);
void setAmDcrStatus(bool enabled);
void setAgcOn(bool agc_on);
void setAgcHang(bool use_hang);
void setAgcThreshold(int threshold);
void setAgcSlope(int factor);
void setAgcDecay(int msec);
void setAgcGain(int gain);
void setNoiseBlanker(int nbid, bool on, float threshold);
void setSqlLevel(double level_db);
void setAudioGain(float gain);
/* audio recording and playback */
void startAudioRec(const QString filename);
void stopAudioRec();
void startAudioPlayback(const QString filename);
void stopAudioPlayback();
void toggleIqPlayback(bool play, const QString filename);
/* FFT settings */
void setIqFftSize(int size);
void setIqFftRate(int fps);
void setIqFftSplit(int pct_wf);
void setAudioFftRate(int fps);
void on_plotter_NewDemodFreq(qint64 freq, qint64 delta); /*! New demod freq (aka. filter offset). */
void on_plotter_NewFilterFreq(int low, int high); /*! New filter width */
/* menu and toolbar actions */
void on_actionDSP_triggered(bool checked);
void on_actionLoadSettings_triggered();
void on_actionSaveSettings_triggered();
void on_actionIqRec_triggered(bool checked);
void on_actionFullScreen_triggered(bool checked);
void on_actionIODevices_triggered();
void on_actionAFSK1200_triggered();
void on_actionBPSK1000_triggered();
void on_actionUserGroup_triggered();
void on_actionAbout_triggered();
void on_actionAboutQt_triggered();
/* window close signals */
void afsk1200win_closed();
void bpsk1000win_closed();
/* cyclic processing */
void decoderTimeout();
void meterTimeout();
void iqFftTimeout();
void audioFftTimeout();
};
#endif // MAINWINDOW_H