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 {
44class Measure; // forward declaration
45class OssiaHeader; // forward declaration
46class Staff; // forward declaration
47} // namespace others
48
49// This file contains common classes that are shared among Options, Others, and Details.
50
57enum class NoteType : Edu
58{
59 Maxima = 0x8000,
60 Longa = 0x4000,
61 Breve = 0x2000,
62 Whole = EDU_PER_WHOLE_NOTE,
63 Half = 0x0800,
64 Quarter = 0x0400,
65 Eighth = 0x0200,
66 Note16th = 0x0100,
67 Note32nd = 0x0080,
68 Note64th = 0x0040,
69 Note128th = 0x0020,
70 Note256th = 0x0010,
71 Note512th = 0x0008,
72 Note1024th = 0x0004,
73 Note2048th = 0x0002,
74 Note4096th = 0x0001
75};
76
83{
84 Treble = 0,
85 Alto = 1,
86 Tenor = 2,
87 Bass = 3,
88 Percussion = 4,
89 Treble8vb = 5,
90 Bass8vb = 6,
91 Baritone = 7,
92 FrenchViolin = 8,
93 BaritoneC = 9,
94 MezzoSoprano = 10,
95 Soprano = 11,
96 AltPercussion = 12,
97 Treble8va = 13,
98 Bass8va = 14,
99 Blank = 15,
100 Tab1 = 16,
101 Tab2 = 17
102};
103
108enum class ShowClefMode
109{
110 WhenNeeded,
111 Never,
112 Always
113};
114
123{
124public:
130 FontInfo(const DocumentWeakPtr& document, bool sizeIsPercent = false)
131 : CommonClassBase(document), m_sizeIsPercent(sizeIsPercent)
132 {
133 }
134
136 int fontSize{};
137 bool bold{};
138 bool italic{};
139 bool underline{};
140 bool strikeout{};
141 bool absolute{};
142 bool hidden{};
143
145 bool getSizeIsPercent() const { return m_sizeIsPercent; }
146
150 inline static constexpr uint16_t EnigmaStyleBold = 0x01;
151 inline static constexpr uint16_t EnigmaStyleItalic = 0x02;
152 inline static constexpr uint16_t EnigmaStyleUnderline = 0x04;
153 inline static constexpr uint16_t EnigmaStyleStrikeout = 0x20;
154 inline static constexpr uint16_t EnigmaStyleAbsolute = 0x40;
155 inline static constexpr uint16_t EnigmaStyleHidden = 0x80;
157
162 std::string getName() const;
163
169 void setFontIdByName(const std::string& name);
170
177 void setEnigmaStyles(uint16_t efx)
178 {
179 bold = efx & EnigmaStyleBold;
185 }
186
188 uint16_t getEnigmaStyles() const
189 {
190 uint16_t result = 0;
191 if (bold) result |= EnigmaStyleBold;
192 if (italic) result |= EnigmaStyleItalic;
193 if (underline) result |= EnigmaStyleUnderline;
194 if (strikeout) result |= EnigmaStyleStrikeout;
195 if (absolute) result |= EnigmaStyleAbsolute;
196 if (hidden) result |= EnigmaStyleHidden;
197 return result;
198 }
199
202 { return fontId == 0; }
203
205 bool calcIsSymbolFont() const;
206
209 static std::optional<std::filesystem::path> calcSMuFLMetaDataPath(const std::string& fontName);
210
212 std::optional<std::filesystem::path> calcSMuFLMetaDataPath() const
214
218 bool calcIsSMuFL() const;
219
225 static std::vector<std::filesystem::path> calcSMuFLPaths();
226
228
229private:
230 bool m_sizeIsPercent;
231};
232
238{
239public:
241
252 enum class KeyContext {
253 Concert,
254 Written
255 };
256
263 uint16_t key{};
264 bool keyless{};
266
281 Cmper getKeyMode() const { return isLinear() ? key >> 8 : key; }
282
287 { return isLinear() ? int(int8_t(key & 0xff)) + getAlterationOffset(ctx) : 0; }
288
289 bool isLinear() const { return (key & 0xC000) == 0; }
290 bool isNonLinear() const { return (key & 0xC000) != 0; }
291 bool isBuiltIn() const { return isLinear() && getKeyMode() <= 1; }
292 bool isMajor() const { return getKeyMode() == 0; }
293 bool isMinor() const { return getKeyMode() == 1; }
294
298 std::optional<music_theory::DiatonicMode> calcDiatonicMode() const;
299
301 bool isSame(const KeySignature& src) const
302 {
303 return isSameConcert(src) && m_alterationOffset == src.m_alterationOffset && m_octaveDisplacement == src.m_octaveDisplacement;
304 }
305
307 bool isSameConcert(const KeySignature& src) const
308 {
309 return key == src.key && keyless == src.keyless && hideKeySigShowAccis == src.hideKeySigShowAccis;
310 }
311
315 int calcScaleDegree(int displacement) const;
316
333 void setTransposition(int interval, int keyAdjustment, bool simplify);
334
337
341 int calcTonalCenterIndex(KeyContext ctx) const;
342
346 int calcAlterationOnNote(unsigned noteIndex, KeyContext ctx ) const;
347
351 { return ctx == KeyContext::Written ? m_octaveDisplacement : 0; }
352
354 int calcEDODivisions() const;
355
357 std::optional<std::vector<int>> calcKeyMap() const;
358
363 std::unique_ptr<music_theory::Transposer> createTransposer(int displacement, int alteration) const;
364
365 void integrityCheck(const std::shared_ptr<Base>& ptrToThis) override
366 {
367 this->CommonClassBase::integrityCheck(ptrToThis);
368 if (key >= 0x8000) {
369 MUSX_INTEGRITY_ERROR("Key signature has invalid key value: " + std::to_string(key));
370 }
371 }
372
374
375private:
376 std::vector<unsigned> calcTonalCenterArrayForSharps() const;
377 std::vector<unsigned> calcTonalCenterArrayForFlats() const;
378 std::vector<unsigned> calcTonalCenterArray(KeyContext ctx) const;
379 std::vector<int> calcAcciAmountsArray(KeyContext ctx) const;
380 std::vector<unsigned> calcAcciOrderArray(KeyContext ctx) const;
381
382 int m_octaveDisplacement{};
383 int m_alterationOffset{};
384
385 int getAlterationOffset(KeyContext ctx) const
386 { return ctx == KeyContext::Written ? m_alterationOffset : 0; }
387
388};
389
390namespace texts {
391class LyricsTextBase; // forward delcaration
392} // namespace texts
393
399{
400public:
401
402 std::string syllable;
405
406private:
412 LyricsSyllableInfo(const DocumentWeakPtr& document, const std::string text, bool before, bool after)
413 : CommonClassBase(document), syllable(text), hasHyphenBefore(before), hasHyphenAfter(after)
414 {
415 }
416
417 friend class texts::LyricsTextBase;
418};
419
425{
426public:
427
430 {
431 std::vector<util::Fraction> counts;
433 std::vector<Edu> units;
436
438 bool operator==(const TimeSigComponent& src) const
439 { return counts == src.counts && units == src.units; }
440
443 { return std::accumulate(counts.begin(), counts.end(), util::Fraction{}); }
444
446 Edu sumUnits() const
447 { return std::accumulate(units.begin(), units.end(), Edu{}); }
448 };
449
450 std::vector<TimeSigComponent> components;
451
456 std::pair<util::Fraction, NoteType> calcSimplified() const;
457
460 {
461 util::Fraction result = std::accumulate(components.begin(), components.end(), util::Fraction{},
462 [](const util::Fraction& acc, const TimeSigComponent& comp)
463 { return acc + (comp.sumCounts() * comp.sumUnits()); }
464 );
465 return result / Edu(NoteType::Whole);
466 }
467
469 bool isSame(const TimeSignature& src) const
470 {
471 return components == src.components && m_abbreviate == src.m_abbreviate;
472 }
473
478 {
479 checkIndex(index);
480 return MusxInstance<TimeSignature>(new TimeSignature(getDocument(), components[index], m_abbreviate));
481 }
482
487 std::optional<char32_t> getAbbreviatedSymbol() const;
488
490 bool isCommonTime() const;
492 bool isCutTime() const;
493
494private:
495 void checkIndex(size_t index) const
496 {
497 if (index > components.size()) {
498 throw std::invalid_argument("Index out of range. The time signature has " + std::to_string(components.size())
499 + " elements. The index requested was " + std::to_string(index) + ".");
500 }
501 }
502
507 explicit TimeSignature(const DocumentWeakPtr& document, int beats, Edu unit, bool hasCompositeTop, bool hasCompositeBottom,
508 std::optional<bool> abbreviate = std::nullopt);
509
514 explicit TimeSignature(const DocumentWeakPtr& document, const TimeSigComponent& timeSigUnit, std::optional<bool> abbreviate)
515 : CommonClassBase(document), m_abbreviate(abbreviate)
516 {
517 components.push_back(timeSigUnit);
518 }
519
520 std::optional<bool> m_abbreviate;
521
522 friend class others::Measure;
523 friend class others::OssiaHeader;
524 friend class details::IndependentStaffDetails;
525};
526
527namespace others {
528
529// The following classes are defined here because they are shared by multiple subclasses and container classes.
530
535class Enclosure : public OthersBase
536{
537public:
542 enum class Shape : uint8_t
543 {
544 NoEnclosure = 0,
545 Rectangle = 1,
546 Ellipse = 2,
547 Triangle = 3,
548 Diamond = 4,
549 Pentagon = 5,
550 Hexagon = 6,
551 Heptagon = 7,
552 Octogon = 8
553 };
554
562 explicit Enclosure(const DocumentWeakPtr& document, Cmper partId = SCORE_PARTID, ShareMode shareMode = ShareMode::All, Cmper cmper = 0)
563 : OthersBase(document, partId, shareMode, cmper) {}
564
572 bool fixedSize{};
573 bool equalAspect{};
574 bool notTall{};
575 bool opaque{};
577
579};
580
588class MusicRange : public OthersBase
589{
590public:
599 explicit MusicRange(const DocumentWeakPtr& document, Cmper partId = SCORE_PARTID, ShareMode shareMode = ShareMode::All,
600 Cmper cmper = 0, std::optional<Inci> inci = std::nullopt)
601 : OthersBase(document, partId, shareMode, cmper, inci)
602 {
603 }
604
609
613 bool contains(MeasCmper measId, Edu eduPosition) const
614 {
615 return (startMeas < measId || (startMeas == measId && startEdu <= eduPosition)) &&
616 (endMeas > measId || (endMeas == measId && endEdu >= eduPosition));
617 }
618
625 std::optional<std::pair<MeasCmper, Edu>> nextLocation(const std::optional<StaffCmper>& forStaff = std::nullopt) const;
626
628};
629
638{
639public:
640
648 explicit NamePositioning(const DocumentWeakPtr& document, Cmper partId = SCORE_PARTID, ShareMode shareMode = ShareMode::All, Cmper cmper = 0)
649 : OthersBase(document, partId, shareMode, cmper) {}
650
653 enum class AlignJustify
654 {
655 Left,
656 Right,
657 Center
658 };
659
663 bool indivPos{};
665 bool expand{};
666
668};
669
670} // namespace others
671} // namespace dom
672} // 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:123
static constexpr uint16_t EnigmaStyleHidden
Hidden text bit.
Definition CommonClasses.h:155
static constexpr uint16_t EnigmaStyleItalic
Italic style bit.
Definition CommonClasses.h:151
FontInfo(const DocumentWeakPtr &document, bool sizeIsPercent=false)
constructor
Definition CommonClasses.h:130
static constexpr uint16_t EnigmaStyleStrikeout
Strikeout style bit.
Definition CommonClasses.h:153
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:152
uint16_t getEnigmaStyles() const
Returns the font styles as an nfx bitmask.
Definition CommonClasses.h:188
static constexpr uint16_t EnigmaStyleAbsolute
Fixed-size (absolute) bit.
Definition CommonClasses.h:154
static constexpr uint16_t EnigmaStyleBold
Bold style bit.
Definition CommonClasses.h:150
bool strikeout
Strikeout effect.
Definition CommonClasses.h:140
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:135
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:145
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:177
bool italic
Italic effect.
Definition CommonClasses.h:138
bool hidden
Hidden effect.
Definition CommonClasses.h:142
bool calcIsDefaultMusic() const
Calculates if this is the default music font.
Definition CommonClasses.h:201
int fontSize
Font size or percent (where 100 is 100%) of preceding font size. (See getSizeIsPercent....
Definition CommonClasses.h:136
bool underline
Underline effect.
Definition CommonClasses.h:139
bool absolute
Fixed size effect.
Definition CommonClasses.h:141
std::optional< std::filesystem::path > calcSMuFLMetaDataPath() const
Returns the filepath of the SMuFL font's metadata json file, if any.
Definition CommonClasses.h:212
bool bold
Bold effect.
Definition CommonClasses.h:137
Shared key signature class that is contained in other classes. (See others::Measure)
Definition CommonClasses.h:238
Cmper getKeyMode() const
Returns the key mode.
Definition CommonClasses.h:281
bool isSame(const KeySignature &src) const
returns whether the two key signatures represent the same key signature, taking into account transpos...
Definition CommonClasses.h:301
int getAlteration(KeyContext ctx) const
For linear keys, returns the number of sharps or flats from -7..7 (if any).
Definition CommonClasses.h:286
bool hideKeySigShowAccis
Instead of a key signature, show accidentals for the key on the notes where they occur.
Definition CommonClasses.h:265
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:365
int calcScaleDegree(int displacement) const
Calculates the scale degree for the given displacement, where 0 is the tonic.
Definition CommonClasses.cpp:345
bool isLinear() const
whether this is a linear key
Definition CommonClasses.h:289
int calcEDODivisions() const
Calculates the number of EDO division for the key. (The standard value is 12.)
Definition CommonClasses.cpp:429
bool isBuiltIn() const
whether this is a built-in key
Definition CommonClasses.h:291
KeyContext
Indicates whether to compute key signature values in concert or written pitch.
Definition CommonClasses.h:252
@ 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:350
uint16_t key
16-bit value intepreted as follows:
Definition CommonClasses.h:263
std::unique_ptr< music_theory::Transposer > createTransposer(int displacement, int alteration) const
Creates a transposer for this KeySignature instance.
Definition CommonClasses.cpp:437
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:442
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:356
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:293
bool isNonLinear() const
whether this is a non-linear key
Definition CommonClasses.h:290
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:307
bool isMajor() const
whether this is a built-in major key
Definition CommonClasses.h:292
std::optional< std::vector< int > > calcKeyMap() const
Calculates the key's diatonic key map.
Definition CommonClasses.cpp:391
bool keyless
Indicates the absence of a key signature.
Definition CommonClasses.h:264
Contains the syllable information for a single syllable. (See texts::LyricsTextBase)
Definition CommonClasses.h:399
bool hasHyphenAfter
indicates the syllable if followed by a hyphen.
Definition CommonClasses.h:404
std::string syllable
the syllable text with no hyphenation or font information.
Definition CommonClasses.h:402
bool hasHyphenBefore
indicates the syllable is preceded by a hyphen.
Definition CommonClasses.h:403
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:425
bool isSame(const TimeSignature &src) const
returns whether the two time signatures represent the same time signature
Definition CommonClasses.h:469
bool isCutTime() const
Returns if this time signature is cut time.
Definition CommonClasses.cpp:540
std::vector< TimeSigComponent > components
the components in the time signature
Definition CommonClasses.h:450
util::Fraction calcTotalDuration() const
Calculates the total duration of the time signature as a fraction of a whole note.
Definition CommonClasses.h:459
std::optional< char32_t > getAbbreviatedSymbol() const
Returns the abbreviated symbol (code point) for this time signature, or std::nullopt if none.
Definition CommonClasses.cpp:509
bool isCommonTime() const
Returns if this time signature is common time.
Definition CommonClasses.cpp:532
MusxInstance< TimeSignature > createComponent(size_t index) const
Creates a time signature corresponding to the component at index.
Definition CommonClasses.h:477
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:548
Represents independent time and key signature overrides for a staff.
Definition Details.h:898
Represents the enclosure settings for text expressions.
Definition CommonClasses.h:536
bool notTall
"Enforce Minimum Width": don't let shape get taller than it is wide
Definition CommonClasses.h:574
Enclosure(const DocumentWeakPtr &document, Cmper partId=SCORE_PARTID, ShareMode shareMode=ShareMode::All, Cmper cmper=0)
Constructs an Enclosure object.
Definition CommonClasses.h:562
Evpu yAdd
Center Y offset - offsets text from center (in EVPU).
Definition CommonClasses.h:566
bool roundCorners
Whether the enclosure has rounded corners.
Definition CommonClasses.h:576
Efix lineWidth
Line thickness in 64ths of an EVPU (EFIX).
Definition CommonClasses.h:569
static const xml::XmlElementArray< Enclosure > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool opaque
Whether the enclosure is opaque.
Definition CommonClasses.h:575
Shape
Enumeration for enclosure shapes.
Definition CommonClasses.h:543
Evpu yMargin
Half height - extra space on top/bottom sides (in EVPU).
Definition CommonClasses.h:568
Shape shape
Enclosure shape (default: NoEnclosure).
Definition CommonClasses.h:570
bool fixedSize
Whether the enclosure is fixed size (ignore text bounding box)
Definition CommonClasses.h:572
bool equalAspect
"Match Height and Width"
Definition CommonClasses.h:573
Efix cornerRadius
Corner radius (in EFIX).
Definition CommonClasses.h:571
Evpu xMargin
Half width - extra space on left/right sides (in EVPU).
Definition CommonClasses.h:567
Evpu xAdd
Center X offset - offsets text from center (in EVPU).
Definition CommonClasses.h:565
Represents the attributes of a measure.
Definition Others.h:1090
Represents a range of music using measure and EDUs.
Definition CommonClasses.h:589
Edu startEdu
Starting EDU (Elapsed Durational Unit) in the range.
Definition CommonClasses.h:606
MeasCmper endMeas
Ending measure in the range.
Definition CommonClasses.h:607
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:305
static const xml::XmlElementArray< MusicRange > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
Edu endEdu
Ending EDU (Elapsed Durational Unit) in the range.
Definition CommonClasses.h:608
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:599
MeasCmper startMeas
Starting measure in the range.
Definition CommonClasses.h:605
bool contains(MeasCmper measId, Edu eduPosition) const
Returns true of the given metric location is contained in this MusicRange instance.
Definition CommonClasses.h:613
Contains horizontal and vertical offsets, alignment, and expansion settings for name positioning.
Definition CommonClasses.h:638
bool indivPos
Indicates that this positioning overrides the default positioning. (Not used by options::StaffOptions...
Definition CommonClasses.h:663
NamePositioning(const DocumentWeakPtr &document, Cmper partId=SCORE_PARTID, ShareMode shareMode=ShareMode::All, Cmper cmper=0)
Constructs an NamePositioning object.
Definition CommonClasses.h:648
bool expand
"Expand Single Word"
Definition CommonClasses.h:665
AlignJustify
Alignment and justification options for staff and group names.
Definition CommonClasses.h:654
@ Left
Left alignment or justification (the default value.)
Evpu horzOff
Horizontal distance from staff in Evpu.
Definition CommonClasses.h:660
AlignJustify hAlign
Horizontal alignment for the name text. (xml node is <halign>)
Definition CommonClasses.h:664
AlignJustify justify
Justification for the name text.
Definition CommonClasses.h:662
Evpu vertOff
Vertical offset from staff in Evpu.
Definition CommonClasses.h:661
static const xml::XmlElementArray< NamePositioning > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
Header properties for an ossia passage (clef, key, time, grouping).
Definition Ossia.h:71
Represents the definition of a Finale staff.
Definition Staff.h:48
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:109
@ 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:58
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:83
@ 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:430
std::vector< util::Fraction > counts
Definition CommonClasses.h:431
std::vector< Edu > units
Definition CommonClasses.h:433
util::Fraction sumCounts() const
Compute the sum of all counts.
Definition CommonClasses.h:442
Edu sumUnits() const
Compute the sum of all units.
Definition CommonClasses.h:446
bool operator==(const TimeSigComponent &src) const
Test if two TimeSigComponent values are the same.
Definition CommonClasses.h:438