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; }
41 struct Barcheck_req : Request {
42 virtual Barcheck_req *barcheck() { return this; }
44 Request*clone() const;
47 /// a request with a duration
48 struct Rhythmic_req : virtual Request {
54 Moment duration() const;
56 Rhythmic_req*rhythmic() { return this;}
58 Request*clone() const;
62 struct Melodic_req :virtual Request
70 // return height from central c (in halflines)
73 Melodic_req*melodic() { return this;}
74 virtual void print() const;
75 Request*clone() const;
78 /// Put a note of specified type, height, and with accidental on the staff.
79 struct Note_req : Rhythmic_req, virtual Melodic_req {
80 Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
82 Note_req*note() { return this;}
83 virtual void print() const;
84 Request*clone() const;
90 ///Put a rest on the staff.
91 struct Rest_req : Rhythmic_req {
95 Rest_req * rest() { return this;}
96 Request*clone() const ;
99 Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
102 /// attach a stem to the noteball
103 struct Stem_req : Request {
107 virtual Stem_req *stem() {return this;}
108 Stem_req(int s) { stem_number = s; }
109 Request*clone() const;
112 /// requests to start or stop something.
113 struct Span_req : Request {
114 /// should the spanner start or stop, or is it unwanted?
119 virtual void print() const;
120 Span_req*span() { return this; }
122 virtual Request*clone()const;
125 This type of request typically results in the creation of a #Spanner#
129 ///Start / stop a beam at this note.
130 struct Beam_req : Span_req {
136 virtual Beam_req * beam() { return this; }
137 virtual Request*clone()const;
139 /** if #nplet# is set, the staff will try to put an
140 appropriate number over the beam
144 struct Slur_req : Span_req {
146 virtual Request*clone()const;
147 virtual Slur_req*slur() { return this; }
151 ///Put a script above or below this ``note''
152 struct Script_req : Request {
154 Script_def *scriptdef;
157 Script_req*script() { return this; }
158 virtual void print() const;
159 Request *clone()const;
160 Script_req(int d, Script_def*);
162 Script_req(Script_req const&);
164 /** eg upbow, downbow. Why a request? These symbols may conflict with
165 slurs and brackets, so this also a request */
168 ///Put a text above or below (?) this staff.
169 struct Text_req : Request {
173 Text_req*text() { return this; }
174 virtual void print() const;
175 Request *clone()const;
176 Text_req(int d, Text_def*);
178 Text_req(Text_req const&);
184 ///Put a lyric above or below (?) this staff.
185 struct Lyric_req : Request {
191 ///Draw a (Guitar) chord above or below this ``note''
192 struct Chord : Request {
193 // don't know how this looks.
197 Because everything else is done in requests.
201 /// for absolute dynamics
203 FFF, FF, F, MF, MP, P, PP, PPP
207 ///Start / stop a slur or a bracket.
208 struct Bracket_req : Span_req {
209 int nplet; // print a number over the beam.
213 Start/stop a bracket at this note. if #nplet# is set, the staff will
214 try to put an appropriate number over the bracket
217 struct Subtle_request {
221 /// helper in the hierarchy
222 struct Dynamic:Subtle_request {
225 /** Each dynamic is bound to one note ( a crescendo spanning multiple
226 notes is thought to be made of two "dynamics": a start and a stop).
227 Dynamic changes can occur in a smaller time than the length of its
228 note, therefore fore each Dynamic request carries a time, measured
229 from the start of its note.
231 This subfield would come in handy, if mpp96 was adapted for midi
234 Dynamic should have been derived from request, but I don't want to
235 fuss with virtual baseclasses. */
238 struct Cresc_req : Span_req, Dynamic {
243 struct Decresc_req : Span_req, Dynamic {
247 /// do a dynamic like "fff" or "mp"
248 struct Absdynamic_req : Request, Dynamic {
252 struct Grace_req : Subtle_request {
256 struct Grace_turn_req : Grace_turn {
260 struct Grace_note : Melodic_req {