File: instrwin.h

package info (click to toggle)
aeolus 0.8.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 492 kB
  • ctags: 1,426
  • sloc: cpp: 8,564; makefile: 59
file content (103 lines) | stat: -rw-r--r-- 2,903 bytes parent folder | download | duplicates (3)
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
/*
    Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
    
    This program 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.

    This program 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 this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/


#ifndef __INSTRWIN_H
#define __INSTRWIN_H


#include <clxclient.h>
#include "messages.h"


class Divis
{
public:

    X_hslider  *_slid [3];
};


class Instrwin : public X_window, public X_callback
{
public:

    Instrwin (X_window *parent, X_callback *callb, int xp, int yp, X_resman *xresm);
    ~Instrwin (void);

    void setup (M_ifc_init *);
    void set_dipar (M_ifc_dipar *M);
    void set_tuning (M_ifc_retune *M);

    int   divis (void) const { return _divis; }
    int   parid (void) const { return _parid; }
    float value (void) const { return _value; }
    bool  final (void) const { return _final; }
    float freq (void) const { return _freq; }
    int   temp (void) const { return _temp; }

private:

    enum { XSIZE = 840, YSIZE = 130 };

    enum
    {
        TEMP_DEC, TEMP_INC, FREQ_DEC, FREQ_INC, TUNE_EXE, TUNE_CAN,
        NDIVIS = 8, DIVIS_BIT0 = 8, DIVIS_STEP = (1 << DIVIS_BIT0), DIVIS_MASK = (DIVIS_STEP - 1),
        NTEMPE = 16
    }; 
           

    virtual void handle_event (XEvent *);
    virtual void handle_callb (int, X_window *, XEvent *);

    void handle_xmesg (XClientMessageEvent *);
    void show_tuning (int s);
    void incdec_temp (int d);
    void incdec_freq (int d);
    void add_text (int xp, int yp, int xs, int ys, const char *text, X_textln_style *style, int align);

    Atom            _atom;
    X_callback     *_callb;
    X_resman       *_xresm;
    int             _xp, _yp;
    X_button       *_dec_freq;
    X_button       *_inc_freq;
    X_button       *_dec_temp;
    X_button       *_inc_temp;
    X_button       *_tune_exe;
    X_button       *_tune_can;
    X_textip       *_freq_txt;
    X_textip       *_temp_txt;
    X_slider       *_trem0_freq;
    X_slider       *_trem0_ampl;
    X_slider       *_trem1_freq;
    X_slider       *_trem1_ampl;
    Divis           _divisd [NDIVIS];
    int             _divis;
    int             _parid;
    float           _value;
    bool            _final;
    int             _ntempe;
    const char     *_temped [NTEMPE];
    float           _freq, _freq1;
    int             _temp, _temp1;
};


#endif