]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stream-event.cc
parser.yy et al: Turn \transpose into a music function.
[lilypond.git] / lily / stream-event.cc
index 1019c9e85bf728b06b3178fecb85c4374dfd5d10..489e0e0906a2274999cfbd0a4ccd44383d70bdb3 100644 (file)
@@ -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--2011 Erik Sandberg  <mandolaerik@gmail.com>
 
-  (c) 2005-2006 Erik Sandberg  <mandolaerik@gmail.com>
+  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 <http://www.gnu.org/licenses/>.
 */
 
 #include "stream-event.hh"
@@ -11,7 +22,7 @@
 #include "ly-smobs.icc"
 #include "context.hh"
 #include "input.hh"
-#include "input-smob.hh"
+#include "input.hh"
 
 /* TODO: Rename Stream_event -> Event */
 
@@ -22,30 +33,23 @@ Stream_event::Stream_event ()
 
 Stream_event::Stream_event (SCM event_class, SCM mutable_props)
   : Prob (ly_symbol2scm ("Stream_event"),
-         scm_list_1 (scm_cons (ly_symbol2scm ("class"), event_class)))
+          scm_list_1 (scm_cons (ly_symbol2scm ("class"), event_class)))
 {
   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)))
+          scm_list_1 (scm_cons (ly_symbol2scm ("class"), class_name)))
 {
   if (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 *
@@ -69,8 +73,6 @@ Stream_event::internal_in_event_class (SCM class_name)
   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);
 MAKE_SCHEME_CALLBACK (Stream_event, dump, 1);
 
@@ -80,7 +82,7 @@ Stream_event::dump (SCM self)
   Stream_event *ev = unsmob_stream_event (self);
   // Reversed alists look prettier.
   return scm_cons (scm_reverse (ev->immutable_property_alist_),
-                  scm_reverse (ev->mutable_property_alist_));
+                   scm_reverse (ev->mutable_property_alist_));
 }
 
 SCM
@@ -95,5 +97,5 @@ Stream_event::undump (SCM data)
 Stream_event *
 unsmob_stream_event (SCM m)
 {
-  return dynamic_cast<Stream_event*> (unsmob_prob (m));
+  return dynamic_cast<Stream_event *> (unsmob_prob (m));
 }