-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscorearea.h
55 lines (45 loc) · 1.12 KB
/
scorearea.h
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
#ifndef SCOREAREA_H
#define SCOREAREA_H
#include <QBrush>
#include <QPen>
#include <QWidget>
#include <QPainter>
#include <QMatrix>
#include "note.h"
class StaffPaths
{
QPainterPath trebleClefPath,
bassClefPath,
quarterNotePath,
ledgerLinePath,
sharpPath, naturalPath, flatPath;
public:
const QPainterPath& trebleClef();
const QPainterPath& bassClef();
const QPainterPath& quarterNote();
const QPainterPath& ledgerLine();
const QPainterPath& sharp();
const QPainterPath& natural();
const QPainterPath& flat();
};
class ScoreArea : public QWidget
{
public:
ScoreArea();
QSize minimumSizeHint() const;
QSize sizeHint() const;
void showNote(const Note &n);
enum {
staffWeight = 2,
staffSpacing = 10,
staffGap = 3
};
protected:
Note blackNote, shownNote;
bool match;
void paintEvent(QPaintEvent *event);
void paintLedgerLines(QPainter& painter, const Note& note);
void paintNote(QPainter& painter, const Note& note, const QBrush& brush);
void keyPressEvent(QKeyEvent *event);
};
#endif // SCOREAREA_H