2 musical-request.hh -- declare Musical requests
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
13 #include "lily-proto.hh"
15 #include "duration.hh"
19 A request which is coupled to a #Request_chord#
22 class Musical_req : public virtual Request {
25 virtual Lyric_req* lreq_l() { return 0; }
26 virtual Note_req *note() { return 0;}
27 virtual Stem_req *stem() { return 0;}
28 virtual Melodic_req *melodic() { return 0; }
29 virtual Slur_req *slur() { return 0 ; }
30 virtual Beam_req *beam() { return 0 ; }
31 virtual Abbreviation_beam_req* abbrev_beam() { return 0 ; }
32 virtual Rhythmic_req*rhythmic() { return 0; }
33 virtual Musical_script_req*musicalscript() { return 0; }
34 virtual Text_req*text() { return 0; }
35 virtual Rest_req *rest() { return 0; }
36 virtual Skip_req* skip() { return 0; }
37 virtual Dynamic_req* dynamic() { return 0; }
38 virtual Absolute_dynamic_req * absdynamic() { return 0; }
39 virtual Tie_req * tie() { return 0; }
40 virtual Plet_req* plet() { return 0; }
41 virtual Span_dynamic_req * span_dynamic() { return 0; }
42 virtual Abbreviation_req* abbrev() { return 0; }
43 virtual Multi_measure_rest_req* multi_measure() { return 0; }
44 REQUESTMETHODS(Musical_req, musical);
49 /** a request with a duration.
50 This request is used only a base class.
52 class Rhythmic_req : public virtual Musical_req {
57 void set_duration (Duration);
58 bool do_equal_b (Request*) const;
59 virtual Moment duration() const;
61 static int compare (Rhythmic_req const&,Rhythmic_req const&);
62 REQUESTMETHODS(Rhythmic_req, rhythmic);
65 class Skip_req : public Rhythmic_req {
67 REQUESTMETHODS(Skip_req, skip);
70 struct Spacing_req :virtual Request {
76 REQUESTMETHODS(Spacing_req, spacing);
79 struct Abbreviation_req : public Musical_req {
80 REQUESTMETHODS (Abbreviation_req, abbrev);
85 class Blank_req : public Spacing_req, Rhythmic_req {
87 REQUESTMETHODS(Spacing_req, spacing);
90 /// Put a text above or below (?) this staff.
91 class Text_req : public virtual Musical_req {
93 /// preferred position (above/below)
95 /// the characteristics of the text
99 Text_req (int d, Text_def*);
101 Text_req (Text_req const&);
103 REQUESTMETHODS(Text_req,text);
106 /** Put a text in lyric_staff
109 class Lyric_req : public Rhythmic_req, public Text_req {
111 Lyric_req (Text_def* t_p);
112 REQUESTMETHODS(Lyric_req, lreq_l);
115 /// request which has some kind of pitch
116 struct Melodic_req :virtual Musical_req
123 /// 0 natural, 1 sharp, etc
126 /// return height from central c (in halflines)
129 /// transpose. #delta# is relative to central c.
130 virtual void transpose (Melodic_req const *delta);
131 /// return pitch from central c (in halfnotes)
134 bool do_equal_b (Request*) const;
135 static int compare (Melodic_req const&,Melodic_req const&);
136 REQUESTMETHODS(Melodic_req,melodic);
139 /// Put a note of specified type, height, and with accidental on the staff.
140 class Note_req : public Rhythmic_req, virtual public Melodic_req {
143 /// force/supress printing of accidental.
146 bool do_equal_b (Request*) const;
147 Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic (); }
148 REQUESTMETHODS(Note_req, note);
152 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.
154 class Rest_req : public Rhythmic_req {
156 REQUESTMETHODS(Rest_req,rest);
160 Part: typeset a measure with the number of measures rest
161 Score: typeset all individual measures ass full rests
163 class Multi_measure_rest_req : public Rhythmic_req {
165 REQUESTMETHODS(Multi_measure_rest_req, multi_measure);
169 Requests to start or stop something.
170 This type of request typically results in the creation of a #Spanner#
172 class Span_req : public virtual Musical_req {
174 /// should the spanner start or stop, or is it unwanted?
178 bool do_equal_b (Request*) const;
179 REQUESTMETHODS(Span_req,span);
185 /** Start / stop a beam at this note */
186 class Beam_req : public Span_req {
188 /* *************** */
189 REQUESTMETHODS(Beam_req,beam);
195 Start / stop an abbreviation beam at this note.
197 class Abbreviation_beam_req : public Span_req {
199 REQUESTMETHODS (Abbreviation_beam_req, abbrev_beam);
201 Abbreviation_beam_req ();
207 Start a tie at this voice element, end it at the next
209 class Tie_req : public Musical_req {
211 REQUESTMETHODS(Tie_req, tie);
215 class Slur_req : public Span_req {
217 REQUESTMETHODS(Slur_req,slur);
221 /// a plet (bracket with) number
222 class Plet_req : public Span_req {
226 REQUESTMETHODS(Plet_req,plet);
231 class Musical_script_req : public Musical_req, public Script_req {
233 REQUESTMETHODS(Musical_script_req, musicalscript);
237 class Dynamic_req : public virtual Musical_req {
240 for absolute dynamics
242 This sux. We'd want increasing numbers for FFF till PPP, but not
243 for FP, SF, SFZ (FP is *not* louder than FFF)
246 FFF, FF, F, MF, MP, P, PP, PPP, FP, SF, SFZ
248 static String loudness_static_str (Loudness);
249 REQUESTMETHODS(Dynamic_req, dynamic);
252 class Absolute_dynamic_req : public Dynamic_req {
255 virtual bool do_equal_b (Request*) const;
256 String loudness_str () const;
257 Absolute_dynamic_req();
258 REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
261 class Span_dynamic_req : public Dynamic_req, public Span_req {
263 /// Grow or shrink the volume: 1=cresc, -1 = decresc
264 Direction dynamic_dir_;
266 REQUESTMETHODS(Span_dynamic_req, span_dynamic);
269 #endif // MUSICALREQUESTS_HH