]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.79
authorfred <fred>
Tue, 26 Mar 2002 23:54:54 +0000 (23:54 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:54:54 +0000 (23:54 +0000)
lily/chord.cc
lily/include/musical-pitch.hh
lily/musical-pitch.cc
lily/part-combine-music.cc

index 6c858167262d77800362841d123c32436a0398b6..ef1c58a66f49cad4d7bcaa71967e3b5d5aa4d7e9 100644 (file)
@@ -13,6 +13,7 @@
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
+#include "lookup.hh"
 
 int
 compare (Chord* left, Chord* right)
@@ -20,17 +21,9 @@ compare (Chord* left, Chord* right)
   assert (left);
   assert (right);
   
-  if (left->inversion_b_ == right->inversion_b_
-      && left->bass_b_ == right->bass_b_
-      && left->pitch_arr_.size () == right->pitch_arr_.size ())
-    {
-      for (int i = 0; i < left->pitch_arr_.size (); i++)
-       if (left->pitch_arr_[i] != right->pitch_arr_[i])
-         return 1;
-      return 0;
-    }
-  
-  return 1;
+  return !(left->inversion_b_ == right->inversion_b_
+          && left->bass_b_ == right->bass_b_
+          && !compare (&left->pitch_arr_, &right->pitch_arr_));
 }
 
 /*
index 7f2c386b4d71b85020af474a1000089f1814ec94..079de76c8f650127501de88e1a6d82c7bdccc512 100644 (file)
@@ -53,5 +53,7 @@ struct Musical_pitch : public Input
 #include "compare.hh"
 INSTANTIATE_COMPARE(Musical_pitch, Musical_pitch::compare);
 
+int compare (Array<Musical_pitch>*, Array<Musical_pitch>*);
+
 #endif /* MUSICAL_PITCH_HH */
 
index 0ebd91dfe4139d94bcc2c02dbb60c610ed0878fb..5e82e01c7b2ee30e73e68c77353f8adbff537722 100644 (file)
 #include "debug.hh"
 #include "main.hh"
 
+int
+compare (Array<Musical_pitch>* left, Array<Musical_pitch>* right)
+{
+  assert (left);
+  assert (right);
+  
+  if (left->size () == right->size ())
+    {
+      for (int i = 0; i < left->size (); i++)
+       if ((*left)[i] != (*right)[i])
+         return 1;
+    }
+  return 0;
+}
+
 SCM
 Musical_pitch::to_scm ()const
 {
index 41127ac7419d3b6c83157b4a6d3b51ed19a2385a..27064244b7628996c83685b30524affc92cf8581 100644 (file)
@@ -13,8 +13,8 @@
 Part_combine_music::Part_combine_music (String what, Music * f, Music * s)
 {
   what_str_ = what;
-  set_mus_property ("first", f->self_scm ());
-  set_mus_property ("second", s->self_scm ());  
+  set_mus_property ("one", f->self_scm ());
+  set_mus_property ("two", s->self_scm ());  
 }
 
 
@@ -55,11 +55,11 @@ Part_combine_music::compress (Moment m)
 Music*
 Part_combine_music::first_l () const
 {
-  return unsmob_music (get_mus_property ("first"));
+  return unsmob_music (get_mus_property ("one"));
 }
 
 Music*
 Part_combine_music::second_l () const
 {
-  return unsmob_music (get_mus_property ("second"));
+  return unsmob_music (get_mus_property ("two"));
 }