]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bar-engraver.cc
patch::: 1.3.33.jcn3
[lilypond.git] / lily / bar-engraver.cc
index 5811e6dc864c1b4a4be43938f9f920c03852fc33..d835edbd09765ef3a809ab807ad9338f494218f9 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997, 1998, 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
@@ -32,28 +32,29 @@ Bar_engraver::create_bar ()
   if (!bar_p_)
     {
       bar_p_ = new Staff_bar;
-      bar_p_->set_elt_property (break_priority_scm_sym, gh_int2scm (0));
+      bar_p_->set_elt_property ("break-aligned", SCM_BOOL_T);
 
       // urg: "" != empty...
-      SCM default_type = get_property ("defaultBarType", 0);
+      SCM default_type = get_property ("defaultBarType");
       if (gh_string_p (default_type))
        {
-         bar_p_->type_str_ = ly_scm2string (default_type);
+         bar_p_->set_elt_property ("glyph", default_type); // gu.h
        }
 
+#if 0
       /*
-       urg.  Why did I implement this?
-       */
-      SCM prop = get_property ("barAtLineStart", 0);
-      if (gh_boolean_p (prop) && gh_scm2bool (prop))
+       urg.  Why did I implement this? And did I implement this so
+       clumsily?
+
+       input/test/just-friends.ly
+       Maybe a staffgroup of just one staff would be a better solution.
+      */
+      SCM prop = get_property ("barAtLineStart");
+      if (to_boolean (prop))
        {
-         bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T);
-       }
-      prop = get_property ("barSize", 0);
-      if (SCM_NUMBERP(prop))
-       {
-         bar_p_->set_elt_property (bar_size_scm_sym, prop);
+         bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T);
        }
+#endif
       announce_element (Score_element_info (bar_p_, 0));
     }
 }
@@ -68,8 +69,8 @@ Bar_engraver::request_bar (String requested_type)
 {
   if (!now_mom ())
     {
-      SCM prop = get_property ("barAtLineStart", 0);
-      if (!gh_boolean_p (prop) && gh_scm2bool (prop))
+      SCM prop = get_property ("barAtLineStart");
+      if (!to_boolean (prop))
        return;
     }
   bool  bar_existed = bar_p_;
@@ -78,11 +79,16 @@ Bar_engraver::request_bar (String requested_type)
     {
       return;
     }
-  else if (((requested_type == "|:") && (bar_p_->type_str_ == ":|"))
-    || ((requested_type == ":|") && (bar_p_->type_str_ == "|:")))
-    bar_p_->type_str_ = ":|:";
-  else
-    bar_p_->type_str_ = requested_type;
+
+  String current = ly_scm2string (bar_p_->get_elt_property ("glyph"));
+  
+  if ((requested_type == "|:" && current== ":|")
+    || (requested_type == ":|" && current == "|:"))
+    requested_type = ":|:";
+
+  
+  bar_p_->set_elt_property ("glyph",
+                           ly_str02scm (requested_type.ch_C ()));
 }
 
 void 
@@ -101,7 +107,7 @@ Bar_engraver::do_removal_processing ()
 }
 
 void
-Bar_engraver::do_process_requests()
+Bar_engraver::do_process_music()
 {  
   Translator * t = daddy_grav_l  ()->get_simple_translator ("Timing_engraver");
 
@@ -111,7 +117,7 @@ Bar_engraver::do_process_requests()
   if (which.length_i ())
     {
       create_bar();
-      bar_p_->type_str_ = which;
+      bar_p_->set_elt_property ("glyph",  ly_str02scm (which.ch_C ()));
     }
   
   if (!bar_p_)
@@ -144,3 +150,4 @@ Bar_engraver::do_pre_move_processing()
 ADD_THIS_TRANSLATOR(Bar_engraver);
 
 
+