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