GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRAccidental.h
1 #ifndef GRAccidental_H
2 #define GRAccidental_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 "GRNotationElement.h"
19 
20 #include "ARAccidental.h"
21 
22 class GREvent;
23 
24 
28 {
29  enum { kNotAnID = -999999 };
30  public:
31  GRAccidental(GREvent * sngnot, float notebreite, float inAccidentalID, float p_size = 1.0f, float curLSPACE = 50.0f );
32  GRAccidental(); // a none accidental
33  GRAccidental(float detune, bool cautionnary, float p_size); //
34  virtual ~GRAccidental();
35 
36  virtual void OnDraw(VGDevice & hdc) const;
37  virtual void setAccidental ( float inAccidentalID, float notebreite, float curLSPACE );
38  virtual void setAccidentalByQuarter( int quarterTones, int offset, float notebreite, float curLSPACE = 50.0f );
39  virtual void setCautionary(int offset, float notebreite, float curLSPACE = 50.0f );
40  virtual void setStyleNone();
41  virtual void setColor(const TagParameterString *tps);
42  virtual void setColRef(unsigned char *colRef);
43  virtual void setAccidentalLayout( float notebreite, float curLSPACE );
44 
45  virtual void addToOffset( const NVPoint & pt );
46  virtual const NVPoint & getReferencePosition() const;
47 
48 
49  virtual const NVPoint & getOffset() const { return offset; }
50  virtual const unsigned char * getColRef() const { return mColRef; }
51  virtual float getSize() const { return mAccidentalSize; }
52 
53  virtual void setOffsetX(float x) { offsetset = true; offset.x = x; }
54  virtual void setOffsetY(float y) { offsetset = true; offset.y = y; }
55  virtual void setOffset(const NVPoint & pt) { offsetset = true; offset = pt; }
56 
57  virtual void setDxy(const NVPoint & pt) { fDxy = pt; }
58  virtual void setAlterSize(float size) { fAlterSize = size; }
59 
60  virtual void setSize( float newsize ) { mAccidentalSize = newsize; }
61  bool getOffsetSet() const { return offsetset; }
62  bool isCautionary() const { return fCautionary; }
63 
64  protected:
65  bool offsetset;
66 
76 
81 
83  NVPoint fDxy; // can only be set with alter tag
84  float fAlterSize = 1; // can only be set with alter tag
85  unsigned char * mColRef;
87 
88  private:
89  bool fCautionary = false;
90 
91  void initialize (GREvent * sngnot, float p_size);
92  int accidentalID2acc (int inAccidentalID, bool& cautionary) const;
93  unsigned int accidentalID2symbol (int inAccidentalID) const;
94  unsigned int accidentalDetunedID2symbol (float inAccidentalID) const;
95  unsigned int quarters2symbol (int quarters) const;
96  unsigned int getCautionary (unsigned int symbol) const;
97  NVPoint & getRefPos() const;
98 };
99 
100 #endif
GRAccidental::getColRef
virtual const unsigned char * getColRef() const
Definition: GRAccidental.h:50
GRAccidental::~GRAccidental
virtual ~GRAccidental()
GRAccidental::sRefposDFlat
static NVPoint sRefposDFlat
Definition: GRAccidental.h:72
GRAccidental::sRefposFlat
static NVPoint sRefposFlat
Definition: GRAccidental.h:71
GRAccidental::offsetset
bool offsetset
Definition: GRAccidental.h:65
GRAccidental::sRefposNone
static NVPoint sRefposNone
Definition: GRAccidental.h:67
GRAccidental::setAccidentalLayout
virtual void setAccidentalLayout(float notebreite, float curLSPACE)
GRAccidental::fDxy
NVPoint fDxy
Definition: GRAccidental.h:83
NVPoint::x
float x
Definition: NVPoint.h:68
GRAccidental::setCautionary
virtual void setCautionary(int offset, float notebreite, float curLSPACE=50.0f)
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
GREvent
Graphical representation for an event (= has duration).
Definition: GREvent.h:61
GRAccidental::setAlterSize
virtual void setAlterSize(float size)
Definition: GRAccidental.h:58
NVPoint
Definition: NVPoint.h:20
GRAccidental::setOffset
virtual void setOffset(const NVPoint &pt)
Definition: GRAccidental.h:55
GRAccidental::setOffsetX
virtual void setOffsetX(float x)
Definition: GRAccidental.h:53
GRAccidental::getOffset
virtual const NVPoint & getOffset() const
Definition: GRAccidental.h:49
GRAccidental::setAccidental
virtual void setAccidental(float inAccidentalID, float notebreite, float curLSPACE)
GRAccidental::sRefposQSharp
static NVPoint sRefposQSharp
Definition: GRAccidental.h:77
GRAccidental::GRAccidental
GRAccidental()
GRAccidental::addToOffset
virtual void addToOffset(const NVPoint &pt)
GRAccidental::isCautionary
bool isCautionary() const
Definition: GRAccidental.h:62
GRAccidental::setColRef
virtual void setColRef(unsigned char *colRef)
GRAccidental::sRefposCSharp
static NVPoint sRefposCSharp
Definition: GRAccidental.h:70
GRAccidental::sRefposNatural
static NVPoint sRefposNatural
Definition: GRAccidental.h:74
NVPoint::y
float y
Definition: NVPoint.h:69
GRAccidental::setColor
virtual void setColor(const TagParameterString *tps)
GRAccidental::sRefpos3QFlat
static NVPoint sRefpos3QFlat
Definition: GRAccidental.h:80
GRAccidental::mColRef
unsigned char * mColRef
Definition: GRAccidental.h:85
GRAccidental::mAccidentalSize
float mAccidentalSize
Definition: GRAccidental.h:86
GRAccidental::setOffsetY
virtual void setOffsetY(float y)
Definition: GRAccidental.h:54
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GRAccidental
Accidentals: sharp, flat, natural, double sharp, double flat.
Definition: GRAccidental.h:27
GRAccidental::sRefposCNatural
static NVPoint sRefposCNatural
Definition: GRAccidental.h:75
GRAccidental::setSize
virtual void setSize(float newsize)
Definition: GRAccidental.h:60
GRAccidental::setDxy
virtual void setDxy(const NVPoint &pt)
Definition: GRAccidental.h:57
GRAccidental::fAlterSize
float fAlterSize
Definition: GRAccidental.h:84
GRAccidental::sRefposSharp
static NVPoint sRefposSharp
Definition: GRAccidental.h:68
GRAccidental::offset
NVPoint offset
Definition: GRAccidental.h:82
GRAccidental::sRefposDSharp
static NVPoint sRefposDSharp
Definition: GRAccidental.h:69
TagParameterString
A string-type tag parameter.
Definition: TagParameterString.h:25
GRAccidental::getReferencePosition
virtual const NVPoint & getReferencePosition() const
Retrieves the Symbol-reference-position with respect to the GUIDO-reference-position.
GRAccidental::setAccidentalByQuarter
virtual void setAccidentalByQuarter(int quarterTones, int offset, float notebreite, float curLSPACE=50.0f)
GRAccidental::setStyleNone
virtual void setStyleNone()
GRAccidental::sRefpos3QSharp
static NVPoint sRefpos3QSharp
Definition: GRAccidental.h:78
GRAccidental::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRAccidental::getOffsetSet
bool getOffsetSet() const
Definition: GRAccidental.h:61
GRAccidental::sRefposCFlat
static NVPoint sRefposCFlat
Definition: GRAccidental.h:73
GRAccidental::sRefposQFlat
static NVPoint sRefposQFlat
Definition: GRAccidental.h:79
GRAccidental::getSize
virtual float getSize() const
Definition: GRAccidental.h:51

Guido Project Copyright © 2019 Grame-CNCM