MuseScore  3.4
Music composition and notation
bend.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2010-2011 Werner Schweer
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 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __BEND_H__
14 #define __BEND_H__
15 
16 #include "element.h"
17 #include "pitchvalue.h"
18 #include "property.h"
19 #include "style.h"
20 
21 namespace Ms {
22 
23 //---------------------------------------------------------
24 // @@ Bend
25 //---------------------------------------------------------
26 
27 class Bend final : public Element {
32 
33  bool _playBend { true };
34  QList<PitchValue> _points;
35 
36  QPointF notePos;
37  qreal noteWidth;
38 
39  QFont font(qreal) const;
40 
41  public:
42  Bend(Score* s);
43  virtual Bend* clone() const override { return new Bend(*this); }
44  virtual ElementType type() const override { return ElementType::BEND; }
45  virtual void layout() override;
46  virtual void draw(QPainter*) const override;
47  virtual void write(XmlWriter&) const override;
48  virtual void read(XmlReader& e) override;
49  QList<PitchValue>& points() { return _points; }
50  const QList<PitchValue>& points() const { return _points; }
51  void setPoints(const QList<PitchValue>& p) { _points = p; }
52  bool playBend() const { return _playBend; }
53  void setPlayBend(bool v) { _playBend = v; }
54 
55  // property methods
56  virtual QVariant getProperty(Pid propertyId) const override;
57  virtual bool setProperty(Pid propertyId, const QVariant&) override;
58  virtual QVariant propertyDefault(Pid) const override;
59  };
60 
61 
62 } // namespace Ms
63 #endif
64 
const qreal & fontSize() const
Definition: bend.h:29
Pid
Definition: property.h:62
Definition: xml.h:67
const QString & fontFace() const
Definition: bend.h:28
virtual void write(XmlWriter &) const override
Definition: bend.cpp:285
QPointF notePos
Definition: bend.h:36
void setFontStyle(const FontStyle &val)
Definition: bend.h:30
Base class of score layout elements.
Definition: element.h:158
FontStyle
Definition: types.h:468
bool _playBend
Definition: bend.h:33
void setLineWidth(const qreal &val)
Definition: bend.h:31
const qreal & lineWidth() const
Definition: bend.h:31
bool playBend() const
Definition: bend.h:52
Definition: score.h:391
void setFontFace(const QString &val)
Definition: bend.h:28
void setFontSize(const qreal &val)
Definition: bend.h:29
const FontStyle & fontStyle() const
Definition: bend.h:30
QFont font(qreal) const
Definition: bend.cpp:54
Definition: bend.h:27
virtual Bend * clone() const override
Definition: bend.h:43
virtual Pid propertyId(const QStringRef &xmlName) const override
Definition: element.cpp:1326
#define M_PROPERTY(a, b, c)
Definition: property.h:36
QList< PitchValue > _points
Definition: bend.h:34
Definition: aeolus.cpp:26
virtual void read(XmlReader &e) override
Definition: bend.cpp:302
virtual QVariant propertyDefault(Pid) const override
Definition: bend.cpp:379
QList< PitchValue > & points()
Definition: bend.h:49
Definition: xml.h:218
virtual ElementType type() const override
Definition: bend.h:44
const QList< PitchValue > & points() const
Definition: bend.h:50
void setPlayBend(bool v)
Definition: bend.h:53
ElementType
Definition: types.h:34
virtual bool setProperty(Pid propertyId, const QVariant &) override
Definition: bend.cpp:350
virtual QVariant getProperty(Pid propertyId) const override
Definition: bend.cpp:328
virtual void draw(QPainter *) const override
Definition: bend.cpp:180
virtual void layout() override
Definition: bend.cpp:71
Bend(Score *s)
Definition: bend.cpp:44
void setPoints(const QList< PitchValue > &p)
Definition: bend.h:51
qreal noteWidth
Definition: bend.h:37