2 request.cc -- implement all musical requests.
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "musical-request.hh"
12 #include "music-list.hh"
15 Tremolo_req::Tremolo_req ()
21 Melodic_req::transpose (Pitch delta
)
23 Pitch p
= *unsmob_pitch (get_mus_property ("pitch"));
27 if (abs (p
.alteration_i_
) > 2)
29 warning (_f ("Transposition by %s makes accidental larger than two",
33 set_mus_property ("pitch", p
.smobbed_copy ());
37 Melodic_req::do_equal_b (Request
const* r
) const
39 Melodic_req
const* m
= dynamic_cast <Melodic_req
const*> (r
);
40 return m
; // && !compare (*m, *this);
44 Rhythmic_req::do_equal_b (Request
const* r
) const
46 Rhythmic_req
const* rh
= dynamic_cast <Rhythmic_req
const*> (r
);
48 return rh
; // ; && !compare (*this, *rh);
54 Rhythmic_req::length_mom () const
56 return unsmob_duration ( get_mus_property( "duration"))->length_mom ();
61 Rhythmic_req::compress (Moment m
)
63 Duration
*d
= unsmob_duration (get_mus_property( "duration"));
65 set_mus_property ("duration", d
->compressed (m
).smobbed_copy());
69 Note_req::do_equal_b (Request
const* r
) const
71 Note_req
const* n
= dynamic_cast<Note_req
const*> (r
);
72 return n
&& Rhythmic_req::do_equal_b (n
) && Melodic_req::do_equal_b (n
);
85 Span_req::do_equal_b (Request
const*r
) const
87 Span_req
const* s
= dynamic_cast <Span_req
const*> (r
);
88 return s
&& get_span_dir () == s
->get_span_dir ();
97 Text_script_req::do_equal_b (Request
const* r
) const
99 Text_script_req
const* t
= dynamic_cast<Text_script_req
const*> (r
);
100 return t
&& gh_equal_p (get_mus_property ("text"),
101 t
->get_mus_property ("text"));
106 Articulation_req::do_equal_b (Request
const* r
) const
108 Articulation_req
const* a
= dynamic_cast<Articulation_req
const*> (r
);
110 return a
; // && articulation_str_ == a->articulation_str_;