]> git.donarmstrong.com Git - lilypond.git/blob - lily/command-request.cc
58f4d434d03c28bfffe80a78f364c063a8c1a1a4
[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 #ifndef NPRINT
110   for (int i=0; i < key_.pitch_arr_.size (); i++)
111     {
112       key_.pitch_arr_[i].print ();
113     }
114 #endif
115 }
116
117 Key_change_req::Key_change_req ()
118 {
119 }
120
121 Break_req::Break_req ()
122 {
123 }
124
125
126
127 bool
128 Mark_req::do_equal_b (Request const * r) const
129 {
130   Mark_req const * other = dynamic_cast<Mark_req const*> (r);
131   return other && scm_equal_p (other->mark_label_,  mark_label_);
132 }
133
134 void
135 Key_change_req::transpose (Musical_pitch p)
136 {
137   key_.transpose (p);
138 }
139
140
141