]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-wrapper.cc
* lily/beam.cc (shift_region_to_valid): fix stupido bug.
[lilypond.git] / lily / music-wrapper.cc
index b84394d86d82ebe86a50e88ed7d53df4a2e25c02..3d58fca2ef3f6311465ce70df906f233faa6999e 100644 (file)
@@ -1,64 +1,66 @@
 /*   
-  music-wrapper.cc --  implement 
+  music-wrapper.cc --  implement Music_wrapper
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 
 #include "music-wrapper.hh"
 
-Music_wrapper::~Music_wrapper ()
-{
-  delete element_p_;
-}
 
-Music_wrapper::Music_wrapper (Music_wrapper const&s)
-  : Music (s)
-{
-  element_p_ = (s.element_p_)?s.element_p_->clone ():0;
-}
 
 
 void
-Music_wrapper::do_print () const
+Music_wrapper::transpose (Pitch p)
 {
-  element_p_->print ();
+  if (element ())
+    element ()-> transpose (p);
 }
 
 
-void
-Music_wrapper::transpose (Musical_pitch p)
+Music_wrapper::Music_wrapper (SCM l)
+  : Music (l)
 {
-  if (element_p_)
-    element_p_-> transpose (p);
 }
 
+Moment
+Music_wrapper::length_mom () const
+{
+  return element ()->length_mom ();
+}
 
-Music_wrapper::Music_wrapper(Music*p)
+Pitch
+Music_wrapper::to_relative_octave (Pitch p)
 {
-  element_p_ = p;
+  return element ()->to_relative_octave (p);
 }
 
 
+Music*
+Music_wrapper::element () const
+{
+  return unsmob_music (get_mus_property ("element"));
+}
 
-Moment
-Music_wrapper::length_mom () const
+void
+Music_wrapper::compress (Moment m)
 {
-  return element_p_->length_mom ();
+  element ()->compress (m);
 }
 
+ADD_MUSIC (Music_wrapper);
 
-Musical_pitch
-Music_wrapper::to_relative_octave (Musical_pitch p)
+Music_wrapper::Music_wrapper ()
+  : Music (SCM_EOL)
 {
-  return element_p_->to_relative_octave (p);
+  
 }
 
-Music*
-Music_wrapper::element_l () const
+Moment
+Music_wrapper::start_mom () const
 {
-  return element_p_;
+  return element ()->start_mom ();
 }