~ubuntu-branches/ubuntu/intrepid/aeolus/intrepid

« back to all changes in this revision

Viewing changes to instrwin.h

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2007-05-14 22:18:54 UTC
  • Revision ID: james.westby@ubuntu.com-20070514221854-274rj6fqs5tegu7q
Tags: upstream-0.6.6+2
ImportĀ upstreamĀ versionĀ 0.6.6+2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2005 Fons Adriaensen <fons.adriaensen@skynet.be>
 
3
    
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
*/
 
18
 
 
19
 
 
20
#ifndef __INSTRWIN_H
 
21
#define __INSTRWIN_H
 
22
 
 
23
 
 
24
#include <clxclient.h>
 
25
#include "messages.h"
 
26
 
 
27
 
 
28
class Divis
 
29
{
 
30
public:
 
31
 
 
32
    X_hslider  *_slid [3];
 
33
};
 
34
 
 
35
 
 
36
class Instrwin : public X_window, public X_callback
 
37
{
 
38
public:
 
39
 
 
40
    Instrwin (X_window *parent, X_callback *callb, int xp, int yp, X_resman *xresm);
 
41
    ~Instrwin (void);
 
42
 
 
43
    void setup (M_ifc_init *);
 
44
    void set_dipar (M_ifc_dipar *M);
 
45
    void set_tuning (M_ifc_retune *M);
 
46
 
 
47
    int   divis (void) const { return _divis; }
 
48
    int   parid (void) const { return _parid; }
 
49
    float value (void) const { return _value; }
 
50
    bool  final (void) const { return _final; }
 
51
    float freq (void) const { return _freq; }
 
52
    int   temp (void) const { return _temp; }
 
53
 
 
54
private:
 
55
 
 
56
    enum { XSIZE = 840, YSIZE = 130 };
 
57
 
 
58
    enum
 
59
    {
 
60
        TEMP_DEC, TEMP_INC, FREQ_DEC, FREQ_INC, TUNE_EXE, TUNE_CAN,
 
61
        NDIVIS = 8, DIVIS_BIT0 = 8, DIVIS_STEP = (1 << DIVIS_BIT0), DIVIS_MASK = (DIVIS_STEP - 1),
 
62
        NTEMPE = 16
 
63
    }; 
 
64
           
 
65
 
 
66
    virtual void handle_event (XEvent *);
 
67
    virtual void handle_callb (int, X_window *, XEvent *);
 
68
 
 
69
    void handle_xmesg (XClientMessageEvent *);
 
70
    void show_tuning (int s);
 
71
    void incdec_temp (int d);
 
72
    void incdec_freq (int d);
 
73
    void add_text (int xp, int yp, int xs, int ys, const char *text, X_textln_style *style, int align);
 
74
 
 
75
    Atom            _atom;
 
76
    X_callback     *_callb;
 
77
    X_resman       *_xresm;
 
78
    int             _xp, _yp;
 
79
    X_button       *_dec_freq;
 
80
    X_button       *_inc_freq;
 
81
    X_button       *_dec_temp;
 
82
    X_button       *_inc_temp;
 
83
    X_button       *_tune_exe;
 
84
    X_button       *_tune_can;
 
85
    X_textip       *_freq_txt;
 
86
    X_textip       *_temp_txt;
 
87
    X_slider       *_trem0_freq;
 
88
    X_slider       *_trem0_ampl;
 
89
    X_slider       *_trem1_freq;
 
90
    X_slider       *_trem1_ampl;
 
91
    Divis           _divisd [NDIVIS];
 
92
    int             _divis;
 
93
    int             _parid;
 
94
    float           _value;
 
95
    bool            _final;
 
96
    int             _ntempe;
 
97
    const char     *_temped [NTEMPE];
 
98
    float           _freq, _freq1;
 
99
    int             _temp, _temp1;
 
100
};
 
101
 
 
102
 
 
103
#endif