]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
release: 1.3.93
[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 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
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
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 /// specify inversion of a chord
104 struct Inversion_req : public Melodic_req
105 {
106   VIRTUAL_COPY_CONS (Music);
107 };
108
109 /// specify bass of a chord
110 struct Bass_req : public Melodic_req
111 {
112   VIRTUAL_COPY_CONS (Music);
113 };
114
115 /// Put a note of specified type, height, and with accidental on the staff.
116 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
117 public:
118     
119   /// force/supress printing of accidental.
120   bool forceacc_b_;
121   /// Cautionary, i.e. parenthesized accidental.
122   bool cautionary_b_;
123   Note_req();
124 protected:
125
126   bool do_equal_b (Request const*) const;
127   VIRTUAL_COPY_CONS(Music);
128 };
129
130 /**
131 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.
132 */
133 class Rest_req : public Rhythmic_req {
134 public:
135   VIRTUAL_COPY_CONS(Music);
136 };
137
138
139 /// an extender line
140 class Extender_req : public Request  {
141 public:
142   VIRTUAL_COPY_CONS(Music);
143 };
144
145 /// a centred hyphen
146 class Hyphen_req : public Request  {
147 public:
148   VIRTUAL_COPY_CONS(Music);
149 };
150
151 /** is anyone  playing a note?
152     Used for communication between Music & Lyrics
153  */
154 class Busy_playing_req : public Request
155 {
156 public:
157   VIRTUAL_COPY_CONS (Music);
158 };
159
160
161
162 /**
163    instruct lyric context to alter typesetting (unimplemented).  */
164 class Melisma_req : public Span_req
165 {
166 public:
167   VIRTUAL_COPY_CONS(Music);
168 };
169
170
171 /**
172    Helping req to signal start of a melisma from within a context, and
173    to   */
174 class Melisma_playing_req : public Request
175 {
176 public:
177   VIRTUAL_COPY_CONS (Music);
178 };
179 #endif // MUSICALREQUESTS_HH