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)
38 class Break_req : public Command_req {
40 enum { DISALLOW = -10000, FORCE = 10000 };
43 REQUESTMETHODS (Break_req);
46 class Mark_req : public Command_req {
50 REQUESTMETHODS (Mark_req);
53 class Command_script_req : public Command_req, public Script_req {
57 ~Command_script_req();
58 REQUESTMETHODS(Command_script_req);
61 /** Baseclass for time_signature/partial req. It has to be handled by
62 Staff_{walker,column} baseclass. */
63 class Timing_req : public Command_req {
65 REQUESTMETHODS(Timing_req);
66 DEFAULTACCESSOR(Tempo_req)
70 class Tempo_req : public Timing_req
77 REQUESTMETHODS(Tempo_req);
78 bool do_equal_b (Request *) const;
81 class Partial_measure_req : public Timing_req {
85 Partial_measure_req (Moment);
86 REQUESTMETHODS(Partial_measure_req);
87 bool do_equal_b (Request*) const;
91 todo: allow C time_signature
93 class Time_signature_change_req : public Timing_req {
95 int beats_i_, one_beat_i_;
97 Time_signature_change_req();
98 bool do_equal_b (Request*) const;
99 REQUESTMETHODS(Time_signature_change_req);
102 /// toggle Cadenza mode
103 class Cadenza_req : public Timing_req {
107 bool do_equal_b (Request*) const;
109 REQUESTMETHODS(Cadenza_req);
112 /// check if we're at start of a measure.
113 class Barcheck_req : public Timing_req {
115 bool do_equal_b (Request *) const;
116 REQUESTMETHODS(Barcheck_req);
119 class Measure_grouping_req : public Timing_req {
121 Array<int> beat_i_arr_;
122 Array<Moment> elt_length_arr_;
123 bool do_equal_b (Request *) const;
124 REQUESTMETHODS(Measure_grouping_req);
127 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
128 the latter should only happen at the start of a measure. */
129 class Bar_req : public Command_req {
133 bool do_equal_b (Request*) const;
135 REQUESTMETHODS(Bar_req);
141 Routines for sharps and flats are separated,
142 so that caller may identify non-conventional keys.
144 class Key_change_req : public Command_req {
146 Array<Musical_pitch> pitch_arr_;
148 bool ordinary_key_b_;
151 REQUESTMETHODS(Key_change_req);
153 /// squash the octaves to 1
154 void squash_octaves();
155 /// return number of flats in key
158 /// return number of sharps in key
161 void transpose (Musical_pitch d);
163 bool minor_b() const;
166 class Clef_change_req : public Command_req {
169 Clef_change_req (String);
170 REQUESTMETHODS(Clef_change_req);
173 #endif // COMMANDREQUEST_HH