2 stream-event.cc -- implement Scheme bindings for Stream_event
4 source file of the GNU LilyPond music typesetter
6 (c) 2006 Erik Sandberg <mandolaerik@gmail.com>
9 #include "stream-event.hh"
11 LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
12 1, 1, 0, (SCM cl, SCM proplist),
13 "Creates a stream event of class @var{cl} with the given mutable property list.\n" )
15 SCM_ASSERT_TYPE (scm_is_symbol (cl), cl, SCM_ARG1, __FUNCTION__, "symbol");
16 if (proplist != SCM_UNDEFINED)
18 SCM_ASSERT_TYPE (scm_list_p (proplist), proplist, SCM_ARG2, __FUNCTION__, "association list");
22 Stream_event *e = new Stream_event (cl, proplist);
23 return e->unprotect ();
26 LY_DEFINE (ly_event_property, "ly:event-property",
27 2, 0, 0, (SCM sev, SCM sym),
28 "Get the property @var{sym} of stream event @var{mus}.\n"
29 "If @var{sym} is undefined, return @code{' ()}.\n")
31 Stream_event *e = unsmob_stream_event (sev);
32 SCM_ASSERT_TYPE (e, sev, SCM_ARG1, __FUNCTION__, "stream event");
33 SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
35 return e->internal_get_property (sym);
38 LY_DEFINE (ly_event_set_property, "ly:event-set-property!",
39 3, 0, 0, (SCM ev, SCM sym, SCM val),
40 "Set property @var{sym} in event @var{ev} to @var{val}."){
41 Stream_event *sc = unsmob_stream_event (ev);
42 SCM_ASSERT_TYPE (sc, ev, SCM_ARG1, __FUNCTION__, "event");
43 return ly_prob_set_property_x (ev, sym, val);