]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/system-start-delimiter.cc (after_line_breaking): retrieve
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 6 Aug 2003 13:02:14 +0000 (13:02 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 6 Aug 2003 13:02:14 +0000 (13:02 +0000)
vertical extents to deal with Hara kiri correctly.

* input/regression/hara-kiri-short.ly: remove

* input/regression/hara-kiri-pianostaff.ly: update test.

ChangeLog
Documentation/user/refman.itely
flower/include/interval.hh
input/regression/hara-kiri-pianostaff.ly
input/regression/hara-kiri-short.ly [deleted file]
input/regression/pc-mmrest.ly
input/test/coriolan-margin.ly
lily/system-start-delimiter.cc

index 70d88fae87a9b68369306be57411cd701266c5fb..1c2c1905839068722325d6f0626e57292cd8313f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2003-08-06  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/system-start-delimiter.cc (after_line_breaking): retrieve
+       vertical extents to deal with Hara kiri correctly.
+
+       * input/regression/hara-kiri-short.ly: remove
+
+       * input/regression/hara-kiri-pianostaff.ly: update test.
+
        * Documentation/user/*.tely: remove WEBTITLE
 
        * scm/output-tex.scm (comment): idem.
index 6f76a9bba42d80120c7428b8611041525e4700ba..b1c8302e5ec56d1cac690d617a67e43c75266842 100644 (file)
@@ -1100,6 +1100,10 @@ The bar line objects that are created at @internalsref{Staff} level
 are called @internalsref{BarLine}, the bar lines that span staffs are
 @internalsref{SpanBar}s.
 
+The barlines at the start of each system are
+@internalsref{SystemStartDelimiter}s, which are spanner objects and
+typically must be tuned from a @code{\translator} block.
+
 
 @node Polyphony
 @section Polyphony
index 53b2680af4d4594abf4d094aae8bd3c9da0db525..44a5d9ce7cdf7eeccd2aaa9e433493400426d0fd 100644 (file)
@@ -53,6 +53,10 @@ struct Interval_t : public Drul_array<T> {
   T delta () const;
   void set_empty () ;
   void set_full ();
+
+  /*
+    TODO: strip hungarian suffix.
+   */
   bool empty_b () const { return elem (LEFT) > elem (RIGHT); }
   bool contains_b (Interval_t<T> const&) const;
   Interval_t () {
index 574917e51cd963c73c2747c72c6f46ef4450f631..6ac1a71b430843ca7de527e2f7f11c99dc074045 100644 (file)
@@ -1,15 +1,31 @@
 \version "1.7.19"
-\header {
-texidoc = "Hara kiri should not upset fixed distance alignment like in pianostaff. In this example the middle of 3 staves is harakiried."
+
+\header { texidoc =
+
+         " Hara kiri staves kill themselves if they are empty.  This
+example really contains three staves, but as they progress, empty ones
+are removed: this example has three staves, but some of them
+disappear: note how the 2nd line only has the bar number 2. (That the
+bar number is printed might be considered a bug, however, the scenario
+of all staves disappearing doesn't happen in practice.)
+
+Any staff brackets and braces are removed, both in the single staff
+and no staff case.
+
+This example was done with a pianostaff, which has fixed distance
+alignment; this should not confuse the mechanism.
+"
+         
 }
-    \paper { raggedright= ##t }
+
+\paper { raggedright= ##t }
 
        
 \score { \notes \transpose c c''
  \context PianoStaff <
-   \context Staff = up {  c c c c \break }
-   \context Staff = mid {  s1 \break }
-   \context Staff = down {  c4 c c c \break }
+   \context Staff = up {  c4 c c c \break  s1 \break c4 c c c \break c c c c}
+   \context Staff = mid {  d4 d d d s1 s1 s1 s1 }
+   \context Staff = down {  e4 e e e s1 e4 e e e s1 }
  >
  \paper {
   \translator {
diff --git a/input/regression/hara-kiri-short.ly b/input/regression/hara-kiri-short.ly
deleted file mode 100644 (file)
index 8a9a9c0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-\version "1.7.19"
-\header{
-texidoc="
-Hara kiri staves kill themselves if they are empty.  This example really
-contains two staves, but the second contains only spaces, and is
-therefore removed.  Also, any staff brackets and braces are removed.
-"
-}
-
-
-
-
-
-zager =  \context Staff = zager \notes \relative c'' {
-       \clef treble
-       c1      c1
-}
-
-zeuger =  \context Staff = zeuger \notes \relative c'' {
-       \clef treble
-       c1      c1
-}
-
-zoger =  \context Staff = zoger \notes \relative c'' {
-       \clef treble
-       \skip 2* 1
-}
-
-zagers =  \context StaffGroup <
-       \zager
-       \zoger
-       \zeuger
->
-\score{
-       < \context StaffGroup = zagers <
-                       \zagers
-       > >
-       \paper{
-               linewidth = 80.0\mm
-
-               \translator { \RemoveEmptyStaffContext }
-%uh?
-
-       }
-}
-
-
-
index 7ee8857d622cb498fcb52c02eb64f179bac9c5a7..03c15b4ad1628e47bdd0ccd9a2fb60048586e1a2 100644 (file)
@@ -4,6 +4,12 @@ texidoc="Multi measure rests of second voice should not disappear."
 }
 
 
+%{
+
+TODO:  what does this test? The contexts are tweaked too much.
+
+%}
+
 #(ly:set-point-and-click 'line-column)
 one = \notes\relative c'' {
 
index 205ac612ee2a38c8b1b36baf84ff9ae8659e38b7..34379d4b4ae603d12bf07cd0c45031d9a4f79c13 100644 (file)
@@ -15,8 +15,12 @@ texidoc = "@cindex Orchestra Score
 Demonstration of how to set up an orchestral score (Beethoven's Coriolan overture).
 " }
 
+\include "paper16.ly"
+
 raisedFlat = \markup { \raise #0.4 \smaller \smaller \musicglyph #"accidentals--1"  }
 
+
+
 flauti = \notes \relative c' {
   \property Staff.instrument   = #"2 Flauti"
   \property Staff.instr                = #"Fl."
index 0292655e0f7866302bd3e535a68b95aee6817ce1..40243c6a8aa99a0f176fcfc36aea8c940dce3029 100644 (file)
@@ -74,13 +74,29 @@ System_start_delimiter::after_line_breaking (SCM smob)
 {
   Grob * me = unsmob_grob (smob);
   SCM   gl = me->get_grob_property ("glyph");
-
-  if (scm_ilength (me->get_grob_property ("elements")) <=  1
-      && gh_equal_p (gl,scm_makfrom0str ("bar-line")))
+  if (gh_equal_p (gl,scm_makfrom0str ("bar-line")))
     {
-      me->suicide ();
+      int count = 0;
+
+      /*
+       Get all coordinates, to trigger Hara kiri. 
+      */
+      SCM elts = me->get_grob_property ("elements");
+      Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
+      for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
+       {
+         Interval v = unsmob_grob (gh_car (s))->extent (common, Y_AXIS);
+
+         if (!v.empty_b ())
+           count ++;
+       }
+  
+  
+      if (count <=  1)
+       {
+         me->suicide ();
+       }
     }
-
   return SCM_UNSPECIFIED;
 }