]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bar-engraver.cc
release: 1.3.18
[lilypond.git] / lily / bar-engraver.cc
index 92378ccbd8152f1fe14f9d9d3707504675b77e09..45636011c048182d9a6a30caeb9e3c49f678c9be 100644 (file)
@@ -32,23 +32,25 @@ 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);
       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?
-       */
+       urg.  Why did I implement this? And did I implement this so
+       clumsily?  */
       SCM prop = get_property ("barAtLineStart", 0);
-      if (gh_boolean_p (prop) && gh_scm2bool (prop))
+      if (to_boolean (prop))
        {
-         bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T);
+         bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T);
        }
+#endif
       announce_element (Score_element_info (bar_p_, 0));
     }
 }
@@ -64,7 +66,7 @@ Bar_engraver::request_bar (String requested_type)
   if (!now_mom ())
     {
       SCM prop = get_property ("barAtLineStart", 0);
-      if (!gh_boolean_p (prop) && gh_scm2bool (prop))
+      if (!to_boolean (prop))
        return;
     }
   bool  bar_existed = bar_p_;
@@ -73,11 +75,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 
@@ -106,7 +113,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_)
@@ -139,3 +146,4 @@ Bar_engraver::do_pre_move_processing()
 ADD_THIS_TRANSLATOR(Bar_engraver);
 
 
+