]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper.cc
* scm/music-functions.scm (has-request-chord): don't use
[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
10 #include "music-wrapper.hh"
11
12 Music_wrapper::Music_wrapper (SCM x)
13   : Music (x)
14 {
15   if (!ly_c_procedure_p (length_callback_))
16     length_callback_ = length_callback_proc; 
17   if (!ly_c_procedure_p (start_callback_))
18     start_callback_ = length_callback_proc; 
19 }
20
21 MAKE_SCHEME_CALLBACK(Music_wrapper, start_callback, 1);
22 SCM
23 Music_wrapper::start_callback (SCM m)
24 {
25   Music *me = unsmob_music (m);
26   Music *elt = unsmob_music (me->get_property ("element"));
27   return elt->start_mom ().smobbed_copy ();
28 }
29
30 MAKE_SCHEME_CALLBACK(Music_wrapper, length_callback, 1);
31 SCM
32 Music_wrapper::length_callback (SCM m)
33 {
34   Music * me = unsmob_music (m);
35   Music *elt = unsmob_music (me->get_property ("element"));
36   return elt->get_length ().smobbed_copy ();
37 }
38
39 Music*
40 Music_wrapper::element () const
41 {
42   return unsmob_music (get_property ("element"));
43 }
44
45
46 ADD_MUSIC (Music_wrapper);
47