From 429e15acdf5e3bc2e4c451ea1c58df1f68bd273d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 4 Jul 2004 12:58:39 +0000 Subject: [PATCH] * 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. --- ChangeLog | 11 +++++++ lily/volta-bracket.cc | 13 +++------ lily/volta-engraver.cc | 66 +++++++++++++++++++++++++----------------- scm/define-grobs.scm | 2 +- 4 files changed, 55 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9368f7db1..a9e93c1126 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-07-04 Han-Wen Nienhuys + + * 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 * scripts/abc2ly.py: Backport. @@ -15,6 +24,8 @@ 2004-06-20 Han-Wen Nienhuys + * VERSION: 2.2.3 + * po/tr.po: turkish translation. 2004-06-19 Han-Wen Nienhuys diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 119868b189..515fb49fe5 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -37,12 +37,6 @@ SCM Volta_bracket_interface::print (SCM smob) { Grob *me = unsmob_grob (smob); - Link_array bars - = Pointer_group_interface__extract_grobs (me, (Item*)0, "bars"); - - if (!bars.size ()) - return SCM_EOL; - Spanner *orig_span = dynamic_cast (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 |= diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index d0bf956419..50574ac8b5 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -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 (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 (cc); + end_volta_span_->set_bound (RIGHT, ci); + } if (end_volta_span_) { diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 171219a8d2..e9f5457cec 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -686,7 +686,7 @@ (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) -- 2.39.5