2 relative-music.cc -- implement Relative_octave_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 #include "program-option.hh"
14 class Relative_octave_music
17 DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
18 DECLARE_SCHEME_CALLBACK (no_relative_callback, (SCM, SCM));
21 MAKE_SCHEME_CALLBACK (Relative_octave_music, no_relative_callback, 2)
23 Relative_octave_music::no_relative_callback (SCM music, SCM pitch)
29 MAKE_SCHEME_CALLBACK (Relative_octave_music, relative_callback, 2)
31 Relative_octave_music::relative_callback (SCM music, SCM pitch)
33 Music *me = unsmob_music (music);
34 if (lily_1_8_relative)
36 lily_1_8_compatibility_used = true;
37 /* last-pitch should be junked some time, when
38 we ditch 1.8 compat too.
40 When you do, B should start where A left off.
42 \relative { A \relative { ...} B } */
43 SCM last_pitch = me->get_property ("last-pitch");
44 Pitch *ptr = unsmob_pitch (last_pitch);
45 return (ptr) ? last_pitch : pitch;