GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRVolta.h
1 #ifndef __GRVolta__
2 #define __GRVolta__
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2004 Grame
7 
8  This Source Code Form is subject to the terms of the Mozilla Public
9  License, v. 2.0. If a copy of the MPL was not distributed with this
10  file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
13  research@grame.fr
14 
15 */
16 
17 #include <map>
18 #include <vector>
19 #include "GRPTagARNotationElement.h"
20 
21 class ARVolta;
22 class GRStaff;
23 
24 
28 {
29  private:
30  std::vector<NVRect> fSegments; // segments of the volta
31  NVRect fCurrentSegment;
32  bool fStartTell = true;
33 
34  void drawText (VGDevice & hdc, float x, float y) const;
35  void drawEndings (VGDevice & hdc, size_t index, float dx, float dy) const;
36 
37  const ARVolta * getARVolta() const { return (const ARVolta*)getAbstractRepresentation(); }
38  void adjustLeft (const GRNotationElement * startElt); // adjust first segment to the previous bar (if any)
39  void adjustRight(const GRNotationElement * endElt); // adjust last segment to the next bar (if any)
40  void adjustToNext (GRVolta * next); // vertical adjustment for adjacent voltas
41  GRVolta * getNextVolta(GRStaff * staff) const;
42 
43  public:
45 
46  GRVolta( GRStaff * pstaff, const ARVolta * ar );
47  virtual ~GRVolta();
48 
49  virtual void OnDraw( VGDevice & hdc ) const;
50  virtual const NVPoint & getReferencePosition() const { return refpos; }
51  virtual void tellPosition(GObject * caller, const NVPoint & newPosition);
52  virtual void FinishPTag (GRStaff * grstaff);
53 
54  GRNotationElement * getEndPos() const { return mEnd; }
55  GRNotationElement * getBegPos() const { return mBeg; }
56  NVRect getFirstSegment() const { return fSegments[0]; }
57  size_t getSegmentsSize() const { return fSegments.size(); }
58  void setFirstSegment(NVRect r) { fSegments[0] = r; }
59 
60  protected:
63 
64  static NVPoint refpos;
65  GRNotationElement * mEnd, *mBeg;// these are for graphic adjustments
66 
67  int mShape; // the volta shape (from ARVolta)
68  const char* mString; // the volta string (from ARVolta)
70 };
71 
72 #endif
GRVolta::setFirstSegment
void setFirstSegment(NVRect r)
Definition: GRVolta.h:58
GRVolta::kRightOpened
Definition: GRVolta.h:44
GRVolta::getEndElt
GRNotationElement * getEndElt(GRNotationElement *after)
GObject
The base class for all graphic objects.
Definition: GObject.h:54
GRVolta::mEnd
GRNotationElement * mEnd
Definition: GRVolta.h:65
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
NVPoint
Definition: NVPoint.h:20
GRVolta::GRVolta
GRVolta(GRStaff *pstaff, const ARVolta *ar)
GRVolta::kLeftOpened
Definition: GRVolta.h:44
GRVolta::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRVolta::getFirstSegment
NVRect getFirstSegment() const
Definition: GRVolta.h:56
GRStaff
A GRStaff represents a single line of music.
Definition: GRStaff.h:181
GRVolta::tellPosition
virtual void tellPosition(GObject *caller, const NVPoint &newPosition)
GRVolta::FinishPTag
virtual void FinishPTag(GRStaff *grstaff)
GRPTagARNotationElement
not yet documented
Definition: GRPTagARNotationElement.h:25
GRVolta
an ending bracket graphical element.
Definition: GRVolta.h:27
GRVolta::mString
const char * mString
Definition: GRVolta.h:68
GRVolta::~GRVolta
virtual ~GRVolta()
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GRVolta::getReferencePosition
virtual const NVPoint & getReferencePosition() const
Retrieves the Symbol-reference-position with respect to the GUIDO-reference-position.
Definition: GRVolta.h:50
GRVolta::mShape
int mShape
Definition: GRVolta.h:67
GRVolta::kDefault
Definition: GRVolta.h:44
GRVolta::getSegmentsSize
size_t getSegmentsSize() const
Definition: GRVolta.h:57
GRVolta::getBegElt
GRNotationElement * getBegElt(GRNotationElement *before)
NVRect
Definition: NVRect.h:22
GRVolta::getBegPos
GRNotationElement * getBegPos() const
Definition: GRVolta.h:55
GRVolta::mStringSize
int mStringSize
Definition: GRVolta.h:69
GRARNotationElement::getAbstractRepresentation
virtual const ARMusicalObject * getAbstractRepresentation()
ARVolta
for different repeat endings
Definition: ARVolta.h:44
GRVolta::getEndPos
GRNotationElement * getEndPos() const
Definition: GRVolta.h:54
GRVolta::kOpened
Definition: GRVolta.h:44
GRVolta::refpos
static NVPoint refpos
Definition: GRVolta.h:64
GRVolta::mBeg
GRNotationElement * mBeg
Definition: GRVolta.h:65

Guido Project Copyright © 2019 Grame-CNCM