38 class AccidentalState;
47 static const int MAX_DOTS = 4;
56 enum class Group : signed char {
129 enum class Type : signed char {
148 Group headGroup()
const;
150 static QString group2userName(
Group group);
151 static QString type2userName(
Type type);
152 static QString group2name(
Group group);
153 static QString type2name(
Type type);
154 static Group name2group(QString s);
155 static Type name2type(QString s);
168 int fret { FRET_NONE };
169 int string { STRING_NONE };
176 static const int INVALID_LINE = -10000;
219 bool _ghost {
false };
220 bool _hidden {
false };
221 bool _dotsHidden {
false };
224 bool _fretConflict {
false };
226 bool dragMode {
false };
228 bool _mirror {
false };
229 bool _small {
false };
231 mutable bool _mark {
false };
232 bool _fixed {
false };
242 char _offTimeType { 0 };
243 char _onTimeType { 0 };
245 int _subchannel { 0 };
246 int _line { INVALID_LINE };
250 mutable int _pitch { 0 };
252 int _veloOffset { 0 };
253 int _fixedLine { 0 };
254 qreal _tuning { 0.0 };
275 void editDrag(
EditData &editData)
override;
282 int concertPitchIdx()
const;
283 void updateRelLine(
int relLine,
bool undoable);
284 bool isNoteName()
const;
285 SymId noteHead()
const;
291 Note(
const Note&,
bool link =
false);
294 Note& operator=(
const Note&) =
delete;
298 virtual void undoUnlink()
override;
300 virtual qreal mag()
const override;
306 void scanElements(
void* data,
void (*func)(
void*,
Element*),
bool all=
true);
307 void setTrack(
int val);
309 int playTicks()
const;
311 qreal headWidth()
const;
312 qreal headHeight()
const;
313 qreal tabHeadWidth(
const StaffType* tab = 0)
const;
314 qreal tabHeadHeight(
const StaffType* tab = 0)
const;
315 QPointF stemDownNW()
const;
316 QPointF stemUpSE()
const;
317 qreal bboxXShift()
const;
318 qreal noteheadCenterX()
const;
319 qreal bboxRightPos()
const;
320 qreal headBodyWidth()
const;
327 virtual int subtype()
const override {
return (
int) _headGroup; }
328 virtual QString subtypeName()
const override;
330 void setPitch(
int val);
331 void setPitch(
int pitch,
int tpc1,
int tpc2);
332 int pitch()
const {
return _pitch; }
337 void undoSetTpc(
int v);
338 int transposition()
const;
339 bool fixed()
const {
return _fixed; }
345 int tpc1()
const {
return _tpc[0]; }
346 int tpc2()
const {
return _tpc[1]; }
347 QString tpcUserName(
bool explicitAccidental =
false)
const;
352 void setTpcFromPitch();
353 int tpc1default(
int pitch)
const;
354 int tpc2default(
int pitch)
const;
365 int physicalLine()
const;
367 int fret()
const {
return _fret; }
370 void setString(
int val);
371 bool ghost()
const {
return _ghost; }
376 virtual void add(
Element*)
override;
377 virtual void remove(
Element*)
override;
382 bool small()
const {
return _small; }
383 void setSmall(
bool val);
385 bool play()
const {
return _play; }
392 Note* firstTiedNote()
const;
393 const Note* lastTiedNote()
const;
395 int unisonIndex()
const;
396 void disconnectTiedNotes();
397 void connectTiedNotes();
401 virtual void draw(QPainter*)
const override;
404 virtual bool readProperties(
XmlReader&)
override;
406 virtual void write(
XmlWriter&)
const override;
408 bool acceptDrop(
EditData&)
const override;
417 QString noteTypeUserName()
const;
430 bool dotIsUp()
const;
439 void setOnTimeOffset(
int v);
440 void setOffTimeOffset(
int v);
442 int customizeVelocity(
int velo)
const;
444 const QVector<NoteDot*>&
dots()
const {
return _dots; }
445 QVector<NoteDot*>&
dots() {
return _dots; }
456 const QVector<Spanner*>&
spannerFor()
const {
return _spannerFor; }
457 const QVector<Spanner*>&
spannerBack()
const {
return _spannerBack; }
464 void transposeDiatonic(
int interval,
bool keepAlterations,
bool useDoubleAccidentals);
466 virtual void localSpatiumChanged(qreal oldValue, qreal newValue)
override;
468 virtual bool setProperty(
Pid propertyId,
const QVariant&)
override;
469 void undoChangeDotsVisible(
bool v);
470 virtual QVariant propertyDefault(
Pid)
const override;
471 virtual QString propertyUserValue(
Pid)
const override;
473 bool mark()
const {
return _mark; }
475 virtual void setScore(
Score* s)
override;
478 void addParentheses();
486 virtual Element* nextElement()
override;
487 virtual Element* prevElement()
override;
488 virtual Element* lastElementBeforeSegment();
489 virtual Element* nextSegmentElement()
override;
490 virtual Element* prevSegmentElement()
override;
492 virtual QString accessibleInfo()
const override;
493 virtual QString screenReaderInfo()
const override;
494 virtual QString accessibleExtraInfo()
const override;
496 virtual Shape shape()
const override;
497 std::vector<Note*> tiedNotes()
const;
DirectionH
Definition: mscore.h:297
Helper class for reading beams, tuplets and spanners.
Definition: connector.h:96
void addSpannerBack(Spanner *e)
Definition: note.h:459
virtual Note * clone() const override
Definition: note.h:295
const ElementList & el() const
Definition: note.h:420
Pid
Definition: property.h:62
virtual NoteHead * clone() const override
Definition: note.h:145
Definition: noteevent.h:25
int fret() const
Definition: note.h:367
int offTimeType() const
Definition: note.h:501
bool dotsHidden() const
Definition: note.h:413
virtual int subtype() const override
Definition: note.h:327
Virtual base class for slurs, ties, lines etc.
Definition: spanner.h:136
Definition: note.cpp:1485
ValueType veloType() const
Definition: note.h:434
qreal tuning() const
Definition: note.h:335
void setTpc2(int v)
Definition: note.h:351
Accidental * accidental() const
Definition: note.h:357
void setUserMirror(MScore::DirectionH d)
Definition: note.h:426
ElementType type() const override
Definition: note.h:296
void setHidden(bool val)
Definition: note.h:412
AccidentalType
Definition: types.h:152
int string() const
Definition: note.h:369
SymId _cachedSymNull
Definition: note.h:268
NoteHeadScheme
Definition: mscore.h:182
QString _fretString
Definition: note.h:270
NoteHead::Type headType() const
Definition: note.h:323
SymId
Definition: sym.h:30
Base class of score layout elements.
Definition: element.h:158
bool mark() const
Definition: note.h:473
NoteEventList _playEvents
Definition: note.h:263
Definition: element.h:517
void setMark(bool v) const
Definition: note.h:474
void setTieFor(Tie *t)
Definition: note.h:390
void setCachedNoteheadSym(SymId i)
Definition: note.h:305
void setGhost(bool val)
Definition: note.h:372
Direction userDotPosition() const
Definition: note.h:428
int tpc1() const
Definition: note.h:345
ElementList & el()
Definition: note.h:419
Definition: accidental.h:65
void setChord(Chord *a)
Definition: note.h:400
int tpc2() const
Definition: note.h:346
Definition: noteevent.h:53
int transposeTpc(int tpc, Interval interval, bool useDoubleSharpsFlats)
Definition: transpose.cpp:117
void setSubchannel(int val)
Definition: note.h:423
const QVector< NoteDot * > & dots() const
Definition: note.h:444
int onTimeType() const
Definition: note.h:502
void setMirror(bool val)
Definition: note.h:380
bool removeSpannerFor(Spanner *e)
Definition: note.h:462
NoteVal(int p)
Definition: note.h:173
NoteVal()
Definition: note.h:172
QVector< Spanner * > _spannerFor
Definition: note.h:264
void setUserDotPosition(Direction d)
Definition: note.h:429
void setVeloType(ValueType v)
Definition: note.h:435
void setTieBack(Tie *t)
Definition: note.h:391
void setFretConflict(bool val)
Definition: note.h:374
bool small() const
Definition: note.h:382
bool ghost() const
Definition: note.h:371
void setOnTimeType(int v)
Definition: note.h:500
int fixedLine() const
Definition: note.h:341
Definition: aeolus.cpp:26
void setDotsHidden(bool val)
Definition: note.h:414
Definition: pitchspelling.h:41
void setPlayEvents(const NoteEventList &l)
Definition: note.h:454
Definition: stafftype.h:173
NoteEvent * noteEvent(int idx)
Definition: note.h:453
helper structure
Definition: note.h:164
int veloOffset() const
Definition: note.h:436
void setTpc1(int v)
Definition: note.h:350
void setOffTimeType(int v)
Definition: note.h:499
NoteType
Definition: types.h:255
void setFixedLine(int v)
Definition: note.h:342
void setLine(int n)
Definition: note.h:364
void addSpannerFor(Spanner *e)
Definition: note.h:461
a Tie has a Note as startElement/endElement
Definition: tie.h:60
Symbol constructed from builtin symbol.
Definition: symbol.h:31
Graphic representation of a chord.
Definition: chord.h:55
MScore::DirectionH userMirror() const
Definition: note.h:425
const NoteEventList & playEvents() const
Definition: note.h:452
bool play() const
Definition: note.h:385
bool mirror() const
Definition: note.h:379
ValueType
Definition: note.h:215
Direction
Definition: types.h:282
void setFret(int val)
Definition: note.h:368
Definition: element.h:111
int pitch() const
Definition: note.h:332
const QVector< Spanner * > & spannerFor() const
Definition: note.h:456
NoteDot * dot(int n)
Definition: note.h:443
int subchannel() const
Definition: note.h:422
Chord * chord() const
Definition: note.h:399
NoteHead::Group headGroup() const
Definition: note.h:322
Group
Definition: note.h:56
int tpc(int idx, int pitch, int opt)
Definition: pitchspelling.cpp:539
QVector< NoteDot * > & dots()
Definition: note.h:445
void setVeloOffset(int v)
Definition: note.h:437
Graphic representation of a note.
Definition: note.h:212
NoteHead(Score *s=0)
Definition: note.h:143
NoteEventList & playEvents()
Definition: note.h:451
void setTuning(qreal v)
Definition: note.h:336
Ms::Tie * tieFor() const
Definition: note.h:388
Type
Definition: note.h:129
Definition: fraction.h:46
ElementType
Definition: types.h:34
QVector< NoteDot * > _dots
Definition: note.h:262
bool fretConflict() const
Definition: note.h:373
void setAccidental(Accidental *a)
Definition: note.h:358
bool hidden() const
Definition: note.h:411
bool removeSpannerBack(Spanner *e)
Definition: note.h:460
Note * lastTiedNote()
Definition: note.h:394
virtual ElementType type() const override
Definition: note.h:146
ElementList _el
fingering, other text, symbols or images
Definition: note.h:261
void setFixed(bool v)
Definition: note.h:340
bool fixed() const
Definition: note.h:339
Pid propertyId(const QStringRef &s)
Definition: property.cpp:347
QVector< Spanner * > _spannerBack
Definition: note.h:265
SymId _cachedNoteheadSym
Definition: note.h:267
const QVector< Spanner * > & spannerBack() const
Definition: note.h:457
Ms::Tie * tieBack() const
Definition: note.h:389
void setPlay(bool val)
Definition: note.h:386