lilypond-0.0.35
[lilypond.git] / hdr / commandrequest.hh
blobf9eef852fd5759a1d905580f1dbdb6f0b550d8a8
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 /**
17 Request assumed to be "happening" before the musical requests
19 struct Nonmusical_req : virtual Request {
20 REQUESTMETHODS(Nonmusical_req, nonmus);
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 Timing_req*timing() { return 0; }
33 /** Baseclass for meter/partial req. It has to be handled by
34 Staff_{walker,column} baseclass. */
35 struct Timing_req : Nonmusical_req {
36 REQUESTMETHODS(Timing_req, timing);
40 struct Partial_measure_req : Timing_req {
41 Moment duration_;
43 Partial_measure_req(Moment);
44 REQUESTMETHODS(Partial_measure_req, partial);
47 /**
48 todo: allow C meter
50 struct Meter_change_req : Timing_req {
51 int beats_i_, one_beat_i_;
53 Meter_change_req();
54 void set(int,int);
55 REQUESTMETHODS(Meter_change_req, meterchange);
58 /// toggle Cadenza mode
59 struct Cadenza_req : Timing_req {
60 /// turn on?
61 bool on_b;
62 Cadenza_req(bool);
63 REQUESTMETHODS(Cadenza_req,cadenza);
66 /// check if we're at start of a measure.
67 struct Barcheck_req : Timing_req {
69 REQUESTMETHODS(Barcheck_req,barcheck);
72 struct Measure_grouping_req: Timing_req {
73 Array<int> beat_i_arr_;
74 Array<Moment> elt_length_arr_;
76 REQUESTMETHODS(Measure_grouping_req, measuregrouping);
79 struct Group_change_req : Nonmusical_req {
80 String newgroup_str_;
81 REQUESTMETHODS(Group_change_req, groupchange);
84 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
85 the latter should only happen at the start of a measure. */
86 struct Bar_req : Nonmusical_req {
87 String type_str_;
88 Bar_req(String);
89 int compare(const Bar_req&)const;
90 REQUESTMETHODS(Bar_req,bar);
92 struct Terminate_voice_req : Nonmusical_req {
93 REQUESTMETHODS(Terminate_voice_req,terminate);
96 struct Group_feature_req : Nonmusical_req {
97 int stemdir_i_;
98 Group_feature_req();
99 REQUESTMETHODS(Group_feature_req, groupfeature);
103 struct Key_change_req : Nonmusical_req {
104 Array<Melodic_req*> melodic_p_arr_;
106 Key_change_req();
107 Key_change_req(Key_change_req const&);
108 ~Key_change_req();
109 REQUESTMETHODS(Key_change_req, keychange);
112 struct Clef_change_req : Nonmusical_req {
113 String clef_str_;
114 Clef_change_req(String);
115 REQUESTMETHODS(Clef_change_req, clefchange);
118 #endif // COMMANDREQUEST_HH