2 command-request.hh -- declare non-musical requests
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef COMMANDREQUEST_HH
11 #define COMMANDREQUEST_HH
15 #include "duration.hh"
17 /** Request which are assumed to be "happening" before the
19 class Command_req : public virtual Request {
21 REQUESTMETHODS(Command_req, command);
22 virtual Group_feature_req * groupfeature() { return 0; }
23 virtual Measure_grouping_req * measuregrouping() { return 0; }
24 virtual Clef_change_req * clefchange() { return 0; }
25 virtual Key_change_req * keychange() { return 0; }
26 virtual Partial_measure_req * partial() { return 0; }
27 virtual Meter_change_req * meterchange() { return 0; }
28 virtual Bar_req *bar() { return 0; }
29 virtual Cadenza_req *cadenza() { return 0; }
30 virtual Disallow_break_req *disallowbreak() { return 0; }
31 virtual Timing_req*timing() { return 0; }
32 virtual Command_script_req*commandscript() { return 0;}
36 class Command_script_req : public Command_req, public Script_req {
40 REQUESTMETHODS(Command_script_req, commandscript);
44 class Disallow_break_req : public Command_req {
46 REQUESTMETHODS(Disallow_break_req, disallowbreak);
50 /** Baseclass for meter/partial req. It has to be handled by
51 Staff_{walker,column} baseclass. */
52 class Timing_req : public Command_req {
54 REQUESTMETHODS(Timing_req, timing);
55 virtual Tempo_req * tempo(){return 0; }
60 class Tempo_req : public Timing_req
67 REQUESTMETHODS(Tempo_req, tempo);
68 bool do_equal_b(Request *)const;
71 class Partial_measure_req : public Timing_req {
75 Partial_measure_req(Moment);
76 REQUESTMETHODS(Partial_measure_req, partial);
77 bool do_equal_b(Request*)const;
83 class Meter_change_req : public Timing_req {
85 int beats_i_, one_beat_i_;
89 bool do_equal_b(Request*)const;
90 REQUESTMETHODS(Meter_change_req, meterchange);
93 /// toggle Cadenza mode
94 class Cadenza_req : public Timing_req {
98 bool do_equal_b(Request*)const;
100 REQUESTMETHODS(Cadenza_req,cadenza);
103 /// check if we're at start of a measure.
104 class Barcheck_req : public Timing_req {
106 bool do_equal_b(Request *)const;
107 REQUESTMETHODS(Barcheck_req,barcheck);
110 class Measure_grouping_req : public Timing_req {
112 Array<int> beat_i_arr_;
113 Array<Moment> elt_length_arr_;
114 bool do_equal_b(Request *)const;
115 REQUESTMETHODS(Measure_grouping_req, measuregrouping);
118 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
119 the latter should only happen at the start of a measure. */
120 class Bar_req : public Command_req {
124 bool do_equal_b(Request*)const;
126 REQUESTMETHODS(Bar_req,bar);
129 class Group_feature_req : public Command_req {
134 REQUESTMETHODS(Group_feature_req, groupfeature);
140 Routines for sharps and flats are separated,
141 so that caller may identify non-conventional keys.
143 class Key_change_req : public Command_req {
145 Array<Melodic_req*> melodic_p_arr_;
148 /// don't ignore the octaves in #melodic_p_arr_#?
149 bool multi_octave_b_;
151 Key_change_req(Key_change_req const&);
153 REQUESTMETHODS(Key_change_req, keychange);
155 /// squash the octaves to 1
156 void squash_octaves();
157 /// return number of flats in key
160 /// return number of sharps in key
163 void transpose(Melodic_req const & d) const;
168 class Clef_change_req : public Command_req {
171 Clef_change_req(String);
172 REQUESTMETHODS(Clef_change_req, clefchange);
175 #endif // COMMANDREQUEST_HH