GUIDOLib  1.7.7
Guido Engine Internal Documentation
ARFeatheredBeam.h
1 #ifndef ARFeatheredBeam_H
2 #define ARFeatheredBeam_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 "ARMTParameter.h"
19 #include "ARPositionTag.h"
20 #include "ARBeam.h"
21 
22 
23 /*@mkdoc
24 
25 @group:Beaming
26 
27 @tagname:\fBeam
28 @tagalias:\fbeamBegin fbeamEnd
29 @tagtype:R
30 @tagnotation:feathered beaming
31 @tagdesc
32 Feathered beaming is provided to support contemporary notation.
33 
34 Notes grouped under a feathered beam should express their duration normally.
35 The spacing algorithm will take these durations into account to position them like any other note.
36 The number of beams is computed according to the first and last notes durations.
37 @tagend
38 
39 @params:
40 @param:durations:string:used to control the number of beams:*none*:true
41 @param:drawDuration:boolean:displays the effective duration of the beamed group:false:true
42 @paramdesc
43 - **duration** may be used to override the default strategy to compute the number of beams.
44 It must be a string in the form "n/d,m/e" that express the number of beams for the begin and end of the group,
45 under the form of two rationals denoting durations. For example, "1/8,1/32" indicates that the group starts with
46 - **drawDuration** is used to display the actual total duration of the beamed group under the form of a rational value.
47 
48 See the [Beaming](@EXAMPLES/beaming/) example.
49 @paramend
50 
51 */
52 
55 class ARFeatheredBeam : public ARBeam
56 {
57 // friend class GRBeam;
58 
59  public:
61  virtual ~ARFeatheredBeam() {}
62 
63  virtual bool MatchEndTag(const char * s);
64 
65  virtual const char* getParamsStr() const { return kARFeatheredBeamParams; };
66  virtual const char* getTagName() const { return "ARFeatheredBeam"; };
67  virtual std::string getGMNName() const { return "\\featheredBeam"; };
68 
69  virtual void setTagParameters (const TagParameterMap& params);
70 
71  bool isDurationsSet() const { return fDurationsSet;}
72  bool drawDuration() const { return fDrawDur;}
73  int getFirstBeaming() const { return fBeams.first;}
74  int getLastBeaming() const { return fBeams.second;}
75  TYPE_TIMEPOSITION getBeginTimePosition () const { return fBeginTimePos;}
76  TYPE_TIMEPOSITION getEndTimePosition () const { return fEndTimePos;}
77 
78  void setBeginDuration( const TYPE_DURATION b) { fBeginDur = b;}
79  void setEndDuration( const TYPE_DURATION e) { fEndDur = e;}
80  void setBeginTimePosition( const TYPE_TIMEPOSITION bp) { fBeginTimePos = bp;}
81  void setEndTimePosition( const TYPE_TIMEPOSITION ep) { fEndTimePos = ep;}
82 
83 
84  const ARMusicalObject *isARFeatheredBeam() const { return this; }
85 
86  void findDefaultPoints();
87 
88  private:
89 
90  bool fDrawDur;
91  bool fDurationsSet;
92  std::pair<int,int> fBeams;
93  TYPE_DURATION fBeginDur;
94  TYPE_DURATION fEndDur;
95  TYPE_TIMEPOSITION fBeginTimePos;
96  TYPE_TIMEPOSITION fEndTimePos;
97 
98  void findPoints(std::string points);
99  void convertDurationToBeams(float valor, float valor2);
100 };
101 
102 #endif
ARFeatheredBeam::getFirstBeaming
int getFirstBeaming() const
Definition: ARFeatheredBeam.h:73
ARFeatheredBeam::findDefaultPoints
void findDefaultPoints()
Fraction
Numerator and denominator.
Definition: Fraction.h:23
ARFeatheredBeam::getGMNName
virtual std::string getGMNName() const
Definition: ARFeatheredBeam.h:67
ARFeatheredBeam::setTagParameters
virtual void setTagParameters(const TagParameterMap &params)
ARBeam
Abstract representation of a beam.
Definition: ARBeam.h:50
ARFeatheredBeam::getLastBeaming
int getLastBeaming() const
Definition: ARFeatheredBeam.h:74
ARFeatheredBeam::isARFeatheredBeam
const ARMusicalObject * isARFeatheredBeam() const
Definition: ARFeatheredBeam.h:84
ARFeatheredBeam::setBeginTimePosition
void setBeginTimePosition(const TYPE_TIMEPOSITION bp)
Definition: ARFeatheredBeam.h:80
ARFeatheredBeam::drawDuration
bool drawDuration() const
Definition: ARFeatheredBeam.h:72
ARFeatheredBeam::getEndTimePosition
TYPE_TIMEPOSITION getEndTimePosition() const
Definition: ARFeatheredBeam.h:76
ARFeatheredBeam::~ARFeatheredBeam
virtual ~ARFeatheredBeam()
Definition: ARFeatheredBeam.h:61
ARFeatheredBeam::getBeginTimePosition
TYPE_TIMEPOSITION getBeginTimePosition() const
Definition: ARFeatheredBeam.h:75
ARFeatheredBeam::isDurationsSet
bool isDurationsSet() const
Definition: ARFeatheredBeam.h:71
ARFeatheredBeam::getParamsStr
virtual const char * getParamsStr() const
Definition: ARFeatheredBeam.h:65
ARFeatheredBeam::setEndDuration
void setEndDuration(const TYPE_DURATION e)
Definition: ARFeatheredBeam.h:79
ARFeatheredBeam::setEndTimePosition
void setEndTimePosition(const TYPE_TIMEPOSITION ep)
Definition: ARFeatheredBeam.h:81
ARFeatheredBeam
Abstract representation of a feathered beam.
Definition: ARFeatheredBeam.h:55
ARFeatheredBeam::setBeginDuration
void setBeginDuration(const TYPE_DURATION b)
Definition: ARFeatheredBeam.h:78
ARFeatheredBeam::getTagName
virtual const char * getTagName() const
Definition: ARFeatheredBeam.h:66
ARPositionTag::ep
GuidoPos ep
Definition: ARPositionTag.h:74
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
ARFeatheredBeam::ARFeatheredBeam
ARFeatheredBeam()
ARFeatheredBeam::MatchEndTag
virtual bool MatchEndTag(const char *s)

Guido Project Copyright © 2019 Grame-CNCM