23 #define VRV_UNSET MEI_UNSET
27 #define _USE_MATH_DEFINES // needed by Windows for math constants like "M_PI"
32 #define M_PI (3.14159265358979323846264338327950288)
41 #define VERSION_MAJOR 5
42 #define VERSION_MINOR 2
43 #define VERSION_REVISION 0
45 #define VERSION_DEV true
51 #define VRV_RESOURCE_DIR RESOURCE_DIR
53 #define VRV_RESOURCE_DIR "/usr/local/share/verovio"
61 #ifdef VRV_DYNAMIC_CAST
63 #define vrv_cast dynamic_cast
65 #define vrv_cast static_cast
72 #define MIDI_VELOCITY 90
73 #define MIDI_TEMPO 120
75 #define UNACC_GRACENOTE_DUR 27 // in milliseconds
76 #define UNACC_GRACENOTE_FRACTION Fraction(1, 2048)
89 enum ClassId : uint16_t {
95 FLOATING_CURVE_POSITIONER,
152 EDITORIAL_ELEMENT_max,
161 TEXT_LAYOUT_ELEMENT_max,
170 SYSTEM_MILESTONE_END,
266 SCOREDEF_ELEMENT_max,
280 CUSTOM_DEVICE_CONTEXT,
302 INTERFACE_TIME_POINT,
303 INTERFACE_TIME_SPANNING
312 class ClassIdComparison;
313 class BeamElementCoord;
316 class CurveSpannedElement;
318 class FloatingPositioner;
319 class FloatingCurvePositioner;
321 class InterfaceComparison;
324 class LinkingInterface;
330 class PlistInterface;
335 class TimePointInterface;
336 class TimeSpanningInterface;
338 typedef std::vector<Object *> ArrayOfObjects;
340 typedef std::vector<const Object *> ArrayOfConstObjects;
342 typedef std::list<Object *> ListOfObjects;
344 typedef std::list<const Object *> ListOfConstObjects;
346 typedef std::set<Object *> SetOfObjects;
348 typedef std::set<const Object *> SetOfConstObjects;
350 typedef std::vector<Note *> ChordNoteGroup;
352 typedef std::vector<std::tuple<Alignment *, Alignment *, int>> ArrayOfAdjustmentTuples;
354 typedef std::vector<std::tuple<Alignment *, Arpeg *, int, bool>> ArrayOfAlignmentArpegTuples;
356 typedef std::vector<BeamElementCoord *> ArrayOfBeamElementCoords;
358 typedef std::vector<std::pair<int, int>> ArrayOfIntPairs;
360 typedef std::multimap<std::string, LinkingInterface *> MapOfLinkingInterfaceIDPairs;
362 typedef std::map<std::string, Note *> MapOfNoteIDPairs;
364 typedef std::vector<std::pair<PlistInterface *, std::string>> ArrayOfPlistInterfaceIDPairs;
366 typedef std::vector<CurveSpannedElement *> ArrayOfCurveSpannedElements;
368 typedef std::list<std::pair<Object *, data_MEASUREBEAT>> ListOfObjectBeatPairs;
370 typedef std::list<std::pair<Object *, std::string>> ListOfObjectAttNamePairs;
372 typedef std::list<std::pair<TimePointInterface *, ClassId>> ListOfPointingInterClassIdPairs;
374 typedef std::list<std::pair<TimeSpanningInterface *, ClassId>> ListOfSpanningInterClassIdPairs;
376 typedef std::list<std::pair<TimeSpanningInterface *, Object *>> ListOfSpanningInterOwnerPairs;
378 typedef std::vector<FloatingPositioner *> ArrayOfFloatingPositioners;
380 typedef std::vector<FloatingCurvePositioner *> ArrayOfFloatingCurvePositioners;
382 typedef std::vector<BoundingBox *> ArrayOfBoundingBoxes;
384 typedef std::vector<LedgerLine> ArrayOfLedgerLines;
386 typedef std::vector<TextElement *> ArrayOfTextElements;
388 typedef std::map<const Staff *, std::multiset<int>> MapOfNoteLocs;
390 typedef std::map<const Staff *, std::set<int>> MapOfDotLocs;
392 typedef std::map<std::string, Option *> MapOfStrOptions;
394 typedef std::map<int, data_ACCIDENTAL_WRITTEN> MapOfOctavedPitchAccid;
396 typedef std::map<int, GraceAligner *> MapOfIntGraceAligners;
398 typedef std::vector<std::pair<std::u32string, bool>> ArrayOfStringDynamTypePairs;
400 typedef std::map<ClassId, std::function<Object *(void)>> MapOfClassIdConstructors;
402 typedef std::map<std::string, ClassId> MapOfStrClassIds;
404 typedef std::vector<std::pair<LayerElement *, LayerElement *>> MeasureTieEndpoints;
406 typedef bool (*NotePredicate)(
const Note *);
408 typedef std::vector<std::pair<LayerElement *, data_DURATION>> ArrayOfElementDurPairs;
420 std::map<int, IntTree> child;
423 typedef std::map<int, IntTree> IntTree_t;
431 typedef std::map<int, bool> VerseN_t;
432 typedef std::map<int, VerseN_t> LayerN_VerserN_t;
433 typedef std::map<int, LayerN_VerserN_t> StaffN_LayerN_VerseN_t;
439 #define DEFINITION_FACTOR 10
441 #define isIn(x, a, b) (((x) >= std::min((a), (b))) && ((x) <= std::max((a), (b))))
449 enum FunctorCode { FUNCTOR_CONTINUE = 0, FUNCTOR_SIBLINGS, FUNCTOR_STOP };
458 #define MAX_ACCID_DEPTH -1
461 #define MAX_BEAM_DEPTH -1
464 #define MAX_CHORD_DEPTH -1
467 #define MAX_FTREM_DEPTH -1
470 #define MAX_LIGATURE_DEPTH -1
473 #define MAX_TABGRP_DEPTH -1
476 #define MAX_TUPLET_DEPTH -1
479 #define MAX_STAFFGRP_DEPTH -1
482 #define MAX_NOTE_DEPTH -1
488 #define UNICODE_FLAT U'\u266D' // ♭
489 #define UNICODE_NATURAL U'\u266E' // ♮
490 #define UNICODE_SHARP U'\u266F' // ♯
492 #define UNICODE_UNDERTIE U'\u203F' // ‿
494 #define UNICODE_DAL_SEGNO U'\U0001D109' // 𝄉
495 #define UNICODE_DA_CAPO U'\U0001D10A' // 𝄊
496 #define UNICODE_SEGNO U'\U0001D10B' // 𝄋
497 #define UNICODE_CODA U'\U0001D10C' // 𝄌
499 #define UNICODE_DOUBLE_FLAT U'\U0001D12B' // 𝄫
500 #define UNICODE_DOUBLE_SHARP U'\U0001D12A' // 𝄪
514 #define VRV_TEXT_HARM \
515 U"\u266D\u266E\u266F" \
516 U"\uE260\uE261\uE262\uE263\uE264" \
517 U"\uEA50\uEA51\uEA52\uEA53\uEA54\uEA55\uEA56\uEA57\uEA58\uEA59\uEA5A\uEA5B\uEA5C\uEA5D\uEA5E" \
518 U"\uEA5F\uEA60\uEA61\uEA62\uEA63\uEA64\uEA65\uEA66\uEA67" \
525 #define LINEWIDTHTERM_factor_narrow 1.0
526 #define LINEWIDTHTERM_factor_medium 2.0
527 #define LINEWIDTHTERM_factor_wide 4.0
534 enum EditorialLevel {
535 EDITORIAL_UNDEFINED = 0,
552 enum VisibilityType { Hidden = 0, Visible };
558 enum SMuFLGlyphAnchor {
559 SMUFL_stemDownNW = 0,
571 enum { SPANNING_START_END = 0, SPANNING_START, SPANNING_END, SPANNING_MIDDLE };
582 enum ElementScoreDefRole { SCOREDEF_NONE = 0, SCOREDEF_SYSTEM, SCOREDEF_INTERMEDIATE, SCOREDEF_CAUTIONARY };
588 enum ArticType { ARTIC_INSIDE = 0, ARTIC_OUTSIDE };
594 enum VisibilityOptimization { OPTIMIZATION_NONE = 0, OPTIMIZATION_HIDDEN, OPTIMIZATION_SHOW };
617 LIGATURE_DEFAULT = 0,
618 LIGATURE_STEM_LEFT_UP = 1,
619 LIGATURE_STEM_LEFT_DOWN = 2,
620 LIGATURE_STEM_RIGHT_UP = 4,
621 LIGATURE_STEM_RIGHT_DOWN = 8,
622 LIGATURE_OBLIQUE = 16,
623 LIGATURE_STACKED = 32
632 MARKUP_ANALYTICAL_TIE = 1,
633 MARKUP_ANALYTICAL_FERMATA = 2,
634 MARKUP_GRACE_ATTRIBUTE = 4,
635 MARKUP_ARTIC_MULTIVAL = 8,
636 MARKUP_SCOREDEF_DEFINITIONS = 16
643 enum LayoutInformation { LAYOUT_NONE = 0, LAYOUT_ENCODED, LAYOUT_DONE };
649 enum Accessor { SELF = 0, CONTENT };
655 enum { KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40 };
661 enum StemSameasDrawingRole { SAMEAS_NONE = 0, SAMEAS_UNSET, SAMEAS_PRIMARY, SAMEAS_SECONDARY };
667 enum SmuflTextFont { SMUFL_NONE = 0, SMUFL_FONT_SELECTED, SMUFL_FONT_FALLBACK };
673 enum GraphicID { PRIMARY = 0, SPANNING, SYMBOLREF };
679 enum MeasureType { MEASURED = 0, UNMEASURED, NEUMELINE };
685 enum FocusStatusType { FOCUS_UNSET = 0, FOCUS_SET, FOCUS_USED };
691 #define SCORE_TIME_UNIT 4
697 #define NEUME_LINE_TYPE "neon-neume-line"
703 #define OCTAVE_OFFSET 4
706 #define STANDARD_STEMLENGTH 7
707 #define STANDARD_STEMLENGTH_TAB 3
713 #define TABLATURE_STAFF_RATIO 1.75
714 #define GERMAN_TAB_STAFF_RATIO 2.2
716 #define SUPER_SCRIPT_FACTOR 0.58
717 #define SUPER_SCRIPT_POSITION -0.20 // lowered down from the midline
718 #define SUB_SCRIPT_POSITION -0.17 // lowered down from the baseline
724 #define NOTE_HEIGHT_TO_STAFF_SIZE_RATIO 2
725 #define NOTE_WIDTH_TO_STAFF_SIZE_RATIO 1.4
729 #endif // __VRV_DEF_H__