MuseScore  3.4
Music composition and notation
jump.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-2013 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 __JUMP_H__
14 #define __JUMP_H__
15 
16 #include "text.h"
17 
18 namespace Ms {
19 
20 //---------------------------------------------------------
21 // @@ Jump
23 //
24 // @P continueAt string
25 // @P jumpTo string
26 // not used?
27 // jumpType enum (Jump.DC, .DC_AL_FINE, .DC_AL_CODA, .DS_AL_CODA, .DS_AL_FINE, .DS, USER) (read only)
28 // @P playUntil string
29 //---------------------------------------------------------
30 
31 class Jump final : public TextBase {
32  QString _jumpTo;
33  QString _playUntil;
34  QString _continueAt;
36 
37  public:
38  enum class Type : char {
39  DC,
40  DC_AL_FINE,
41  DC_AL_CODA,
42  DS_AL_CODA,
43  DS_AL_FINE,
44  DS,
45  USER
46  };
47 
48  Jump(Score*);
49 
50  void setJumpType(Type t);
51  Type jumpType() const;
52  QString jumpTypeUserName() const;
53 
54  virtual Jump* clone() const override { return new Jump(*this); }
55  virtual ElementType type() const override { return ElementType::JUMP; }
56  virtual int subtype() const override { return int(jumpType()); }
57 
58  Measure* measure() const { return toMeasure(parent()); }
59 
60  virtual void read(XmlReader&) override;
61  virtual void write(XmlWriter& xml) const override;
62 
63  virtual void layout() override;
64 
65  QString jumpTo() const { return _jumpTo; }
66  QString playUntil() const { return _playUntil; }
67  QString continueAt() const { return _continueAt; }
68  void setJumpTo(const QString& s) { _jumpTo = s; }
69  void setPlayUntil(const QString& s) { _playUntil = s; }
70  void setContinueAt(const QString& s) { _continueAt = s; }
71  void undoSetJumpTo(const QString& s);
72  void undoSetPlayUntil(const QString& s);
73  void undoSetContinueAt(const QString& s);
74  bool playRepeats() const { return _playRepeats; }
75  void setPlayRepeats(bool val) { _playRepeats = val; }
76 
77  virtual QVariant getProperty(Pid propertyId) const override;
78  virtual bool setProperty(Pid propertyId, const QVariant&) override;
79  virtual QVariant propertyDefault(Pid) const override;
80 
81  Element* nextSegmentElement() override;
82  Element* prevSegmentElement() override;
83  virtual QString accessibleInfo() const override;
84  };
85 
86 //---------------------------------------------------------
87 // JumpTypeTable
88 //---------------------------------------------------------
89 
90 struct JumpTypeTable {
92  const char* text;
93  const char* jumpTo;
94  const char* playUntil;
95  const char* continueAt;
96  QString userText;
97  };
98 
99 extern const JumpTypeTable jumpTypeTable[];
100 int jumpTypeTableSize();
101 
102 } // namespace Ms
103 
104 Q_DECLARE_METATYPE(Ms::Jump::Type);
105 
106 #endif
107 
QString _playUntil
Definition: jump.h:33
const char * text
Definition: jump.h:92
Pid
Definition: property.h:62
Definition: xml.h:67
virtual bool setProperty(Pid propertyId, const QVariant &) override
Definition: jump.cpp:196
void undoSetPlayUntil(const QString &s)
Definition: jump.cpp:157
void undoSetJumpTo(const QString &s)
Definition: jump.cpp:148
one measure in a system
Definition: measure.h:65
virtual Jump * clone() const override
Definition: jump.h:54
QString jumpTo() const
Definition: jump.h:65
const JumpTypeTable jumpTypeTable[]
Definition: jump.cpp:33
Base class of score layout elements.
Definition: element.h:158
Jump label.
Definition: jump.h:31
bool playRepeats() const
Definition: jump.h:74
Definition: jump.h:90
QString continueAt() const
Definition: jump.h:67
Element * prevSegmentElement() override
Definition: jump.cpp:256
Element * parent() const
Definition: element.h:192
QString _continueAt
Definition: jump.h:34
virtual void write(XmlWriter &xml) const override
Definition: jump.cpp:133
void setPlayUntil(const QString &s)
Definition: jump.h:69
Definition: score.h:391
virtual QVariant getProperty(Pid propertyId) const override
Definition: jump.cpp:175
virtual void layout() override
Definition: jump.cpp:102
virtual QVariant propertyDefault(Pid) const override
Definition: jump.cpp:225
QString _jumpTo
Definition: jump.h:32
Type
Definition: jump.h:38
Jump(Score *)
Definition: jump.cpp:51
Element * nextSegmentElement() override
Definition: jump.cpp:246
virtual ElementType type() const override
Definition: jump.h:55
Definition: textbase.h:217
const char * continueAt
Definition: jump.h:95
QString playUntil() const
Definition: jump.h:66
Definition: aeolus.cpp:26
void setJumpTo(const QString &s)
Definition: jump.h:68
Definition: xml.h:218
Jump::Type type
Definition: jump.h:91
virtual Pid propertyId(const QStringRef &xmlName) const override
Definition: textbase.cpp:1808
void setJumpType(Type t)
Definition: jump.cpp:63
void setContinueAt(const QString &s)
Definition: jump.h:70
bool _playRepeats
Definition: jump.h:35
QString userText
Definition: jump.h:96
const char * playUntil
Definition: jump.h:94
virtual int subtype() const override
Definition: jump.h:56
Measure * measure() const
Definition: jump.h:58
int jumpTypeTableSize()
Definition: jump.cpp:42
ElementType
Definition: types.h:34
virtual void read(XmlReader &) override
Definition: jump.cpp:112
virtual QString accessibleInfo() const override
Definition: jump.cpp:265
void setPlayRepeats(bool val)
Definition: jump.h:75
const char * jumpTo
Definition: jump.h:93
void undoSetContinueAt(const QString &s)
Definition: jump.cpp:166
QString jumpTypeUserName() const
Definition: jump.cpp:90
Type jumpType() const
Definition: jump.cpp:81