MUSX Document Model
Loading...
Searching...
No Matches
CommonClasses.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 <numeric>
25#include <filesystem>
26#include <array>
27
28#include "musx/util/Fraction.h"
29#include "BaseClasses.h"
30
31namespace music_theory {
32class Transposer;
33enum class DiatonicMode : int;
34} // namespace music_theory
35
36namespace musx {
37namespace dom {
38
39namespace details {
40class IndependentStaffDetails; // forward delcaration
41} // namespace details
42
43namespace others {
44 class Measure; // forward declaration
45 class Staff; // forward declaration
46} // namespace others
47
48// This file contains common classes that are shared among Options, Others, and Details.
49
56enum class NoteType : Edu
57{
58 Maxima = 0x8000,
59 Longa = 0x4000,
60 Breve = 0x2000,
61 Whole = EDU_PER_WHOLE_NOTE,
62 Half = 0x0800,
63 Quarter = 0x0400,
64 Eighth = 0x0200,
65 Note16th = 0x0100,
66 Note32nd = 0x0080,
67 Note64th = 0x0040,
68 Note128th = 0x0020,
69 Note256th = 0x0010,
70 Note512th = 0x0008,
71 Note1024th = 0x0004,
72 Note2048th = 0x0002,
73 Note4096th = 0x0001
74};
75
82{
83 Treble = 0,
84 Alto = 1,
85 Tenor = 2,
86 Bass = 3,
87 Percussion = 4,
88 Treble8vb = 5,
89 Bass8vb = 6,
90 Baritone = 7,
91 FrenchViolin = 8,
92 BaritoneC = 9,
93 MezzoSoprano = 10,
94 Soprano = 11,
95 AltPercussion = 12,
96 Treble8va = 13,
97 Bass8va = 14,
98 Blank = 15,
99 Tab1 = 16,
100 Tab2 = 17
101};
102
107enum class ShowClefMode
108{
109 WhenNeeded,
110 Never,
111 Always
112};
113
122{
123public:
129 FontInfo(const DocumentWeakPtr& document, bool sizeIsPercent = false)
130 : CommonClassBase(document), m_sizeIsPercent(sizeIsPercent)
131 {
132 }
133
135 int fontSize{};
136 bool bold{};
137 bool italic{};
138 bool underline{};
139 bool strikeout{};
140 bool absolute{};
141 bool hidden{};
142
144 bool getSizeIsPercent() const { return m_sizeIsPercent; }
145
149 inline static constexpr uint16_t EnigmaStyleBold = 0x01;
150 inline static constexpr uint16_t EnigmaStyleItalic = 0x02;
151 inline static constexpr uint16_t EnigmaStyleUnderline = 0x04;
152 inline static constexpr uint16_t EnigmaStyleStrikeout = 0x20;
153 inline static constexpr uint16_t EnigmaStyleAbsolute = 0x40;
154 inline static constexpr uint16_t EnigmaStyleHidden = 0x80;
156
161 std::string getName() const;
162
168 void setFontIdByName(const std::string& name);
169
176 void setEnigmaStyles(uint16_t efx)
177 {
178 bold = efx & EnigmaStyleBold;
184 }
185
187 uint16_t getEnigmaStyles() const
188 {
189 uint16_t result = 0;
190 if (bold) result |= EnigmaStyleBold;
191 if (italic) result |= EnigmaStyleItalic;
192 if (underline) result |= EnigmaStyleUnderline;
193 if (strikeout) result |= EnigmaStyleStrikeout;
194 if (absolute) result |= EnigmaStyleAbsolute;
195 if (hidden) result |= EnigmaStyleHidden;
196 return result;
197 }
198
201 { return fontId == 0; }
202
204 bool calcIsSymbolFont() const;
205
208 static std::optional<std::filesystem::path> calcSMuFLMetaDataPath(const std::string& fontName);
209
211 std::optional<std::filesystem::path> calcSMuFLMetaDataPath() const
213
217 bool calcIsSMuFL() const;
218
224 static std::vector<std::filesystem::path> calcSMuFLPaths();
225
227
228private:
229 bool m_sizeIsPercent;
230};
231
237{
238public:
240
251 enum class KeyContext {
252 Concert,
253 Written
254 };
255
262 uint16_t key{};
263 bool keyless{};
265
280 Cmper getKeyMode() const { return isLinear() ? key >> 8 : key; }
281
286 { return isLinear() ? int(int8_t(key & 0xff)) + getAlterationOffset(ctx) : 0; }
287
288 bool isLinear() const { return (key & 0xC000) == 0; }
289 bool isNonLinear() const { return (key & 0xC000) != 0; }
290 bool isBuiltIn() const { return isLinear() && getKeyMode() <= 1; }
291 bool isMajor() const { return getKeyMode() == 0; }
292 bool isMinor() const { return getKeyMode() == 1; }
293
297 std::optional<music_theory::DiatonicMode> calcDiatonicMode() const;
298
300 bool isSame(const KeySignature& src) const
301 {
302 return isSameConcert(src) && m_alterationOffset == src.m_alterationOffset && m_octaveDisplacement == src.m_octaveDisplacement;
303 }
304
306 bool isSameConcert(const KeySignature& src) const
307 {
308 return key == src.key && keyless == src.keyless && hideKeySigShowAccis == src.hideKeySigShowAccis;
309 }
310
327 void setTransposition(int interval, int keyAdjustment, bool simplify);
328
331
335 int calcTonalCenterIndex(KeyContext ctx) const;
336
340 int calcAlterationOnNote(unsigned noteIndex, KeyContext ctx ) const;
341
345 { return ctx == KeyContext::Written ? m_octaveDisplacement : 0; }
346
348 int calcEDODivisions() const;
349
351 std::optional<std::vector<int>> calcKeyMap() const;
352
357 std::unique_ptr<music_theory::Transposer> createTransposer(int displacement, int alteration) const;
358
359 void integrityCheck(const std::shared_ptr<Base>& ptrToThis) override
360 {
361 this->CommonClassBase::integrityCheck(ptrToThis);
362 if (key >= 0x8000) {
363 MUSX_INTEGRITY_ERROR("Key signature has invalid key value: " + std::to_string(key));
364 }
365 }
366
368
369private:
370 std::vector<unsigned> calcTonalCenterArrayForSharps() const;
371 std::vector<unsigned> calcTonalCenterArrayForFlats() const;
372 std::vector<unsigned> calcTonalCenterArray(KeyContext ctx) const;
373 std::vector<int> calcAcciAmountsArray(KeyContext ctx) const;
374 std::vector<unsigned> calcAcciOrderArray(KeyContext ctx) const;
375
376 int m_octaveDisplacement{};
377 int m_alterationOffset{};
378
379 int getAlterationOffset(KeyContext ctx) const
380 { return ctx == KeyContext::Written ? m_alterationOffset : 0; }
381
382};
383
384namespace texts {
385class LyricsTextBase; // forward delcaration
386} // namespace texts
387
393{
394public:
395
396 std::string syllable;
399
400private:
406 LyricsSyllableInfo(const DocumentWeakPtr& document, const std::string text, bool before, bool after)
407 : CommonClassBase(document), syllable(text), hasHyphenBefore(before), hasHyphenAfter(after)
408 {
409 }
410
411 friend class texts::LyricsTextBase;
412};
413
419{
420public:
421
424 {
425 std::vector<util::Fraction> counts;
427 std::vector<Edu> units;
430
432 bool operator==(const TimeSigComponent& src) const
433 { return counts == src.counts && units == src.units; }
434
437 { return std::accumulate(counts.begin(), counts.end(), util::Fraction{}); }
438
440 Edu sumUnits() const
441 { return std::accumulate(units.begin(), units.end(), Edu{}); }
442 };
443
444 std::vector<TimeSigComponent> components;
445
450 std::pair<util::Fraction, NoteType> calcSimplified() const;
451
454 {
455 util::Fraction result = std::accumulate(components.begin(), components.end(), util::Fraction{},
456 [](const util::Fraction& acc, const TimeSigComponent& comp)
457 { return acc + (comp.sumCounts() * comp.sumUnits()); }
458 );
459 return result / Edu(NoteType::Whole);
460 }
461
463 bool isSame(const TimeSignature& src) const
464 {
465 return components == src.components && m_abbreviate == src.m_abbreviate;
466 }
467
472 {
473 checkIndex(index);
474 return MusxInstance<TimeSignature>(new TimeSignature(getDocument(), components[index], m_abbreviate));
475 }
476
481 std::optional<char32_t> getAbbreviatedSymbol() const;
482
484 bool isCommonTime() const;
486 bool isCutTime() const;
487
488private:
489 void checkIndex(size_t index) const
490 {
491 if (index > components.size()) {
492 throw std::invalid_argument("Index out of range. The time signature has " + std::to_string(components.size())
493 + " elements. The index requested was " + std::to_string(index) + ".");
494 }
495 }
496
501 explicit TimeSignature(const DocumentWeakPtr& document, int beats, Edu unit, bool hasCompositeTop, bool hasCompositeBottom,
502 std::optional<bool> abbreviate = std::nullopt);
503
508 explicit TimeSignature(const DocumentWeakPtr& document, const TimeSigComponent& timeSigUnit, std::optional<bool> abbreviate)
509 : CommonClassBase(document), m_abbreviate(abbreviate)
510 {
511 components.push_back(timeSigUnit);
512 }
513
514 std::optional<bool> m_abbreviate;
515
516 friend class others::Measure;
517 friend class details::IndependentStaffDetails;
518};
519
520namespace others {
521
522// The following classes are defined here because they are shared by multiple subclasses and container classes.
523
528class Enclosure : public OthersBase
529{
530public:
535 enum class Shape : uint8_t
536 {
537 NoEnclosure = 0,
538 Rectangle = 1,
539 Ellipse = 2,
540 Triangle = 3,
541 Diamond = 4,
542 Pentagon = 5,
543 Hexagon = 6,
544 Heptagon = 7,
545 Octogon = 8
546 };
547
555 explicit Enclosure(const DocumentWeakPtr& document, Cmper partId = 0, ShareMode shareMode = ShareMode::All, Cmper cmper = 0)
556 : OthersBase(document, partId, shareMode, cmper) {}
557
565 bool fixedSize{};
566 bool equalAspect{};
567 bool notTall{};
568 bool opaque{};
570
572};
573
581class MusicRange : public OthersBase
582{
583public:
592 explicit MusicRange(const DocumentWeakPtr& document, Cmper partId = SCORE_PARTID, ShareMode shareMode = ShareMode::All,
593 Cmper cmper = 0, std::optional<Inci> inci = std::nullopt)
594 : OthersBase(document, partId, shareMode, cmper, inci)
595 {
596 }
597
602
606 bool contains(MeasCmper measId, Edu eduPosition) const
607 {
608 return (startMeas < measId || (startMeas == measId && startEdu <= eduPosition)) &&
609 (endMeas > measId || (endMeas == measId && endEdu >= eduPosition));
610 }
611
618 std::optional<std::pair<MeasCmper, Edu>> nextLocation(const std::optional<StaffCmper>& forStaff = std::nullopt) const;
619
621};
622
631{
632public:
633
641 explicit NamePositioning(const DocumentWeakPtr& document, Cmper partId = SCORE_PARTID, ShareMode shareMode = ShareMode::All, Cmper cmper = 0)
642 : OthersBase(document, partId, shareMode, cmper) {}
643
646 enum class AlignJustify
647 {
648 Left,
649 Right,
650 Center
651 };
652
656 bool indivPos{};
658 bool expand{};
659
661};
662
663} // namespace others
664} // namespace dom
665} // namespace mux
DocumentPtr getDocument() const
Gets a reference to the Document.
Definition BaseClasses.h:108
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 commonly used among others, details, entries, and/or texts....
Definition BaseClasses.h:200
CommonClassBase(const DocumentWeakPtr &document)
Constructs a CommonClassBase object.
Definition BaseClasses.h:209
Represents the default font settings for a particular element type.
Definition CommonClasses.h:122
static constexpr uint16_t EnigmaStyleHidden
Hidden text bit.
Definition CommonClasses.h:154
static constexpr uint16_t EnigmaStyleItalic
Italic style bit.
Definition CommonClasses.h:150
FontInfo(const DocumentWeakPtr &document, bool sizeIsPercent=false)
constructor
Definition CommonClasses.h:129
static constexpr uint16_t EnigmaStyleStrikeout
Strikeout style bit.
Definition CommonClasses.h:152
bool calcIsSymbolFont() const
Calculates if this is a symbol font. (See others::FontDefinition::calcIsSymbolFont....
Definition CommonClasses.cpp:109
static constexpr uint16_t EnigmaStyleUnderline
Underline style bit.
Definition CommonClasses.h:151
uint16_t getEnigmaStyles() const
Returns the font styles as an nfx bitmask.
Definition CommonClasses.h:187
static constexpr uint16_t EnigmaStyleAbsolute
Fixed-size (absolute) bit.
Definition CommonClasses.h:153
static constexpr uint16_t EnigmaStyleBold
Bold style bit.
Definition CommonClasses.h:149
bool strikeout
Strikeout effect.
Definition CommonClasses.h:139
void setFontIdByName(const std::string &name)
Sets the id of the font from a string name.
Definition CommonClasses.cpp:60
Cmper fontId
Font identifier. This is a Cmper for others::FontDefinition.
Definition CommonClasses.h:134
static std::vector< std::filesystem::path > calcSMuFLPaths()
Returns the standard SMuFL font folder.
Definition CommonClasses.cpp:117
bool calcIsSMuFL() const
Calculates whether this is a SMuFL font.
Definition CommonClasses.cpp:87
std::string getName() const
Get the name of the font.
Definition CommonClasses.cpp:52
static const xml::XmlElementArray< FontInfo > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool getSizeIsPercent() const
If true, the size of this font is calculated as a percent of the preceding font size (in an Enigma st...
Definition CommonClasses.h:144
void setEnigmaStyles(uint16_t efx)
Set style effects based on a bitmask. This is mainly useful for capturing text styles from enigma str...
Definition CommonClasses.h:176
bool italic
Italic effect.
Definition CommonClasses.h:137
bool hidden
Hidden effect.
Definition CommonClasses.h:141
bool calcIsDefaultMusic() const
Calculates if this is the default music font.
Definition CommonClasses.h:200
int fontSize
Font size or percent (where 100 is 100%) of preceding font size. (See getSizeIsPercent....
Definition CommonClasses.h:135
bool underline
Underline effect.
Definition CommonClasses.h:138
bool absolute
Fixed size effect.
Definition CommonClasses.h:140
std::optional< std::filesystem::path > calcSMuFLMetaDataPath() const
Returns the filepath of the SMuFL font's metadata json file, if any.
Definition CommonClasses.h:211
bool bold
Bold effect.
Definition CommonClasses.h:136
Shared key signature class that is contained in other classes. (See others::Measure)
Definition CommonClasses.h:237
Cmper getKeyMode() const
Returns the key mode.
Definition CommonClasses.h:280
bool isSame(const KeySignature &src) const
returns whether the two key signatures represent the same key signature, taking into account transpos...
Definition CommonClasses.h:300
int getAlteration(KeyContext ctx) const
For linear keys, returns the number of sharps or flats from -7..7 (if any).
Definition CommonClasses.h:285
bool hideKeySigShowAccis
Instead of a key signature, show accidentals for the key on the notes where they occur.
Definition CommonClasses.h:264
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 CommonClasses.h:359
bool isLinear() const
whether this is a linear key
Definition CommonClasses.h:288
int calcEDODivisions() const
Calculates the number of EDO division for the key. (The standard value is 12.)
Definition CommonClasses.cpp:418
bool isBuiltIn() const
whether this is a built-in key
Definition CommonClasses.h:290
KeyContext
Indicates whether to compute key signature values in concert or written pitch.
Definition CommonClasses.h:251
@ Written
Use written pitch (with transposition)
@ Concert
Use concert pitch (untransposed)
int calcTonalCenterIndex(KeyContext ctx) const
Calculates the tonal center index for the key, where C=0, D=1, E=2, ...
Definition CommonClasses.cpp:302
int getOctaveDisplacement(KeyContext ctx) const
The octave displacement if this key is a transposed key.
Definition CommonClasses.h:344
uint16_t key
16-bit value intepreted as follows:
Definition CommonClasses.h:262
std::unique_ptr< music_theory::Transposer > createTransposer(int displacement, int alteration) const
Creates a transposer for this KeySignature instance.
Definition CommonClasses.cpp:426
std::optional< music_theory::DiatonicMode > calcDiatonicMode() const
If this key specifies a diatonic mode, returns the mode. This value is independent of EDO divisions....
Definition CommonClasses.cpp:431
void setTransposition(int interval, int keyAdjustment, bool simplify)
Transposes the key by the specified amounts. Set them to zero to remove transposition.
Definition CommonClasses.cpp:345
int calcAlterationOnNote(unsigned noteIndex, KeyContext ctx) const
Calculates the amount of alteration on a note int the key.
Definition CommonClasses.cpp:313
bool isMinor() const
whether this is a built-in minor key
Definition CommonClasses.h:292
bool isNonLinear() const
whether this is a non-linear key
Definition CommonClasses.h:289
static const xml::XmlElementArray< KeySignature > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool isSameConcert(const KeySignature &src) const
returns whether the two key signatures represent the same concert key signature, ignoring transpositi...
Definition CommonClasses.h:306
bool isMajor() const
whether this is a built-in major key
Definition CommonClasses.h:291
std::optional< std::vector< int > > calcKeyMap() const
Calculates the key's diatonic key map.
Definition CommonClasses.cpp:380
bool keyless
Indicates the absence of a key signature.
Definition CommonClasses.h:263
Contains the syllable information for a single syllable. (See texts::LyricsTextBase)
Definition CommonClasses.h:393
bool hasHyphenAfter
indicates the syllable if followed by a hyphen.
Definition CommonClasses.h:398
std::string syllable
the syllable text with no hyphenation or font information.
Definition CommonClasses.h:396
bool hasHyphenBefore
indicates the syllable is preceded by a hyphen.
Definition CommonClasses.h:397
Base class for all "others" types.
Definition BaseClasses.h:283
Shared time signature class that is derived from other classes. (See others::Measure)
Definition CommonClasses.h:419
bool isSame(const TimeSignature &src) const
returns whether the two time signatures represent the same time signature
Definition CommonClasses.h:463
bool isCutTime() const
Returns if this time signature is cut time.
Definition CommonClasses.cpp:529
std::vector< TimeSigComponent > components
the components in the time signature
Definition CommonClasses.h:444
util::Fraction calcTotalDuration() const
Calculates the total duration of the time signature as a fraction of a whole note.
Definition CommonClasses.h:453
std::optional< char32_t > getAbbreviatedSymbol() const
Returns the abbreviated symbol (code point) for this time signature, or std::nullopt if none.
Definition CommonClasses.cpp:498
bool isCommonTime() const
Returns if this time signature is common time.
Definition CommonClasses.cpp:521
MusxInstance< TimeSignature > createComponent(size_t index) const
Creates a time signature corresponding to the component at index.
Definition CommonClasses.h:471
std::pair< util::Fraction, NoteType > calcSimplified() const
Calculates the simplest form of of this time signature, expressed as a fractional count of NoteType u...
Definition CommonClasses.cpp:537
Represents independent time and key signature overrides for a staff.
Definition Details.h:721
Represents the enclosure settings for text expressions.
Definition CommonClasses.h:529
bool notTall
"Enforce Minimum Width": don't let shape get taller than it is wide
Definition CommonClasses.h:567
Evpu yAdd
Center Y offset - offsets text from center (in EVPU).
Definition CommonClasses.h:559
Enclosure(const DocumentWeakPtr &document, Cmper partId=0, ShareMode shareMode=ShareMode::All, Cmper cmper=0)
Constructs an Enclosure object.
Definition CommonClasses.h:555
bool roundCorners
Whether the enclosure has rounded corners.
Definition CommonClasses.h:569
Efix lineWidth
Line thickness in 64ths of an EVPU (EFIX).
Definition CommonClasses.h:562
static const xml::XmlElementArray< Enclosure > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool opaque
Whether the enclosure is opaque.
Definition CommonClasses.h:568
Shape
Enumeration for enclosure shapes.
Definition CommonClasses.h:536
Evpu yMargin
Half height - extra space on top/bottom sides (in EVPU).
Definition CommonClasses.h:561
Shape shape
Enclosure shape (default: NoEnclosure).
Definition CommonClasses.h:563
bool fixedSize
Whether the enclosure is fixed size (ignore text bounding box)
Definition CommonClasses.h:565
bool equalAspect
"Match Height and Width"
Definition CommonClasses.h:566
Efix cornerRadius
Corner radius (in EFIX).
Definition CommonClasses.h:564
Evpu xMargin
Half width - extra space on left/right sides (in EVPU).
Definition CommonClasses.h:560
Evpu xAdd
Center X offset - offsets text from center (in EVPU).
Definition CommonClasses.h:558
Represents the attributes of a measure.
Definition Others.h:963
Represents a range of music using measure and EDUs.
Definition CommonClasses.h:582
Edu startEdu
Starting EDU (Elapsed Durational Unit) in the range.
Definition CommonClasses.h:599
MeasCmper endMeas
Ending measure in the range.
Definition CommonClasses.h:600
std::optional< std::pair< MeasCmper, Edu > > nextLocation(const std::optional< StaffCmper > &forStaff=std::nullopt) const
Returns the next metric location following the music range.
Definition Others.cpp:274
static const xml::XmlElementArray< MusicRange > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
Edu endEdu
Ending EDU (Elapsed Durational Unit) in the range.
Definition CommonClasses.h:601
MusicRange(const DocumentWeakPtr &document, Cmper partId=SCORE_PARTID, ShareMode shareMode=ShareMode::All, Cmper cmper=0, std::optional< Inci > inci=std::nullopt)
Constructs a MusicRange object.
Definition CommonClasses.h:592
MeasCmper startMeas
Starting measure in the range.
Definition CommonClasses.h:598
bool contains(MeasCmper measId, Edu eduPosition) const
Returns true of the given metric location is contained in this MusicRange instance.
Definition CommonClasses.h:606
Contains horizontal and vertical offsets, alignment, and expansion settings for name positioning.
Definition CommonClasses.h:631
bool indivPos
Indicates that this positioning overrides the default positioning. (Not used by options::StaffOptions...
Definition CommonClasses.h:656
NamePositioning(const DocumentWeakPtr &document, Cmper partId=SCORE_PARTID, ShareMode shareMode=ShareMode::All, Cmper cmper=0)
Constructs an NamePositioning object.
Definition CommonClasses.h:641
bool expand
"Expand Single Word"
Definition CommonClasses.h:658
AlignJustify
Alignment and justification options for staff and group names.
Definition CommonClasses.h:647
@ Left
Left alignment or justification (the default value.)
Evpu horzOff
Horizontal distance from staff in Evpu.
Definition CommonClasses.h:653
AlignJustify hAlign
Horizontal alignment for the name text. (xml node is <halign>)
Definition CommonClasses.h:657
AlignJustify justify
Justification for the name text.
Definition CommonClasses.h:655
Evpu vertOff
Vertical offset from staff in Evpu.
Definition CommonClasses.h:654
static const xml::XmlElementArray< NamePositioning > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
Represents the definition of a Finale staff.
Definition Staff.h:43
Base class for lyrics text.
Definition Texts.h:122
A class to represent fractions with integer m_numerator and m_denominator, automatically reduced to s...
Definition Fraction.h:38
A dependency-free, header-only collection of useful functions for music theory.
DiatonicMode
Represents the seven standard diatonic musical modes.
Definition music_theory.hpp:85
ShowClefMode
Enum representing the clef display mode for a frame.
Definition CommonClasses.h:108
@ WhenNeeded
Clef is displayed only when needed (the default).
@ Always
Clef is always displayed. (xml value is "forced")
@ Never
Clef is never displayed. (xml value is "hidden")
NoteType
Enum class representing note types based on EDU values.
Definition CommonClasses.h:57
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
constexpr Cmper SCORE_PARTID
The part id of the score.
Definition Fundamentals.h:79
int32_t Evpu
EVPU value (288 per inch)
Definition Fundamentals.h:57
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:55
DefaultClefType
Clef types used by default in Finale documents. The values correspond to indices into musx::dom::opti...
Definition CommonClasses.h:82
@ Bass8vb
F clef, sounds one octave lower (8vb).
@ Alto
C clef, centered on third line (Alto clef).
@ BaritoneC
C clef on fifth line (Baritone clef).
@ Tab1
Tablature clef (5 lines).
@ Treble
G clef, standard treble.
@ FrenchViolin
G clef placed on first line (French violin clef).
@ Treble8va
G clef, sounds one octave higher (8va).
@ Bass8va
F clef, sounds one octave higher (8va).
@ AltPercussion
Alternate percussion clef, heavy vertical hash marks (no pitch).
@ Soprano
C clef on first line (Soprano clef).
@ Bass
F clef, standard bass.
@ Percussion
Percussion clef, open rectangle (no pitch).
@ Baritone
F clef on third line (Baritone clef).
@ Tab2
Tablature clef (5 lines, alternative style).
@ Treble8vb
G clef, sounds one octave lower (8vb).
@ Blank
Blank clef (invisible, no symbol).
@ MezzoSoprano
C clef on second line (Mezzo-soprano clef).
@ Tenor
C clef, centered on fourth line (Tenor clef).
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::vector< XmlElementDescriptor< T > > XmlElementArray
an array type for XmlElementDescriptor instances.
Definition XmlInterface.h:127
object model for musx file (enigmaxml)
Definition BaseClasses.h:36
A single time signature component.
Definition CommonClasses.h:424
std::vector< util::Fraction > counts
Definition CommonClasses.h:425
std::vector< Edu > units
Definition CommonClasses.h:427
util::Fraction sumCounts() const
Compute the sum of all counts.
Definition CommonClasses.h:436
Edu sumUnits() const
Compute the sum of all units.
Definition CommonClasses.h:440
bool operator==(const TimeSigComponent &src) const
Test if two TimeSigComponent values are the same.
Definition CommonClasses.h:432