]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam-performer.cc
* flower
[lilypond.git] / lily / beam-performer.cc
index b5b694a04b052bb3308f91dc5a38fc5bf007564d..a7cd2547b1ca64053f0dda0f1405b685206c1eae 100644 (file)
@@ -3,22 +3,22 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2004 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #include "performer.hh"
-#include "event.hh"
 #include "audio-item.hh"
 #include "audio-column.hh"
 #include "global-context.hh"
 #include "warn.hh"
 
-class Beam_performer : public Performer {
+class Beam_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Beam_performer);
-  
+
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void start_translation_timestep ();
   virtual void process_music ();
   void set_melisma (bool);
@@ -28,7 +28,14 @@ private:
   bool beam_;
 };
 
-void 
+Beam_performer::Beam_performer ()
+{
+  beam_ = false;
+  start_ev_ = 0;
+  now_stop_ev_ = 0;
+}
+
+void
 Beam_performer::process_music ()
 {
   if (now_stop_ev_)
@@ -44,13 +51,12 @@ Beam_performer::process_music ()
     }
 }
 
-
 void
 Beam_performer::set_melisma (bool ml)
 {
   SCM b = get_property ("autoBeaming");
   if (!to_boolean (b))
-    daddy_context_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+    context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
 }
 
 void
@@ -59,7 +65,7 @@ Beam_performer::start_translation_timestep ()
   start_ev_ = 0;
   now_stop_ev_ = 0;
 }
+
 bool
 Beam_performer::try_music (Music *m)
 {
@@ -71,7 +77,7 @@ Beam_performer::try_music (Music *m)
        {
          start_ev_ = m;
        }
-      else if (d==STOP)
+      else if (d == STOP)
        {
          now_stop_ev_ = m;
        }
@@ -80,10 +86,6 @@ Beam_performer::try_music (Music *m)
   return false;
 }
 
-ENTER_DESCRIPTION (Beam_performer,"","",
-                 "beam-event","","","");
+ADD_TRANSLATOR (Beam_performer, "", "",
+               "beam-event", "", "", "");
 
-Beam_performer::Beam_performer ()
-{
-  beam_ = false;
-}