]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur-engraver.cc
* lily/include/grob-info.hh: origin_contexts() now does not
[lilypond.git] / lily / slur-engraver.cc
index 132ea54ca2f09e6794e9c676b66be41cba6bd155..3daf274d6b8144e08cea3e7c7db757f1cdb9d54b 100644 (file)
@@ -1,14 +1,15 @@
 /*
   slur-engraver.cc -- implement Slur_engraver
 
-  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "event.hh"
 #include "slur.hh"
 #include "warn.hh"
 #include "note-column.hh"
-#include "translator-group.hh"
+#include "context.hh"
+
 #include "engraver.hh"
 #include "spanner.hh"
 
@@ -29,7 +30,6 @@ protected:
   virtual bool try_music (Music*);
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();
   virtual void finalize ();
   virtual void process_music ();
 
@@ -45,22 +45,7 @@ Slur_engraver::Slur_engraver ()
 bool
 Slur_engraver::try_music (Music *ev)
 {
-  if (ev->is_mus_type ("abort-event"))
-    {
-      for (int i = 0; i < slur_stack_.size (); i++)
-       {
-         slur_stack_[i]->suicide ();
-       }
-      slur_stack_.clear ();
-      for (int i = 0; i < end_slurs_.size (); i++)
-       {
-         end_slurs_[i]->suicide ();
-       }
-      end_slurs_.clear ();
-      events_.clear ();
-      new_slur_evs_.clear ();
-    }
-  else if (ev->is_mus_type ("slur-event"))
+  if (ev->is_mus_type ("slur-event"))
     {
       /*
        Let's not start more than one slur per moment.
@@ -103,7 +88,7 @@ Slur_engraver::try_music (Music *ev)
 void
 Slur_engraver::set_melisma (bool m)
 {
-  daddy_trans_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+  daddy_context_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
 }
 
 void
@@ -148,7 +133,7 @@ Slur_engraver::process_music ()
       Direction d = to_dir (slur_ev->get_mus_property ("span-direction"));
       if (d== STOP)
        {
-         if (slur_stack_.empty ())
+         if (slur_stack_.is_empty ())
            /* How to shut up this warning, when Voice_devnull_engraver has
               eaten start event? */
            slur_ev->origin ()->warning (_f ("can't find start of slur"));
@@ -164,7 +149,7 @@ Slur_engraver::process_music ()
        {
          // push a new slur onto stack.
          // (use temp. array to wait for all slur STOPs)
-         Grob* slur = new Spanner (get_property ("Slur"));
+         Grob* slur = make_spanner ("Slur");
          Slur::set_interface (slur); // cannot remove yet!