]> code.delx.au - virtualtones/blob - pianoinstrument.h
Initial commit
[virtualtones] / pianoinstrument.h
1 // pianoinstrument.h - A piano simulator
2 // Written by James Bunton <james@delx.cjb.net>
3 // Licensed under the GPL, see COPYING.txt for more details
4
5
6 #ifndef PIANOINSTRUMENT_H
7 #define PIANOINSTRUMENT_H
8
9 #include <qwidget.h>
10 #include <qpixmap.h>
11 #include <qpainter.h>
12
13 #include "instrument.h"
14
15
16 class PianoInstrument : public Instrument
17 {
18 Q_OBJECT
19 public:
20 PianoInstrument(QWidget *parent);
21 ~PianoInstrument();
22
23 protected:
24 QString generateHelp();
25 void paintEvent(QPaintEvent *);
26 void keyPressEvent(QKeyEvent *);
27 void keyReleaseEvent(QKeyEvent *);
28
29 private:
30 void paintPart(QPainter &paint, int start, int stop, int y, bool sharp);
31 void copyArray(bool source[26], bool dest[26]);
32 void emitSounds();
33
34 bool oldNotes[26];
35 bool notes[26];
36 };
37
38
39
40 #endif