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 {
25 DEFAULTACCESSOR(Lyric_req)
26 DEFAULTACCESSOR(Note_req )
27 DEFAULTACCESSOR(Stem_req )
28 DEFAULTACCESSOR(Melodic_req )
29 DEFAULTACCESSOR(Slur_req )
30 DEFAULTACCESSOR(Beam_req )
31 DEFAULTACCESSOR(Abbreviation_beam_req)
32 DEFAULTACCESSOR(Rhythmic_req)
33 DEFAULTACCESSOR(Musical_script_req)
34 DEFAULTACCESSOR(Text_req)
35 DEFAULTACCESSOR(Rest_req )
36 DEFAULTACCESSOR(Skip_req)
37 DEFAULTACCESSOR(Dynamic_req)
38 DEFAULTACCESSOR(Absolute_dynamic_req )
39 DEFAULTACCESSOR(Tie_req)
40 DEFAULTACCESSOR(Musical_span_req)
41 DEFAULTACCESSOR(Plet_req)
42 DEFAULTACCESSOR(Span_dynamic_req )
43 DEFAULTACCESSOR(Abbreviation_req)
44 DEFAULTACCESSOR(Multi_measure_rest_req)
45 REQUESTMETHODS(Musical_req);
50 /** a request with a duration.
51 This request is used only used as a base class.
53 class Rhythmic_req : public virtual Musical_req {
57 bool do_equal_b (Request*) const;
58 void compress (Moment);
59 virtual Moment duration() const;
61 static int compare (Rhythmic_req const&,Rhythmic_req const&);
62 REQUESTMETHODS(Rhythmic_req);
65 class Skip_req : public Rhythmic_req {
67 REQUESTMETHODS(Skip_req);
70 struct Spacing_req :virtual Request {
75 REQUESTMETHODS(Spacing_req);
78 struct Abbreviation_req : public Musical_req {
79 REQUESTMETHODS (Abbreviation_req);
84 class Blank_req : public Spacing_req, Rhythmic_req {
86 REQUESTMETHODS(Spacing_req);
89 /// Put a text above or below (?) this staff.
90 class Text_req : public virtual Musical_req {
92 /// preferred position (above/below)
94 /// the characteristics of the text
97 Text_req (int d, Text_def*);
99 Text_req (Text_req const&);
101 REQUESTMETHODS(Text_req);
104 /** a syllable or lyric is a string with rhythm.
106 class Lyric_req : public Rhythmic_req {
109 REQUESTMETHODS(Lyric_req);
114 /// request which has some kind of pitch
115 struct Melodic_req :virtual Musical_req
117 Musical_pitch pitch_;
118 /// transpose. #delta# is relative to central c.
119 virtual void transpose (Musical_pitch delta);
121 bool do_equal_b (Request*) const;
122 static int compare (Melodic_req const&,Melodic_req const&);
123 REQUESTMETHODS(Melodic_req);
126 /// Put a note of specified type, height, and with accidental on the staff.
127 class Note_req : public Rhythmic_req, virtual public Melodic_req {
130 /// force/supress printing of accidental.
133 bool do_equal_b (Request*) const;
134 Rhythmic_req* access_Rhythmic_req () { return Rhythmic_req::access_Rhythmic_req (); }
135 REQUESTMETHODS(Note_req);
139 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.
141 class Rest_req : public Rhythmic_req {
143 REQUESTMETHODS(Rest_req);
147 Part: typeset a measure with the number of measures rest
148 Score: typeset all individual measures ass full rests
150 class Multi_measure_rest_req : public Rhythmic_req {
152 REQUESTMETHODS(Multi_measure_rest_req);
156 class Musical_span_req : public Span_req, public virtual Musical_req
159 REQUESTMETHODS(Musical_span_req);
163 /** Start / stop a beam at this note */
164 class Beam_req : public Musical_span_req {
166 REQUESTMETHODS(Beam_req);
172 Start / stop an abbreviation beam at this note.
174 class Abbreviation_beam_req : public Musical_span_req {
176 REQUESTMETHODS (Abbreviation_beam_req);
178 Abbreviation_beam_req ();
184 Start a tie at this note, end it at the next
186 class Tie_req : public Musical_req {
188 REQUESTMETHODS(Tie_req);
192 class Slur_req : public Musical_span_req {
194 REQUESTMETHODS(Slur_req);
198 /// a plet (bracket with) number
199 class Plet_req : public Musical_span_req {
203 REQUESTMETHODS(Plet_req);
207 class Musical_script_req : public Musical_req, public Script_req {
209 REQUESTMETHODS(Musical_script_req);
213 class Dynamic_req : public virtual Musical_req {
216 for absolute dynamics
218 This sux. We'd want increasing numbers for FFF till PPP, but not
219 for FP, SF, SFZ (FP is *not* louder than FFF)
222 FFF, FF, F, MF, MP, P, PP, PPP, FP, SF, SFZ
224 static String loudness_static_str (Loudness);
225 REQUESTMETHODS(Dynamic_req);
228 class Absolute_dynamic_req : public Dynamic_req {
231 virtual bool do_equal_b (Request*) const;
232 String loudness_str () const;
233 Absolute_dynamic_req();
234 REQUESTMETHODS(Absolute_dynamic_req);
237 class Span_dynamic_req : public Dynamic_req, public Musical_span_req {
239 virtual bool do_equal_b (Request*) const;
240 /// Grow or shrink the volume: 1=cresc, -1 = decresc
241 Direction dynamic_dir_;
243 REQUESTMETHODS(Span_dynamic_req);
246 #endif // MUSICALREQUESTS_HH