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

« back to all changes in this revision

Viewing changes to editwin.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) 2003 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 __EDITWIN_H
 
21
#define __EDITWIN_H
 
22
 
 
23
 
 
24
#include "clxclient.h"
 
25
#include "multislider.h"
 
26
#include "functionwin.h"
 
27
#include "addsynth.h"
 
28
#include "rankwave.h"
 
29
 
 
30
 
 
31
class H_scale : public X_window
 
32
{
 
33
public:
 
34
 
 
35
    H_scale (X_window *parent, X_callback *callb, int xp, int yp);
 
36
    int get_ind (void) { return _i; }
 
37
 
 
38
private:
 
39
 
 
40
    void handle_event (XEvent *E);
 
41
    void redraw (void);
 
42
 
 
43
    X_callback *_callb;
 
44
    int         _i;
 
45
};
 
46
 
 
47
 
 
48
 
 
49
class N_scale : public X_window
 
50
{
 
51
public:
 
52
 
 
53
    N_scale (X_window *parent, X_callback *callb, int xp, int yp);
 
54
    int get_ind (void) { return _i; }
 
55
 
 
56
private:
 
57
 
 
58
    void handle_event (XEvent *E);
 
59
    void redraw (void);
 
60
 
 
61
    X_callback *_callb;
 
62
    int         _i;
 
63
};
 
64
 
 
65
 
 
66
 
 
67
class Editwin : public X_window, public X_callback
 
68
{
 
69
public:
 
70
 
 
71
    Editwin (X_window *parent, X_callback *callb, int xp, int yp, X_resman *xresm);
 
72
    ~Editwin (void);
 
73
 
 
74
    void handle_mesg (ITC_mesg *);
 
75
    void handle_time (void);
 
76
 
 
77
    void init (Addsynth *);
 
78
    void lock (int);
 
79
    void show (void) { x_mapraised (); }
 
80
    void hide (void) { x_unmap (); }
 
81
    void sdir (const char *sdir) { _sdir = sdir; }
 
82
    void wdir (const char *wdir) { _wdir = wdir; }
 
83
 
 
84
private:
 
85
 
 
86
    enum {
 
87
            TAB_GEN, TAB_LEV, TAB_ATT, TAB_RAN,
 
88
            B_APPL, B_MOFF, B_SAVE, B_LOAD, B_LNEW, B_PEDAL, B_PFTB, N_PFTB = 11
 
89
         };
 
90
 
 
91
    virtual void handle_event (XEvent *xe);
 
92
    virtual void handle_callb (int, X_window*, _XEvent*);
 
93
 
 
94
    void handle_xmesg (XClientMessageEvent *E);
 
95
    void set_func (N_func *D, Functionwin *F, int k);
 
96
    void set_harm (HN_func *D, Multislider *M, Functionwin *F, int k, int h);
 
97
    void set_note (HN_func *D, Multislider *M, Functionwin *F, int n);
 
98
    void msl_update (HN_func *D, Multislider *M, Functionwin *F, int k, int d, int h, int n);
 
99
    void fun_update (HN_func *D, Multislider *M, Functionwin *F, int d, int h, int n);
 
100
    void fun_update (N_func *D, Functionwin *F, int d);
 
101
    void add_text (X_window *win, int xp, int yp, int xs, int ys, const char *text, X_textln_style *style);
 
102
    void set_tab (int);
 
103
    void set_pft (int);
 
104
    void load (const char *sdir);
 
105
    void save (const char *sdir);
 
106
 
 
107
    Atom        _atom;
 
108
    X_callback *_callb;
 
109
    X_resman   *_xresm;
 
110
    int         _xs;
 
111
    int         _ys;
 
112
    int         _lock;    
 
113
    const char *_sdir;
 
114
    const char *_wdir;
 
115
    Addsynth   *_edit;
 
116
 
 
117
    X_button   *_tabb [4];
 
118
    X_window   *_tabw [4];
 
119
    int         _tabh [4];
 
120
    int         _ctab;
 
121
    X_button   *_appl;
 
122
    X_button   *_moff;
 
123
 
 
124
    X_textip   *_file;
 
125
    X_textip   *_name;
 
126
    X_textip   *_mnem;
 
127
    X_textip   *_copy;
 
128
    X_textip   *_comm;
 
129
    X_button   *_save;
 
130
    X_button   *_load;
 
131
    X_button   *_lnew;
 
132
    X_button   *_pedal;
 
133
    X_button   *_pftb [N_PFTB];    
 
134
    int         _cpft;
 
135
 
 
136
    Functionwin *_vol_fun;
 
137
    N_scale     *_vol_nsc; 
 
138
    Functionwin *_tun_fun;
 
139
    N_scale     *_tun_nsc; 
 
140
    Functionwin *_atu_fun;
 
141
    N_scale     *_atu_nsc; 
 
142
    Functionwin *_dtu_fun;
 
143
    N_scale     *_dtu_nsc; 
 
144
 
 
145
    Multislider *_lev_msl;
 
146
    H_scale     *_lev_hsc; 
 
147
    Functionwin *_lev_fun;
 
148
    N_scale     *_lev_nsc; 
 
149
    int          _lev_harm;
 
150
    int          _lev_note;
 
151
 
 
152
    Multislider *_att_msl;
 
153
    H_scale     *_att_hsc; 
 
154
    Multislider *_atp_msl;
 
155
    H_scale     *_atp_hsc; 
 
156
    Functionwin *_att_fun;
 
157
    N_scale     *_att_nsc; 
 
158
    int          _att_harm;
 
159
    int          _att_note;
 
160
 
 
161
    Multislider *_ran_msl;
 
162
    H_scale     *_ran_hsc; 
 
163
    Functionwin *_ran_fun;
 
164
    N_scale     *_ran_nsc; 
 
165
    int          _ran_harm;
 
166
    int          _ran_note;
 
167
 
 
168
    static const char  *_pftb_text [N_PFTB]; 
 
169
    static const char   _fn [N_PFTB];
 
170
    static const char   _fd [N_PFTB];
 
171
};
 
172
 
 
173
 
 
174
#endif