lilypond-1.3.16
[lilypond.git] / lily / command-request.cc
blobc9f75ead8515b42c0279c7bed4d474a995e408fe
1 /*
2 command-request.cc -- implement non-musical reqs
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "command-request.hh"
10 #include "debug.hh"
11 #include "musical-request.hh"
14 bool
15 Bar_req::do_equal_b (Request const *r) const
17 Bar_req const* b = dynamic_cast <Bar_req const *> (r);
18 return b && type_str_ == b->type_str_;
21 void
22 Bar_req::do_print () const
24 #ifndef NPRINT
25 DEBUG_OUT << type_str_;
26 #endif
29 Bar_req::Bar_req (String s)
31 type_str_ = s;
36 bool
37 Barcheck_req::do_equal_b (Request const *r) const
39 Barcheck_req const*b = dynamic_cast<Barcheck_req const*> (r);
40 return b;
43 void
44 Clef_change_req::do_print () const
46 #ifndef NPRINT
47 DEBUG_OUT << clef_str_ ;
48 #endif
51 Clef_change_req::Clef_change_req (String s)
53 clef_str_ = s;
57 void
58 Time_signature_change_req::do_print () const
60 #ifndef NPRINT
61 DEBUG_OUT << beats_i_ << "/" << one_beat_i_;
62 #endif
65 bool
66 Time_signature_change_req::do_equal_b (Request const *r) const
68 Time_signature_change_req const* m
69 = dynamic_cast <Time_signature_change_req const*> (r);
71 return m && m->beats_i_ == beats_i_
72 && one_beat_i_ == m->one_beat_i_;
75 Time_signature_change_req::Time_signature_change_req ()
77 beats_i_ = 0;
78 one_beat_i_ =0;
82 Tempo_req::Tempo_req ()
84 metronome_i_ = 60;
85 dur_. durlog_i_ = 2;
88 void
89 Tempo_req::do_print () const
91 DEBUG_OUT << dur_.str () << " = " << metronome_i_;
95 bool
96 Tempo_req::do_equal_b (Request const *r) const
98 Tempo_req const *t = dynamic_cast <Tempo_req const*> (r);
100 return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
106 void
107 Key_change_req::do_print () const
109 #ifndef NPRINT
110 for (int i=0; i < key_.pitch_arr_.size (); i++)
112 key_.pitch_arr_[i].print ();
114 #endif
117 Key_change_req::Key_change_req ()
121 Break_req::Break_req ()
125 Mark_req::Mark_req (String s)
127 str_ = s;
130 void
131 Mark_req::do_print () const
133 DEBUG_OUT << str_;
135 void
136 Key_change_req::transpose (Musical_pitch p)
138 key_.transpose (p);