]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
c38fd7fee94ef87bc5110434e448e9aae1aa506d
[lilypond.git] / lily / include / musical-request.hh
1 /*
2   musical-request.hh -- declare Musical requests
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
12
13 #include "lily-proto.hh"
14 #include "request.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
17 #include "array.hh"
18 #include "protected-scm.hh"
19
20
21 /** a request with a duration.
22   This request is used only used as a base class.
23  */
24 class Rhythmic_req  : public virtual Request  {
25 public:
26   Duration duration_;
27
28
29   bool do_equal_b (Request const*) const;
30   void compress (Moment);
31   virtual Moment length_mom () const;
32   static int compare (Rhythmic_req const&,Rhythmic_req const&);
33   VIRTUAL_COPY_CONS(Music);
34 };
35
36 class Skip_req  : public Rhythmic_req  {
37 public:
38   VIRTUAL_COPY_CONS(Music);
39 };
40
41
42 struct Tremolo_req : public Request {
43   VIRTUAL_COPY_CONS (Music);
44   Tremolo_req ();
45   int type_i_;
46
47 };
48
49
50 /**
51    a syllable or lyric is a string with rhythm.
52   */
53 class Lyric_req : public Rhythmic_req
54 {
55 public:
56   Protected_scm text_;
57
58 protected:
59   VIRTUAL_COPY_CONS (Music);
60 };
61
62
63 class Articulation_req : public Script_req
64 {
65 public:
66   String articulation_str_;
67 protected:
68   virtual bool do_equal_b (Request const*) const;
69
70   VIRTUAL_COPY_CONS(Music);
71 };
72
73 class Text_script_req : public Script_req
74 {
75 public:
76   Protected_scm text_;
77
78 protected:
79   VIRTUAL_COPY_CONS (Music);
80   virtual bool do_equal_b (Request const*) const;
81 };
82
83 class Dynamic_script_req : public Script_req
84 {
85 public:
86   Protected_scm text_;
87
88 protected:
89   VIRTUAL_COPY_CONS (Music);
90 };
91
92 /// request which has some kind of pitch
93 struct Melodic_req :virtual Request
94 {
95   Musical_pitch pitch_;
96
97   static int compare (Melodic_req const&,Melodic_req const&);
98   
99 protected:
100   /// transpose. #delta# is relative to central c.
101   virtual void transpose (Musical_pitch delta);
102   virtual bool do_equal_b (Request const*) const;
103
104   VIRTUAL_COPY_CONS(Music);
105 };
106
107 /// specify tonic of a chord
108 struct Tonic_req : public Melodic_req
109 {
110   VIRTUAL_COPY_CONS (Music);
111 };
112
113 /// specify inversion of a chord
114 struct Inversion_req : public Melodic_req
115 {
116   VIRTUAL_COPY_CONS (Music);
117 };
118
119 /// specify bass of a chord
120 struct Bass_req : public Melodic_req
121 {
122   VIRTUAL_COPY_CONS (Music);
123 };
124
125 /// Put a note of specified type, height, and with accidental on the staff.
126 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
127 public:
128     
129   /// force/supress printing of accidental.
130   bool forceacc_b_;
131   /// Cautionary, i.e. parenthesized accidental.
132   bool cautionary_b_;
133   Note_req();
134 protected:
135
136   bool do_equal_b (Request const*) const;
137   VIRTUAL_COPY_CONS(Music);
138 };
139
140 /**
141 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.
142 */
143 class Rest_req : public Rhythmic_req {
144 public:
145   VIRTUAL_COPY_CONS(Music);
146 };
147
148
149 /// an extender line
150 class Extender_req : public Request  {
151 public:
152   VIRTUAL_COPY_CONS(Music);
153 };
154
155 /// a centred hyphen
156 class Hyphen_req : public Request  {
157 public:
158   VIRTUAL_COPY_CONS(Music);
159 };
160
161 /** is anyone  playing a note?
162     Used for communication between Music & Lyrics
163  */
164 class Busy_playing_req : public Request
165 {
166 public:
167   VIRTUAL_COPY_CONS (Music);
168 };
169
170
171
172 /**
173    instruct lyric context to alter typesetting (unimplemented).  */
174 class Melisma_req : public Span_req
175 {
176 public:
177   VIRTUAL_COPY_CONS(Music);
178 };
179
180
181 /**
182    Helping req to signal start of a melisma from within a context, and
183    to   */
184 class Melisma_playing_req : public Request
185 {
186 public:
187   VIRTUAL_COPY_CONS (Music);
188 };
189
190 class Arpeggio_req : public Request
191 {
192 public:
193   VIRTUAL_COPY_CONS (Music);
194 };
195
196 #endif // MUSICALREQUESTS_HH