]> code.delx.au - virtualtones/blob - stringinstrument.h
Remove unused include
[virtualtones] / stringinstrument.h
1 // stringinstrument.h - A stringed instrument simulator
2 // Written by James Bunton <james@delx.net.au>
3 // Licensed under the GPL, see COPYING.txt for more details
4
5
6 #ifndef STRINGINSTRUMENT_H
7 #define STRINGINSTRUMENT_H
8
9 #include <qwidget.h>
10 #include <qpixmap.h>
11 #include <qpainter.h>
12 #include <qtimer.h>
13 #include <QWidget>
14 #include <QPixmap>
15 #include <QPainter>
16 #include <QTimer>
17
18 #include "instrument.h"
19
20
21
22 class StringInstrument : public Instrument
23 {
24 Q_OBJECT
25 public:
26 StringInstrument(QWidget *parent);
27 ~StringInstrument();
28
29 private slots:
30 void emitSounds();
31
32 protected:
33 QString generateHelp();
34 void paintEvent(QPaintEvent *);
35 void keyPressEvent(QKeyEvent *);
36 void keyReleaseEvent(QKeyEvent *);
37
38
39 virtual void setNotes(int array[4])=0; // Set the base string notes
40
41 QPixmap background;
42
43 // Keys
44 bool down[4][4];
45 // down[1][3] == true, means that when the D string is bowed, G will be played
46 // First dimension is the string, second is the modifier
47 bool downFudge[4];
48 // Fudge keys. They're at the beginning of each string and do not play a note by themself
49 // downFudge[0] is '~', [1] is tab, etc.. They allow access to sharps
50
51 bool bow[4][4];
52 // bow[1][4] == true means that the D string will be bowed at the highest volume
53 // First dimension is the string to be bowed, second is the volume
54
55 int stringnote[4];
56 // Base notes for each string
57
58
59 // The volumes and notes to play for each string
60 int oldVolume[4];
61 int oldNote[4];
62 int volume[4];
63 int note[4];
64 };
65
66
67 class ViolinInstrument : public StringInstrument
68 {
69 public:
70 ViolinInstrument(QWidget *parent);
71 ~ViolinInstrument() {};
72 protected:
73 void setNotes(int array[4]);
74 };
75
76
77 class ViolaInstrument : public StringInstrument
78 {
79 public:
80 ViolaInstrument(QWidget *parent);
81 ~ViolaInstrument() {};
82 protected:
83 void setNotes(int array[4]);
84 };
85
86
87 class CelloInstrument : public StringInstrument
88 {
89 public:
90 CelloInstrument(QWidget *parent);
91 ~CelloInstrument() {};
92 protected:
93 void setNotes(int array[4]);
94 };
95
96
97 class ContrabassInstrument : public StringInstrument
98 {
99 public:
100 ContrabassInstrument(QWidget *parent);
101 ~ContrabassInstrument() {};
102 protected:
103 void setNotes(int array[4]);
104 };
105
106
107
108 #endif