GUIDOLib  1.7.7
Guido Engine Internal Documentation
ARClef.h
1 #ifndef ARClef_H
2 #define ARClef_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 <string>
19 #include <map>
20 
21 #include "TagParameterStrings.h"
22 #include "ARMTParameter.h"
23 
24 /*@mkdoc
25 
26 @group:Clef Key Meter
27 
28 @tagname:\clef
29 @tagalias:
30 @tagtype:P
31 @tagnotation:clef signs
32 @tagdesc
33 @tagend
34 
35 @params:
36 @param:type:string:bass, basso, f, f5, f4, f3, f2, f1, <br />tenor, c, c5, c4, c3, c2, c1, c0, <br />alto, violin, treble, <br />g, g5, g4, g3, g2, g1, <br />gg, gg5, gg4, gg3, gg2, gg1, <br />perc, perc5, perc4, perc3, perc2, perc1, <br />TAB, <br />none or off:treble:false
37 @paramdesc
38 - bass, basso, f, f4 are equivalent and represent a standard F clef on the 4th staff line
39 - f1, f2, f3, f5 represent a f clef on the 1st, 2nd and 5th staff line
40 - alto, c, c3 are equivalent and represent a bratsche clef on the 3rd staff line
41 - c4 and tenor are equivalent and represent a bratsche clef on the 4th staff line
42 - c1, c2, c3, c5 represent a bratsche clef on the 1st, 2nd, 3rd and 5th staff line
43 - c0 represent a bratsche clef on the 1st ledger line under the staff
44 - g, g2, treble, violin are equivalent and represent a G clef on the 2nd staff line
45 - g1, g3, g4, g5 represent a G clef on the 1st, 3rd, 4th and 5th staff line
46 - gg, gg2 are equivalent and represent a double G clef on the 2nd staff line
47 - gg1, gg3, gg4, gg5 represent a double G clef on the 1st, 3rd, 4th and 5th staff line
48 - perc, perc3 are equivalent and represent a percussion clef on the 3rd staff line
49 - perc1, perc2, perc4, perc5 represent a percussion clef on the 1st, 2nd, 4th and 5th staff line
50 - TAB for guitar tablatures (expects a 'TAB' [staff format](../Layout/#staffformat))
51 - none, off prevents the clef to be displayed
52 
53 See the [Clefs](@EXAMPLES/clefkeymeter/) example.
54 @paramend
55 
56 */
57 
60 class ARClef : public ARMTParameter
61 {
62  public:
64  enum octavatype { LOW15 = -2, LOW8 = -1, NONE = 0, HIGH8 = 1, HIGH15 = 2 };
65 
66  ARClef();
67  ARClef(const ARClef & clef);
68  ARClef(const TYPE_TIMEPOSITION & timeposition);
69  ARClef(const std::string& theName);
70 
71  virtual ~ARClef() {}
72 
73  virtual bool IsStateTag() const { return true;}
74 
75  virtual int getOrder() const { return kClefOrder; }
76  virtual const char* getParamsStr() const { return kARClefParams; };
77  virtual const char* getTagName() const { return "ARClef"; };
78  virtual std::string getGMNName() const { return "\\clef"; };
79 
80  virtual bool operator==(const ARClef & clef) const;
81 
82  virtual void setTagParameters (const TagParameterMap& params);
83  void setName(const std::string& theName);
84  const std::string& getName() const { return fName; }
85 
86 
87  // staffline where the clef starts
88  int getLine() const { return fStaffLine; }
89  cleftype getClefType() const { return fClef; }
90  octavatype getOctavaType() const { return fOctava; }
91  ARMusicalObject *isARClef() { return this; }
92 
93  private:
94  void buildMap ();
95  std::string decodeOctava (const std::string& name);
96 
97  std::string fName;
98 
99  cleftype fClef;
100  int fStaffLine; // Die Notenlinie
101  octavatype fOctava;
102 
103  static std::map<std::string, std::pair<cleftype,int> > fClefsMap;
104 };
105 
106 #endif
ARClef::UNDEFINED
Definition: ARClef.h:63
ARClef::HIGH15
Definition: ARClef.h:64
ARClef::setName
void setName(const std::string &theName)
ARClef::getOctavaType
octavatype getOctavaType() const
Definition: ARClef.h:90
ARClef::AUTO
Definition: ARClef.h:63
ARClef::cleftype
cleftype
Definition: ARClef.h:63
ARClef::IsStateTag
virtual bool IsStateTag() const
Definition: ARClef.h:73
ARClef::getLine
int getLine() const
Definition: ARClef.h:88
ARClef::operator==
virtual bool operator==(const ARClef &clef) const
ARClef::isARClef
ARMusicalObject * isARClef()
Definition: ARClef.h:91
ARClef::ARClef
ARClef()
Fraction
Numerator and denominator.
Definition: Fraction.h:23
ARMusicalTag::kClefOrder
Definition: ARMusicalTag.h:40
ARClef::getName
const std::string & getName() const
Definition: ARClef.h:84
ARClef::~ARClef
virtual ~ARClef()
Definition: ARClef.h:71
ARClef::LOW15
Definition: ARClef.h:64
ARMTParameter
not yet documented
Definition: ARMTParameter.h:24
ARClef::OFF
Definition: ARClef.h:63
ARClef::DOUBLEG
Definition: ARClef.h:63
ARClef::BRATSCHE
Definition: ARClef.h:63
ARClef::VIOLIN
Definition: ARClef.h:63
ARClef::setTagParameters
virtual void setTagParameters(const TagParameterMap &params)
ARClef::TAB
Definition: ARClef.h:63
ARClef::LOW8
Definition: ARClef.h:64
ARClef::HIGH8
Definition: ARClef.h:64
ARClef::getTagName
virtual const char * getTagName() const
Definition: ARClef.h:77
ARClef::PERC
Definition: ARClef.h:63
ARClef::getParamsStr
virtual const char * getParamsStr() const
Definition: ARClef.h:76
ARClef::getGMNName
virtual std::string getGMNName() const
Definition: ARClef.h:78
ARClef
Abstract representation of a staff clef.
Definition: ARClef.h:60
ARClef::getClefType
cleftype getClefType() const
Definition: ARClef.h:89
TagParameterMap
A list of tag parameters represented as a map.
Definition: TagParameterMap.h:31
ARMusicalObject
The base class for all AR objects. It contains all musical information : duration and time position.
Definition: ARMusicalObject.h:33
ARClef::BASS
Definition: ARClef.h:63
ARClef::octavatype
octavatype
Definition: ARClef.h:64
ARClef::getOrder
virtual int getOrder() const
Definition: ARClef.h:75
ARClef::NONE
Definition: ARClef.h:64

Guido Project Copyright © 2019 Grame-CNCM