]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/command-request.hh
patch::: 1.1.37.script1
[lilypond.git] / lily / include / command-request.hh
1 /*
2   command-request.hh -- declare non-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 COMMANDREQUEST_HH
11 #define COMMANDREQUEST_HH
12
13 #include "request.hh"
14 #include "array.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
17
18 class Break_req : public Request {
19 public:
20   enum { DISALLOW = -10000, FORCE = 10000 };
21   int penalty_i_;
22   Break_req ();
23 protected:
24   VIRTUAL_COPY_CONS(Music);
25 };
26
27 class Mark_req : public Request {
28 public:
29   Mark_req (String);
30   String str_;
31 protected:
32   virtual void do_print () const;  
33   VIRTUAL_COPY_CONS(Music);
34 };
35
36
37 /** Baseclass for time_signature/partial req. It has to be handled by
38   Staff_{walker,column} baseclass.  */
39 class Timing_req  : public Request  {
40 public:
41   VIRTUAL_COPY_CONS(Music);
42 };
43
44
45 class Tempo_req : public Timing_req
46 {
47 public:
48   Duration dur_;
49   int metronome_i_;
50
51   Tempo_req();
52 protected:
53     virtual void do_print () const;
54   VIRTUAL_COPY_CONS(Music);
55   bool do_equal_b (Request *) const;
56 };
57
58 class Partial_measure_req  : public Timing_req  {
59 public:
60   Moment length_mom_;
61
62   Partial_measure_req (Moment);
63 protected:
64   VIRTUAL_COPY_CONS(Music);
65   virtual void do_print () const;
66   bool do_equal_b (Request*) const;
67 };
68
69 /**
70   todo: allow C time_signature
71  */
72 class Time_signature_change_req  : public Timing_req  {
73 public:
74   int beats_i_;
75   int one_beat_i_;
76
77   Time_signature_change_req();
78 protected:
79   virtual void do_print () const;
80   bool do_equal_b (Request*) const;
81   VIRTUAL_COPY_CONS(Music);
82 };
83
84 /// toggle Cadenza mode
85 class Cadenza_req  : public Timing_req  {
86 public:
87   /// turn on?
88   bool on_b_;
89   Cadenza_req (bool);
90 protected:
91   virtual void do_print () const;
92   
93   bool do_equal_b (Request*) const;
94   VIRTUAL_COPY_CONS(Music);
95 };
96
97 /// check if we're at start of a  measure.
98 class Barcheck_req  : public Timing_req  {
99 public:
100   bool do_equal_b (Request *) const;
101   VIRTUAL_COPY_CONS(Music);
102 };
103
104 class Measure_grouping_req : public Timing_req  {
105 public:
106   Array<int> beat_i_arr_;
107   Array<Moment> elt_length_arr_;
108 protected:
109   virtual void do_print () const;
110   bool do_equal_b (Request *) const;
111   VIRTUAL_COPY_CONS(Music);
112 };
113
114 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
115   the latter should only happen at the start of a measure.  */
116 class Bar_req  : public Request  {
117 public:
118   String type_str_;
119   Bar_req (String);
120 protected:
121   virtual void do_print () const;
122   bool do_equal_b (Request*) const;
123
124   VIRTUAL_COPY_CONS(Music);
125 };
126
127
128 /**
129     Handle key changes.
130     Routines for sharps and flats are separated, 
131     so that caller may identify non-conventional keys.
132 */
133 class Key_change_req  : public Request  {
134 public:
135   Array<Musical_pitch> pitch_arr_;
136   int modality_i_;
137   bool ordinary_key_b_;
138
139   Key_change_req();
140
141   /// squash the octaves to 1
142   void squash_octaves();
143   /// return number of flats in key
144   int flats_i();
145
146   /// return number of sharps in key
147   int sharps_i();
148   bool minor_b() const;
149
150 protected:
151   VIRTUAL_COPY_CONS(Music);
152   void transpose (Musical_pitch  d);
153   virtual void do_print () const;
154 };
155
156 class Clef_change_req  : public Request  {
157 public:
158   String clef_str_;
159   Clef_change_req (String);
160 protected:
161   virtual void do_print () const;
162   VIRTUAL_COPY_CONS(Music);
163 };
164
165 class Bracket_req :  public Span_req {
166
167 public:
168   VIRTUAL_COPY_CONS(Music);
169 };
170
171
172 #endif // COMMANDREQUEST_HH