2 relative-music.cc -- implement Relative_octave_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "program-option.hh"
13 class Relative_octave_music
16 DECLARE_SCHEME_CALLBACK (relative_callback
, (SCM
, SCM
));
17 DECLARE_SCHEME_CALLBACK (no_relative_callback
, (SCM
, SCM
));
20 MAKE_SCHEME_CALLBACK (Relative_octave_music
, no_relative_callback
, 2)
22 Relative_octave_music::no_relative_callback (SCM
/* music */,
28 MAKE_SCHEME_CALLBACK (Relative_octave_music
, relative_callback
, 2)
30 Relative_octave_music::relative_callback (SCM music
, SCM pitch
)
32 Music
*me
= unsmob_music (music
);
33 if (lily_1_8_relative
)
35 lily_1_8_compatibility_used
= true;
36 /* last-pitch should be junked some time, when
37 we ditch 1.8 compat too.
39 When you do, B should start where A left off.
41 \relative { A \relative { ...} B } */
42 SCM last_pitch
= me
->get_property ("last-pitch");
43 Pitch
*ptr
= unsmob_pitch (last_pitch
);
44 return (ptr
) ? last_pitch
: pitch
;