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