]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add support for partial span-bars.
authorJoe Neeman <joeneeman@gmail.com>
Fri, 14 Sep 2007 22:25:51 +0000 (08:25 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Fri, 14 Sep 2007 22:25:51 +0000 (08:25 +1000)
input/regression/span-bar-partial.ly [new file with mode: 0644]
lily/bar-line.cc
lily/span-bar.cc
scm/define-grob-properties.scm
scm/define-grobs.scm

diff --git a/input/regression/span-bar-partial.ly b/input/regression/span-bar-partial.ly
new file mode 100644 (file)
index 0000000..c1075bc
--- /dev/null
@@ -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:
+
index 2136571ed404f603034f3ad1979c9f4bb9f3a633..369e3d779d8639a48e3175df3d55586172680369 100644 (file)
@@ -308,6 +308,7 @@ ADD_INTERFACE (Bar_line,
 
 
               /* properties */
+              "allow-span-bar "
               "gap "
               "kern "
               "thin-kern "
index 4c9142139f37ee687a5a4d5ea75091578ea2b148..67d464297dbd0b189a1e1a5da265e8681c54f1ce 100644 (file)
@@ -57,6 +57,7 @@ Span_bar::print (SCM smobbed_me)
 
   /* compose span_bar_mol */
   vector<Interval> extents;
+  vector<bool> 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. */
            }
index 754ebcb00e5682ea7b6824bc86e56b244ef250cd..14838fe3661d80826e16583ba4f946c469bdc903 100644 (file)
@@ -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.")
index ba600479635ff0e4f28d4c2c14996b720ba53aa7..510c1ed79037503b4500b8998c3b3cc75dee6970 100644 (file)
        (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))