~ubuntu-branches/ubuntu/wily/japa/wily

« back to all changes in this revision

Viewing changes to source/gobjects.h

  • Committer: Package Import Robot
  • Author(s): Jaromír Mikeš
  • Date: 2013-08-07 02:19:42 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130807021942-1rdfsndm8ga103f5
Tags: 0.8.4-1
* New upstream release.
* Fixed URL in watch file.
* Fixed URL and upstream email.
* Fixed homepage URL.
* Set dh/compat 9
* Tighten build-dep on libclthreads.
* Tighten build-dep on libclxclient.
* Bump standards.
* Fix VCS canonical URLs.
* Set Priority optional.
* Don't sign tags.
* Update copyright file.
* Added Keywords entry to desktop files.
* Tune gitignore file to handle rather dir.
* Update man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -------------------------------------------------------------------------
 
2
//
 
3
//  Copyright (C) 2004-2010 Fons Adriaensen <fons@linuxaudio.org>
 
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 2 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, write to the Free Software
 
17
//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
//
 
19
// -------------------------------------------------------------------------
 
20
 
 
21
 
 
22
#ifndef __GOBJECTS_H
 
23
#define __GOBJECTS_H
 
24
 
 
25
 
 
26
#include "styles.h"
 
27
 
 
28
 
 
29
enum 
 
30
{
 
31
    CB_INPUT,
 
32
    CB_GAIN,
 
33
    CB_AUTO,
 
34
    CB_LINK,
 
35
    CB_PEAK,
 
36
    CB_MEMX,
 
37
    CB_MEMY,
 
38
    CB_RESOL,
 
39
    CB_WFACT,
 
40
    CB_SPEED,
 
41
    CB_TRACEA,
 
42
    CB_TRACEB,
 
43
    CB_TRACEM,
 
44
    CB_ASCALE,
 
45
    CB_FSCALE,
 
46
    CB_ARESPF
 
47
};
 
48
 
 
49
 
 
50
class GUI_select : public X_callback
 
51
{
 
52
public:
 
53
 
 
54
    void init (X_window *W, X_callback *C, int k, int x, int y,
 
55
               const char *label, const char **texts);
 
56
    int  get_state (void) const { return _state; }
 
57
    void set_state (int state) { _tstat->set_text (_texts [_state = state]); }
 
58
 
 
59
    virtual ~GUI_select (void) {}
 
60
 
 
61
private:
 
62
 
 
63
    virtual void handle_callb (int k, X_window *W, _XEvent *E);
 
64
 
 
65
    X_callback  *_callb;
 
66
    X_textip    *_tstat;
 
67
    int          _cbnum;
 
68
    int          _state;
 
69
    const char **_texts;
 
70
};
 
71
 
 
72
 
 
73
class GUI_bgroup : public X_callback
 
74
{
 
75
public:
 
76
 
 
77
    void init (X_window *W, X_callback *C, X_button_style *B, int k, int x, int y, 
 
78
               const char *label, const char **texts);
 
79
    int  get_state (void) const { return _state; }
 
80
    void set_state (int state);
 
81
 
 
82
    virtual ~GUI_bgroup (void) {}
 
83
 
 
84
private:
 
85
 
 
86
    virtual void handle_callb (int k, X_window *W, _XEvent *E);
 
87
 
 
88
    X_callback  *_callb;
 
89
    X_button    *_butt [3];
 
90
    int          _cbnum;
 
91
    int          _state;
 
92
};
 
93
 
 
94
 
 
95
class GUI_input : public X_callback
 
96
{
 
97
public:
 
98
 
 
99
    void init (X_window *W, X_callback *C, int k, int x0, int y0);    
 
100
    int   get_input (void) const { return _input; }
 
101
    float get_gain  (void) const { return _gain; }
 
102
    bool  get_link  (void) const { return _blink ? _blink->stat () : 0; }
 
103
    void  set_gain (float g);
 
104
 
 
105
    virtual ~GUI_input (void) {}
 
106
 
 
107
private:
 
108
 
 
109
    enum { INP1, INP2, INP3, INP4, DEC, INC, AUTO, LINK };
 
110
 
 
111
    virtual void handle_callb (int k, X_window *W, _XEvent *E);
 
112
    
 
113
    X_callback *_callb;
 
114
    X_button   *_binp [4];
 
115
    X_textip   *_tgain;
 
116
    X_button   *_blink;
 
117
    int         _group;
 
118
    int         _input;
 
119
    float       _gain;
 
120
};
 
121
 
 
122
 
 
123
class GUI_analys
 
124
{
 
125
public:
 
126
 
 
127
    void init (X_window *W, X_callback *C, int x, int y);    
 
128
    int get_resol (void) const { return _resol.get_state (); } 
 
129
    int get_wfact (void) const { return _wfact.get_state (); } 
 
130
    int get_speed (void) const { return _speed.get_state (); } 
 
131
 
 
132
private:
 
133
 
 
134
    GUI_select  _resol;
 
135
    GUI_select  _wfact;
 
136
    GUI_select  _speed;    
 
137
 
 
138
    static const char *_resol_texts [];
 
139
    static const char *_wfact_texts [];
 
140
    static const char *_speed_texts [];
 
141
};
 
142
 
 
143
 
 
144
class GUI_memory : public X_callback
 
145
{
 
146
public:
 
147
 
 
148
    void init (X_window *W, X_callback *C, int k, int x, int y);    
 
149
    bool get_peak (void) const { return _peak; }
 
150
 
 
151
    virtual ~GUI_memory (void) {}
 
152
 
 
153
private:
 
154
 
 
155
    virtual void handle_callb (int k, X_window *W, _XEvent *E);
 
156
    
 
157
    X_callback *_callb;
 
158
    int         _group;
 
159
    bool        _peak; 
 
160
};
 
161
 
 
162
 
 
163
class GUI_traces
 
164
{
 
165
public:
 
166
 
 
167
    void init (X_window *W, X_callback *C, int x, int y);    
 
168
    int get_traceA (void) const { return _traceA.get_state (); } 
 
169
    int get_traceB (void) const { return _traceB.get_state (); } 
 
170
    int get_traceM (void) const { return _traceM.get_state (); } 
 
171
 
 
172
private:
 
173
 
 
174
    GUI_bgroup  _traceA;
 
175
    GUI_bgroup  _traceB;
 
176
    GUI_bgroup  _traceM;
 
177
 
 
178
    static const char *_traceA_texts [];
 
179
    static const char *_traceB_texts [];
 
180
    static const char *_traceM_texts [];
 
181
};
 
182
 
 
183
 
 
184
class GUI_display
 
185
{
 
186
public:
 
187
 
 
188
    void init (X_window *W, X_callback *C, int x, int y);    
 
189
    int get_ascale (void) const { return _ascale.get_state (); } 
 
190
    int get_fscale (void) const { return _fscale.get_state (); } 
 
191
    int get_arespf (void) const { return _arespf.get_state (); } 
 
192
 
 
193
private:
 
194
 
 
195
    GUI_select  _ascale;
 
196
    GUI_select  _fscale;
 
197
    GUI_select  _arespf;
 
198
 
 
199
    static const char *_ascale_texts [];
 
200
    static const char *_fscale_texts [];
 
201
    static const char *_arespf_texts [];
 
202
};
 
203
 
 
204
 
 
205
#endif
 
206