11 #include "altsyminterface.h"
12 #include "atts_externalsymbols.h"
13 #include "atts_mensural.h"
14 #include "atts_visual.h"
15 #include "durationinterface.h"
16 #include "layerelement.h"
17 #include "offsetinterface.h"
18 #include "positioninterface.h"
24 enum RestLayer { RL_UNSET = -1, RL_sameLayer, RL_otherLayer };
26 enum RestAccidental { RA_UNSET = -1, RA_none, RA_s, RA_f, RA_x, RA_n };
28 enum RestLayerPlace { RLP_UNSET = -1, RLP_restOnTopLayer, RLP_restOnBottomLayer };
30 enum RestNotePlace { RNP_UNSET = -1, RNP_noteInSpace, RNP_noteOnLine };
46 public AttEnclosingChars,
48 public AttExtSymNames,
49 public AttRestVisMensural {
60 std::string GetClassName()
const override {
return "rest"; }
78 AltSymInterface *GetAltSymInterface()
override {
return vrv_cast<AltSymInterface *>(
this); }
79 const AltSymInterface *GetAltSymInterface()
const override {
return vrv_cast<const AltSymInterface *>(
this); }
80 OffsetInterface *GetOffsetInterface()
override {
return vrv_cast<OffsetInterface *>(
this); }
81 const OffsetInterface *GetOffsetInterface()
const override {
return vrv_cast<const OffsetInterface *>(
this); }
82 PositionInterface *GetPositionInterface()
override {
return vrv_cast<PositionInterface *>(
this); }
83 const PositionInterface *GetPositionInterface()
const override {
return vrv_cast<const PositionInterface *>(
this); }
84 DurationInterface *GetDurationInterface()
override {
return vrv_cast<DurationInterface *>(
this); }
85 const DurationInterface *GetDurationInterface()
const override {
return vrv_cast<const DurationInterface *>(
this); }
97 char32_t
GetRestGlyph(
const data_DURATION duration)
const;
125 FunctorCode AcceptEnd(
Functor &functor)
override;
126 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
133 std::pair<int, RestAccidental> GetLocationRelativeToOtherLayers(
134 const Layer *currentLayer,
bool isTopLayer,
bool &restOverlap)
const;
139 int GetLocationRelativeToCurrentLayer(
const Staff *currentStaff,
const Layer *currentLayer,
bool isTopLayer)
const;
144 int GetFirstRelativeElementLocation(
145 const Staff *currentStaff,
const Layer *currentLayer,
bool isPrevious,
bool isTopLayer)
const;
151 int GetMarginLayerLocation(
bool isTopLayer,
bool restOverlap)
const;
156 std::pair<int, RestAccidental> GetElementLocation(
const Object *
object,
const Layer *layer,
bool isTopLayer)
const;
161 int GetRestOffsetFromOptions(
162 RestLayer layer,
const std::pair<int, RestAccidental> &location,
bool isTopLayer)
const;
168 bool DetermineRestPosition(
const Staff *staff,
const Layer *layer,
bool &isTopLayer)
const;
This class is an interface for elements having a @altsym It is not an abstract class but should not b...
Definition: altsyminterface.h:30
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class is an interface for elements with duration, such as notes and rests.
Definition: durationinterface.h:39
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a layer in a laid-out score (Doc).
Definition: layer.h:39
This class represents a basic object.
Definition: object.h:64
This class is an interface for elements having a single visual offset, such as arpeg,...
Definition: offsetinterface.h:28
This class is an interface for elements with a position on the staff, such as rests.
Definition: positioninterface.h:30
This class models the MEI <rest> element.
Definition: rest.h:49
char32_t GetRestGlyph() const
Get the SMuFL glyph or a rest considering its actual duration.
std::pair< char32_t, char32_t > GetEnclosingGlyphs() const
Retrieve parentheses / brackets from the enclose attribute.
void UpdateFromTransLoc(const TransPitch &tp)
Update the rest location based on the input TransPitch.
bool AddChild(Object *object) override
Overwritten method for rest.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void Reset() override
Virtual reset method.
bool HasToBeAligned() const override
Override the method since alignment is required.
Definition: rest.h:89
Object * Clone() const override
Method call for copying child classes.
Definition: rest.h:58
bool IsSupportedChild(ClassId classId) override
Add an element to a rest.
int GetOptimalLayerLocation(const Staff *staff, const Layer *layer, int defaultLocation) const
Get the vertical location for the rests that are located on other layers.
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:107
Definition: transposition.h:35