]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge commit '76de7e1'
authorJoe Neeman <joeneeman@gmail.com>
Sun, 16 Sep 2007 22:58:12 +0000 (08:58 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 16 Sep 2007 22:58:12 +0000 (08:58 +1000)
input/regression/span-bar-partial.ly [new file with mode: 0644]
lily/bar-line.cc
lily/include/bar-line.hh
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 48b9c4715da6e4e09631bb7b873812b82e123ddc..369e3d779d8639a48e3175df3d55586172680369 100644 (file)
 #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)
@@ -292,6 +308,7 @@ ADD_INTERFACE (Bar_line,
 
 
               /* properties */
+              "allow-span-bar "
               "gap "
               "kern "
               "thin-kern "
index d85905d72e79d6cad32a30db89ae7c55eb2c33f6..ce22353c8d4934e656febec388536d3d2b6662a6 100644 (file)
@@ -18,6 +18,7 @@ public:
   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));
index 993fafe14a70581aad7f852c4d53f2b806056d04..67d464297dbd0b189a1e1a5da265e8681c54f1ce 100644 (file)
@@ -57,15 +57,17 @@ 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--;)
     {
       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;
     }
 
@@ -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 3539dc29e496eb5b382ab9a756ff7809416007be..0b38ad9e5c630e0acc1d19a34e9be6df604655e5 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 cd2c337b8823ce0a408780279d6908d334fc3f5d..ccbf965fcbb184dc9fedd4645c21b6dd7aa353a1 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))