2 musical-request.hh -- declare Musical requests
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 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 Rhythmic_req*rhythmic() { return 0; }
32 virtual Musical_script_req*musicalscript() { return 0; }
33 virtual Text_req*text() { return 0; }
34 virtual Rest_req *rest() { return 0; }
35 virtual Skip_req* skip() { return 0; }
36 virtual Dynamic_req* dynamic() { return 0; }
37 virtual Absolute_dynamic_req * absdynamic() { return 0; }
38 virtual Tie_req * tie() { return 0; }
39 virtual Span_dynamic_req * span_dynamic() { return 0; }
40 REQUESTMETHODS(Musical_req, musical);
45 /** a request with a duration.
46 This request is used only a base class.
48 class Rhythmic_req : public virtual Musical_req {
53 void set_duration (Duration);
54 bool do_equal_b (Request*) const;
55 virtual Moment duration() const;
57 static int compare (Rhythmic_req const&,Rhythmic_req const&);
58 REQUESTMETHODS(Rhythmic_req, rhythmic);
61 class Skip_req : public Rhythmic_req {
63 REQUESTMETHODS(Skip_req, skip);
65 struct Spacing_req :virtual Request {
71 REQUESTMETHODS(Spacing_req, spacing);
74 class Blank_req : public Spacing_req, Rhythmic_req {
76 REQUESTMETHODS(Spacing_req, spacing);
80 /// Put a text above or below (?) this staff.
81 class Text_req : public virtual Musical_req {
83 /// preferred position (above/below)
85 /// the characteristics of the text
89 Text_req (int d, Text_def*);
91 Text_req (Text_req const&);
93 REQUESTMETHODS(Text_req,text);
96 /** Put a text in lyric_staff
99 class Lyric_req : public Rhythmic_req, public Text_req {
101 Lyric_req (Text_def* t_p);
102 REQUESTMETHODS(Lyric_req, lreq_l);
105 /// request which has some kind of pitch
106 struct Melodic_req :virtual Musical_req
113 /// 0 natural, 1 sharp, etc
116 /// return height from central c (in halflines)
119 /// transpose. #delta# is relative to central c.
120 void transpose (Melodic_req const &delta);
121 /// return pitch from central c (in halfnotes)
124 bool do_equal_b (Request*) const;
125 static int compare (Melodic_req const&,Melodic_req const&);
126 REQUESTMETHODS(Melodic_req,melodic);
129 /// Put a note of specified type, height, and with accidental on the staff.
130 class Note_req : public Rhythmic_req, virtual public Melodic_req {
133 /// force/supress printing of accidental.
136 bool do_equal_b (Request*) const;
137 Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic (); }
138 REQUESTMETHODS(Note_req, note);
142 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.
144 class Rest_req : public Rhythmic_req {
146 REQUESTMETHODS(Rest_req,rest);
152 Requests to start or stop something.
153 This type of request typically results in the creation of a #Spanner#
155 class Span_req : public virtual Musical_req {
157 /// should the spanner start or stop, or is it unwanted?
161 bool do_equal_b (Request*) const;
162 REQUESTMETHODS(Span_req,span);
168 /** Start / stop a beam at this note. if #nplet# is set, the staff
169 will try to put an appropriate number over the beam */
170 class Beam_req : public Span_req {
174 /* *************** */
175 REQUESTMETHODS(Beam_req,beam);
181 Start a tie at this voice element, end it at the next
183 class Tie_req : public Musical_req {
185 REQUESTMETHODS(Tie_req, tie);
189 class Slur_req : public Span_req {
191 REQUESTMETHODS(Slur_req,slur);
195 class Musical_script_req : public Musical_req, public Script_req {
197 REQUESTMETHODS(Musical_script_req, musicalscript);
201 class Dynamic_req : public virtual Musical_req {
203 /// for absolute dynamics
205 FFF, FF, F, MF, MP, P, PP, PPP
207 static String loudness_str (Loudness);
208 REQUESTMETHODS(Dynamic_req, dynamic);
211 class Absolute_dynamic_req : public Dynamic_req {
214 Absolute_dynamic_req();
215 REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
218 class Span_dynamic_req : public Dynamic_req, public Span_req {
220 /// Grow or shrink the volume: 1=cresc, -1 = decresc
221 Direction dynamic_dir_;
223 REQUESTMETHODS(Span_dynamic_req, span_dynamic);
226 #endif // MUSICALREQUESTS_HH