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
20 class Command_req : public virtual Request {
22 REQUESTMETHODS(Command_req);
24 DEFAULTACCESSOR(Measure_grouping_req)
25 DEFAULTACCESSOR(Clef_change_req)
26 DEFAULTACCESSOR(Key_change_req)
27 DEFAULTACCESSOR(Partial_measure_req)
28 DEFAULTACCESSOR(Time_signature_change_req)
29 DEFAULTACCESSOR(Bar_req)
30 DEFAULTACCESSOR(Cadenza_req)
31 DEFAULTACCESSOR(Timing_req)
32 DEFAULTACCESSOR(Command_script_req)
33 DEFAULTACCESSOR(Break_req)
34 DEFAULTACCESSOR(Mark_req)
35 DEFAULTACCESSOR(Bracket_req)
39 class Break_req : public Command_req {
41 enum { DISALLOW = -10000, FORCE = 10000 };
44 REQUESTMETHODS (Break_req);
47 class Mark_req : public Command_req {
51 REQUESTMETHODS (Mark_req);
54 class Command_script_req : public Command_req, public Script_req {
58 ~Command_script_req();
59 REQUESTMETHODS(Command_script_req);
62 /** Baseclass for time_signature/partial req. It has to be handled by
63 Staff_{walker,column} baseclass. */
64 class Timing_req : public Command_req {
66 REQUESTMETHODS(Timing_req);
67 DEFAULTACCESSOR(Tempo_req)
71 class Tempo_req : public Timing_req
78 REQUESTMETHODS(Tempo_req);
79 bool do_equal_b (Request *) const;
82 class Partial_measure_req : public Timing_req {
86 Partial_measure_req (Moment);
87 REQUESTMETHODS(Partial_measure_req);
88 bool do_equal_b (Request*) const;
92 todo: allow C time_signature
94 class Time_signature_change_req : public Timing_req {
96 int beats_i_, one_beat_i_;
98 Time_signature_change_req();
99 bool do_equal_b (Request*) const;
100 REQUESTMETHODS(Time_signature_change_req);
103 /// toggle Cadenza mode
104 class Cadenza_req : public Timing_req {
108 bool do_equal_b (Request*) const;
110 REQUESTMETHODS(Cadenza_req);
113 /// check if we're at start of a measure.
114 class Barcheck_req : public Timing_req {
116 bool do_equal_b (Request *) const;
117 REQUESTMETHODS(Barcheck_req);
120 class Measure_grouping_req : public Timing_req {
122 Array<int> beat_i_arr_;
123 Array<Moment> elt_length_arr_;
124 bool do_equal_b (Request *) const;
125 REQUESTMETHODS(Measure_grouping_req);
128 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
129 the latter should only happen at the start of a measure. */
130 class Bar_req : public Command_req {
134 bool do_equal_b (Request*) const;
136 REQUESTMETHODS(Bar_req);
142 Routines for sharps and flats are separated,
143 so that caller may identify non-conventional keys.
145 class Key_change_req : public Command_req {
147 Array<Musical_pitch> pitch_arr_;
149 bool ordinary_key_b_;
152 REQUESTMETHODS(Key_change_req);
154 /// squash the octaves to 1
155 void squash_octaves();
156 /// return number of flats in key
159 /// return number of sharps in key
162 void transpose (Musical_pitch d);
164 bool minor_b() const;
167 class Clef_change_req : public Command_req {
170 Clef_change_req (String);
171 REQUESTMETHODS(Clef_change_req);
174 class Bracket_req : public Span_req, public Command_req {
177 REQUESTMETHODS(Bracket_req);
180 #endif // COMMANDREQUEST_HH