From: Joe Neeman Date: Fri, 14 Sep 2007 22:25:51 +0000 (+1000) Subject: Add support for partial span-bars. X-Git-Tag: release/2.11.33-1~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1efdfdaed5cd51abfe5da5e4f5731fe9396c96f2;p=lilypond.git Add support for partial span-bars. --- diff --git a/input/regression/span-bar-partial.ly b/input/regression/span-bar-partial.ly new file mode 100644 index 0000000000..c1075bc8c7 --- /dev/null +++ b/input/regression/span-bar-partial.ly @@ -0,0 +1,35 @@ +\version "2.11.32" +\header { + texidoc = "Span bars can be turned on/off on a staff-by-staff basis." +} + +\layout { + \context { + \Staff + } + ragged-right =##t +} + +\relative c' \new StaffGroup << + \new Staff { + c1 + \once \override Staff.BarLine #'allow-span-bar = ##f + c1 c1 c1 + \bar "|." + } + \new Staff { + a1 a1 + \once \override Staff.BarLine #'allow-span-bar = ##f + a1 a1 + } + \new Staff { + f1 f1 f1 f1 + } +>> + + + +%% Local variables: +%% LilyPond-indent-level:2 +%% End: + diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 2136571ed4..369e3d779d 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -308,6 +308,7 @@ ADD_INTERFACE (Bar_line, /* properties */ + "allow-span-bar " "gap " "kern " "thin-kern " diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 4c9142139f..67d464297d 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -57,6 +57,7 @@ Span_bar::print (SCM smobbed_me) /* compose span_bar_mol */ vector extents; + vector make_span_bar; Grob *model_bar = 0; for (vsize i = elements.size (); i--;) { @@ -66,6 +67,7 @@ Span_bar::print (SCM smobbed_me) continue; extents.push_back (ext); + make_span_bar.push_back (to_boolean (bar->get_property ("allow-span-bar"))); model_bar = bar; } @@ -84,7 +86,7 @@ Span_bar::print (SCM smobbed_me) Interval l (prev_extent [UP], ext[DOWN]); - if (l.is_empty ()) + if (l.is_empty () || !make_span_bar[i]) { /* There is overlap between the bar lines. Do nothing. */ } diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 754ebcb00e..14838fe366 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -37,6 +37,8 @@ callback for @code{after-line-breaking}.") @code{0}: around center of width, @code{1}: right side.") (allow-loose-spacing ,boolean? "If set, column can be detached from main spacing.") + (allow-span-bar ,boolean? "If false, no inter-staff barline will +be created below this barline.") (alteration ,number? "Alteration numbers for accidental.") (alteration-alist ,list? "List of @code{(@var{pitch} . @var{accidental})} pairs for key signature.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index ba60047963..510c1ed790 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -184,6 +184,7 @@ (stencil . ,ly:bar-line::print) (glyph-name . ,bar-line::calc-glyph-name) (bar-size . ,ly:bar-line::calc-bar-size) + (allow-span-bar . #t) (space-alist . ( (time-signature . (extra-space . 0.75))