summaryrefslogtreecommitdiffstats
path: root/kmid/channel4d.cpp
blob: 4f47c3aec68e53962fda17d719507e61e1b390fb (plain)
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/**************************************************************************

    channel4d.cpp  - KMidChannel4D widget, with 3D look and filled
    Copyright (C) 1998  Antonio Larrosa Jimenez

    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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

    Send comments and bug fixes to [email protected]
    or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain

***************************************************************************/

#include "channel4d.h"
#include <tqpainter.h>

KMidChannel4D::KMidChannel4D  (int chn,TQWidget *parent) : KMidChannel(chn,parent)
{
    brushR = new TQBrush (red);
    brushW = new TQBrush (white);
    brushB = new TQBrush (black);
    penR   = new TQPen   (red);
}


void KMidChannel4D::drawDo(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    
    qpaint->drawLine(x,KEYBOARDY+43,x+6,KEYBOARDY+43);
    qpaint->drawLine(x,KEYBOARDY+44,x+6,KEYBOARDY+44);
    
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x-1,KEYBOARDY+45,x+8,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+7,KEYBOARDY+28,x+7,KEYBOARDY+42);

    qpaint->fillRect(x,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x,KEYBOARDY+1,5,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+5,KEYBOARDY+27);
}
void KMidChannel4D::drawDo__(TQPainter *qpaint,int x,int p)
{
    qpaint->fillRect(x+6,KEYBOARDY+1,5,26,((p)?*brushR:*brushB));

    if (!p)
    {
        qpaint->setPen(*penW);
        qpaint->drawLine(x+6,KEYBOARDY+2,x+6,KEYBOARDY+25);
        qpaint->drawLine(x+7,KEYBOARDY+25,x+11,KEYBOARDY+25);
    };
    
    qpaint->setPen(p?(*penW):(*penB));
    qpaint->drawLine(x+11,KEYBOARDY+1,x+11,KEYBOARDY+27);
    qpaint->drawPoint(x+10,KEYBOARDY+27);


}
void KMidChannel4D::drawRe(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+9,KEYBOARDY+43,x+15,KEYBOARDY+43);
    qpaint->drawLine(x+9,KEYBOARDY+44,x+15,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+8,KEYBOARDY+45,x+17,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+16,KEYBOARDY+28,x+16,KEYBOARDY+42);

    qpaint->fillRect(x+9,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+12,KEYBOARDY+1,2,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+11,KEYBOARDY+27);
    qpaint->drawPoint(x+14,KEYBOARDY+27);

}

void KMidChannel4D::drawRe__(TQPainter *qpaint,int x,int p)
{
    qpaint->fillRect(x+15,KEYBOARDY+1,5,26,((p)?*brushR:*brushB));

    if (!p)
    {
        qpaint->setPen(*penW);
        qpaint->drawLine(x+15,KEYBOARDY+2,x+15,KEYBOARDY+25);
        qpaint->drawLine(x+16,KEYBOARDY+25,x+20,KEYBOARDY+25);
    };

    qpaint->setPen(p?(*penW):(*penB));
    qpaint->drawLine(x+20,KEYBOARDY+1,x+20,KEYBOARDY+27);
    qpaint->drawPoint(x+19,KEYBOARDY+27);


}
void KMidChannel4D::drawMi(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+18,KEYBOARDY+43,x+24,KEYBOARDY+43);
    qpaint->drawLine(x+18,KEYBOARDY+44,x+24,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+17,KEYBOARDY+45,x+26,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+25,KEYBOARDY+1,x+25,KEYBOARDY+42);

    qpaint->fillRect(x+18,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+21,KEYBOARDY+1,4,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+20,KEYBOARDY+27);

}
void KMidChannel4D::drawFa(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+27,KEYBOARDY+43,x+33,KEYBOARDY+43);
    qpaint->drawLine(x+27,KEYBOARDY+44,x+33,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+26,KEYBOARDY+45,x+35,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+34,KEYBOARDY+28,x+34,KEYBOARDY+42);

    qpaint->fillRect(x+27,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+27,KEYBOARDY+1,5,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+32,KEYBOARDY+27);

}
void KMidChannel4D::drawFa__(TQPainter *qpaint,int x,int p)
{
    qpaint->fillRect(x+33,KEYBOARDY+1,5,26,((p)?*brushR:*brushB));
    if (!p)
    {
        qpaint->setPen(*penW);
        qpaint->drawLine(x+33,KEYBOARDY+2,x+33,KEYBOARDY+25);
        qpaint->drawLine(x+34,KEYBOARDY+25,x+38,KEYBOARDY+25);
    };
    qpaint->setPen(p?(*penW):(*penB));
    qpaint->drawLine(x+38,KEYBOARDY+1,x+38,KEYBOARDY+27);
    qpaint->drawPoint(x+37,KEYBOARDY+27);

}

void KMidChannel4D::drawSol(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+36,KEYBOARDY+43,x+42,KEYBOARDY+43);
    qpaint->drawLine(x+36,KEYBOARDY+44,x+42,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+35,KEYBOARDY+45,x+44,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+43,KEYBOARDY+28,x+43,KEYBOARDY+42);

    qpaint->fillRect(x+36,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+39,KEYBOARDY+1,2,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+38,KEYBOARDY+27);
    qpaint->drawPoint(x+41,KEYBOARDY+27);

}

void KMidChannel4D::drawSol__(TQPainter *qpaint,int x,int p)
{
    qpaint->fillRect(x+42,KEYBOARDY+1,5,26,((p)?*brushR:*brushB));

    if (!p)
    {
        qpaint->setPen(*penW);
        qpaint->drawLine(x+42,KEYBOARDY+2,x+42,KEYBOARDY+25);
        qpaint->drawLine(x+43,KEYBOARDY+25,x+47,KEYBOARDY+25);
    };
    qpaint->setPen(p?(*penW):(*penB));
    qpaint->drawLine(x+47,KEYBOARDY+1,x+47,KEYBOARDY+27);
    qpaint->drawPoint(x+46,KEYBOARDY+27);


}
void KMidChannel4D::drawLa(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+45,KEYBOARDY+43,x+51,KEYBOARDY+43);
    qpaint->drawLine(x+45,KEYBOARDY+44,x+51,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+44,KEYBOARDY+45,x+53,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+52,KEYBOARDY+28,x+52,KEYBOARDY+42);

    qpaint->fillRect(x+45,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+48,KEYBOARDY+1,2,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+47,KEYBOARDY+27);
    qpaint->drawPoint(x+50,KEYBOARDY+27);
}
void KMidChannel4D::drawLa__(TQPainter *qpaint,int x,int p)
{
    qpaint->fillRect(x+51,KEYBOARDY+1,5,26,((p)?*brushR:*brushB));

    if (!p)
    {
        qpaint->setPen(*penW);
        qpaint->drawLine(x+51,KEYBOARDY+2,x+51,KEYBOARDY+25);
        qpaint->drawLine(x+52,KEYBOARDY+25,x+56,KEYBOARDY+25);
    };
    qpaint->setPen(p?(*penW):(*penB));
    qpaint->drawLine(x+56,KEYBOARDY+1,x+56,KEYBOARDY+27);
    qpaint->drawPoint(x+55,KEYBOARDY+27);

}
void KMidChannel4D::drawSi(TQPainter *qpaint,int x,int p)
{
    qpaint->setPen(p?(*penR):(*penB));
    qpaint->drawLine(x+54,KEYBOARDY+43,x+60,KEYBOARDY+43);
    qpaint->drawLine(x+54,KEYBOARDY+44,x+60,KEYBOARDY+44);
    qpaint->setPen(p?(*penB):(*penT));
    qpaint->drawLine(x+53,KEYBOARDY+45,x+62,KEYBOARDY+45);
    qpaint->setPen(p?(*penB):(*penW));
    qpaint->drawLine(x+61,KEYBOARDY+1,x+61,KEYBOARDY+42);

    qpaint->fillRect(x+54,KEYBOARDY+28,7,15,((p)?*brushR:*brushW));
    qpaint->fillRect(x+57,KEYBOARDY+1,4,27,((p)?*brushR:*brushW));
    qpaint->setPen(p?(*penR):(*penW));
    qpaint->drawPoint(x+56,KEYBOARDY+27);
}