]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper.cc
* flower
[lilypond.git] / lily / music-wrapper.cc
1 /*
2   music-wrapper.cc -- implement Music_wrapper
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "music-wrapper.hh"
10
11 Music_wrapper::Music_wrapper (SCM x)
12   : Music (x)
13 {
14   if (!ly_c_procedure_p (length_callback_))
15     length_callback_ = length_callback_proc;
16   if (!ly_c_procedure_p (start_callback_))
17     start_callback_ = length_callback_proc;
18 }
19
20 MAKE_SCHEME_CALLBACK (Music_wrapper, start_callback, 1);
21 SCM
22 Music_wrapper::start_callback (SCM m)
23 {
24   Music *me = unsmob_music (m);
25   Music *elt = unsmob_music (me->get_property ("element"));
26   return elt->start_mom ().smobbed_copy ();
27 }
28
29 MAKE_SCHEME_CALLBACK (Music_wrapper, length_callback, 1);
30 SCM
31 Music_wrapper::length_callback (SCM m)
32 {
33   Music *me = unsmob_music (m);
34   Music *elt = unsmob_music (me->get_property ("element"));
35   return elt->get_length ().smobbed_copy ();
36 }
37
38 Music *
39 Music_wrapper::element () const
40 {
41   return unsmob_music (get_property ("element"));
42 }
43
44 ADD_MUSIC (Music_wrapper);
45