From: Han-Wen Nienhuys Date: Wed, 6 Aug 2003 13:02:14 +0000 (+0000) Subject: * lily/system-start-delimiter.cc (after_line_breaking): retrieve X-Git-Tag: release/1.8.0~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=255a8a58b0153db41658e3c2539fe612a3d14693;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 70d88fae87..1c2c190583 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-08-06 Han-Wen Nienhuys + * 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. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 6f76a9bba4..b1c8302e5e 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -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 diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 53b2680af4..44a5d9ce7c 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -53,6 +53,10 @@ struct Interval_t : public Drul_array { 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 const&) const; Interval_t () { diff --git a/input/regression/hara-kiri-pianostaff.ly b/input/regression/hara-kiri-pianostaff.ly index 574917e51c..6ac1a71b43 100644 --- a/input/regression/hara-kiri-pianostaff.ly +++ b/input/regression/hara-kiri-pianostaff.ly @@ -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 index 8a9a9c0044..0000000000 --- a/input/regression/hara-kiri-short.ly +++ /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? - - } -} - - - diff --git a/input/regression/pc-mmrest.ly b/input/regression/pc-mmrest.ly index 7ee8857d62..03c15b4ad1 100644 --- a/input/regression/pc-mmrest.ly +++ b/input/regression/pc-mmrest.ly @@ -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'' { diff --git a/input/test/coriolan-margin.ly b/input/test/coriolan-margin.ly index 205ac612ee..34379d4b4a 100644 --- a/input/test/coriolan-margin.ly +++ b/input/test/coriolan-margin.ly @@ -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." diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 0292655e0f..40243c6a8a 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -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; }