9 #ifndef __VRV_KEYSIG_H__
10 #define __VRV_KEYSIG_H__
16 #include "atts_analytical.h"
17 #include "atts_shared.h"
18 #include "atts_visual.h"
20 #include "layerelement.h"
24 class ScoreDefInterface;
33 data_ACCIDENTAL_WRITTEN accid;
51 public AttVisibility {
62 std::string GetClassName()
const override {
return "keySig"; }
92 void GenerateKeyAccidAttribChildren();
107 data_KEYSIGNATURE ConvertFromWritten(
int diatonic,
int chromatic)
const;
113 void FillMap(MapOfOctavedPitchAccid &mapOfPitchAccid)
const;
115 int GetFifthsInt()
const;
122 void ResetDrawingClef();
123 void SetDrawingClef(
Clef *clef);
133 static data_PITCHNAME
GetAccidPnameAt(data_ACCIDENTAL_WRITTEN alterationType,
int pos);
134 static int GetOctave(data_ACCIDENTAL_WRITTEN alterationType, data_PITCHNAME pitch,
const Clef *clef);
135 static int GetFifthsDelta(
int diatonic,
int chromatic);
147 FunctorCode AcceptEnd(
Functor &functor)
override;
148 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
155 void FilterList(ListOfConstObjects &childList)
const override;
161 std::optional<KeyAccidInfo> GetKeyAccidInfoAt(
int pos)
const;
170 data_ACCIDENTAL_WRITTEN m_drawingCancelAccidType;
171 char m_drawingCancelAccidCount;
178 static const data_PITCHNAME s_pnameForFlats[];
179 static const data_PITCHNAME s_pnameForSharps[];
186 std::optional<Clef> m_drawingClef;
192 static const int octave_map[2][9][7];
This class models the MEI <clef> element.
Definition: clef.h:41
This abstract class is the base class for all const functors.
Definition: functor.h:126
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class models the MEI <keySig> element.
Definition: keysig.h:51
static data_PITCHNAME GetAccidPnameAt(data_ACCIDENTAL_WRITTEN alterationType, int pos)
Static methods for calculating position;.
void FillMap(MapOfOctavedPitchAccid &mapOfPitchAccid) const
Fill the map of modified pitches.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
bool AddChildAdditionalCheck(Object *child) override
Additional check when adding a child.
void FilterList(ListOfConstObjects &childList) const override
Filter the flat list and keep only StaffDef elements.
data_KEYSIGNATURE ConvertToWritten(int diatonic, int chromatic) const
Convert to and from a written key sig according to the diatonic and chromatic transposition values.
data_ACCIDENTAL_WRITTEN GetAccidType() const
Accid type getter.
bool HasNonAttribKeyAccidChildren() const
Generate KeyAccid attribute children.
Clef * GetDrawingClef()
Set/Get the drawing clef.
bool IsSupportedChild(ClassId classId) override
Add an element (a keyAccid) to a keySig.
bool IsScoreDefElement() const override
Override the method since check is required.
Definition: keysig.h:69
Object * Clone() const override
Method call for copying child classes.
Definition: keysig.h:60
data_KEYSIGNATURE ConvertToSig() const
Try to convert a keySig content (keyAccid) to a @sig value This can work only if the content represen...
void Reset() override
Virtual reset method.
bool HasToBeAligned() const override
Override the method since alignment is required.
Definition: keysig.h:66
bool m_skipCancellation
Variables for storing cancellation introduced by the key sig.
Definition: keysig.h:169
int GetAccidCount(bool fromAttribute=false) const
Accid number getter.
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a basic object.
Definition: object.h:66
Object * GetFirstAncestor(const ClassId classId, int maxSteps=-1)
Return the first ancestor of the specified type.
Object * GetParent()
Get the parent of the Object.
Definition: object.h:410
This class is an pseudo interface for elements maintaining a flat list of children LayerElement for p...
Definition: object.h:932
Useful information regarding a KeyAccid child.
Definition: keysig.h:32