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