]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
9905362080bc5e8084c0cf3f08c4c5a57b172a4c
[lilypond.git] / lily / include / musical-request.hh
1 /*
2   musical-request.hh -- declare Musical requests
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
12
13 #include "lily-proto.hh"
14 #include "request.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
17
18 /**
19   A request which is coupled to a note (that has duration).
20   Base class only
21  */
22 class Musical_req  : public virtual Request  {
23 public:
24
25
26   REQUESTMETHODS(Musical_req);
27 };
28
29
30
31 /** a request with a duration.
32   This request is used only used as a base class.
33  */
34 class Rhythmic_req  : public virtual Musical_req  {
35 public:
36   Duration duration_;
37     
38   bool do_equal_b (Request*) const;
39   void compress (Moment);
40   virtual Moment length_mom () const;
41   static int compare (Rhythmic_req const&,Rhythmic_req const&);
42   REQUESTMETHODS(Rhythmic_req);
43 };
44
45 class Skip_req  : public Rhythmic_req  {
46 public:
47   REQUESTMETHODS(Skip_req);
48 };
49
50 struct Spacing_req :virtual Request {
51   Moment next;
52   Real distance;
53   Real strength;
54   Spacing_req();
55   REQUESTMETHODS(Spacing_req);
56 };
57
58 struct Abbreviation_req : public Musical_req {
59   REQUESTMETHODS (Abbreviation_req);
60   Abbreviation_req ();
61   int type_i_;
62 };
63
64 class Blank_req  : public Spacing_req, Rhythmic_req  {
65 public:
66   REQUESTMETHODS(Spacing_req);
67 };
68
69 /** a syllable  or lyric is a string with rhythm.
70   */
71 class Lyric_req  : public  Rhythmic_req  {
72 public:
73   String text_str_;
74   REQUESTMETHODS(Lyric_req);
75 };
76
77
78
79 /// request which has some kind of pitch
80 struct Melodic_req :virtual Musical_req
81 {
82   Musical_pitch pitch_;
83   /// transpose. #delta# is relative to central c.
84   virtual void transpose (Musical_pitch delta);
85   Melodic_req();
86   bool do_equal_b (Request*) const;
87   static int compare (Melodic_req const&,Melodic_req const&);
88   REQUESTMETHODS(Melodic_req);
89 };
90
91 /// specify tonic of a chord
92 struct Tonic_req : public Melodic_req
93 {
94   Tonic_req ();
95   REQUESTMETHODS(Tonic_req);
96 };
97
98 /// Put a note of specified type, height, and with accidental on the staff.
99 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
100 public:
101     
102   /// force/supress printing of accidental.
103   bool forceacc_b_;
104   /// Cautionary, i.e. parenthesized accidental.
105   bool cautionary_b_;
106   Note_req();
107   bool do_equal_b (Request*) const;
108   REQUESTMETHODS(Note_req);
109 };
110
111 /**
112 Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
113 */
114 class Rest_req : public Rhythmic_req {
115 public:
116   REQUESTMETHODS(Rest_req);
117 };
118
119 /**
120  Part: typeset a measure with the number of measures rest
121  Score: typeset all individual measures ass full rests
122  */
123 class Multi_measure_rest_req : public Rhythmic_req  {
124 public:
125   REQUESTMETHODS(Multi_measure_rest_req);
126
127 };
128
129 class Musical_span_req : public Span_req, public virtual Musical_req
130 {
131 public:
132   REQUESTMETHODS(Musical_span_req);
133   
134 };
135
136
137 /** 
138  Start / stop an abbreviation beam at this note. 
139  */
140 class Abbreviation_beam_req : public Musical_span_req  {
141 public:
142   REQUESTMETHODS (Abbreviation_beam_req);
143
144   Abbreviation_beam_req ();
145
146   int type_i_;
147 };
148
149
150
151 /// a slur
152 class Slur_req  : public Musical_span_req  {
153 public:
154   REQUESTMETHODS(Slur_req);
155
156 };
157
158 /// an extender line
159 class Extender_req : public Musical_span_req  {
160 public:
161   REQUESTMETHODS(Extender_req);
162   Extender_req ();
163 };
164
165 class Musical_script_req : public Musical_req,  public Script_req {
166 public:
167   REQUESTMETHODS(Musical_script_req);
168 };
169
170
171 class Dynamic_req  : public virtual Musical_req  {
172 public:
173   REQUESTMETHODS(Dynamic_req);
174 };
175
176 class Absolute_dynamic_req  : public Dynamic_req  {
177 public:
178   String loudness_str_;
179   virtual bool do_equal_b (Request*) const;
180   String loudness_str () const;
181   Absolute_dynamic_req();
182   REQUESTMETHODS(Absolute_dynamic_req);
183 };
184
185 class Span_dynamic_req  : public Dynamic_req, public Musical_span_req  {
186 public:
187   virtual bool do_equal_b (Request*) const;
188   /// Grow or shrink the volume: 1=cresc, -1 = decresc 
189   Direction dynamic_dir_;
190   Span_dynamic_req();
191   REQUESTMETHODS(Span_dynamic_req);
192 };
193
194 #endif // MUSICALREQUESTS_HH