~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kmid/channel.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************
 
2
 
 
3
    channel.h  - The KMidChannel widget (with pure virtual members)
 
4
    Copyright (C) 1998  Antonio Larrosa Jimenez
 
5
 
 
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.
 
10
 
 
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.
 
15
 
 
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.
 
19
 
 
20
    Send comments and bug fixes to larrosa@kde.org
 
21
    or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
 
22
 
 
23
***************************************************************************/
 
24
 
 
25
#ifndef KMIDCHANNEL_H
 
26
#define KMIDCHANNEL_H
 
27
#include <qwidget.h>
 
28
#include <qpixmap.h>
 
29
 
 
30
#define CHANNELHEIGHT 71
 
31
#define KEYBOARDY CHANNELHEIGHT-46
 
32
 
 
33
#define CHN_CHANGE_PGM 1
 
34
#define CHN_CHANGE_FORCED_STATE 2
 
35
 
 
36
class QFont;
 
37
class QComboBox;
 
38
class KMidButton;
 
39
class KMidChannel : public QWidget
 
40
{
 
41
    Q_OBJECT
 
42
 
 
43
private:
 
44
    bool pressed[128]; // The 128 keys
 
45
    int channel;
 
46
    bool replay; // Indicates if music should restart playing after
 
47
    // changing the force state
 
48
    
 
49
protected:
 
50
    QPixmap keyboard;
 
51
    QPixmap button1;
 
52
    QPixmap button2;
 
53
 
 
54
    QComboBox *instrumentCombo;
 
55
 
 
56
    KMidButton *forcepgm;
 
57
    QFont *qcvfont;
 
58
 
 
59
    QPen *penB; // Black
 
60
    QPen *penW; // White
 
61
    QPen *penT; // "Transparent" for Background
 
62
    
 
63
    void paintEvent( QPaintEvent * );
 
64
public:
 
65
    KMidChannel(int i,QWidget *Parent);
 
66
    virtual ~KMidChannel();
 
67
 
 
68
    void drawKeyboard(QPainter *qpaint);
 
69
    void drawPressedKeys(QPainter *qpaint);
 
70
    void drawKey(QPainter *qpaint,int key);
 
71
 
 
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;
 
84
 
 
85
    void noteOn(int key);
 
86
    void noteOff(int key);
 
87
    void changeInstrument(int pgm);
 
88
    void changeForceState(bool i);
 
89
    
 
90
    void reset(int level=1); // 0 only release notes, 1 also set instr to 0 ...
 
91
 
 
92
    void saveState(bool *p,int *pgm);
 
93
    void loadState(bool *p,int *pgm);
 
94
    
 
95
public slots:
 
96
    void pgmChanged(int i);
 
97
    void changeForcedState(bool);
 
98
 
 
99
signals:
 
100
    void signalToKMidClient(int *data);
 
101
    
 
102
};
 
103
 
 
104
#endif