Verovio
Source code documentation
volta.h
1 // Name: volta.h
3 // Author: Simon Waloschek
4 // Copyright (c) Authors and others. All rights reserved.
6 
7 #ifndef __VRV_VOLTA_H__
8 #define __VRV_VOLTA_H__
9 
10 #include "atts_shared.h"
11 #include "layerelement.h"
12 #include "offsetinterface.h"
13 
14 namespace vrv {
15 
16 //----------------------------------------------------------------------------
17 // Volta
18 //----------------------------------------------------------------------------
19 
21 class Volta : public LayerElement,
22  public OffsetInterface,
23  public AttColor,
24  public AttLang,
25  public AttNNumberLike,
26  public AttTypography {
27 public:
28  Volta();
29  virtual ~Volta();
30  Object *Clone() const override { return new Volta(*this); }
31  void Reset() override;
32  std::string GetClassName() const override { return "volta"; }
33 
35  bool IsSupportedChild(ClassId classId) override;
36 
37  OffsetInterface *GetOffsetInterface() override { return vrv_cast<OffsetInterface *>(this); }
38  const OffsetInterface *GetOffsetInterface() const override { return vrv_cast<const OffsetInterface *>(this); }
39 
41  int GetDrawingVoltaN() const { return m_drawingVoltaN; }
42  void SetDrawingVoltaN(int drawingVoltaN) const
43  {
44  m_drawingVoltaN = drawingVoltaN;
45  m_drawingVoltaNSet = true;
46  }
47  bool HasDrawingVoltaN() const { return m_drawingVoltaNSet; }
48  void ResetDrawingVoltaN()
49  {
50  m_drawingVoltaN = 1;
51  m_drawingVoltaNSet = false;
52  }
53 
54  FunctorCode Accept(Functor &functor) override;
55  FunctorCode Accept(ConstFunctor &functor) const override;
56  FunctorCode AcceptEnd(Functor &functor) override;
57  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
58 
59 private:
60  mutable int m_drawingVoltaN;
61  mutable bool m_drawingVoltaNSet;
62 };
63 
64 } // namespace vrv
65 
66 #endif
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 is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a basic object.
Definition: object.h:66
This class is an interface for elements having a single visual offset, such as arpeg,...
Definition: offsetinterface.h:28
Sung text for a specific iteration of a repeated section of music.
Definition: volta.h:26
bool IsSupportedChild(ClassId classId) override
Add an element (a syl) to a volta.
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: volta.h:30
int GetDrawingVoltaN() const
The normalized one-based alternative index used only for drawing and lyric processing.
Definition: volta.h:41