]> git.donarmstrong.com Git - lilypond.git/blob - lily/event.cc
*** empty log message ***
[lilypond.git] / lily / event.cc
1 /*
2   event.cc -- implement Event
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "event.hh"
10 #include "warn.hh"
11
12 MAKE_SCHEME_CALLBACK(Event,length_callback,1);
13 SCM
14 Event::length_callback (SCM m)
15 {
16   Music* me = unsmob_music (m);
17   Duration *d = unsmob_duration (me->get_property ("duration"));
18
19   Moment mom;
20   if (d)
21     {
22       mom = d->get_length ();
23     }
24   return mom.smobbed_copy();
25 }
26   
27 Event::Event (SCM i)
28   : Music (i)
29 {
30   if (!ly_c_procedure_p (length_callback_))
31     {
32       length_callback_ = length_callback_proc;
33     }
34 }
35
36 ADD_MUSIC (Event);
37
38
39