File: editwin.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 (174 lines) | stat: -rw-r--r-- 4,460 bytes parent folder | download
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
    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 __EDITWIN_H
#define __EDITWIN_H


#include "clxclient.h"
#include "multislider.h"
#include "functionwin.h"
#include "addsynth.h"
#include "rankwave.h"


class H_scale : public X_window
{
public:

    H_scale (X_window *parent, X_callback *callb, int xp, int yp);
    int get_ind (void) { return _i; }

private:

    void handle_event (XEvent *E);
    void redraw (void);

    X_callback *_callb;
    int         _i;
};



class N_scale : public X_window
{
public:

    N_scale (X_window *parent, X_callback *callb, int xp, int yp);
    int get_ind (void) { return _i; }

private:

    void handle_event (XEvent *E);
    void redraw (void);

    X_callback *_callb;
    int         _i;
};



class Editwin : public X_window, public X_callback
{
public:

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

    void handle_mesg (ITC_mesg *);
    void handle_time (void);

    void init (Addsynth *);
    void lock (int);
    void show (void) { x_mapraised (); }
    void hide (void) { x_unmap (); }
    void sdir (const char *sdir) { _sdir = sdir; }
    void wdir (const char *wdir) { _wdir = wdir; }
 
private:

    enum {
	    TAB_GEN, TAB_LEV, TAB_ATT, TAB_RAN,
            B_APPL, B_MOFF, B_SAVE, B_LOAD, B_LNEW, B_PEDAL, B_PFTB, N_PFTB = 11
         };
 
    virtual void handle_event (XEvent *xe);
    virtual void handle_callb (int, X_window*, _XEvent*);

    void handle_xmesg (XClientMessageEvent *E);
    void set_func (N_func *D, Functionwin *F, int k);
    void set_harm (HN_func *D, Multislider *M, Functionwin *F, int k, int h);
    void set_note (HN_func *D, Multislider *M, Functionwin *F, int n);
    void msl_update (HN_func *D, Multislider *M, Functionwin *F, int k, int d, int h, int n);
    void fun_update (HN_func *D, Multislider *M, Functionwin *F, int d, int h, int n);
    void fun_update (N_func *D, Functionwin *F, int d);
    void add_text (X_window *win, int xp, int yp, int xs, int ys, const char *text, X_textln_style *style);
    void set_tab (int);
    void set_pft (int);
    void load (const char *sdir);
    void save (const char *sdir);

    Atom        _atom;
    X_callback *_callb;
    X_resman   *_xresm;
    int         _xs;
    int         _ys;
    int         _lock;    
    const char *_sdir;
    const char *_wdir;
    Addsynth   *_edit;

    X_button   *_tabb [4];
    X_window   *_tabw [4];
    int         _tabh [4];
    int         _ctab;
    X_button   *_appl;
    X_button   *_moff;

    X_textip   *_file;
    X_textip   *_name;
    X_textip   *_mnem;
    X_textip   *_copy;
    X_textip   *_comm;
    X_button   *_save;
    X_button   *_load;
    X_button   *_lnew;
    X_button   *_pedal;
    X_button   *_pftb [N_PFTB];    
    int         _cpft;

    Functionwin *_vol_fun;
    N_scale     *_vol_nsc; 
    Functionwin *_tun_fun;
    N_scale     *_tun_nsc; 
    Functionwin *_atu_fun;
    N_scale     *_atu_nsc; 
    Functionwin *_dtu_fun;
    N_scale     *_dtu_nsc; 

    Multislider *_lev_msl;
    H_scale     *_lev_hsc; 
    Functionwin *_lev_fun;
    N_scale     *_lev_nsc; 
    int          _lev_harm;
    int          _lev_note;

    Multislider *_att_msl;
    H_scale     *_att_hsc; 
    Multislider *_atp_msl;
    H_scale     *_atp_hsc; 
    Functionwin *_att_fun;
    N_scale     *_att_nsc; 
    int          _att_harm;
    int          _att_note;

    Multislider *_ran_msl;
    H_scale     *_ran_hsc; 
    Functionwin *_ran_fun;
    N_scale     *_ran_nsc; 
    int          _ran_harm;
    int          _ran_note;

    static const char  *_pftb_text [N_PFTB]; 
    static const char   _fn [N_PFTB];
    static const char   _fd [N_PFTB];
};


#endif