]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/command-request.hh
release: 1.3.47
[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--2000 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 #include "protected-scm.hh"
19
20 class Break_req : public Request {
21 public:
22   Real penalty_f_;
23   Break_req ();
24 protected:
25   VIRTUAL_COPY_CONS(Music);
26 };
27
28 class Mark_req : public Request {
29 public:
30   Protected_scm mark_label_;
31 protected:
32   virtual bool do_equal_b (Request const*) 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
59 /**
60   todo: allow C time_signature
61  */
62 class Time_signature_change_req  : public Timing_req  {
63 public:
64   int beats_i_;
65   int one_beat_i_;
66
67   Time_signature_change_req();
68 protected:
69   virtual void do_print () const;
70   bool do_equal_b (Request const *) const;
71   VIRTUAL_COPY_CONS(Music);
72 };
73
74
75 /// check if we're at start of a  measure.
76 class Barcheck_req  : public Timing_req  {
77 public:
78   bool do_equal_b (Request const *) const;
79   VIRTUAL_COPY_CONS(Music);
80 };
81
82
83 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
84   the latter should only happen at the start of a measure.  */
85 class Bar_req  : public Request  {
86 public:
87   String type_str_;
88   Bar_req (String);
89 protected:
90   virtual bool do_equal_b (Request const*) const;
91   virtual void do_print () const;
92
93   VIRTUAL_COPY_CONS(Music);
94 };
95
96 class Breathing_sign_req : public Request {
97   VIRTUAL_COPY_CONS(Music);
98 };
99
100 /**
101     Handle key changes.
102     Routines for sharps and flats are separated, 
103     so that caller may identify non-conventional keys.
104 */
105 class Key_change_req  : public Request
106 {
107 public:
108   Key_change_req ();
109   ~Key_change_req();
110   Key_change_req(Key_change_req const &);
111   Key_def *key_;
112
113 protected:
114   VIRTUAL_COPY_CONS(Music);
115   void transpose (Musical_pitch  d);
116   virtual void do_print () const;
117 };
118
119 class Clef_change_req  : public Request  {
120 public:
121   String clef_str_;
122   Clef_change_req (String);
123 protected:
124   virtual void do_print () const;
125   VIRTUAL_COPY_CONS(Music);
126 };
127
128
129 #endif // COMMANDREQUEST_HH