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