]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/musical-request.cc
* Documentation/windows/zlily-profile.sh:
[lilypond.git] / lily / musical-request.cc
index e4866b6064908b5aa236a9b710713c86fd5617ef..6138a8daf90c56c0e59588b139e972eccc157cd3 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "musical-request.hh"
@@ -16,22 +16,6 @@ Tremolo_req::Tremolo_req ()
 {
 }
 
-void
-Melodic_req::transpose (Pitch delta)
-{
-  Pitch p = *unsmob_pitch (get_mus_property ("pitch"));
-  
-  p.transpose (delta);
-  
-  if (abs (p.alteration_i_) > 2)
-    {
-       warning (_f ("Transposition by %s makes accidental larger than two",
-         delta.str ()));
-    }
-
-  set_mus_property ("pitch", p.smobbed_copy ());
-}
-
 bool
 Melodic_req::do_equal_b (Request const* r) const
 {
@@ -47,21 +31,26 @@ Rhythmic_req::do_equal_b (Request const* r) const
   return rh; // ;  && !compare (*this, *rh);
 }
 
-
-
 Moment
 Rhythmic_req::length_mom () const
 {
-  return  unsmob_duration (get_mus_property ("duration"))->length_mom ();
-
+  Duration *d = unsmob_duration (get_mus_property ("duration"));
+  if (!d)
+    {
+      Moment m ;
+      //programming_error("Rhythmic_req has no duration");
+      origin ()->warning ("programming error: Rhythmic_req has no duration");
+      return m;
+    }
+  return d->length_mom ();
 }
 
 void
 Rhythmic_req::compress (Moment m)
 {
   Duration *d =  unsmob_duration (get_mus_property ("duration"));
-
-  set_mus_property ("duration", d ->compressed (m).smobbed_copy ());
+  if (d)
+    set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
 }
 
 bool
@@ -103,11 +92,9 @@ Articulation_req::do_equal_b (Request const* r) const
   Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
   
   return a && gh_equal_p (get_mus_property ("articulation-type"),
-                         r->get_mus_property ("articulation-type"));
+                         r->get_mus_property ("articulation-type"))
+    && get_direction () == a->get_direction ();
 }
 
 
 
-
-
-