GUIDOLib  1.7.7
Guido Engine Internal Documentation
ARHarmony.h
1 
2 #pragma once
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 "ARFontAble.h"
19 #include "ARPositionTag.h"
20 #include "TagParameterString.h"
21 #include "TagParameterStrings.h"
22 
23 class TagParameterString;
24 
25 /*@mkdoc
26 
27 @group:Text
28 
29 @tagname:\harmony
30 @tagalias:
31 @tagtype:P
32 @tagnotation:harmony marking
33 @tagdesc
34 @tagend
35 
36 @params:
37 @param:text:string:the harmony string (e.g. C7):*none*:false
38 @param:position:string:above or below:below:false
39 @fontparams:
40 @paramdesc:
41 The harmony string may contain # and & characters. They are converted to sharp and flat symbols.
42 
43 See the [jazz](@EXAMPLES/allthethings/) example.
44 @paramend
45 
46 */
47 
50 class ARHarmony : public ARFontAble, public ARPositionTag
51 {
52  public:
53  enum { kUndefined, kAbove, kBelow };
55  virtual ~ARHarmony() {}
56 
57  virtual void setTagParameters (const TagParameterMap& params);
58 
59  virtual const char* getText() const { return fText ? fText->getValue() : 0; }
60  int position() const { return fPosition; }
61 
62  virtual const char* getParamsStr() const { return kARHarmonyParams; };
63  virtual const char* getTagName() const { return "ARHarmony"; };
64  virtual std::string getGMNName() const { return "\\harmony"; };
65 
66  private:
67  const TagParameterString * fText = 0;
68  int fPosition = kUndefined;
69 };
ARHarmony::setTagParameters
virtual void setTagParameters(const TagParameterMap &params)
ARHarmony::getText
virtual const char * getText() const
Definition: ARHarmony.h:59
ARHarmony
The text tag.
Definition: ARHarmony.h:50
ARHarmony::getGMNName
virtual std::string getGMNName() const
Definition: ARHarmony.h:64
TagParameterString::getValue
const char * getValue() const
Definition: TagParameterString.h:43
ARFontAble
Definition: ARFontAble.h:21
ARHarmony::kAbove
Definition: ARHarmony.h:53
ARHarmony::~ARHarmony
virtual ~ARHarmony()
Definition: ARHarmony.h:55
TagParameterString
A string-type tag parameter.
Definition: TagParameterString.h:25
ARPositionTag
The base class for all range tags.
Definition: ARPositionTag.h:26
ARHarmony::position
int position() const
Definition: ARHarmony.h:60
TagParameterMap
A list of tag parameters represented as a map.
Definition: TagParameterMap.h:31
ARHarmony::getParamsStr
virtual const char * getParamsStr() const
Definition: ARHarmony.h:62
ARHarmony::getTagName
virtual const char * getTagName() const
Definition: ARHarmony.h:63
ARHarmony::ARHarmony
ARHarmony(int position=kUndefined)
ARHarmony::kBelow
Definition: ARHarmony.h:53
ARHarmony::kUndefined
Definition: ARHarmony.h:53

Guido Project Copyright © 2019 Grame-CNCM