]> git.donarmstrong.com Git - lilypond.git/blob - lily/command-request.cc
patch::: 1.3.59.uu2.jcn1
[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 bool
35 Barcheck_req::do_equal_b (Request const *r) const
36 {
37   Barcheck_req  const*b = dynamic_cast<Barcheck_req const*> (r);
38   return b;
39 }
40
41 void
42 Clef_change_req::do_print () const
43 {
44 #ifndef NPRINT
45   DEBUG_OUT << clef_str_ ;
46 #endif
47 }
48
49 Clef_change_req::Clef_change_req (String s)
50 {
51   clef_str_ = s;
52 }
53
54
55 void
56 Time_signature_change_req::do_print () const
57 {
58 #ifndef NPRINT
59   DEBUG_OUT << beats_i_ << "/" << one_beat_i_;
60 #endif
61 }
62
63 bool
64 Time_signature_change_req::do_equal_b (Request const *r) const
65 {
66   Time_signature_change_req  const* m
67     = dynamic_cast <Time_signature_change_req  const*> (r);
68
69   return m && m->beats_i_ == beats_i_
70     && one_beat_i_ == m->one_beat_i_;
71 }
72
73 Time_signature_change_req::Time_signature_change_req ()
74 {
75   beats_i_ = 0;
76   one_beat_i_ =0;
77 }
78
79
80 Tempo_req::Tempo_req ()
81 {
82   metronome_i_ = 60;
83   dur_. durlog_i_ = 2;
84 }
85
86 void
87 Tempo_req::do_print () const
88 {
89   DEBUG_OUT << dur_.str () << " = " << metronome_i_;
90 }
91
92
93 bool
94 Tempo_req::do_equal_b (Request const *r) const
95 {
96   Tempo_req const *t = dynamic_cast <Tempo_req const*> (r);
97
98   return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
99 }
100
101 void
102 Key_change_req::do_print () const
103 {
104 }
105
106 Key_change_req::Key_change_req ()
107 {
108   key_ = 0;
109 }
110
111 Key_change_req::Key_change_req (Key_change_req const&s)
112   : Request (s)
113 {
114   key_ = s.key_ ?  new Newkey_def (*s.key_) : 0;
115 }
116
117 Key_change_req::~Key_change_req ()
118 {
119   delete key_;
120 }
121
122 Break_req::Break_req ()
123 {
124 }
125
126
127
128 bool
129 Mark_req::do_equal_b (Request const * r) const
130 {
131   Mark_req const * other = dynamic_cast<Mark_req const*> (r);
132   return other && scm_equal_p (other->mark_label_,  mark_label_);
133 }
134
135 void
136 Key_change_req::transpose (Musical_pitch p)
137 {
138   key_->transpose (p);
139 }
140