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