]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bar.cc
release: 1.1.29
[lilypond.git] / lily / bar.cc
index 87a654100e60e44775ee585c2b6f9947016adb43..3e9556da75f48f171cfc7119c593bea084ef59db 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "bar.hh"
 #include "lookup.hh"
 #include "debug.hh"
 
-Bar::Bar()
+
+Bar::Bar ()
 {
   breakable_b_ = true;
   type_str_ = "|";
+  at_line_start_b_ = false;
 }
 
-
-
-IMPLEMENT_IS_TYPE_B1(Bar,Item);
-
 void
-Bar::do_print() const
+Bar::do_print () const
 {
 #ifndef NPRINT
   DOUT << type_str_;
@@ -32,13 +30,11 @@ Bar::do_print() const
 }
 
 Molecule*
-Bar::brew_molecule_p() const
+Bar::do_brew_molecule_p () const
 {    
-  Paper_def *p = paper();
-  Atom s = p->lookup_l()->bar (type_str_, 
-                              p->get_var ("barsize"));
+  Paper_def *p = paper ();
+  Molecule *output = new Molecule (lookup_l ()->bar (type_str_, p->get_var ("barsize")));
   
-  Molecule*output = new Molecule (Atom (s));
   return output;
 }
 
@@ -51,18 +47,29 @@ static char const *bar_breaks[][3] ={
   {"|", "|", ""},
   {"", "|s", "|"},
   {"", "|:", "|:"},
-  {"||.", "||.", ""},
+  {"|.", "|.", ""},
   {":|", ":|", ""},
+  {"||", "||", ""},
+  {".|.", ".|.", ""},
+  {"", "scorebar", "|"},
+  {"", "{", "{"},
+  {"", "[", "["},  
   {0,0,0}
 };
 
 void
-Bar::do_pre_processing()
+Bar::do_pre_processing ()
 {
   for (int i=0; bar_breaks[i][0]; i++) 
     {
       if (bar_breaks[i][1] == type_str_)
-       type_str_ = bar_breaks[i][break_status_i()+1];
+       {
+         type_str_ = bar_breaks[i][break_status_dir ()+1];
+         if (at_line_start_b_ && (break_status_dir_ == 1) && (type_str_ == ""))
+           {
+             type_str_ = "|";
+           }
+       }
     }
   
   /*