X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstream-event.cc;h=6392e3c718585d2b01611d105fdf5998f01e5f2c;hb=d29eebdeb66b6651e1e565eafd4fad68c0d2e2bf;hp=e9fe80a22fa17d60269c418763029f41a370fca5;hpb=a6a733a8e2f138a4c30d7abdff7b0372d9b9fb97;p=lilypond.git diff --git a/lily/stream-event.cc b/lily/stream-event.cc index e9fe80a22f..6392e3c718 100644 --- a/lily/stream-event.cc +++ b/lily/stream-event.cc @@ -1,9 +1,20 @@ /* - stream-event.cc -- implement Stream_event + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2010 Erik Sandberg - (c) 2005-2006 Erik Sandberg + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "stream-event.hh" @@ -11,7 +22,9 @@ #include "ly-smobs.icc" #include "context.hh" #include "input.hh" -#include "input-smob.hh" +#include "input.hh" + +/* TODO: Rename Stream_event -> Event */ Stream_event::Stream_event () : Prob (ly_symbol2scm ("Stream_event"), SCM_EOL) @@ -25,12 +38,6 @@ Stream_event::Stream_event (SCM event_class, SCM mutable_props) mutable_property_alist_ = mutable_props; } -Stream_event::Stream_event (SCM property_alist) - : Prob (ly_symbol2scm ("Stream_event"), SCM_EOL) -{ - mutable_property_alist_ = property_alist; -} - Stream_event::Stream_event (SCM class_name, Input *origin) : Prob (ly_symbol2scm ("Stream_event"), scm_list_1 (scm_cons (ly_symbol2scm ("class"), class_name))) @@ -39,11 +46,10 @@ Stream_event::Stream_event (SCM class_name, Input *origin) set_spot (origin); } -Stream_event::Stream_event (Stream_event *ev) - : Prob (ly_symbol2scm ("Stream_event"), SCM_EOL) +SCM +Stream_event::copy_mutable_properties () const { - mutable_property_alist_ = scm_copy_tree (ev->mutable_property_alist_); - immutable_property_alist_ = ev->immutable_property_alist_; + return ly_event_deep_copy (mutable_property_alist_); } Input * @@ -53,11 +59,20 @@ Stream_event::origin () const return i ? i : &dummy_input_global; } -void Stream_event::set_spot (Input *i) +void +Stream_event::set_spot (Input *i) { set_property ("origin", make_input (*i)); } +bool +Stream_event::internal_in_event_class (SCM class_name) +{ + SCM cl = get_property ("class"); + cl = scm_call_1 (ly_lily_module_constant ("ly:make-event-class"), cl); + return scm_c_memq (class_name, cl) != SCM_BOOL_F; +} + IMPLEMENT_TYPE_P (Stream_event, "ly:stream-event?"); MAKE_SCHEME_CALLBACK (Stream_event, undump, 1);