]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
patch::: 1.3.108.jcn1
[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   Duration duration_;
25
26   bool do_equal_b (Request const*) const;
27   void compress (Moment);
28   virtual Moment length_mom () const;
29   static int compare (Rhythmic_req const&,Rhythmic_req const&);
30   VIRTUAL_COPY_CONS(Music);
31 };
32
33 class Skip_req  : public Rhythmic_req  {
34 public:
35   VIRTUAL_COPY_CONS(Music);
36 };
37
38
39 struct Tremolo_req : public Request {
40   VIRTUAL_COPY_CONS (Music);
41   Tremolo_req ();
42
43   void set_type (int);
44   int get_type () const;
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 get_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   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 (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 /*
110    Put a note of specified type, height, and with accidental on the staff.
111     /// force/supress printing of accidental.
112   bool forceacc_b_;
113   /// Cautionary, i.e. parenthesized accidental.
114   bool cautionary_b_;
115
116  */
117 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
118 public:
119     
120   Note_req();
121 protected:
122
123   bool do_equal_b (Request const*) const;
124   VIRTUAL_COPY_CONS(Music);
125 };
126
127 /**
128 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.
129 */
130 class Rest_req : public Rhythmic_req {
131 public:
132   VIRTUAL_COPY_CONS(Music);
133 };
134
135
136 /// an extender line
137 class Extender_req : public Request  {
138 public:
139   VIRTUAL_COPY_CONS(Music);
140 };
141
142 /// a centred hyphen
143 class Hyphen_req : public Request  {
144 public:
145   VIRTUAL_COPY_CONS(Music);
146 };
147
148 /** is anyone  playing a note?
149     Used for communication between Music & Lyrics
150  */
151 class Busy_playing_req : public Request
152 {
153 public:
154   VIRTUAL_COPY_CONS (Music);
155 };
156
157
158
159 /**
160    instruct lyric context to alter typesetting (unimplemented).  */
161 class Melisma_req : public Span_req
162 {
163 public:
164   VIRTUAL_COPY_CONS(Music);
165 };
166
167
168 /**
169    Helping req to signal start of a melisma from within a context, and
170    to   */
171 class Melisma_playing_req : public Request
172 {
173 public:
174   VIRTUAL_COPY_CONS (Music);
175 };
176
177 class Arpeggio_req : public Request
178 {
179 public:
180   VIRTUAL_COPY_CONS (Music);
181 };
182
183 #endif // MUSICALREQUESTS_HH