Verovio
Source code documentation
adjustsylspacingfunctor.h
1 // Name: adjustsylspacingfunctor.h
3 // Author: David Bauer
4 // Created: 2023
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_ADJUSTSYLSPACINGFUNCTOR_H__
9 #define __VRV_ADJUSTSYLSPACINGFUNCTOR_H__
10 
11 #include "functor.h"
12 
13 namespace vrv {
14 
15 class LyricElement;
16 
17 //----------------------------------------------------------------------------
18 // AdjustSylSpacingFunctor
19 //----------------------------------------------------------------------------
20 
25 public:
30  AdjustSylSpacingFunctor(Doc *doc, int voltaTrack = 0);
31  virtual ~AdjustSylSpacingFunctor() = default;
33 
34  /*
35  * Abstract base implementation
36  */
37  bool ImplementsEndInterface() const override { return true; }
38 
39  /*
40  * Functor interface
41  */
43  FunctorCode VisitMeasureEnd(Measure *measure) override;
44  FunctorCode VisitStaff(Staff *staff) override;
45  FunctorCode VisitSystem(System *system) override;
46  FunctorCode VisitSystemEnd(System *system) override;
47  FunctorCode VisitLyricElement(LyricElement *lyricElement) override;
48  FunctorCode VisitRefrain(Refrain *refrain) override;
49  FunctorCode VisitVerse(Verse *verse) override;
51 
52 protected:
53  //
54 private:
55  //
56 public:
57  //
58 private:
59  // List of adjustment tuples (Alignment start|Alignment end|distance)
60  ArrayOfAdjustmentTuples m_overlappingSyl;
61  // The previous verse or volta lyric container
62  LayerElement *m_previousContainer;
63  // The previous syl
64  Syl *m_lastSyl;
65  // The previous measure
66  Measure *m_previousMeasure;
67  // The current LabelAbbr
68  LabelAbbr *m_currentLabelAbbr;
69  // Amount of free space
70  int m_freeSpace;
71  // The staff size
72  int m_staffSize;
73  // 0 for direct verse content, otherwise the normalized volta alternative.
74  int m_voltaTrack;
75 };
76 
77 } // namespace vrv
78 
79 #endif // __VRV_ADJUSTSYLSPACINGFUNCTOR_H__
This class adjusts the spacing of the syl processing verse by verse.
Definition: adjustsylspacingfunctor.h:24
bool ImplementsEndInterface() const override
Return true if the functor implements the end interface.
Definition: adjustsylspacingfunctor.h:37
This abstract class is the base class for all mutable functors that need access to the document.
Definition: functor.h:151
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This class models the MEI <labelAbbr> element.
Definition: labelabbr.h:22
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
Shared implementation for note-attached verse and refrain lyrics.
Definition: lyricelement.h:33
This class represents a measure in a page-based score (Doc).
Definition: measure.h:46
Recurring note-attached lyrics, such as a chorus.
Definition: refrain.h:19
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:110
Syl is a TimeSpanningInterface for managing syllable connectors.
Definition: syl.h:38
This class represents a system in a laid-out score (Doc).
Definition: system.h:36
Definition: verse.h:21