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