]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bar-engraver.cc
patch::: 1.5.22.jcn4
[lilypond.git] / lily / bar-engraver.cc
index 540c32139609d26dd2d87d09b292f16eb86ae5f6..b18bdf251da3805ac41fea4247fcc1a835a020fb 100644 (file)
 class Bar_engraver : public Engraver
 {
 public:
-  Bar_engraver();
-  VIRTUAL_COPY_CONS(Translator);
+  TRANSLATOR_DECLARATIONS(  Bar_engraver );
   void request_bar (String type_str);
     
 protected:
   virtual void finalize ();
-  virtual void stop_translation_timestep();
+  virtual void stop_translation_timestep ();
   virtual void create_grobs ();
 
 private:
@@ -38,7 +37,7 @@ private:
   Item * bar_p_;
 };
 
-Bar_engraver::Bar_engraver()
+Bar_engraver::Bar_engraver ()
 {
   bar_p_ =0;
 }
@@ -65,8 +64,8 @@ Bar_engraver::finalize ()
 }
 
 /*
-  Bar_engraver should come *after* any engravers that expect bars to
-  modify whichBar in  deprecated_process_music () be typeset
+  Bar_engraver should come *after* any engravers that  
+  modify whichBar
 */
 void
 Bar_engraver::create_grobs ()
@@ -88,27 +87,24 @@ Bar_engraver::typeset_bar ()
 }
 
 /*
-  lines may only be broken if there is a barline in all staff
+  lines may only be broken if there is a barline in all stave
 */
 void 
-Bar_engraver::stop_translation_timestep()
+Bar_engraver::stop_translation_timestep ()
 {
   if (!bar_p_)
     {
-      Score_engraver * e = 0;
-      Translator * t  =  daddy_grav_l ();
-      for (; !e && t;  t = t->daddy_trans_l_)
-       {
-         e = dynamic_cast<Score_engraver*> (t);
-       }
-
-      if (!e)
-       programming_error ("No score engraver!");
-      else
-       e->forbid_breaks ();    // guh. Use properties!
+      top_engraver ()->forbid_breaks ();       // guh. Use properties!
     }
   else
     typeset_bar ();
 }
 
-ADD_THIS_TRANSLATOR(Bar_engraver);
+
+ENTER_DESCRIPTION(Bar_engraver,
+/* descr */       "Create barlines. This engraver is controlled through the
+@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
+/* creats*/       "BarLine",
+/* acks  */       "",
+/* reads */       "whichBar stavesFound",
+/* write */       "");