X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frelative-octave-music.cc;h=fde9c2f8351155f1ec1e1f4abf8392d1f1764e28;hb=ed9862d117b627c0438d6c11d1bb3ef103abbc47;hp=f339aa92ca060663f1cf571a3999270e1bc82305;hpb=f2f5eb23db6c2daf882957dcfe472657c8bdb1b6;p=lilypond.git diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index f339aa92ca..fde9c2f835 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -3,26 +3,38 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2000 Han-Wen Nienhuys + (c) 1998--2004 Han-Wen Nienhuys */ - #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; + /* last-pitch should be junked some time, when + we ditch 1.8 compat too. + + When you do, B should start where A left off. + + \relative { A \relative { ...} B } */ + Pitch *ptr = unsmob_pitch (get_property ("last-pitch")); + return (ptr) ? *ptr : p; + } + else + return p; } -Relative_octave_music::Relative_octave_music(Music*p,Musical_pitch def) - : Music_wrapper (p) +Relative_octave_music::Relative_octave_music () { - last_pitch_ = element ()->to_relative_octave (def); - set_mus_property ("type", ly_symbol2scm ("relative-octave-music")); } +ADD_MUSIC (Relative_octave_music);