lilypond-0.1.57
[lilypond.git] / hdr / commandrequest.hh
blob71b83316610e27e7d04191ed0c043c678de89b4d
1 /*
2 commandrequest.hh -- declare Non musical requests
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
10 #ifndef COMMANDREQUEST_HH
11 #define COMMANDREQUEST_HH
13 #include "request.hh"
14 #include "varray.hh"
16 /** Request which are assumed to be "happening" before the
17 musical requests. */
18 struct Command_req : virtual Request {
19 REQUESTMETHODS(Command_req, command);
21 virtual Measure_grouping_req * measuregrouping() { return 0; }
22 virtual Clef_change_req * clefchange() { return 0; }
23 virtual Key_change_req * keychange() { return 0; }
24 virtual Partial_measure_req * partial() { return 0; }
25 virtual Meter_change_req * meterchange() { return 0; }
26 virtual Bar_req *bar() { return 0; }
27 virtual Cadenza_req *cadenza() { return 0; }
28 virtual Timing_req*timing() { return 0; }
32 /** Baseclass for meter/partial req. It has to be handled by
33 Staff_{walker,column} baseclass. */
34 struct Timing_req : Command_req {
35 REQUESTMETHODS(Timing_req, timing);
39 struct Partial_measure_req : Timing_req {
40 Moment duration_;
42 Partial_measure_req(Moment);
43 REQUESTMETHODS(Partial_measure_req, partial);
46 /**
47 todo: allow C meter
49 struct Meter_change_req : Timing_req {
50 int beats_i_, one_beat_i_;
52 Meter_change_req();
53 void set(int,int);
54 REQUESTMETHODS(Meter_change_req, meterchange);
57 /// toggle Cadenza mode
58 struct Cadenza_req : Timing_req {
59 /// turn on?
60 bool on_b_;
61 Cadenza_req(bool);
62 REQUESTMETHODS(Cadenza_req,cadenza);
65 /// check if we're at start of a measure.
66 struct Barcheck_req : Timing_req {
68 REQUESTMETHODS(Barcheck_req,barcheck);
71 struct Measure_grouping_req: Timing_req {
72 Array<int> beat_i_arr_;
73 Array<Moment> elt_length_arr_;
75 REQUESTMETHODS(Measure_grouping_req, measuregrouping);
78 struct Group_change_req : Command_req {
79 String newgroup_str_;
80 REQUESTMETHODS(Group_change_req, groupchange);
83 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
84 the latter should only happen at the start of a measure. */
85 struct Bar_req : Command_req {
86 String type_str_;
87 Bar_req(String);
88 int compare(const Bar_req&)const;
89 REQUESTMETHODS(Bar_req,bar);
91 struct Terminate_voice_req : Command_req {
92 REQUESTMETHODS(Terminate_voice_req,terminate);
95 struct Group_feature_req : Command_req {
96 int stemdir_i_;
97 Group_feature_req();
98 REQUESTMETHODS(Group_feature_req, groupfeature);
102 struct Key_change_req : Command_req {
103 Array<Melodic_req*> melodic_p_arr_;
105 Key_change_req();
106 Key_change_req(Key_change_req const&);
107 ~Key_change_req();
108 REQUESTMETHODS(Key_change_req, keychange);
111 struct Clef_change_req : Command_req {
112 String clef_str_;
113 Clef_change_req(String);
114 REQUESTMETHODS(Clef_change_req, clefchange);
117 #endif // COMMANDREQUEST_HH