MuseScore  3.4
Music composition and notation
breath.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-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 __BREATH_H__
14 #define __BREATH_H__
15 
16 #include "element.h"
17 
18 namespace Ms {
19 
20 enum class SymId;
21 
22 //---------------------------------------------------------
23 // BreathType
24 //---------------------------------------------------------
25 
26 struct BreathType {
28  bool isCaesura;
29  qreal pause;
30  };
31 
32 //---------------------------------------------------------
33 // @@ Breath
35 //---------------------------------------------------------
36 
37 class Breath final : public Element {
38  qreal _pause;
40 
41  public:
42  Breath(Score* s);
43  virtual ElementType type() const override { return ElementType::BREATH; }
44  virtual Breath* clone() const override { return new Breath(*this); }
45 
46  virtual qreal mag() const override;
47 
48  void setSymId(SymId id) { _symId = id; }
49  SymId symId() const { return _symId; }
50  qreal pause() const { return _pause; }
51  void setPause(qreal v) { _pause = v; }
52 
53  Segment* segment() const { return (Segment*)parent(); }
54 
55  virtual void draw(QPainter*) const override;
56  virtual void layout() override;
57  virtual void write(XmlWriter&) const override;
58  virtual void read(XmlReader&) override;
59  virtual QPointF pagePos() const override;
60 
61  virtual QVariant getProperty(Pid propertyId) const override;
62  virtual bool setProperty(Pid propertyId, const QVariant&) override;
63  virtual QVariant propertyDefault(Pid) const override;
64 
65  virtual Element* nextSegmentElement() override;
66  virtual Element* prevSegmentElement() override;
67  virtual QString accessibleInfo() const override;
68 
69  bool isCaesura() const;
70 
71  static const std::vector<BreathType> breathList;
72  };
73 
74 
75 } // namespace Ms
76 #endif
77 
qreal pause() const
Definition: breath.h:50
void setPause(qreal v)
Definition: breath.h:51
void setSymId(SymId id)
Definition: breath.h:48
SymId symId() const
Definition: breath.h:49
Pid
Definition: property.h:62
SymId id
Definition: breath.h:27
Definition: xml.h:67
SymId
Definition: sym.h:30
Base class of score layout elements.
Definition: element.h:158
SymId _symId
Definition: breath.h:39
Definition: score.h:391
bool isCaesura
Definition: breath.h:28
Definition: segment.h:50
Definition: aeolus.cpp:26
qreal _pause
Definition: breath.h:38
Definition: xml.h:218
virtual ElementType type() const override
Definition: breath.h:43
static const std::vector< BreathType > breathList
Definition: breath.h:71
qreal pause
Definition: breath.h:29
virtual Breath * clone() const override
Definition: breath.h:44
ElementType
Definition: types.h:34
Segment * segment() const
Definition: breath.h:53
Definition: breath.h:26
breathType() is index in symList
Definition: breath.h:37
Pid propertyId(const QStringRef &s)
Definition: property.cpp:347