2 musicalrequests.hh -- declare Musical requests
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
17 A request which is coupled to a #Voice_element# with nonzero duration.
20 struct Musical_req
: virtual Request
{
21 virtual Skip_req
* skip() { return 0; }
22 REQUESTMETHODS(Musical_req
, musical
);
26 struct Skip_req
: Musical_req
{
29 virtual Moment
duration() const;
30 REQUESTMETHODS(Skip_req
, skip
);
32 /** a request with a duration.
33 This request is used only a base class.
35 struct Rhythmic_req
: virtual Musical_req
{
40 static int compare(const Rhythmic_req
&, const Rhythmic_req
&);
41 virtual Moment
duration() const;
43 Rhythmic_req(int,int);
44 REQUESTMETHODS(Rhythmic_req
, rhythmic
);
47 struct Spacing_req
:virtual Request
{
53 REQUESTMETHODS(Spacing_req
, spacing
);
56 struct Blank_req
: Spacing_req
, Rhythmic_req
{
57 REQUESTMETHODS(Spacing_req
, spacing
);
61 /// Put a text above or below (?) this staff.
62 struct Text_req
: virtual Musical_req
{
63 /// preferred position (above/below)
65 /// the characteristics of the text
68 Text_req(int d
, Text_def
*);
70 Text_req(Text_req
const&);
71 static int compare(const Text_req
&,const Text_req
&);
72 REQUESTMETHODS(Text_req
,text
);
75 /** Put a text in lyric_staff
78 struct Lyric_req
: public Rhythmic_req
, Text_req
{
79 Lyric_req(Text_def
* t_p
);
80 REQUESTMETHODS(Lyric_req
, lreq_l
);
83 /// request which has some kind of pitch
84 struct Melodic_req
:virtual Musical_req
91 /// 0 natural, 1 sharp, etc
94 /// force/supress printing of accidental.
97 /// return height from central c (in halflines)
99 /// return pitch from central c (in halfnotes)
103 REQUESTMETHODS(Melodic_req
,melodic
);
106 /// Put a note of specified type, height, and with accidental on the staff.
107 struct Note_req
: Rhythmic_req
, virtual Melodic_req
{
110 Rhythmic_req
* rhythmic() { return Rhythmic_req::rhythmic(); }
111 REQUESTMETHODS(Note_req
, note
);
115 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.
117 class Rest_req
: public Rhythmic_req
{
119 REQUESTMETHODS(Rest_req
,rest
);
123 attach a stem to the noteball.
124 Rhythmic_req parent needed to determine if it will fit inside a beam.
126 struct Stem_req
: Rhythmic_req
{
127 /// preferred direction for the stem
129 Stem_req(int s
, int dots
);
130 REQUESTMETHODS(Stem_req
,stem
);
134 Requests to start or stop something.
135 This type of request typically results in the creation of a #Spanner#
137 struct Span_req
: Musical_req
{
138 /// should the spanner start or stop, or is it unwanted?
142 static int compare(const Span_req
&r1
, const Span_req
&r2
);
143 REQUESTMETHODS(Span_req
,span
);
149 /// request for backward plet generation
150 struct Plet_req
: Request
{
156 REQUESTMETHODS(Plet_req
,plet
);
161 /** Start / stop a beam at this note. if #nplet# is set, the staff will try to put an
162 appropriate number over the beam
164 struct Beam_req
: Span_req
{
167 /* *************** */
168 REQUESTMETHODS(Beam_req
,beam
);
174 struct Slur_req
: Span_req
{
175 REQUESTMETHODS(Slur_req
,slur
);
180 /**Put a script above or below this ``note''. eg upbow, downbow. Why a
181 request? These symbols may conflict with slurs and brackets, so this
183 struct Script_req
: Musical_req
{
185 Script_def
*scriptdef_p_
;
187 /* *************** */
188 static int compare(const Script_req
&, const Script_req
&);
189 Script_req(int d
, Script_def
*);
190 REQUESTMETHODS(Script_req
,script
);
192 Script_req(Script_req
const&);
198 #endif // MUSICALREQUESTS_HH