--- /dev/null
+\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:
+
#include "staff-symbol-referencer.hh"
#include "line-interface.hh"
+/* Get the extent of just the line part of the bar (ie. excluding any
+ repeat dots) */
+Interval
+Bar_line::bar_y_extent (Grob *me, Grob *refpoint)
+{
+ SCM size = me->get_property ("bar-size");
+ if (!scm_is_number (size))
+ return Interval ();
+
+ Real h = scm_to_double (size);
+ Interval iv (-h/2, h/2);
+
+ iv.translate (me->relative_coordinate (refpoint, Y_AXIS));
+ return iv;
+}
+
MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
SCM
Bar_line::print (SCM smob)
/* properties */
+ "allow-span-bar "
"gap "
"kern "
"thin-kern "
static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
static Stencil compound_barline (Grob *, string, Real height, bool rounded);
static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
+ static Interval bar_y_extent (Grob *, Grob *);
DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_anchor, (SCM));
/* compose span_bar_mol */
vector<Interval> extents;
+ vector<bool> make_span_bar;
Grob *model_bar = 0;
for (vsize i = elements.size (); i--;)
{
Grob *bar = elements[i];
- Interval ext = bar->extent (refp, Y_AXIS);
- if (ext.is_empty () || to_boolean (bar->get_property ("transparent")))
+ Interval ext = Bar_line::bar_y_extent (bar, refp);
+ if (ext.is_empty ())
continue;
extents.push_back (ext);
+ make_span_bar.push_back (to_boolean (bar->get_property ("allow-span-bar")));
model_bar = bar;
}
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. */
}
@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.")
(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))