2 command-request.hh -- declare non-musical requests
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef COMMANDREQUEST_HH
11 #define COMMANDREQUEST_HH
15 #include "duration.hh"
16 #include "musical-pitch.hh"
18 /** Request which are assumed to be "happening" before the
19 musical requests. Not coupled to a note or rest. */
20 class Command_req : public virtual Request {
22 REQUESTMETHODS(Command_req);
27 class Break_req : public Command_req {
29 enum { DISALLOW = -10000, FORCE = 10000 };
32 REQUESTMETHODS (Break_req);
35 class Mark_req : public Command_req {
39 REQUESTMETHODS (Mark_req);
42 class Command_script_req : public Command_req, public Script_req {
46 ~Command_script_req();
47 REQUESTMETHODS(Command_script_req);
50 /** Baseclass for time_signature/partial req. It has to be handled by
51 Staff_{walker,column} baseclass. */
52 class Timing_req : public Command_req {
54 REQUESTMETHODS(Timing_req);
58 class Tempo_req : public Timing_req
65 REQUESTMETHODS(Tempo_req);
66 bool do_equal_b (Request *) const;
69 class Partial_measure_req : public Timing_req {
73 Partial_measure_req (Moment);
74 REQUESTMETHODS(Partial_measure_req);
75 bool do_equal_b (Request*) const;
79 todo: allow C time_signature
81 class Time_signature_change_req : public Timing_req {
83 int beats_i_, one_beat_i_;
85 Time_signature_change_req();
86 bool do_equal_b (Request*) const;
87 REQUESTMETHODS(Time_signature_change_req);
90 /// toggle Cadenza mode
91 class Cadenza_req : public Timing_req {
95 bool do_equal_b (Request*) const;
97 REQUESTMETHODS(Cadenza_req);
100 /// check if we're at start of a measure.
101 class Barcheck_req : public Timing_req {
103 bool do_equal_b (Request *) const;
104 REQUESTMETHODS(Barcheck_req);
107 class Measure_grouping_req : public Timing_req {
109 Array<int> beat_i_arr_;
110 Array<Moment> elt_length_arr_;
111 bool do_equal_b (Request *) const;
112 REQUESTMETHODS(Measure_grouping_req);
115 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
116 the latter should only happen at the start of a measure. */
117 class Bar_req : public Command_req {
121 bool do_equal_b (Request*) const;
123 REQUESTMETHODS(Bar_req);
129 Routines for sharps and flats are separated,
130 so that caller may identify non-conventional keys.
132 class Key_change_req : public Command_req {
134 Array<Musical_pitch> pitch_arr_;
136 bool ordinary_key_b_;
139 REQUESTMETHODS(Key_change_req);
141 /// squash the octaves to 1
142 void squash_octaves();
143 /// return number of flats in key
146 /// return number of sharps in key
149 void transpose (Musical_pitch d);
151 bool minor_b() const;
154 class Clef_change_req : public Command_req {
157 Clef_change_req (String);
158 REQUESTMETHODS(Clef_change_req);
161 class Bracket_req : public Span_req, public Command_req {
164 REQUESTMETHODS(Bracket_req);
167 #endif // COMMANDREQUEST_HH