2 relative-music.cc -- implement Relative_octave_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "scm-option.hh"
16 class Relative_octave_music
19 DECLARE_SCHEME_CALLBACK(relative_callback, (SCM, SCM));
20 DECLARE_SCHEME_CALLBACK(no_relative_callback, (SCM, SCM));
23 MAKE_SCHEME_CALLBACK(Relative_octave_music, no_relative_callback, 2)
25 Relative_octave_music::no_relative_callback (SCM music, SCM pitch)
31 MAKE_SCHEME_CALLBACK(Relative_octave_music, relative_callback, 2)
33 Relative_octave_music::relative_callback (SCM music, SCM pitch)
35 Music *me = unsmob_music (music);
36 if (lily_1_8_relative)
38 lily_1_8_compatibility_used = true;
39 /* last-pitch should be junked some time, when
40 we ditch 1.8 compat too.
42 When you do, B should start where A left off.
44 \relative { A \relative { ...} B } */
45 SCM last_pitch = me->get_property ("last-pitch");
46 Pitch *ptr = unsmob_pitch (last_pitch);
47 return (ptr) ? last_pitch : pitch;