]> git.donarmstrong.com Git - lilypond.git/blob - lily/musical-request.cc
* Documentation/windows/zlily-profile.sh:
[lilypond.git] / lily / musical-request.cc
1 /*
2   request.cc -- implement all musical requests.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "musical-request.hh"
10 #include "misc.hh"
11 #include "debug.hh"
12 #include "music-list.hh"
13
14
15 Tremolo_req::Tremolo_req ()
16 {
17 }
18
19 bool
20 Melodic_req::do_equal_b (Request const* r) const
21 {
22   Melodic_req const* m= dynamic_cast <Melodic_req const*> (r);
23   return m; // && !compare (*m, *this);
24 }
25
26 bool
27 Rhythmic_req::do_equal_b (Request const* r) const
28 {
29   Rhythmic_req const* rh = dynamic_cast <Rhythmic_req const*> (r);
30
31   return rh; // ;  && !compare (*this, *rh);
32 }
33
34 Moment
35 Rhythmic_req::length_mom () const
36 {
37   Duration *d = unsmob_duration (get_mus_property ("duration"));
38   if (!d)
39     {
40       Moment m ;
41       //programming_error("Rhythmic_req has no duration");
42       origin ()->warning ("programming error: Rhythmic_req has no duration");
43       return m;
44     }
45   return d->length_mom ();
46 }
47
48 void
49 Rhythmic_req::compress (Moment m)
50 {
51   Duration *d =  unsmob_duration (get_mus_property ("duration"));
52   if (d)
53     set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
54 }
55
56 bool
57 Note_req::do_equal_b (Request const* r) const
58 {
59   Note_req const* n = dynamic_cast<Note_req const*> (r);
60   return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n);
61 }
62
63
64 Note_req::Note_req ()
65 {
66 }
67
68
69 bool
70 Span_req::do_equal_b (Request const*r) const
71 {
72   Span_req const* s = dynamic_cast <Span_req const*> (r);
73   return s && get_span_dir () == s->get_span_dir ();
74 }
75
76 Span_req::Span_req ()
77 {
78 }
79
80
81 bool
82 Text_script_req::do_equal_b (Request const* r) const
83 {
84   Text_script_req const* t  = dynamic_cast<Text_script_req const*> (r);
85   return t && gh_equal_p (get_mus_property ("text"),
86                           t->get_mus_property ("text"));
87 }
88
89 bool
90 Articulation_req::do_equal_b (Request const* r) const
91 {
92   Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
93   
94   return a && gh_equal_p (get_mus_property ("articulation-type"),
95                           r->get_mus_property ("articulation-type"))
96     && get_direction () == a->get_direction ();
97 }
98
99
100