1
/**************************************************************************
3
channel.h - The KMidChannel widget (with pure virtual members)
4
Copyright (C) 1998 Antonio Larrosa Jimenez
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
Send comments and bug fixes to larrosa@kde.org
21
or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
23
***************************************************************************/
30
#define CHANNELHEIGHT 71
31
#define KEYBOARDY CHANNELHEIGHT-46
33
#define CHN_CHANGE_PGM 1
34
#define CHN_CHANGE_FORCED_STATE 2
39
class KMidChannel : public QWidget
44
bool pressed[128]; // The 128 keys
46
bool replay; // Indicates if music should restart playing after
47
// changing the force state
54
QComboBox *instrumentCombo;
61
QPen *penT; // "Transparent" for Background
63
void paintEvent( QPaintEvent * );
65
KMidChannel(int i,QWidget *Parent);
66
virtual ~KMidChannel();
68
void drawKeyboard(QPainter *qpaint);
69
void drawPressedKeys(QPainter *qpaint);
70
void drawKey(QPainter *qpaint,int key);
72
virtual void drawDo (QPainter *qpaint,int x,int p) = 0;
73
virtual void drawDo__ (QPainter *qpaint,int x,int p) = 0;
74
virtual void drawRe (QPainter *qpaint,int x,int p) = 0;
75
virtual void drawRe__ (QPainter *qpaint,int x,int p) = 0;
76
virtual void drawMi (QPainter *qpaint,int x,int p) = 0;
77
virtual void drawFa (QPainter *qpaint,int x,int p) = 0;
78
virtual void drawFa__ (QPainter *qpaint,int x,int p) = 0;
79
virtual void drawSol (QPainter *qpaint,int x,int p) = 0;
80
virtual void drawSol__(QPainter *qpaint,int x,int p) = 0;
81
virtual void drawLa (QPainter *qpaint,int x,int p) = 0;
82
virtual void drawLa__ (QPainter *qpaint,int x,int p) = 0;
83
virtual void drawSi (QPainter *qpaint,int x,int p) = 0;
86
void noteOff(int key);
87
void changeInstrument(int pgm);
88
void changeForceState(bool i);
90
void reset(int level=1); // 0 only release notes, 1 also set instr to 0 ...
92
void saveState(bool *p,int *pgm);
93
void loadState(bool *p,int *pgm);
96
void pgmChanged(int i);
97
void changeForcedState(bool);
100
void signalToKMidClient(int *data);