]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/musical-request.cc
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / musical-request.cc
index 463d0775e81c558d266b09e98e77b3d58c6465a1..c4a58d0ed206c40fc26b42302826992738288948 100644 (file)
@@ -3,12 +3,12 @@
 
   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"
 #include "misc.hh"
-#include "debug.hh"
+#include "warn.hh"
 #include "music-list.hh"
 
 
@@ -16,23 +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
 {
@@ -48,21 +31,25 @@ 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");
+      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
@@ -78,9 +65,6 @@ Note_req::Note_req ()
 }
 
 
-
-
-
 bool
 Span_req::do_equal_b (Request const*r) const
 {
@@ -101,24 +85,23 @@ Text_script_req::do_equal_b (Request const* r) const
                          t->get_mus_property ("text"));
 }
 
+bool
+String_number_req::do_equal_b (Request const* r) const
+{
+  String_number_req const* s  = dynamic_cast<String_number_req const*> (r);
+  return s && gh_equal_p (get_mus_property ("string"),
+                         s->get_mus_property ("string"));
+}
+
+
 bool
 Articulation_req::do_equal_b (Request const* r) const
 {
   Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
   
-  return a; //  &&  articulation_str_ == a->articulation_str_;
+  return a && gh_equal_p (get_mus_property ("articulation-type"),
+                         r->get_mus_property ("articulation-type"))
+    && get_direction () == a->get_direction ();
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
+ADD_MUSIC(String_number_req);