]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/relative-octave-music.cc
2003 -> 2004
[lilypond.git] / lily / relative-octave-music.cc
index af18a32b1d80e230d3276ce6e4a81202a4d515d9..3a52d5d475c5b562b7d5f571d8c8894c31227f09 100644 (file)
@@ -3,31 +3,40 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
-
 #include "relative-music.hh"
-#include "debug.hh"
+#include "warn.hh"
+#include "scm-option.hh"
+
 
-Musical_pitch
-Relative_octave_music::to_relative_octave (Musical_pitch)
+Pitch
+Relative_octave_music::to_relative_octave (Pitch p)
 {
-  return last_pitch_;
-}
+  if (lily_1_8_relative)
+    {
+      lily_1_8_compatibility_used = true;
+      /*
+       ugh: last-pitch should  be junked.
 
+       Change this for lilypond 2.0. When you do,
+       then B should start where A left off.
 
-Relative_octave_music::Relative_octave_music(Music*p,Musical_pitch def)
-  : Music_wrapper (p)
-{
-  last_pitch_ = element_l ()->to_relative_octave (def);
+       \relative { A \relative { ...} B }
+
+      */
+      return * unsmob_pitch (get_mus_property ("last-pitch"));
+    }
+  else
+    return p;
 }
 
-void
-Relative_octave_music::do_print () const
+
+Relative_octave_music::Relative_octave_music ()
 {
-  Music_wrapper::do_print ();
-  DEBUG_OUT << "default pitch: " << last_pitch_.str ();
 }
 
+ADD_MUSIC (Relative_octave_music);
+