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
16 /** Request which are assumed to be "happening" before the
18 class Command_req : public virtual Request {
20 REQUESTMETHODS(Command_req, command);
21 virtual Group_feature_req * groupfeature() { return 0; }
22 virtual Measure_grouping_req * measuregrouping() { return 0; }
23 virtual Clef_change_req * clefchange() { return 0; }
24 virtual Key_change_req * keychange() { return 0; }
25 virtual Partial_measure_req * partial() { return 0; }
26 virtual Meter_change_req * meterchange() { return 0; }
27 virtual Bar_req *bar() { return 0; }
28 virtual Cadenza_req *cadenza() { return 0; }
29 virtual Disallow_break_req *disallowbreak() { return 0; }
30 virtual Timing_req*timing() { return 0; }
31 virtual Command_script_req*commandscript() { return 0;}
35 class Command_script_req : public Command_req, public Script_req {
37 REQUESTMETHODS(Command_script_req, commandscript);
41 class Disallow_break_req : public Command_req {
43 REQUESTMETHODS(Disallow_break_req, disallowbreak);
47 /** Baseclass for meter/partial req. It has to be handled by
48 Staff_{walker,column} baseclass. */
49 class Timing_req : public Command_req {
51 REQUESTMETHODS(Timing_req, timing);
55 class Partial_measure_req : public Timing_req {
59 Partial_measure_req(Moment);
60 REQUESTMETHODS(Partial_measure_req, partial);
66 class Meter_change_req : public Timing_req {
68 int beats_i_, one_beat_i_;
70 int compare(Meter_change_req const&);
73 REQUESTMETHODS(Meter_change_req, meterchange);
76 /// toggle Cadenza mode
77 class Cadenza_req : public Timing_req {
82 REQUESTMETHODS(Cadenza_req,cadenza);
85 /// check if we're at start of a measure.
86 class Barcheck_req : public Timing_req {
89 REQUESTMETHODS(Barcheck_req,barcheck);
92 class Measure_grouping_req : public Timing_req {
94 Array<int> beat_i_arr_;
95 Array<Moment> elt_length_arr_;
97 REQUESTMETHODS(Measure_grouping_req, measuregrouping);
100 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
101 the latter should only happen at the start of a measure. */
102 class Bar_req : public Command_req {
106 int compare(const Bar_req&)const;
107 REQUESTMETHODS(Bar_req,bar);
110 class Group_feature_req : public Command_req {
115 REQUESTMETHODS(Group_feature_req, groupfeature);
121 Routines for sharps and flats are separated,
122 so that caller may identify non-conventional keys.
124 class Key_change_req : public Command_req {
126 Array<Melodic_req*> melodic_p_arr_;
129 /// don't ignore the octaves in #melodic_p_arr_#?
130 bool multi_octave_b_;
132 Key_change_req(Key_change_req const&);
134 REQUESTMETHODS(Key_change_req, keychange);
136 /// squash the octaves to 1
137 void squash_octaves();
138 /// return number of flats in key
141 /// return number of sharps in key
144 void transpose(Melodic_req const & d) const;
149 class Clef_change_req : public Command_req {
152 Clef_change_req(String);
153 REQUESTMETHODS(Clef_change_req, clefchange);
156 #endif // COMMANDREQUEST_HH