* lily/volta-engraver.cc (staff_eligible): backport. Always
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Jul 2004 12:58:39 +0000 (12:58 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Jul 2004 12:58:39 +0000 (12:58 +0000)
use voltaOnThisStaff as override.
(stop_translation_timestep): backport: set bounds.

* scm/define-grobs.scm (all-grob-descriptions): backport (0 . 0)
fix for clef-8.

ChangeLog
lily/volta-bracket.cc
lily/volta-engraver.cc
scm/define-grobs.scm

index d9368f7db10fac74c3304358f70963cb0f073785..a9e93c1126333a76670802b66babf94c1d6d2915 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-07-04  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/volta-engraver.cc (staff_eligible): backport. Always
+       use voltaOnThisStaff as override.
+       (stop_translation_timestep): backport: set bounds. 
+
+       * scm/define-grobs.scm (all-grob-descriptions): backport (0 . 0)
+       fix for clef-8.
+
 2004-07-01  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scripts/abc2ly.py: Backport.
@@ -15,6 +24,8 @@
 
 2004-06-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * VERSION: 2.2.3
+
        * po/tr.po: turkish translation.
 
 2004-06-19  Han-Wen Nienhuys   <hanwen@xs4all.nl>
index 119868b189bddcbeddd42743d0bc4d72ab7a545f..515fb49fe5b534b8b386f55f1104e209c6192cfe 100644 (file)
@@ -37,12 +37,6 @@ SCM
 Volta_bracket_interface::print (SCM smob) 
 {
   Grob *me = unsmob_grob (smob);
-  Link_array<Item> bars
-    = Pointer_group_interface__extract_grobs (me, (Item*)0, "bars");
-
-  if (!bars.size ())
-    return SCM_EOL;
-
   Spanner *orig_span =  dynamic_cast<Spanner*> (me->original_);
 
   bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner*)me);
@@ -52,14 +46,15 @@ Volta_bracket_interface::print (SCM smob)
   bool no_vertical_start = orig_span && !broken_first_bracket;
   bool no_vertical_end = orig_span && !broken_last_bracket;
   SCM s = me->get_property ("bars");
-  Grob * endbar =   unsmob_grob (ly_car (s));
-  SCM glyph = endbar->get_property ("glyph");
+
+  Grob * endbar = gh_pair_p (s) ?  unsmob_grob (ly_car (s)) : 0;
+  SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL;
   
   String str;
   if (gh_string_p (glyph))
     str = ly_scm2string (glyph);
   else
-    return SCM_EOL;
+    return "|";
   
   const char* cs = str.to_str0 ();
   no_vertical_end |=
index d0bf95641940341f2635a16432e8a09aa7f4f47b..50574ac8b5d157ff8205c3ff61d6eda8b95ff39d 100644 (file)
@@ -60,37 +60,37 @@ Volta_engraver::Volta_engraver ()
 bool
 Volta_engraver::staff_eligible ()
 {
-  /*
-    UGH.
-   */
-  if (!unsmob_grob (staff_))
-    return true;
-  
-  if (!to_boolean (get_property ("voltaOnThisStaff")))
+  SCM doit =get_property ("voltaOnThisStaff");
+  if (ly_c_boolean_p (doit))
     {
-      /*
-       TODO: this does weird things when you open a piece with a
-       volta spanner.
-       
-       */
-      SCM staffs = get_property ("stavesFound");
+      return to_boolean (doit);
+    }
 
-      /*
-       only put a volta on the top staff.
+
+  if (!unsmob_grob (staff_))
+    return false;
+
+  /*
+    TODO: this does weird things when you open a piece with a
+    volta spanner.
+  */
+  SCM staffs = get_property ("stavesFound");
+
+  /*
+    only put a volta on the top staff.
        
-       May be this is a bit convoluted, and we should have a single
-       volta engraver in score context or somesuch.
+    May be this is a bit convoluted, and we should have a single
+    volta engraver in score context or somesuch.
        
-      */
-      if (!gh_pair_p (staffs))
-       {
-         programming_error ("Huh? Volta engraver can't find staffs?");
-         return false;
-       }
-      else if (ly_car (scm_last_pair (staffs)) != staff_)
-       {
-         return false;
-       }
+  */
+  if (!ly_c_pair_p (staffs))
+    {
+      programming_error ("Huh? Volta engraver can't find staffs?");
+      return false;
+    }
+  else if (ly_car (scm_last_pair (staffs)) != staff_)
+    {
+      return false;
     }
   return true;
 }
@@ -234,6 +234,18 @@ Volta_engraver::stop_translation_timestep ()
       volta_span_->suicide ( );
       volta_span_ = 0;
     }
+  if (volta_span_ && !volta_span_->get_bound (LEFT))
+    {
+      Grob * cc = unsmob_grob (get_property ("currentCommandColumn"));
+      Item * ci = dynamic_cast<Item*> (cc);
+      volta_span_->set_bound (LEFT, ci);
+    }
+  if (end_volta_span_ && !end_volta_span_->get_bound (RIGHT))
+    {
+      Grob * cc = unsmob_grob (get_property ("currentCommandColumn"));
+      Item * ci = dynamic_cast<Item*> (cc);
+      end_volta_span_->set_bound (RIGHT, ci);
+    }
   
   if (end_volta_span_)
     {
index 171219a8d2d7adf4b28bac30e0c763189b1bbff9..e9f5457cec4978d467018203d83e07ea7ce95245 100644 (file)
        (print-function . ,Text_item::print)
 
        ;; no Y dimensions, because of lyrics under tenor clef.
-       (Y-extent-callback . #f)
+       (Y-extent-callback . (0 . 0))
        (font-shape . italic)
        (padding . 0.6)
        (staff-padding . 0.2)