Debian Codegraph @

source/captwin.h

raw
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2003-2013 Fons Adriaensen <[email protected]>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // ----------------------------------------------------------------------------
19
20
21 #ifndef __CAPTWIN_H
22 #define __CAPTWIN_H
23
24
25 #include <clxclient.h>
26 #include "extproc.h"
27 #include "shdata.h"
28 #include "filewin.h"
29
30
31 class Captwin : public X_window, public X_callback
32 {
33 public:
34
35 Captwin (X_window *parent, X_resman *resman, X_callback *callb, Filewin *filewin);
36 ~Captwin (void);
37
38 bool running (void) const { return _state != EXIT; }
39 void show (void);
40 void hide (void);
41 void stop (void);
42 void handle_time (void);
43 void set_sess (const char *name);
44 int get_rate (void) const { return _shdata ? _shdata->_fsamp : 0; }
45
46 private:
47
48 enum { INIT, STOP, TEST, CAPT, TERM, EXIT };
49
50 enum
51 {
52 XPOS = 130, YPOS = 130,
53 XDEF = 600, YDEF = 100,
54 };
55
56 enum { B_SSEL, B_ESEL, B_STOP, B_CAPT, B_TEST, B_TRIG, B_CPCH, B_PLCH = B_CPCH + 8 };
57
58 virtual void handle_event (XEvent *);
59 virtual void handle_callb (int, X_window *, XEvent *);
60
61 void xcmesg (XClientMessageEvent *);
62 void expose (XExposeEvent *);
63 void redraw (void);
64 void makewin (void);
65 void setstate (int);
66 void add_text (int xp, int yp, int xs, int ys, const char *text, int align);
67 void addgroup (U32 ftype);
68 void remgroup (void);
69 void askdata (X_textip *T);
70 void starttest (void);
71 void startcapt (void);
72 void file_load (void);
73
74 Atom _xatom;
75 X_callback *_callb;
76 Filewin *_filewin;
77 int _xs;
78 int _ys;
79 int _state;
80 int _count;
81 Extproc *_extproc;
82 Shdata *_shdata;
83
84 X_subwin *_wlevel;
85 X_textip *_grlab [8];
86 X_textip *_chlab [8];
87 X_ibutton *_chbut [8];
88 X_meter *_meter [8];
89 X_ibutton *_bsweep;
90 X_ibutton *_bequal;
91 X_textip *_tlevel;
92 X_textip *_tsweep;
93 X_textip *_tequal;
94
95 X_textip *_ttplay;
96 X_textip *_ttcapt;
97 X_textip *_tniter;
98 X_textip *_ttskip;
99 X_textip *_titcom;
100
101 X_tbutton *_bplay [8];
102 X_tbutton *_bstop;
103 X_tbutton *_bcapt;
104 X_tbutton *_btest;
105 X_tbutton *_btrig;
106
107 X_menuwin *_mtype;
108 int _chan0;
109
110 static X_menuwin_item _mtype_def [];
111 static U32 _ftype [];
112 };
113
114
115 #endif