GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRDynamics.h
1 #ifndef GRDynamics_H
2 #define GRDynamics_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2002-2017 Grame
8 
9  This Source Code Form is subject to the terms of the Mozilla Public
10  License, v. 2.0. If a copy of the MPL was not distributed with this
11  file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
14  research@grame.fr
15 
16 */
17 
18 #include <map>
19 #include <vector>
20 
21 #include "GRPTagARNotationElement.h"
22 #include "GRVisitor.h"
23 
24 class ARDynamic;
25 class GRStaff;
26 
27 
29 {
30  public:
31  GRDynamics(GRStaff * grstaff, const ARDynamic* ar);
32  virtual ~GRDynamics();
33 
34  virtual void addAssociation (GRNotationElement * el);
35  virtual void tellPosition (GObject * caller, const NVPoint & newPosition);
36  virtual void DrawDynamic (VGDevice & hdc, bool cresc) const;
37  virtual void accept (GRVisitor& visitor);
38 
39  virtual const GRDynamics * isGRDynamic() const { return this; }
40 
41  protected:
42  typedef struct TXSegment {
43  float fx1, fx2, fy;
44  TXSegment() : fx1(0.f), fx2(0.f), fy(0.f) {}
45  } TXSegment;
46  std::map<const GRSystem*, TXSegment> fXPoints;
48  float fWidth;
49  float fThickness;
50 
51  const TXSegment* getSegment(const GRSystem*) const;
52  bool empty(const TXSegment& seg) const { return seg.fx1 == seg.fx2; }
53  void clear(TXSegment& seg) const { seg.fx1 = seg.fx2 = 0.f; }
54 
55  private:
56  const GRNotationElement * getNextEvent (const GRStaff* staff, const GRNotationElement * elt) const;
57  const GRNotationElement * fNext; // next event or bar, used in case of single note dynamic
58 
59  static std::map<const std::string, unsigned int> fDynamic2Symbol;
60 };
61 
62 #endif
GRDynamics::tellPosition
virtual void tellPosition(GObject *caller, const NVPoint &newPosition)
GRVisitor
Definition: GRVisitor.h:39
GRDynamics::DrawDynamic
virtual void DrawDynamic(VGDevice &hdc, bool cresc) const
GRDynamics::clear
void clear(TXSegment &seg) const
Definition: GRDynamics.h:53
ARDynamic
the base class for ARCrescendo and ARDiminuendo
Definition: ARDynamic.h:24
GRDynamics::GRDynamics
GRDynamics(GRStaff *grstaff, const ARDynamic *ar)
GObject
The base class for all graphic objects.
Definition: GObject.h:54
GRDynamics::TXSegment::TXSegment
TXSegment()
Definition: GRDynamics.h:44
GRDynamics::fWidth
float fWidth
Definition: GRDynamics.h:48
GRDynamics::~GRDynamics
virtual ~GRDynamics()
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
NVPoint
Definition: NVPoint.h:20
GRDynamics::fXPoints
std::map< const GRSystem *, TXSegment > fXPoints
Definition: GRDynamics.h:46
GRDynamics::fCurrentSegment
TXSegment fCurrentSegment
Definition: GRDynamics.h:47
GRStaff
A GRStaff represents a single line of music.
Definition: GRStaff.h:181
GRDynamics::TXSegment
Definition: GRDynamics.h:42
GRPTagARNotationElement
not yet documented
Definition: GRPTagARNotationElement.h:25
GRDynamics::TXSegment::fy
float fy
Definition: GRDynamics.h:43
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GRDynamics::fThickness
float fThickness
Definition: GRDynamics.h:49
GRDynamics::TXSegment
struct GRDynamics::TXSegment TXSegment
GRDynamics::accept
virtual void accept(GRVisitor &visitor)
GRDynamics::empty
bool empty(const TXSegment &seg) const
Definition: GRDynamics.h:52
GRDynamics::isGRDynamic
virtual const GRDynamics * isGRDynamic() const
Definition: GRDynamics.h:39
GRDynamics
Definition: GRDynamics.h:28
GRSystem
Manages a number of staffs and has a given start and end timeposition. GRSystem is the grafical repre...
Definition: GRSystem.h:52
GRDynamics::getSegment
const TXSegment * getSegment(const GRSystem *) const
GRDynamics::TXSegment::fx2
float fx2
Definition: GRDynamics.h:43
GRDynamics::addAssociation
virtual void addAssociation(GRNotationElement *el)
GRDynamics::TXSegment::fx1
float fx1
Definition: GRDynamics.h:43

Guido Project Copyright © 2019 Grame-CNCM