]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
b4950a7971d4a7224df78a0f351a5fbbdbabe8cd
[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
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   virtual void do_print () const;
26
27
28   bool do_equal_b (Request*) 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 Abbreviation_req : public Request {
42   VIRTUAL_COPY_CONS (Abbreviation_req);
43   Abbreviation_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 G_script_req
60 {
61 public:
62   String articulation_str_;
63 protected:
64   virtual bool do_equal_b (Request*) const;
65   virtual void do_print () const;
66   VIRTUAL_COPY_CONS(Music);
67 };
68
69 class Text_script_req : public G_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 void do_print () const;
78 };
79
80
81 /// request which has some kind of pitch
82 struct Melodic_req :virtual Request
83 {
84   Musical_pitch pitch_;
85
86   static int compare (Melodic_req const&,Melodic_req const&);
87   
88 protected:
89   /// transpose. #delta# is relative to central c.
90   virtual void transpose (Musical_pitch delta);
91   virtual bool do_equal_b (Request*) const;
92   virtual void do_print () const;
93   VIRTUAL_COPY_CONS(Music);
94 };
95
96 /// specify tonic of a chord
97 struct Tonic_req : public Melodic_req
98 {
99   VIRTUAL_COPY_CONS(Music);
100 };
101
102 /// Put a note of specified type, height, and with accidental on the staff.
103 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
104 public:
105     
106   /// force/supress printing of accidental.
107   bool forceacc_b_;
108   /// Cautionary, i.e. parenthesized accidental.
109   bool cautionary_b_;
110   Note_req();
111 protected:
112   virtual void do_print () const;
113   bool do_equal_b (Request*) const;
114   VIRTUAL_COPY_CONS(Music);
115 };
116
117 /**
118 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.
119 */
120 class Rest_req : public Rhythmic_req {
121 public:
122   VIRTUAL_COPY_CONS(Music);
123 };
124
125 /**
126  Part: typeset a measure with the number of measures rest
127  Score: typeset all individual measures ass full rests
128  */
129 class Multi_measure_rest_req : public Rhythmic_req  {
130 public:
131   VIRTUAL_COPY_CONS(Music);
132
133 };
134
135
136 /** 
137  Start / stop an abbreviation beam at this note. 
138  */
139 class Abbreviation_beam_req : public Span_req  {
140 public:
141   VIRTUAL_COPY_CONS(Abbreviation_beam_req);
142
143   Abbreviation_beam_req ();
144
145   int type_i_;
146 };
147
148
149
150 /// a slur
151 class Slur_req  : public Span_req  {
152 public:
153   VIRTUAL_COPY_CONS(Music);
154
155 };
156
157 /// an extender line
158 class Extender_req : public Request  {
159 public:
160   VIRTUAL_COPY_CONS(Music);
161
162 };
163
164
165 class Dynamic_req  : public virtual Request  {
166 public:
167   VIRTUAL_COPY_CONS(Music);
168 };
169 /*
170    merge with Articulation_req? 
171  */
172 class Absolute_dynamic_req  : public Dynamic_req  {
173 public:
174   String loudness_str_;
175   Absolute_dynamic_req();
176
177 protected:
178   virtual void do_print () const;
179   virtual bool do_equal_b (Request*) const;
180   VIRTUAL_COPY_CONS(Music);
181 };
182
183 class Span_dynamic_req  : public Dynamic_req, public Span_req  {
184 public:
185
186   /// Grow or shrink the volume: 1=cresc, -1 = decresc 
187   Direction dynamic_dir_;
188
189   Span_dynamic_req();
190 protected:
191   virtual bool do_equal_b (Request*) const;
192   virtual void do_print () const;
193   VIRTUAL_COPY_CONS(Music);
194 };
195
196 #endif // MUSICALREQUESTS_HH