MuseScore  3.4
Music composition and notation
fermata.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2018 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 __FERMATA_H__
14 #define __FERMATA_H__
15 
16 #include "element.h"
17 #include "mscore.h"
18 
19 namespace Ms {
20 
21 class ChordRest;
22 class Segment;
23 class Measure;
24 class System;
25 class Page;
26 
27 enum class SymId;
28 
29 //---------------------------------------------------------
30 // Fermata
31 //---------------------------------------------------------
32 
33 class Fermata final : public Element {
35  qreal _timeStretch;
36  bool _play;
37 
38  virtual void draw(QPainter*) const override;
39  virtual Sid getPropertyStyle(Pid) const override;
40 
41  public:
42  Fermata(Score*);
43  Fermata(SymId, Score*);
44  Fermata &operator=(const Fermata&) = delete;
45 
46  virtual Fermata* clone() const override { return new Fermata(*this); }
47  virtual ElementType type() const override { return ElementType::FERMATA; }
48 
49  virtual qreal mag() const override;
50 
51  SymId symId() const { return _symId; }
52  void setSymId(SymId id) { _symId = id; }
53  virtual int subtype() const override;
54  QString userName() const;
55 
56  virtual void layout() override;
57 
58  virtual void read(XmlReader&) override;
59  virtual void write(XmlWriter& xml) const override;
60  virtual bool readProperties(XmlReader&) override;
61 
62  virtual QLineF dragAnchor() const override;
63 
64  virtual QVariant getProperty(Pid propertyId) const override;
65  virtual bool setProperty(Pid propertyId, const QVariant&) override;
66  virtual QVariant propertyDefault(Pid) const override;
67  virtual void resetProperty(Pid id) override;
68 
69  virtual Pid propertyId(const QStringRef& xmlName) const override;
70 
71  ChordRest* chordRest() const;
72  Segment* segment() const { return toSegment(parent()); }
73  Measure* measure() const;
74  System* system() const;
75  Page* page() const;
76 
77  qreal timeStretch() const { return _timeStretch; }
78  void setTimeStretch(qreal val) { _timeStretch = val; }
79 
80  bool play() const { return _play; }
81  void setPlay(bool val) { _play = val; }
82 
83  QString accessibleInfo() const override;
84  };
85 
86 } // namespace Ms
87 #endif
88 
void setSymId(SymId id)
Definition: fermata.h:52
Pid
Definition: property.h:62
Fermata(Score *)
Definition: fermata.cpp:41
Definition: xml.h:67
void setPlay(bool val)
Definition: fermata.h:81
ChordRest * chordRest() const
Definition: fermata.cpp:170
one measure in a system
Definition: measure.h:65
Measure * measure() const
Definition: fermata.cpp:181
virtual QLineF dragAnchor() const override
Definition: fermata.cpp:253
SymId _symId
Definition: fermata.h:34
SymId
Definition: sym.h:30
Base class of score layout elements.
Definition: element.h:158
virtual qreal mag() const override
Definition: fermata.cpp:375
void setTimeStretch(qreal val)
Definition: fermata.h:78
virtual QVariant getProperty(Pid propertyId) const override
Definition: fermata.cpp:262
virtual void layout() override
Definition: fermata.cpp:213
Element * parent() const
Definition: element.h:192
bool _play
Definition: fermata.h:36
Definition: score.h:391
qreal timeStretch() const
Definition: fermata.h:77
QString userName() const
Definition: fermata.cpp:137
bool play() const
Definition: fermata.h:80
virtual Sid getPropertyStyle(Pid) const override
Definition: fermata.cpp:364
Definition: fermata.h:33
Definition: segment.h:50
virtual Pid propertyId(const QStringRef &xmlName) const override
Definition: fermata.cpp:353
virtual ElementType type() const override
Definition: fermata.h:47
Definition: aeolus.cpp:26
Sid
Definition: style.h:33
virtual QVariant propertyDefault(Pid) const override
Definition: fermata.cpp:317
Definition: xml.h:218
System * system() const
Definition: fermata.cpp:191
virtual void resetProperty(Pid id) override
Definition: fermata.cpp:336
virtual void read(XmlReader &) override
Definition: fermata.cpp:61
qreal _timeStretch
Definition: fermata.h:35
virtual int subtype() const override
Definition: fermata.cpp:124
virtual void write(XmlWriter &xml) const override
Definition: fermata.cpp:103
Definition: chordrest.h:48
SymId symId() const
Definition: fermata.h:51
QString accessibleInfo() const override
Definition: fermata.cpp:384
virtual void draw(QPainter *) const override
Definition: fermata.cpp:146
Segment * segment() const
Definition: fermata.h:72
One row of measures for all instruments; a complete piece of the timeline.
Definition: system.h:79
virtual bool setProperty(Pid propertyId, const QVariant &) override
Definition: fermata.cpp:280
ElementType
Definition: types.h:34
virtual bool readProperties(XmlReader &) override
Definition: fermata.cpp:73
Fermata & operator=(const Fermata &)=delete
Definition: page.h:34
virtual Fermata * clone() const override
Definition: fermata.h:46
Page * page() const
Definition: fermata.cpp:201