]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
patch::: 1.3.98.jcn2
[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
76 /// request which has some kind of pitch
77 struct Melodic_req :virtual Request
78 {
79   Musical_pitch pitch_;
80
81   static int compare (Melodic_req const&,Melodic_req const&);
82   
83 protected:
84   /// transpose. #delta# is relative to central c.
85   virtual void transpose (Musical_pitch delta);
86   virtual bool do_equal_b (Request const*) const;
87
88   VIRTUAL_COPY_CONS(Music);
89 };
90
91 /// specify tonic of a chord
92 struct Tonic_req : public Melodic_req
93 {
94   VIRTUAL_COPY_CONS (Music);
95 };
96
97 /// specify inversion of a chord
98 struct Inversion_req : public Melodic_req
99 {
100   VIRTUAL_COPY_CONS (Music);
101 };
102
103 /// specify bass of a chord
104 struct Bass_req : public Melodic_req
105 {
106   VIRTUAL_COPY_CONS (Music);
107 };
108
109 /// Put a note of specified type, height, and with accidental on the staff.
110 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
111 public:
112     
113   /// force/supress printing of accidental.
114   bool forceacc_b_;
115   /// Cautionary, i.e. parenthesized accidental.
116   bool cautionary_b_;
117   Note_req();
118 protected:
119
120   bool do_equal_b (Request const*) const;
121   VIRTUAL_COPY_CONS(Music);
122 };
123
124 /**
125 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.
126 */
127 class Rest_req : public Rhythmic_req {
128 public:
129   VIRTUAL_COPY_CONS(Music);
130 };
131
132
133 /// an extender line
134 class Extender_req : public Request  {
135 public:
136   VIRTUAL_COPY_CONS(Music);
137 };
138
139 /// a centred hyphen
140 class Hyphen_req : public Request  {
141 public:
142   VIRTUAL_COPY_CONS(Music);
143 };
144
145 /** is anyone  playing a note?
146     Used for communication between Music & Lyrics
147  */
148 class Busy_playing_req : public Request
149 {
150 public:
151   VIRTUAL_COPY_CONS (Music);
152 };
153
154
155
156 /**
157    instruct lyric context to alter typesetting (unimplemented).  */
158 class Melisma_req : public Span_req
159 {
160 public:
161   VIRTUAL_COPY_CONS(Music);
162 };
163
164
165 /**
166    Helping req to signal start of a melisma from within a context, and
167    to   */
168 class Melisma_playing_req : public Request
169 {
170 public:
171   VIRTUAL_COPY_CONS (Music);
172 };
173
174 class Arpeggio_req : public Request
175 {
176 public:
177   VIRTUAL_COPY_CONS (Music);
178 };
179
180 #endif // MUSICALREQUESTS_HH