]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/command-request.hh
release: 1.1.53
[lilypond.git] / lily / include / command-request.hh
1 /*
2   command-request.hh -- declare non-musical requests
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef COMMANDREQUEST_HH
11 #define COMMANDREQUEST_HH
12
13 #include "request.hh"
14 #include "array.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
17 #include "key-def.hh"
18
19 class Break_req : public Request {
20 public:
21   enum { DISALLOW = -10000, FORCE = 10000 };
22   int penalty_i_;
23   Break_req ();
24 protected:
25   VIRTUAL_COPY_CONS(Music);
26 };
27
28 class Mark_req : public Request {
29 public:
30   Mark_req (String);
31   String str_;
32 protected:
33   virtual void do_print () const;  
34   VIRTUAL_COPY_CONS(Music);
35 };
36
37
38 /** Baseclass for time_signature/partial req. It has to be handled by
39   Staff_{walker,column} baseclass.  */
40 class Timing_req  : public Request  {
41 public:
42   VIRTUAL_COPY_CONS(Music);
43 };
44
45
46 class Tempo_req : public Timing_req
47 {
48 public:
49   Duration dur_;
50   int metronome_i_;
51
52   Tempo_req();
53 protected:
54     virtual void do_print () const;
55   VIRTUAL_COPY_CONS(Music);
56   bool do_equal_b (Request *) const;
57 };
58
59 class Partial_measure_req  : public Timing_req  {
60 public:
61   Moment length_mom_;
62
63   Partial_measure_req (Moment);
64 protected:
65   VIRTUAL_COPY_CONS(Music);
66   virtual void do_print () const;
67   bool do_equal_b (Request*) const;
68 };
69
70 /**
71   todo: allow C time_signature
72  */
73 class Time_signature_change_req  : public Timing_req  {
74 public:
75   int beats_i_;
76   int one_beat_i_;
77
78   Time_signature_change_req();
79 protected:
80   virtual void do_print () const;
81   bool do_equal_b (Request*) const;
82   VIRTUAL_COPY_CONS(Music);
83 };
84
85 /// toggle Cadenza mode
86 class Cadenza_req  : public Timing_req  {
87 public:
88   /// turn on?
89   bool on_b_;
90   Cadenza_req (bool);
91 protected:
92   virtual void do_print () const;
93   
94   bool do_equal_b (Request*) const;
95   VIRTUAL_COPY_CONS(Music);
96 };
97
98 /// check if we're at start of a  measure.
99 class Barcheck_req  : public Timing_req  {
100 public:
101   bool do_equal_b (Request *) const;
102   VIRTUAL_COPY_CONS(Music);
103 };
104
105
106 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
107   the latter should only happen at the start of a measure.  */
108 class Bar_req  : public Request  {
109 public:
110   String type_str_;
111   Bar_req (String);
112 protected:
113   virtual void do_print () const;
114   bool do_equal_b (Request*) const;
115
116   VIRTUAL_COPY_CONS(Music);
117 };
118
119 class Breathing_sign_req : public Request {
120   VIRTUAL_COPY_CONS(Music);
121 };
122
123 /**
124     Handle key changes.
125     Routines for sharps and flats are separated, 
126     so that caller may identify non-conventional keys.
127 */
128 class Key_change_req  : public Request
129 {
130 public:
131   Key_change_req ();
132   Key_def key_;
133
134 protected:
135   VIRTUAL_COPY_CONS(Music);
136   //  void transpose (Musical_pitch  d);
137   virtual void do_print () const;
138 };
139
140 class Clef_change_req  : public Request  {
141 public:
142   String clef_str_;
143   Clef_change_req (String);
144 protected:
145   virtual void do_print () const;
146   VIRTUAL_COPY_CONS(Music);
147 };
148
149
150 #endif // COMMANDREQUEST_HH