]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
patch::: 1.3.108.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 "pitch.hh"
17 #include "array.hh"
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
26   bool do_equal_b (Request const*) const;
27   void compress (Moment);
28   virtual Moment length_mom () const;
29   static int compare (Rhythmic_req const&,Rhythmic_req const&);
30   VIRTUAL_COPY_CONS(Music);
31 };
32
33 class Skip_req  : public Rhythmic_req  {
34 public:
35   VIRTUAL_COPY_CONS(Music);
36 };
37
38
39 struct Tremolo_req : public Request {
40   VIRTUAL_COPY_CONS (Music);
41   Tremolo_req ();
42
43   void set_type (int);
44   int get_type () const;
45 };
46
47
48 /**
49    a syllable or lyric is a string with rhythm.
50   */
51 class Lyric_req : public Rhythmic_req
52 {
53 protected:
54   VIRTUAL_COPY_CONS (Music);
55 };
56
57
58 class Articulation_req : public Script_req
59 {
60 public:
61   String get_articulation_str();
62 protected:
63   virtual bool do_equal_b (Request const*) const;
64
65   VIRTUAL_COPY_CONS(Music);
66 };
67
68 class Text_script_req : public Script_req
69 {
70 protected:
71   VIRTUAL_COPY_CONS (Music);
72   virtual bool do_equal_b (Request const*) const;
73 };
74
75
76 /// request which has some kind of pitch
77 struct Melodic_req :virtual Request
78 {
79   Pitch pitch_;
80
81   static int compare (Melodic_req const&,Melodic_req const&);
82   
83 protected:
84   /// transpose. #delta# is relative to central c.
85   virtual void transpose (Pitch delta);
86   virtual bool do_equal_b (Request const*) const;
87
88   VIRTUAL_COPY_CONS(Music);
89 };
90
91 /*
92    Put a note of specified type, height, and with accidental on the staff.
93     /// force/supress printing of accidental.
94   bool forceacc_b_;
95   /// Cautionary, i.e. parenthesized accidental.
96   bool cautionary_b_;
97
98  */
99 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
100 public:
101     
102   Note_req();
103 protected:
104
105   bool do_equal_b (Request const*) const;
106   VIRTUAL_COPY_CONS(Music);
107 };
108
109 /**
110 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.
111 */
112 class Rest_req : public Rhythmic_req {
113 public:
114   VIRTUAL_COPY_CONS(Music);
115 };
116
117
118 /// an extender line
119 class Extender_req : public Request  {
120 public:
121   VIRTUAL_COPY_CONS(Music);
122 };
123
124 /// a centred hyphen
125 class Hyphen_req : public Request  {
126 public:
127   VIRTUAL_COPY_CONS(Music);
128 };
129
130 /** is anyone  playing a note?
131     Used for communication between Music & Lyrics
132  */
133 class Busy_playing_req : public Request
134 {
135 public:
136   VIRTUAL_COPY_CONS (Music);
137 };
138
139
140
141 /**
142    instruct lyric context to alter typesetting (unimplemented).  */
143 class Melisma_req : public Span_req
144 {
145 public:
146   VIRTUAL_COPY_CONS(Music);
147 };
148
149
150 /**
151    Helping req to signal start of a melisma from within a context, and
152    to   */
153 class Melisma_playing_req : public Request
154 {
155 public:
156   VIRTUAL_COPY_CONS (Music);
157 };
158
159 class Arpeggio_req : public Request
160 {
161 public:
162   VIRTUAL_COPY_CONS (Music);
163 };
164
165 #endif // MUSICALREQUESTS_HH