Verovio
Source code documentation
pedal.h
1 // Name: pedal.h
3 // Author: Laurent Pugin
4 // Created: 2016
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_PEDAL_H__
9 #define __VRV_PEDAL_H__
10 
11 #include "atts_cmn.h"
12 #include "atts_externalsymbols.h"
13 #include "atts_visual.h"
14 #include "controlelement.h"
15 #include "timeinterface.h"
16 
17 namespace vrv {
18 
19 enum class PedalLineJoint : int8_t { None = 0, Bounce };
20 
21 //----------------------------------------------------------------------------
22 // Pedal
23 //----------------------------------------------------------------------------
24 
28 class Pedal : public ControlElement,
29  public TimeSpanningInterface,
30  public AttExtSymAuth,
31  public AttExtSymNames,
32  public AttLineRend,
33  public AttLineRendBase,
34  public AttPedalLog,
35  public AttPedalVis,
36  public AttPlacementRelStaff,
37  public AttVerticalGroup {
38 public:
44  Pedal();
45  virtual ~Pedal();
46  Object *Clone() const override { return new Pedal(*this); }
47  void Reset() override;
48  std::string GetClassName() const override { return "pedal"; }
50 
55  TimePointInterface *GetTimePointInterface() override { return vrv_cast<TimePointInterface *>(this); }
56  const TimePointInterface *GetTimePointInterface() const override
57  {
58  return vrv_cast<const TimePointInterface *>(this);
59  }
60  TimeSpanningInterface *GetTimeSpanningInterface() override { return vrv_cast<TimeSpanningInterface *>(this); }
61  const TimeSpanningInterface *GetTimeSpanningInterface() const override
62  {
63  return vrv_cast<const TimeSpanningInterface *>(this);
64  }
66 
71  PedalLineJoint GetEndJoint() const { return m_endJoint; }
72  void SetEndJoint(PedalLineJoint endJoint) { m_endJoint = endJoint; }
73  PedalLineJoint GetStartJoint() const { return m_startJoint; }
74  void SetStartJoint(PedalLineJoint startJoint) { m_startJoint = startJoint; }
76 
81  data_PEDALSTYLE GetDrawingStyle() const { return m_drawingPedalStyle; }
82  void SetDrawingStyle(data_PEDALSTYLE drawingPedalStyle) { m_drawingPedalStyle = drawingPedalStyle; }
84 
88  char32_t GetPedalGlyph() const;
89 
93  int GetLineWidth(const Doc *doc, int unit) const;
94 
95  //----------//
96  // Functors //
97  //----------//
98 
103  FunctorCode Accept(Functor &functor) override;
104  FunctorCode Accept(ConstFunctor &functor) const override;
105  FunctorCode AcceptEnd(Functor &functor) override;
106  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
108 
109 private:
113  PedalLineJoint m_endJoint;
114  PedalLineJoint m_startJoint;
118  data_PEDALSTYLE m_drawingPedalStyle;
119 };
120 
121 } // namespace vrv
122 
123 #endif
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class represents elements appearing within a measure.
Definition: controlelement.h:35
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class represents a basic object.
Definition: object.h:66
This class models the MEI <pedal> element.
Definition: pedal.h:37
char32_t GetPedalGlyph() const
Get the SMuFL glyph for the pedal based on function or glyph.num.
int GetLineWidth(const Doc *doc, int unit) const
Calculate the pedal line width based on @lwidth or the pedalLineThickness option.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void Reset() override
Virtual reset method.
Object * Clone() const override
Method call for copying child classes.
Definition: pedal.h:46
This class is an interface for elements having a single time point, such as tempo,...
Definition: timeinterface.h:39
This class is an interface for spanning elements, such as slur, hairpin, etc.
Definition: timeinterface.h:145