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@stack.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, command);
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 Timing_req*timing() { return 0; }
31 virtual Command_script_req*commandscript() { return 0;}
32 virtual Break_req *linebreak () { return 0; }
36 class Break_req : public Command_req {
38 enum { DISALLOW = -10000, FORCE = 10000 };
41 REQUESTMETHODS (Break_req, linebreak);
44 class Command_script_req : public Command_req, public Script_req {
48 ~Command_script_req();
49 REQUESTMETHODS(Command_script_req, commandscript);
52 /** Baseclass for meter/partial req. It has to be handled by
53 Staff_{walker,column} baseclass. */
54 class Timing_req : public Command_req {
56 REQUESTMETHODS(Timing_req, timing);
57 virtual Tempo_req * tempo(){return 0; }
61 class Tempo_req : public Timing_req
68 REQUESTMETHODS(Tempo_req, tempo);
69 bool do_equal_b (Request *) const;
72 class Partial_measure_req : public Timing_req {
76 Partial_measure_req (Moment);
77 REQUESTMETHODS(Partial_measure_req, partial);
78 bool do_equal_b (Request*) const;
84 class Meter_change_req : public Timing_req {
86 int beats_i_, one_beat_i_;
90 bool do_equal_b (Request*) const;
91 REQUESTMETHODS(Meter_change_req, meterchange);
94 /// toggle Cadenza mode
95 class Cadenza_req : public Timing_req {
99 bool do_equal_b (Request*) const;
101 REQUESTMETHODS(Cadenza_req,cadenza);
104 /// check if we're at start of a measure.
105 class Barcheck_req : public Timing_req {
107 bool do_equal_b (Request *) const;
108 REQUESTMETHODS(Barcheck_req,barcheck);
111 class Measure_grouping_req : public Timing_req {
113 Array<int> beat_i_arr_;
114 Array<Moment> elt_length_arr_;
115 bool do_equal_b (Request *) const;
116 REQUESTMETHODS(Measure_grouping_req, measuregrouping);
119 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
120 the latter should only happen at the start of a measure. */
121 class Bar_req : public Command_req {
125 bool do_equal_b (Request*) const;
127 REQUESTMETHODS(Bar_req,bar);
133 Routines for sharps and flats are separated,
134 so that caller may identify non-conventional keys.
136 class Key_change_req : public Command_req {
138 Array<Musical_pitch> pitch_arr_;
141 /// don't ignore the octaves in #melodic_p_arr_#?
142 bool multi_octave_b_;
144 REQUESTMETHODS(Key_change_req, keychange);
146 /// squash the octaves to 1
147 void squash_octaves();
148 /// return number of flats in key
151 /// return number of sharps in key
154 void transpose (Musical_pitch d) const;
159 class Clef_change_req : public Command_req {
162 Clef_change_req (String);
163 REQUESTMETHODS(Clef_change_req, clefchange);
166 #endif // COMMANDREQUEST_HH