]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pitch-interval.cc
Merge commit '2799dfc'
[lilypond.git] / lily / pitch-interval.cc
index ee2d4e32810fc51ee8b1d96ca0c216cf3d6b1f62..f871e7e185b000df6cb1dfd8f6010a3e2c1fbfaa 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "pitch-interval.hh"
@@ -30,6 +30,34 @@ Pitch_interval::is_empty () const
 
 void
 Pitch_interval::add_point (Pitch p)
+{
+  if (at (LEFT).tone_pitch () > p.tone_pitch ())
+    at (LEFT) = p;
+  if (at (RIGHT).tone_pitch () < p.tone_pitch ())
+    at (RIGHT) = p;
+}
+
+
+Pitch_lexicographic_interval::Pitch_lexicographic_interval (Pitch p1, Pitch p2)
+{
+  at (LEFT) = p1;
+  at (RIGHT) = p2;
+}
+
+Pitch_lexicographic_interval::Pitch_lexicographic_interval ()
+{
+  at (LEFT) = Pitch (100, 0, 0);
+  at (RIGHT) = Pitch (-100, 0, 0);
+}
+
+bool
+Pitch_lexicographic_interval::is_empty () const
+{
+  return at (LEFT) > at (RIGHT);
+}
+
+void
+Pitch_lexicographic_interval::add_point (Pitch p)
 {
   if (at (LEFT) > p)
     at (LEFT) = p;