1 // LilyPond's second egg of columbus!
9 /// a voice element wants something printed
16 Request(Request const&);
19 virtual void print()const ;
20 virtual Moment duration() const { return 0.0; }
21 virtual Request* clone() const =0;
23 /* accessors for children */
24 virtual Barcheck_req *barcheck() { return 0; }
25 virtual Note_req *note() {return 0;}
26 virtual Script_req *script() {return 0;}
27 virtual Stem_req *stem() {return 0;}
28 virtual Text_req*text() { return 0; }
29 virtual Rest_req *rest() {return 0;}
30 virtual Span_req *span() {return 0;}
31 virtual Beam_req *beam() { return 0 ; }
32 virtual Slur_req *slur() { return 0 ; }
33 virtual Rhythmic_req*rhythmic() { return 0; }
34 virtual Melodic_req *melodic() { return 0; }
35 virtual Mark_req * mark() { return 0; }
42 struct Barcheck_req : Request {
43 virtual Barcheck_req *barcheck() { return this; }
45 Request*clone() const;
48 /// a request with a duration
49 struct Rhythmic_req : virtual Request {
55 Moment duration() const;
57 Rhythmic_req*rhythmic() { return this;}
59 Request*clone() const;
63 struct Melodic_req :virtual Request
71 // return height from central c (in halflines)
74 Melodic_req*melodic() { return this;}
75 virtual void print() const;
76 Request*clone() const;
79 /// Put a note of specified type, height, and with accidental on the staff.
80 struct Note_req : Rhythmic_req, virtual Melodic_req {
81 Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
83 Note_req*note() { return this;}
84 virtual void print() const;
85 Request*clone() const;
91 ///Put a rest on the staff.
92 struct Rest_req : Rhythmic_req {
96 Rest_req * rest() { return this;}
97 Request*clone() const ;
100 Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
103 /// attach a stem to the noteball
104 struct Stem_req : Request {
108 virtual Stem_req *stem() {return this;}
109 Stem_req(int s) { stem_number = s; }
110 Request*clone() const;
111 virtual void print() const;
114 /// requests to start or stop something.
115 struct Span_req : Request {
116 /// should the spanner start or stop, or is it unwanted?
121 virtual void print() const;
122 Span_req*span() { return this; }
124 virtual Request*clone()const;
127 This type of request typically results in the creation of a #Spanner#
131 ///Start / stop a beam at this note.
132 struct Beam_req : Span_req {
138 virtual Beam_req * beam() { return this; }
139 virtual Request*clone()const;
141 /** if #nplet# is set, the staff will try to put an
142 appropriate number over the beam
146 struct Slur_req : Span_req {
148 virtual Request*clone()const;
149 virtual Slur_req*slur() { return this; }
153 ///Put a script above or below this ``note''
154 struct Script_req : Request {
156 Script_def *scriptdef;
159 Script_req*script() { return this; }
160 virtual void print() const;
161 Request *clone()const;
162 Script_req(int d, Script_def*);
164 Script_req(Script_req const&);
166 /** eg upbow, downbow. Why a request? These symbols may conflict with
167 slurs and brackets, so this also a request */
170 ///Put a text above or below (?) this staff.
171 struct Text_req : Request {
175 Text_req*text() { return this; }
176 virtual void print() const;
177 Request *clone()const;
178 Text_req(int d, Text_def*);
180 Text_req(Text_req const&);
183 /// designate this spot with a name.
184 struct Mark_req : Request {
188 Mark_req* mark() { return this; }
189 virtual void print() const;
190 Request *clone() const;
196 ///Put a lyric above or below (?) this staff.
197 struct Lyric_req : Request {
203 ///Draw a (Guitar) chord above or below this ``note''
204 struct Chord : Request {
205 // don't know how this looks.
209 Because everything else is done in requests.
213 /// for absolute dynamics
215 FFF, FF, F, MF, MP, P, PP, PPP
219 ///Start / stop a slur or a bracket.
220 struct Bracket_req : Span_req {
221 int nplet; // print a number over the beam.
225 Start/stop a bracket at this note. if #nplet# is set, the staff will
226 try to put an appropriate number over the bracket
233 /// helper in the hierarchy
234 struct Dynamic:Subtle_req {
237 /** Each dynamic is bound to one note ( a crescendo spanning multiple
238 notes is thought to be made of two "dynamics": a start and a stop).
239 Dynamic changes can occur in a smaller time than the length of its
240 note, therefore fore each Dynamic request carries a time, measured
241 from the start of its note.
243 This subfield would come in handy, if mpp96 was adapted for midi
246 Dynamic should have been derived from request, but I don't want to
247 fuss with virtual baseclasses. */
250 struct Cresc_req : Span_req, Dynamic {
255 struct Decresc_req : Span_req, Dynamic {
259 /// do a dynamic like "fff" or "mp"
260 struct Absdynamic_req : Request, Dynamic {
264 struct Grace_req : Subtle_req {
268 struct Grace_turn_req : Grace_turn {
272 struct Grace_note : Melodic_req {
285 struct Glissando_req : Span_req {