]> git.donarmstrong.com Git - lilypond.git/blob - lily/command-request.cc
release: 1.3.34
[lilypond.git] / lily / command-request.cc
1 /*
2   command-request.cc -- implement non-musical reqs
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 #include "command-request.hh"
10 #include "debug.hh"
11 #include "musical-request.hh"
12
13
14 bool
15 Bar_req::do_equal_b (Request const *r) const
16 {
17   Bar_req  const* b = dynamic_cast <Bar_req const *> (r);
18   return b && type_str_ == b->type_str_;
19 }
20
21 void
22 Bar_req::do_print () const
23 {
24 #ifndef NPRINT
25   DEBUG_OUT << type_str_;
26 #endif
27 }
28
29 Bar_req::Bar_req (String s)
30 {
31   type_str_ = s;
32 }
33
34
35
36 bool
37 Barcheck_req::do_equal_b (Request const *r) const
38 {
39   Barcheck_req  const*b = dynamic_cast<Barcheck_req const*> (r);
40   return b;
41 }
42
43 void
44 Clef_change_req::do_print () const
45 {
46 #ifndef NPRINT
47   DEBUG_OUT << clef_str_ ;
48 #endif
49 }
50
51 Clef_change_req::Clef_change_req (String s)
52 {
53   clef_str_ = s;
54 }
55
56
57 void
58 Time_signature_change_req::do_print () const
59 {
60 #ifndef NPRINT
61   DEBUG_OUT << beats_i_ << "/" << one_beat_i_;
62 #endif
63 }
64
65 bool
66 Time_signature_change_req::do_equal_b (Request const *r) const
67 {
68   Time_signature_change_req  const* m
69     = dynamic_cast <Time_signature_change_req  const*> (r);
70
71   return m && m->beats_i_ == beats_i_
72     && one_beat_i_ == m->one_beat_i_;
73 }
74
75 Time_signature_change_req::Time_signature_change_req ()
76 {
77   beats_i_ = 0;
78   one_beat_i_ =0;
79 }
80
81
82 Tempo_req::Tempo_req ()
83 {
84   metronome_i_ = 60;
85   dur_. durlog_i_ = 2;
86 }
87
88 void
89 Tempo_req::do_print () const
90 {
91   DEBUG_OUT << dur_.str () << " = " << metronome_i_;
92 }
93
94
95 bool
96 Tempo_req::do_equal_b (Request const *r) const
97 {
98   Tempo_req const *t = dynamic_cast <Tempo_req const*> (r);
99
100   return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
101 }
102
103
104
105
106 void
107 Key_change_req::do_print () const
108 {
109 #if 0
110   key_->print();
111 #endif
112 }
113
114 Key_change_req::Key_change_req ()
115 {
116   key_ = 0;
117 }
118 Key_change_req::Key_change_req (Key_change_req const&s)
119   : Request (s)
120 {
121   key_ = new Key_def (*s.key_);
122 }
123 Key_change_req::~Key_change_req ()
124 {
125   delete key_;
126 }
127
128
129 Break_req::Break_req ()
130 {
131 }
132
133
134
135 bool
136 Mark_req::do_equal_b (Request const * r) const
137 {
138   Mark_req const * other = dynamic_cast<Mark_req const*> (r);
139   return other && scm_equal_p (other->mark_label_,  mark_label_);
140 }
141
142 void
143 Key_change_req::transpose (Musical_pitch p)
144 {
145   key_->transpose (p);
146 }
147