MuseScore  3.4
Music composition and notation
fretcanvas.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2009 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __FRETCANVAS_H__
21 #define __FRETCANVAS_H__
22 
23 namespace Ms {
24 
25 class Accidental;
26 class Clef;
27 class FretDiagram;
28 enum class FretDotType : signed char;
29 
30 //---------------------------------------------------------
31 // FretCanvas
32 //---------------------------------------------------------
33 
34 class FretCanvas : public QFrame {
35  Q_OBJECT
36 
38  int cstring;
39  int cfret;
40 
41  bool _automaticDotType { true };
43  bool _barreMode { false };
44  bool _multidotMode { false };
45 
46  virtual void paintEvent(QPaintEvent*);
47  virtual void mousePressEvent(QMouseEvent*);
48  virtual void mouseMoveEvent(QMouseEvent*);
49 
50  void paintDotSymbol(QPainter& p, QPen& pen, qreal y, qreal x, qreal dotd, FretDotType dtype);
51  void getPosition(const QPointF& pos, int* string, int* fret);
52 
53  public:
54  FretCanvas(QWidget* parent = 0);
55  void setFretDiagram(FretDiagram* fd);
56 
57  void setAutomaticDotType(bool v) { _automaticDotType = v; }
58  void setCurrentDotType(FretDotType t) { _currentDtype = t; }
59  void setBarreMode(bool v) { _barreMode = v; }
60  void setMultidotMode(bool v) { _multidotMode = v; }
61  void clear();
62 
63  };
64 
65 
66 } // namespace Ms
67 #endif
68 
FretDotType _currentDtype
Definition: fretcanvas.h:42
Fretboard diagram.
Definition: fret.h:122
void setAutomaticDotType(bool v)
Definition: fretcanvas.h:57
int cfret
Definition: fretcanvas.h:39
FretDiagram * diagram
Definition: fretcanvas.h:37
int cstring
Definition: fretcanvas.h:38
void setCurrentDotType(FretDotType t)
Definition: fretcanvas.h:58
Definition: fretcanvas.h:34
Definition: aeolus.cpp:26
void setBarreMode(bool v)
Definition: fretcanvas.h:59
FretDotType
Definition: fret.h:26
void setMultidotMode(bool v)
Definition: fretcanvas.h:60