MUSX Document Model
Loading...
Searching...
No Matches
Staff.h
1/*
2 * Copyright (C) 2025, Robert Patterson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22#pragma once
23
24#include "musx/util/Logger.h"
25#include "musx/util/Fraction.h"
26
27#include "BaseClasses.h"
28#include "CommonClasses.h"
29 // do not add other dom class dependencies. Use .cpp files for implementations that need total class access.
30
31namespace musx {
32namespace dom {
33
34namespace details {
35class ShapeNoteBase;
36}
37
38namespace others {
39
40class StaffStyle;
47class Staff : public OthersBase
48{
49public:
62
67 enum class StemDirection
68 {
69 Default,
70 AlwaysUp,
72 };
73
78 enum class NotationStyle
79 {
80 Standard,
82 Tablature
83 };
84
89 enum class HideMode
90 {
91 None,
92 Cutaway,
94 Score
95 };
96
102 {
103 Normal,
104 SlashBeats,
105 Rhythmic,
106 Blank,
110 };
111
117 {
118 public:
119 int interval{};
120 int adjust{};
121
123 };
124
137
146 {
147 public:
148 bool setToClef{};
150
152 std::shared_ptr<KeySigTransposition> keysig;
153
155 std::shared_ptr<ChromaticTransposition> chromatic;
156
158 };
159
161 explicit Staff(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper)
162 : OthersBase(document, partId, shareMode, cmper) {}
163
164 // WARNING: Any fields added here must have a mask added in StaffStyle (if it does not already exist)
165 // and must be added to StaffComposite::applyStyle.
166
167 // Public properties corresponding to the XML structure
169 std::shared_ptr<FontInfo> noteFont;
171 bool useNoteFont{};
174 std::optional<int> staffLines{};
175 std::optional<std::vector<int>> customStaff;
177 std::string instUuid;
178 int capoPos{};
180 bool floatKeys{};
181 bool floatTime{};
182 bool blineBreak{};
183 bool rbarBreak{};
184 bool hasStyles{};
187 std::shared_ptr<Transposition> transposition;
204 bool flatBeams{};
208 bool hideLyrics{};
209 bool noOptimize{};
212 bool hideRepeats{};
214 bool hideRptBars{};
215 bool hideKeySigs{};
217 bool hideClefs{};
219 bool hideChords{};
220 bool noKey{};
225 bool hideRests{};
226 bool hideTies{};
227 bool hideDots{};
237 bool hideTuplets{};
239 bool hideStems{};
241 bool hideBeams{};
259
260 // The following values are not in xml but computed by the factory.
261
275 std::optional<int> autoNumberValue;
276 std::optional<Cmper> percussionMapId;
277
281
285
288
291
295 util::EnigmaParsingContext getFullInstrumentNameCtx(Cmper forPartId, bool preferStaffName = false) const;
296
300 util::EnigmaParsingContext getAbbreviatedInstrumentNameCtx(Cmper forPartId, bool preferStaffName = false) const;
301
306 std::string getFullInstrumentName(util::EnigmaString::AccidentalStyle accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii, bool preferStaffName = false) const;
307
312 std::string getAbbreviatedInstrumentName(util::EnigmaString::AccidentalStyle accidentalStyle = util::EnigmaString::AccidentalStyle::Ascii, bool preferStaffName = false) const;
313
316
319
322
324 bool showNamesForPart(Cmper partId) const
325 { return partId == SCORE_PARTID ? !hideNameInScore : showNameInParts; }
326
336 static void calcAllAutoNumberValues(const DocumentPtr& document);
337
343 template <typename SubType>
344 static void calcAllRuntimeValues(const DocumentPtr& document);
345
350 std::pair<std::string, bool> calcAutoNumberingAffix() const;
351
355 std::string addAutoNumbering(const std::string& plainName) const;
356
361 ClefIndex calcClefIndexAt(MeasCmper measureId, Edu position, bool forWrittenPitch = false) const;
362
364 ClefIndex calcFirstClefIndex(bool forWrittenPitch = false) const
365 { return calcClefIndexAt(1, 0, forWrittenPitch); }
366
371 static ClefIndex calcFirstClefIndex(const DocumentPtr& document, Cmper partId, StaffCmper staffCmper);
372
374 int calcNumberOfStafflines() const;
375
377 int calcMiddleStaffPosition() const;
378
380 int calcToplinePosition() const;
381
383 bool hasInstrumentAssigned() const;
384
390 std::pair<int, int> calcTranspositionInterval() const;
391
394 MusxInstanceList<PartDefinition> getContainingParts(bool includeScore = true) const;
395
399
400 void integrityCheck(const std::shared_ptr<Base>& ptrToThis) override
401 {
403 if (!staffLines && !customStaff) {
404 MUSX_INTEGRITY_ERROR("Staff or StaffStyle " + std::to_string(getCmper()) + " has neither a standard nor a custom staff definition.");
405 } else if (staffLines && customStaff) {
406 MUSX_INTEGRITY_ERROR("Staff or StaffStyle " + std::to_string(getCmper()) + " has both a standard and a custom staff definition.");
407 }
408 if (customStaff) { // guarantee ascending order of staves.
409 std::sort(customStaff.value().begin(), customStaff.value().end(),
410 [](const auto& a, const auto& b) { return a < b; });
411 }
412 if (transposition) {
413 if (!transposition->chromatic && !transposition->keysig) {
414 MUSX_INTEGRITY_ERROR("Staff or StaffStyle " + std::to_string(getCmper()) + " has transposition with neither keysig nor chromatic transposition defined.");
415 } else if (transposition->chromatic && transposition->keysig) {
416 MUSX_INTEGRITY_ERROR("Staff or StaffStyle " + std::to_string(getCmper()) + " has transposition with both keysig and chromatic transposition defined.");
417 }
418 }
419 if (useNoteFont && !noteFont) {
420 noteFont = std::make_shared<FontInfo>(getDocument()); // do this first to avoid unreachable code warning, since MUSX_INTEGRITY_ERROR might throw
421 MUSX_INTEGRITY_ERROR("Staff or StaffStyle " + std::to_string(getCmper()) + " specifies to use a custom notehead font, but no custom font was provided.");
422 }
423 }
424
425 constexpr static std::string_view XmlNodeName = "staffSpec";
427
428private:
429 template <typename NamePositionType>
430 MusxInstance<NamePositioning> getNamePosition() const;
431};
432
440class StaffStyle : public Staff
441{
442protected:
444 explicit StaffStyle(const MusxInstance<Staff>& staff)
445 : Staff(*staff) {}
446
449 void createMasks(const MusxInstance<Base>& ptrToSelf)
450 {
451 masks = std::make_shared<Masks>(ptrToSelf);
452 }
453
454public:
456 explicit StaffStyle(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper)
457 : Staff(document, partId, shareMode, cmper) {}
458
509
510 std::string styleName;
511 bool copyable{};
512 bool addToMenu{};
513 std::shared_ptr<Masks> masks;
515
538 bool containsInstrumentChange() const;
539
548 Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition);
549
550 void integrityCheck(const std::shared_ptr<Base>& ptrToThis) override
551 {
552 if (!masks) {
553 // Finale allows creation of staff styles with no masks, so this is just a verbose comment
555 + " (" + std::to_string(getCmper()) + ") does not override anything.");
556 createMasks(ptrToThis);
557 }
558 if (useNoteFont && !masks->floatNoteheadFont && !noteFont) {
559 useNoteFont = false; // silence integrity check in Staff.
560 }
561 Staff::integrityCheck(ptrToThis);
562 }
563
564 constexpr static std::string_view XmlNodeName = "staffStyle";
566};
567
575{
576public:
578 explicit StaffStyleAssign(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper, Inci inci)
579 : MusicRange(document, partId, shareMode, cmper, inci) {}
580
582
587
588 void integrityCheck(const std::shared_ptr<Base>& ptrToThis) override
589 {
591 if (!styleId) {
592 MUSX_INTEGRITY_ERROR(std::string("Staff style assignment has no staff style id:")
593 + " Part " + std::to_string(getSourcePartId())
594 + " Staff " + std::to_string(getCmper())
595 );
596 }
597 }
598
599 constexpr static std::string_view XmlNodeName = "staffStyleAssign";
601};
602
611{
612private:
614 explicit StaffComposite(const MusxInstance<Staff>& staff, MeasCmper measId, Edu eduPosition)
615 : StaffStyle(staff), m_measureId(measId), m_eduPosition(eduPosition) {}
616
619 void applyStyle(const MusxInstance<StaffStyle>& staffStyle);
620
621 const MeasCmper m_measureId;
622 const Edu m_eduPosition;
623
624public:
636 static MusxInstance<StaffComposite> createCurrent(const DocumentPtr& document, Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition);
637
639 MeasCmper getMeasureId() const { return m_measureId; }
640
642 Edu eduPosition() const { return m_eduPosition; }
643
646};
647
648} // namespace others
649} // namespace dom
650} // namespace musx
DocumentPtr getDocument() const
Gets a reference to the Document.
Definition BaseClasses.h:108
Cmper getSourcePartId() const
Gets the source partId for this instance. If an instance is fully shared with the score,...
Definition BaseClasses.h:124
virtual void integrityCheck(const std::shared_ptr< Base > &ptrToThis)
Allows a class to determine if it has been properly contructed by the factory and fix issues that it ...
Definition BaseClasses.h:154
ShareMode
Describes how this instance is shared between part and score.
Definition BaseClasses.h:91
Base class for classes that are contained by other classes.
Definition BaseClasses.h:224
ContainedClassBase(const MusxInstance< Base > &parent)
Constructs a ContainedClassBase object.
Definition BaseClasses.h:233
Provides optional per-type extension methods for MusxInstanceList.
Definition MusxInstance.h:96
Base class for all "others" types.
Definition BaseClasses.h:283
Cmper getCmper() const
Gets the cmper key value.
Definition BaseClasses.h:328
Represents a range of music using measure and EDUs.
Definition CommonClasses.h:589
Represents a composite of an underlying Staff instance with any applicable StaffStyle instances appli...
Definition Staff.h:611
static MusxInstance< StaffComposite > createCurrent(const DocumentPtr &document, Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition)
Calculates the current staff at the specified metric position by applying all relevant staff styles,...
Definition Staff.cpp:793
MusxInstance< others::Staff > getRawStaff() const
Returns the underlying staff without any staff styles applied.
Definition Staff.cpp:784
MeasCmper getMeasureId() const
Returns the measure this staff composite was created with.
Definition Staff.h:639
Edu eduPosition() const
Returns the Edu position this staff composite was created with.
Definition Staff.h:642
Represents an assignment.
Definition Staff.h:575
Cmper styleId
The cmper of the assigned StaffStyle.
Definition Staff.h:581
void integrityCheck(const std::shared_ptr< Base > &ptrToThis) override
Allows a class to determine if it has been properly contructed by the factory and fix issues that it ...
Definition Staff.h:588
StaffStyleAssign(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper, Inci inci)
Constructor function.
Definition Staff.h:578
static const xml::XmlElementArray< StaffStyleAssign > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Staff.h:599
MusxInstance< StaffStyle > getStaffStyle() const
Returns the StaffStyle instance for this assignment.
Definition Staff.cpp:849
lists the masks that deterimine if this staff style overrides the staff settings
Definition Staff.h:461
bool rbarBreak
overrides Staff::rbarBreak
Definition Staff.h:475
bool blineBreak
overrides Staff::blineBreak
Definition Staff.h:474
bool hideRptBars
overrides Staff::hideRptBars
Definition Staff.h:484
bool showTies
overrides Staff::hideTies
Definition Staff.h:493
bool negTimeParts
overrides Staff::hideTimeSigsInParts
Definition Staff.h:504
bool hideStaffLines
overrides Staff::hideStaffLines
Definition Staff.h:502
bool fullName
overrides Staff::fullNameTextId
Definition Staff.h:480
bool floatNoteheadFont
overrides notehead font settings
Definition Staff.h:465
bool negKey
overrides Staff::hideKeySigs
Definition Staff.h:485
bool negClef
overrides Staff::hideClefs
Definition Staff.h:487
bool negRepeat
overrides Staff::hideRepeats
Definition Staff.h:477
bool flatBeams
overrides Staff::flatBeams
Definition Staff.h:467
bool showNameParts
overrides Staff::showNameInParts
Definition Staff.h:500
bool hideChords
overrides Staff::hideChords
Definition Staff.h:497
bool hideBarlines
overrides Staff::hideBarlines
Definition Staff.h:479
bool noOptimize
overrides Staff::noOptimize
Definition Staff.h:469
bool blankMeasureRest
overrides Staff::blankMeasure
Definition Staff.h:468
bool staffType
overrides staff properties (see StaffComposite::applyStyle)
Definition Staff.h:472
bool negMnumb
overrides Staff::hideMeasNums
Definition Staff.h:476
bool hideKeySigsShowAccis
overrides Staff::hideKeySigsShowAccis
Definition Staff.h:505
bool redisplayLayerAccis
overrides Staff::redisplayLayerAccis
Definition Staff.h:503
bool negNameScore
overrides Staff::hideNameInScore
Definition Staff.h:478
static const xml::XmlElementArray< Masks > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool hideFretboards
overrides Staff::hideFretboards
Definition Staff.h:498
bool hideLyrics
overrides Staff::hideLyrics
Definition Staff.h:499
bool fullNamePos
overrides presence, absence of NamePositionStyleFull instance.
Definition Staff.h:490
bool transposition
overrides transposition fields
Definition Staff.h:473
bool abrvName
overrides Staff::abbrvNameTextId
Definition Staff.h:481
bool negTime
overrides Staff::hideTimeSigs (in Score)
Definition Staff.h:486
bool altNotation
overrides alternate notation properties (see StaffComposite::applyStyle)
Definition Staff.h:492
bool showNoteColors
overrides Staff::showNoteColors
Definition Staff.h:501
bool showStems
overrides stem properties (see StaffComposite::applyStyle)
Definition Staff.h:496
bool abrvNamePos
overrides presence, absence of NamePositionStyleAbbreviated instance.
Definition Staff.h:491
bool floatKeys
overrides Staff::floatKeys
Definition Staff.h:482
bool notationStyle
overrides notations style
Definition Staff.h:470
bool showRests
overrides Staff::hideRests
Definition Staff.h:495
bool useNoteShapes
overrides Staff::useNoteShapes
Definition Staff.h:466
bool floatTime
overrides Staff::floatTime
Definition Staff.h:483
bool hideStaff
overrides Staff::hideMode
Definition Staff.h:488
bool defaultClef
overrides Staff::defaultClef
Definition Staff.h:471
bool noKey
overrides Staff::noKey
Definition Staff.h:489
bool showDots
overrides Staff::hideDots
Definition Staff.h:494
Represents a Finale staff style.
Definition Staff.h:441
void integrityCheck(const std::shared_ptr< Base > &ptrToThis) override
Allows a class to determine if it has been properly contructed by the factory and fix issues that it ...
Definition Staff.h:550
std::shared_ptr< Masks > masks
Definition Staff.h:513
static const xml::XmlElementArray< StaffStyle > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
StaffStyle(const MusxInstance< Staff > &staff)
protected constructor for StaffComposite. This constructor must be followed by a call to createMasks.
Definition Staff.h:444
StaffStyle(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
Constructor function.
Definition Staff.h:456
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Staff.h:564
bool containsInstrumentChange() const
Determines whether this staff style represents or includes an instrument change.
Definition Staff.cpp:817
static MusxInstanceList< StaffStyle > findAllOverlappingStyles(const DocumentPtr &document, Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition)
Finds a subset from all StaffStyle instances that overlap with the specified metric position on a giv...
Definition Staff.cpp:825
bool copyable
whether the staff style assignments for this style should be copied when copy/pasting music
Definition Staff.h:511
std::string styleName
name of staff style
Definition Staff.h:510
void createMasks(const MusxInstance< Base > &ptrToSelf)
Separate creator for masks.
Definition Staff.h:449
bool addToMenu
add this staff style to the context menu for staff styles
Definition Staff.h:512
Represents chromatic transposition details.
Definition Staff.h:130
static const xml::XmlElementArray< ChromaticTransposition > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
int diatonic
The diatonic interval. See music_theory::Transposer for more information.
Definition Staff.h:133
int alteration
The alteration that defines the chromatic interval (in chromatic half-steps). See music_theory::Trans...
Definition Staff.h:132
Represents key signature transposition details.
Definition Staff.h:117
int adjust
The adjustment to the number of sharps or flats in the key signature.
Definition Staff.h:120
static const xml::XmlElementArray< KeySigTransposition > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
int interval
The diatonic transposition interval.
Definition Staff.h:119
Encapsulates transposition options for a staff.
Definition Staff.h:146
std::shared_ptr< ChromaticTransposition > chromatic
Shared pointer to the chromatic transposition details, if any.
Definition Staff.h:155
std::shared_ptr< KeySigTransposition > keysig
Shared pointer to the key signature transposition details, if any.
Definition Staff.h:152
bool noSimplifyKey
Inverse of "Simplify Key" (xml node is <noKeyOpt>)
Definition Staff.h:149
static const xml::XmlElementArray< Transposition > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool setToClef
If true, forces the clef in Staff::transposedClef.
Definition Staff.h:148
Represents the definition of a Finale staff.
Definition Staff.h:48
bool altHideOtherLyrics
Hide lyrics in other layers in alternate notation.
Definition Staff.h:200
bool hideDots
Inverse of "Display Augmentation Dots".
Definition Staff.h:227
AutoNumberingStyle
Enum for auto-numbering style. Auto-numbering is based on instUuid.
Definition Staff.h:55
@ ArabicSuffix
Arabic numeral suffix (default). May not appear in xml.
@ ArabicPrefix
Arabic numeral prefix (with dot): 1. 2. 3. ...
@ OrdinalPrefix
Ordinal number prefix: 1st 2nd 3rd, ...
bool noteShapesFromStyle
True if noteShapesId is for a staff style. (Determines which note shapes class to retrieve....
Definition Staff.h:264
Evpu dwRestOffset
Offset for downstem rests.
Definition Staff.h:221
bool hideRepeats
Inverse of "Display Endings and Text Repeats".
Definition Staff.h:212
ClefIndex defaultClef
Index of default clef for the staff.
Definition Staff.h:172
AlternateNotation
Enum for alternate notation styles.
Definition Staff.h:102
@ BlankWithRests
Blank Notation with Rests.
@ SlashBeats
Slash Notation (on beats)
util::EnigmaParsingContext getAbbreviatedInstrumentNameCtx(Cmper forPartId, bool preferStaffName=false) const
Returns the parsing context for the abbreviated name.
Definition Staff.cpp:340
void integrityCheck(const std::shared_ptr< Base > &ptrToThis) override
Allows a class to determine if it has been properly contructed by the factory and fix issues that it ...
Definition Staff.h:400
bool hideClefs
Inverse of "Display Clefs".
Definition Staff.h:217
MusxInstanceList< PartDefinition > getContainingParts(bool includeScore=true) const
Gets a list of all parts that contain this staff.
Definition Staff.cpp:520
bool altRhythmStemsUp
Show stems up in alternate Rhythmic Notation mode.
Definition Staff.h:195
Efix horzStemOffDown
Horizontal Stem Offsets: Down Stem.
Definition Staff.h:248
std::pair< std::string, bool > calcAutoNumberingAffix() const
Calculate the auto numbering prefix or suffix, if needed.
Definition Staff.cpp:243
int calcToplinePosition() const
Calculates the position of the top staff line, relative to the reference line.
Definition Staff.cpp:484
bool hideRepeatTopDot
Inverse of "Top Repeat Dot" in Staff Setup dialog.
Definition Staff.h:207
Evpu hRestOffset
Offset for half rests.
Definition Staff.h:223
std::optional< int > staffLines
Number of lines in the staff (if no custom staff)
Definition Staff.h:174
Efix vertStemStartOffUp
Vertical Stem Offsets For Notehead End: Up Stem.
Definition Staff.h:249
bool hideKeySigs
Inverse of "Display Key Signatures".
Definition Staff.h:215
Cmper multiStaffInstId
Definition Staff.h:273
NotationStyle
Enum for notation style.
Definition Staff.h:79
bool hideStaffLines
Inverse of "Display Staff Lines".
Definition Staff.h:218
bool hideTimeSigs
Inverse of "Display Time Signatures in Score".
Definition Staff.h:216
bool noOptimize
Inverse of "Allow Hiding When Empty".
Definition Staff.h:209
std::optional< std::vector< int > > customStaff
A list of stafflines from 0..26 where a standard 5-line staff is values 11, 12, 13,...
Definition Staff.h:175
Efix vertTabNumOff
Vertical offset for tab number. (Tablature Staff Attributes)
Definition Staff.h:233
int calcNumberOfStafflines() const
Calculates the number of staff lines on this staff.
Definition Staff.cpp:459
bool noKey
"Ignore Key Signatures"
Definition Staff.h:220
static void calcAllRuntimeValues(const DocumentPtr &document)
Populate runtime values for all staves or staffstyles, such as percussion map Id if any.
Definition Staff.cpp:118
std::shared_ptr< FontInfo > noteFont
The custom font to use for noteheads. Guaranteed non-null by integrityCheck if useNoteFont is true.
Definition Staff.h:169
static void calcAllAutoNumberValues(const DocumentPtr &document)
Get the auto-numbering value for this staff, if applicable.
Definition Staff.cpp:37
std::pair< int, int > calcTranspositionInterval() const
Calculates the transposition interval for this staff or staff composite.
Definition Staff.cpp:507
bool hideRepeatBottomDot
Inverse of "Bottom Repeat Dot" in Staff Setup dialog.
Definition Staff.h:203
bool altSlashDots
Show dots on beat slashes in compound meter.
Definition Staff.h:196
int capoPos
"Capo Position" (Tablature Staff Attributes)
Definition Staff.h:178
bool fullNamePosFromStyle
Definition Staff.h:267
bool hasStyles
Indicates that this staff has staff style assignments.
Definition Staff.h:184
Cmper abrvNamePosId
Definition Staff.h:269
Efix vertStemEndOffUp
Vertical Stem Offsets For Stem End: Up Stem.
Definition Staff.h:251
bool altHideArtics
Hide Articulations in alternate notation (in Apply-To Layer)
Definition Staff.h:192
MusxInstance< MultiStaffInstrumentGroup > getMultiStaffInstGroup() const
Returns the MultiStaffInstrumentGroup for this staff if it is part of one in the data....
Definition Staff.cpp:287
std::string addAutoNumbering(const std::string &plainName) const
Add auto numbering as a prefix or suffix, if needed.
Definition Staff.cpp:265
StemDirection stemDirection
stem direction for staff (xml node is <stemDir>)
Definition Staff.h:240
bool hideStems
Inverse of "Display Stems".
Definition Staff.h:239
Evpu otherRestOffset
Offset for other rests.
Definition Staff.h:224
std::string getFullInstrumentName(util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii, bool preferStaffName=false) const
Returns the full instrument name for this staff without Enigma tags and with autonumbering (if any)
Definition Staff.cpp:332
std::optional< int > autoNumberValue
Calculated autonumbering value. It is computed by calcAllAutoNumberValues.
Definition Staff.h:275
Efix horzStemOffUp
Horizontal Stem Offsets: Up Stem.
Definition Staff.h:247
bool abrvNamePosFromStyle
Definition Staff.h:271
Efix vertStemStartOffDown
Vertical Stem Offsets For Notehead End: Down Stem.
Definition Staff.h:250
Evpu lineSpace
Distance between staff lines.
Definition Staff.h:176
Evpu wRestOffset
Offset for whole rests.
Definition Staff.h:222
bool stemStartFromStaff
Definition Staff.h:242
bool altHideSmartShapes
Hide Smart Shapes (in Apply-To layer: probably only affects entry-attached shapes)
Definition Staff.h:194
AlternateNotation altNotation
Alternate notation on the staff.
Definition Staff.h:190
bool stemsFixedEnd
"Use Vertical Offset For Beam End Of Stems (Offset From Staff)"
Definition Staff.h:245
MusxInstance< details::ShapeNoteBase > getNoteShapes() const
Returns the note shape record in effect for this staff instance.
Definition Staff.cpp:368
HideMode hideMode
"Force Hide Staff" option
Definition Staff.h:253
bool hideTuplets
Inverse of "Show Tuplets" (Tablature Staff Attributes)
Definition Staff.h:237
Staff(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
Constructor function.
Definition Staff.h:161
bool hideBarlines
Inverse of "Display Barlines".
Definition Staff.h:213
int lowestFret
"Default Lowest Fret" (Tablature Staff Attributes)
Definition Staff.h:179
bool useNoteShapes
Indicates that note shapes should be used. It is ignored is no staff- or staffstyle-specific note sha...
Definition Staff.h:170
bool hasInstrumentAssigned() const
Return true if this staff has an instrument assigned.
Definition Staff.cpp:499
LayerIndex altLayer
Alternate notation Apply To Layer index (0..3)
Definition Staff.h:191
bool floatKeys
"Independent Key Signature"
Definition Staff.h:180
Cmper fullNameTextId
Full name TextBlock ID. (xml node is <fullName>)
Definition Staff.h:229
NotationStyle notationStyle
Standard, percussion, or tablature.
Definition Staff.h:168
StemDirection
Enum for staff-level stem direction override.
Definition Staff.h:68
@ AlwaysDown
stems are always down on this staff
@ Default
the default (may not occur in xml)
@ AlwaysUp
stems are always up on this staff
bool useAutoNumbering
Whether names should be auto-numbered. (xml node is <useAutoNum>)
Definition Staff.h:257
bool hideTies
Inverse of "Display Ties".
Definition Staff.h:226
util::EnigmaParsingContext getFullInstrumentNameCtx(Cmper forPartId, bool preferStaffName=false) const
Returns the parsing context for the full name.
Definition Staff.cpp:312
bool showNameInParts
"Display Staff Name in Parts" (xml node is <showNameParts>)
Definition Staff.h:185
ClefIndex transposedClef
Index of transposed clef for the staff. Only used if Transposition::setToClef is true.
Definition Staff.h:173
bool floatTime
"Independent Time Signature"
Definition Staff.h:181
bool altHideOtherSmartShapes
Hide Smart Shapes in other layers in alternate notation.
Definition Staff.h:201
std::optional< Cmper > percussionMapId
Calculated percussion map Id for a percussion staff. (Populated by in calcAllRuntimeValues....
Definition Staff.h:276
int calcMiddleStaffPosition() const
Calculates the middle staff position. For staves with even numbers of lines, it is the middle space.
Definition Staff.cpp:469
Evpu botBarlineOffset
Offset for the bottom barline.
Definition Staff.h:189
bool hideLyrics
Inverse of "Display Lyrics".
Definition Staff.h:208
Efix vertStemEndOffDown
Vertical Stem Offsets For Stem End: Down Stem.
Definition Staff.h:252
std::string getFullName(util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
Returns the full staff name without Enigma tags. If the full name contains part-specific tags (rare),...
Definition Staff.cpp:277
Cmper abbrvNameTextId
Abbreviated name TextBlock ID. (xml node is <abbrvName>)
Definition Staff.h:230
std::string getAbbreviatedName(util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii) const
Returns the abbreviated staff name without Enigma tags. If the abbreviated name contains part-specifi...
Definition Staff.cpp:282
bool hideFretboards
Inverse of "Display Fretboards".
Definition Staff.h:205
MusxInstance< details::StaffGroup > getMultiStaffInstVisualGroup() const
Returns the details::StaffGroup for this staff if it is part of a multistaff instrument (as defined i...
Definition Staff.cpp:298
bool rbarBreak
"Break Repeat Barlines Between Staves"
Definition Staff.h:183
Evpu topRepeatDotOff
Offset for top repeat dots.
Definition Staff.h:232
HideMode
Enum for hide mode.
Definition Staff.h:90
@ Score
Collapse in score only.
@ ScoreParts
Collapse in score and parts.
bool showNoteColors
"Color Noteheads" (Score Manager)
Definition Staff.h:186
bool redisplayLayerAccis
"Redisplay Accidentals in Other Layers Within Measures"
Definition Staff.h:254
bool altHideExpressions
Hide Expressions in alternate notation (in Apply-To Layer)
Definition Staff.h:199
bool useNoteFont
Indicates if noteFont should be used.
Definition Staff.h:171
Evpu topBarlineOffset
Offset for the top barline.
Definition Staff.h:210
Cmper fretInstId
Cmper of FretInstrument for TAB strings. (Tablature Staff Attributes)
Definition Staff.h:238
bool hideBeams
Inverse of "Show Beams".
Definition Staff.h:241
bool hideTimeSigsInParts
Inverse of "Display Time Signatures in Parts".
Definition Staff.h:255
MusxInstance< NamePositioning > getFullNamePosition() const
Returns the full name positioning in effect for this staff instance.
Definition Staff.cpp:419
bool hideChords
Inverse of "Display Chords".
Definition Staff.h:219
Cmper fullNamePosId
Definition Staff.h:265
bool showNamesForPart(Cmper partId) const
Returns if names should be shown for the specified part.
Definition Staff.h:324
bool hideRests
Inverse of "Display Rests".
Definition Staff.h:225
bool breakTabLinesAtNotes
"Break Tablature Lines At Numbers" (Tablature Staff Attributes)
Definition Staff.h:236
int stemReversal
Stem reversal value.
Definition Staff.h:228
bool blankMeasure
Inverse of "Display Rests in Empty Measures".
Definition Staff.h:206
Evpu botRepeatDotOff
Offset for bottom repeat dots.
Definition Staff.h:231
bool altHideOtherArtics
Hide articulations in other layers in alternate notation.
Definition Staff.h:198
bool altHideOtherNotes
Hide notes in other layers in alternate notation.
Definition Staff.h:197
bool blineBreak
"Break Barlines Between Staves"
Definition Staff.h:182
MusxInstance< NamePositioning > getAbbreviatedNamePosition() const
Returns the abbreviated name positioning in effect for this staff instance.
Definition Staff.cpp:427
static const xml::XmlElementArray< Staff > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
MusxInstance< PartDefinition > firstContainingPart() const
Finds the first part that contains this staff, not including the score.
Definition Staff.cpp:539
ClefIndex calcClefIndexAt(MeasCmper measureId, Edu position, bool forWrittenPitch=false) const
Returns the clef in this staff at the specified location.
Definition Staff.cpp:435
ClefIndex calcFirstClefIndex(bool forWrittenPitch=false) const
Returns the first clef in this staff.
Definition Staff.h:364
bool useTabLetters
"Use Letters" (Tablature Staff Attributes)
Definition Staff.h:235
bool hideRptBars
Inverse of "Display Repeat Bars".
Definition Staff.h:214
std::shared_ptr< Transposition > transposition
Transposition details, if non-null.
Definition Staff.h:187
bool hideKeySigsShowAccis
"Hide Key Signature and Show Accidentals" transposition option.
Definition Staff.h:258
AutoNumberingStyle autoNumbering
Autonumbering style if useAutoNumbering is true. (xml node is <autoNum>)
Definition Staff.h:256
Cmper noteShapesId
Definition Staff.h:262
bool hideNameInScore
Inverse of "Display Staff Name in Score" (xml node is <hideStfNameInScore>)
Definition Staff.h:188
std::string instUuid
Unique identifier for the type of instrument.
Definition Staff.h:177
bool altHideOtherExpressions
Hide Expressions in other layers in alternate notation.
Definition Staff.h:202
bool stemsFixedStart
"Use Vertical Offset For Notehead End Of Stems"
Definition Staff.h:246
bool hideMeasNums
Inverse of "Display Measure Numbers".
Definition Staff.h:211
std::string getAbbreviatedInstrumentName(util::EnigmaString::AccidentalStyle accidentalStyle=util::EnigmaString::AccidentalStyle::Ascii, bool preferStaffName=false) const
Returns the abbreviated instrument name for this staff without Enigma tags and with autonumbering (if...
Definition Staff.cpp:360
bool flatBeams
"Flat Beams"
Definition Staff.h:204
bool altHideLyrics
Hide Lyrics in alternate notation (in Apply-To Layer)
Definition Staff.h:193
bool showTabClefAllSys
Inverse of "Show Clef Only On First Measure" (Tablature Staff Attributes)
Definition Staff.h:234
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Staff.h:425
Wrapper class for interpreting and rendering Enigma-style strings with insert handling.
Definition EnigmaString.h:415
AccidentalStyle
Enumeration to specify the type of accidental substitution representation.
Definition EnigmaString.h:191
@ Ascii
Use ASCII substitutions for accidentals.
@ Verbose
Informational messages that should only displayed when verbose logging is requested.
static void log(LogLevel level, const std::string &message)
Logs a message with a specific severity level.
Definition Logger.h:87
int16_t MeasCmper
Enigma meas Cmper (may be negative when not applicable)
Definition Fundamentals.h:64
int32_t Efix
EFIX value (64 per EVPU, 64*288=18432 per inch)
Definition Fundamentals.h:60
std::shared_ptr< const T > MusxInstance
Defines the type of a musx instance stored in a pool.
Definition MusxInstance.h:35
unsigned int LayerIndex
Layer index (valid values are 0..3)
Definition Fundamentals.h:71
constexpr Cmper SCORE_PARTID
The part id of the score.
Definition Fundamentals.h:79
int16_t Inci
Enigma "incident" key type.
Definition Fundamentals.h:56
int32_t Evpu
EVPU value (288 per inch)
Definition Fundamentals.h:57
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:55
@ Percussion
Percussion clef, open rectangle (no pitch).
uint16_t ClefIndex
Index into options::ClefOptions::clefDefs.
Definition Fundamentals.h:68
int32_t Edu
"Enigma Durational Units" value (1024 per quarter note)
Definition Fundamentals.h:61
std::weak_ptr< Document > DocumentWeakPtr
Shared weak Document pointer.
Definition BaseClasses.h:57
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition BaseClasses.h:55
int16_t StaffCmper
Enigma staff (staffId) Cmper (may be negative when not applicable)
Definition Fundamentals.h:65
std::vector< XmlElementDescriptor< T > > XmlElementArray
an array type for XmlElementDescriptor instances.
Definition XmlInterface.h:127
object model for musx file (enigmaxml)
Definition BaseClasses.h:36