-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathradio.h
158 lines (149 loc) · 4.88 KB
/
radio.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
#
/*
* Copyright (C) 2018
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of sw radio
*
* swradio 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 2 of the License, or
* (at your option) any later version.
*
* swradio 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 swradio; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SW_RADIO__
#define __SW_RADIO__
#include <QMainWindow>
#include <QTimer>
#include <QWheelEvent>
#include <QLineEdit>
#include <QTimer>
#include <sndfile.h>
#include "ui_newradio.h"
#include "radio-constants.h"
#include "ringbuffer.h"
#include "decimator.h"
#include "fft-filters.h"
#include "shifter.h"
#include "s-meter.h"
#include "agchandler.h"
class deviceHandler;
class virtualDecoder;
class downConverter;
class upConverter;
class QSettings;
class fftScope;
class fft_scope;
class audioScope;
class audioSink;
class keyPad;
class programList;
class fftFilter;
class bandPlan;
class RadioInterface:public QMainWindow,
private Ui_MainWindow {
Q_OBJECT
public:
RadioInterface (QSettings *sI,
QString stationList,
bandPlan *my_bandPlan,
int inputRate,
int decoderRate,
QWidget *parent = NULL);
~RadioInterface ();
int32_t tunedFrequency ();
private:
struct band {
int32_t lowF;
int32_t highF;
int32_t currentOffset;
}theBand;
QSettings *settings;
bandPlan *my_bandPlan;
int32_t inputRate;
int32_t decoderRate;
int32_t scopeWidth;
int32_t workingRate;
int32_t audioRate;
int16_t displaySize;
int16_t spectrumSize;
double *displayBuffer;
audioSink *audioHandler;
int16_t *outTable;
deviceHandler *theDevice;
virtualDecoder *theDecoder;
RingBuffer<std::complex<float> > *inputData;
RingBuffer<std::complex<float> > *audioData;
fftScope *hfScope;
fftScope *lfScope;
audioScope *showAudio;
shifter hfShifter;
fftFilter hfFilter;
fftFilter lfFilter;
agcHandler agc;
decimator theDecimator;
upConverter *theUpConverter;
int16_t mouseIncrement;
int16_t delayCount;
//
SNDFILE *dumpfilePointer;
QTimer secondsTimer;
void setupSoundOut (QComboBox *streamOutSelector,
audioSink *our_audioSink,
int32_t cardRate,
int16_t *table);
keyPad *mykeyPad;
programList *myList;
QLineEdit *myLine;
void adjust (int32_t);
int32_t theFrequency;
private slots:
deviceHandler *setDevice (
RingBuffer<std::complex<float>> *);
void adjustFrequency_khz (int);
void handle_myLine ();
void set_hfscopeLevel (int);
void set_lfscopeLevel (int);
virtualDecoder *selectDecoder (const QString &);
void setStreamOutSelector (int idx);
void handle_freqButton ();
void wheelEvent (QWheelEvent *);
void set_mouseIncrement (int);
void setBand (const QString &);
void set_inMiddle (void);
void set_freqSave (void);
void handle_quitButton (void);
void set_agcThresholdSlider (int);
void set_AGCMode (const QString &);
void switch_hfViewMode (int);
void switch_lfViewMode (int);
void updateTime ();
void set_dumpButton ();
void closeEvent (QCloseEvent *event);
public slots:
void sampleHandler (int amount);
void processAudio (int, int);
void setDetectorMarker (int);
void setFrequency (quint64);
void adjustFrequency_hz (int);
#ifdef HAVE_EXTIO
// and for the extio handling
void set_ExtFrequency (int);
void set_ExtLO (int);
void set_lockLO (void);
void set_unlockLO (void);
void set_stopHW (void);
void set_startHW (void);
#endif
};
#endif