-
Notifications
You must be signed in to change notification settings - Fork 10
/
common.h
151 lines (134 loc) · 3.33 KB
/
common.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
#ifndef _COMMON_H_
#define _COMMON_H_
#define MINSLANT 30
#define MAXSLANT 150
#define BUFLEN 4096
#define SYNCPIXLEN 1.5e-3
extern gboolean Abort;
extern gboolean Adaptive;
extern gboolean *HasSync;
extern gboolean ManualActivated;
extern gboolean ManualResync;
extern guchar *StoredLum;
extern pthread_t thread1;
extern guchar VISmap[];
typedef struct _FFTStuff FFTStuff;
struct _FFTStuff {
double *in;
fftw_complex *out;
fftw_plan Plan1024;
fftw_plan Plan2048;
};
extern FFTStuff fft;
typedef struct _PcmData PcmData;
struct _PcmData {
snd_pcm_t *handle;
gint16 *Buffer;
int WindowPtr;
gboolean BufferDrop;
};
extern PcmData pcm;
typedef struct _GuiObjs GuiObjs;
struct _GuiObjs {
GtkWidget *button_abort;
GtkWidget *button_browse;
GtkWidget *button_clear;
GtkWidget *button_start;
GtkWidget *combo_card;
GtkWidget *combo_mode;
GtkWidget *entry_picdir;
GtkWidget *eventbox_img;
GtkWidget *frame_manual;
GtkWidget *frame_slant;
GtkWidget *grid_vu;
GtkWidget *iconview;
GtkWidget *image_devstatus;
GtkWidget *image_pwr;
GtkWidget *image_rx;
GtkWidget *image_snr;
GtkWidget *label_fskid;
GtkWidget *label_lastmode;
GtkWidget *label_utc;
GtkWidget *menuitem_about;
GtkWidget *menuitem_quit;
GtkWidget *spin_shift;
GtkWidget *statusbar;
GtkWidget *tog_adapt;
GtkWidget *tog_fsk;
GtkWidget *tog_rx;
GtkWidget *tog_save;
GtkWidget *tog_setedge;
GtkWidget *tog_slant;
GtkWidget *window_about;
GtkWidget *window_main;
};
extern GuiObjs gui;
extern GdkPixbuf *pixbuf_PWR;
extern GdkPixbuf *pixbuf_SNR;
extern GdkPixbuf *pixbuf_rx;
extern GdkPixbuf *pixbuf_disp;
extern GtkListStore *savedstore;
extern GKeyFile *config;
typedef struct _PicMeta PicMeta;
struct _PicMeta {
gshort HedrShift;
guchar Mode;
double Rate;
int Skip;
GdkPixbuf *thumbbuf;
char timestr[40];
};
extern PicMeta CurrentPic;
// SSTV modes
enum {
UNKNOWN=0,
M1, M2, M3, M4,
S1, S2, SDX,
R72, R36, R24, R24BW, R12BW, R8BW,
PD50, PD90, PD120, PD160, PD180, PD240, PD290,
P3, P5, P7,
W2120, W2180
};
// Color encodings
enum {
GBR, RGB, YUV, BW
};
typedef struct ModeSpec {
char *Name;
char *ShortName;
double SyncTime;
double PorchTime;
double SeptrTime;
double PixelTime;
double LineTime;
gushort ImgWidth;
gushort NumLines;
guchar LineHeight;
guchar ColorEnc;
} _ModeSpec;
extern _ModeSpec ModeSpec[];
double power (fftw_complex coeff);
guchar clip (double a);
void createGUI ();
double deg2rad (double Deg);
double FindSync (guchar Mode, double Rate, int *Skip);
void GetFSK (char *dest);
gboolean GetVideo (guchar Mode, double Rate, int Skip, gboolean Redraw);
guchar GetVIS ();
guint GetBin (double Freq, guint FFTLen);
int initPcmDevice ();
void *Listen ();
void populateDeviceList ();
void readPcm (gint numsamples);
void saveCurrentPic();
void setVU (double *Power, int FFTLen, int WinIdx, gboolean ShowWin);
void evt_AbortRx ();
void evt_changeDevices ();
void evt_chooseDir ();
void evt_clearPix ();
void evt_clickimg ();
void evt_deletewindow ();
void evt_GetAdaptive ();
void evt_ManualStart ();
void evt_show_about ();
#endif