2 musical-request.hh -- declare Musical requests
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
13 #include "lily-proto.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
19 A request which is coupled to a note (that has duration).
22 class Musical_req : public virtual Request {
26 REQUESTMETHODS(Musical_req);
31 /** a request with a duration.
32 This request is used only used as a base class.
34 class Rhythmic_req : public virtual Musical_req {
38 bool do_equal_b (Request*) const;
39 void compress (Moment);
40 virtual Moment duration() const;
42 static int compare (Rhythmic_req const&,Rhythmic_req const&);
43 REQUESTMETHODS(Rhythmic_req);
46 class Skip_req : public Rhythmic_req {
48 REQUESTMETHODS(Skip_req);
51 struct Spacing_req :virtual Request {
56 REQUESTMETHODS(Spacing_req);
59 struct Abbreviation_req : public Musical_req {
60 REQUESTMETHODS (Abbreviation_req);
65 class Blank_req : public Spacing_req, Rhythmic_req {
67 REQUESTMETHODS(Spacing_req);
70 /// Put a text above or below (?) this staff.
71 class Text_req : public virtual Musical_req {
73 /// preferred position (above/below)
75 /// the characteristics of the text
78 Text_req (int d, Text_def*);
80 Text_req (Text_req const&);
82 REQUESTMETHODS(Text_req);
85 /** a syllable or lyric is a string with rhythm.
87 class Lyric_req : public Rhythmic_req {
90 REQUESTMETHODS(Lyric_req);
95 /// request which has some kind of pitch
96 struct Melodic_req :virtual Musical_req
99 /// transpose. #delta# is relative to central c.
100 virtual void transpose (Musical_pitch delta);
102 bool do_equal_b (Request*) const;
103 static int compare (Melodic_req const&,Melodic_req const&);
104 REQUESTMETHODS(Melodic_req);
107 /// Put a note of specified type, height, and with accidental on the staff.
108 class Note_req : public Rhythmic_req, virtual public Melodic_req {
111 /// force/supress printing of accidental.
114 bool do_equal_b (Request*) const;
115 REQUESTMETHODS(Note_req);
119 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.
121 class Rest_req : public Rhythmic_req {
123 REQUESTMETHODS(Rest_req);
127 Part: typeset a measure with the number of measures rest
128 Score: typeset all individual measures ass full rests
130 class Multi_measure_rest_req : public Rhythmic_req {
132 REQUESTMETHODS(Multi_measure_rest_req);
136 class Musical_span_req : public Span_req, public virtual Musical_req
139 REQUESTMETHODS(Musical_span_req);
143 /** Start / stop a beam at this note */
144 class Beam_req : public Musical_span_req {
146 REQUESTMETHODS(Beam_req);
152 Start / stop an abbreviation beam at this note.
154 class Abbreviation_beam_req : public Musical_span_req {
156 REQUESTMETHODS (Abbreviation_beam_req);
158 Abbreviation_beam_req ();
164 Start a tie at this note, end it at the next
166 class Tie_req : public Musical_req {
168 REQUESTMETHODS(Tie_req);
172 class Slur_req : public Musical_span_req {
174 REQUESTMETHODS(Slur_req);
178 /// a plet (bracket with) number
179 class Plet_req : public Musical_span_req {
183 REQUESTMETHODS(Plet_req);
187 class Musical_script_req : public Musical_req, public Script_req {
189 REQUESTMETHODS(Musical_script_req);
193 class Dynamic_req : public virtual Musical_req {
196 for absolute dynamics
198 This sux. We'd want increasing numbers for FFF till PPP, but not
199 for FP, SF, SFZ (FP is *not* louder than FFF)
202 FFF, FF, F, MF, MP, P, PP, PPP, FP, SF, SFZ
204 static String loudness_static_str (Loudness);
205 REQUESTMETHODS(Dynamic_req);
208 class Absolute_dynamic_req : public Dynamic_req {
211 virtual bool do_equal_b (Request*) const;
212 String loudness_str () const;
213 Absolute_dynamic_req();
214 REQUESTMETHODS(Absolute_dynamic_req);
217 class Span_dynamic_req : public Dynamic_req, public Musical_span_req {
219 virtual bool do_equal_b (Request*) const;
220 /// Grow or shrink the volume: 1=cresc, -1 = decresc
221 Direction dynamic_dir_;
223 REQUESTMETHODS(Span_dynamic_req);
226 #endif // MUSICALREQUESTS_HH