27 class Lyrics final :
public TextBase {
43 static constexpr
int TEMP_MELISMA_TICKS = 1;
52 LyricsLine* _separator;
54 bool isMelisma()
const;
55 void undoChangeProperty(Pid
id,
const QVariant&, PropertyFlags ps)
override;
66 Lyrics* clone()
const override {
return new Lyrics(*
this); }
68 void scanElements(
void* data,
void (*func)(
void*, Element*),
bool all=
true)
override;
69 bool acceptDrop(EditData&)
const override;
70 Element* drop(EditData&)
override;
72 Segment* segment()
const {
return toSegment(parent()->parent()); }
73 Measure* measure()
const {
return toMeasure(parent()->parent()->parent()); }
74 ChordRest* chordRest()
const {
return toChordRest(parent()); }
76 void layout()
override;
79 void write(XmlWriter& xml)
const override;
80 void read(XmlReader&)
override;
81 bool readProperties(XmlReader&)
override;
82 int subtype()
const override {
return _no; }
83 QString subtypeName()
const override {
return QObject::tr(
"Verse %1").arg(_no + 1); }
84 void setNo(
int n) { _no = n; }
85 int no()
const {
return _no; }
86 bool isEven()
const {
return _no % 1; }
87 void setSyllabic(
Syllabic s) { _syllabic = s; }
88 Syllabic syllabic()
const {
return _syllabic; }
89 void add(Element*)
override;
90 void remove(Element*)
override;
91 void endEdit(EditData&)
override;
93 Fraction ticks()
const {
return _ticks; }
94 void setTicks(
const Fraction& tick) { _ticks = tick; }
95 Fraction endTick()
const;
96 void removeFromScore();
98 using ScoreElement::undoChangeProperty;
99 void paste(EditData&)
override;
101 QVariant getProperty(Pid propertyId)
const override;
102 bool setProperty(Pid propertyId,
const QVariant&)
override;
103 QVariant propertyDefault(Pid
id)
const override;
111 class LyricsLine final :
public SLine {
117 LyricsLine(
const LyricsLine&);
119 LyricsLine* clone()
const override {
return new LyricsLine(*
this); }
121 void layout()
override;
122 LineSegment* createLineSegment()
override;
123 void removeUnmanaged()
override;
124 void styleChanged()
override;
126 Lyrics* lyrics()
const {
return toLyrics(parent()); }
127 Lyrics* nextLyrics()
const {
return _nextLyrics; }
128 bool isEndMelisma()
const {
return lyrics()->ticks().isNotZero(); }
129 bool isDash()
const {
return !isEndMelisma(); }
130 bool setProperty(Pid propertyId,
const QVariant& v)
override;
131 SpannerSegment* layoutSystem(System*)
override;
139 class LyricsLineSegment final :
public LineSegment {
141 int _numOfDashes = 0;
142 qreal _dashLength = 0;
145 LyricsLineSegment(Spanner*, Score*);
147 LyricsLineSegment* clone()
const override {
return new LyricsLineSegment(*
this); }
149 void draw(QPainter*)
const override;
150 void layout()
override;
152 LyricsLine* lyricsLine()
const {
return toLyricsLine(spanner()); }
153 Lyrics* lyrics()
const {
return lyricsLine()->lyrics(); }
ElementType
Definition: types.h:34
int _no
row index
Definition: lyrics.h:58
Definition: cursor.cpp:30
Syllabic
Definition: lyrics.h:30