From 81e09b9ab41f7510fd77f9bd50de8087ca281cd5 Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Tue, 2 Sep 2008 23:15:08 +0100 Subject: [PATCH] Implement two variations on double repeat sign. Add context property doubleRepeatType so that default double repeat can be changed for volte using \repeat volta. --- lily/bar-line.cc | 22 ++++++++++++++++++++++ lily/repeat-acknowledge-engraver.cc | 3 ++- lily/span-bar.cc | 4 ++++ ly/engraver-init.ly | 1 + scm/define-context-properties.scm | 2 ++ scm/output-lib.scm | 3 +++ 6 files changed, 34 insertions(+), 1 deletions(-) diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 4d2cbf9..d0b18fd 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -145,11 +145,33 @@ Bar_line::compound_barline (Grob *me, string str, Real h, m.add_at_edge (X_AXIS, RIGHT, thick, kern); m.add_at_edge (X_AXIS, RIGHT, colon, kern); } + else if (str == ":|.|:") + { + m.add_at_edge (X_AXIS, LEFT, thick, 0); + m.add_at_edge (X_AXIS, LEFT, thin, kern); + m.add_at_edge (X_AXIS, LEFT, colon, kern); + m.add_at_edge (X_AXIS, RIGHT, thin, kern); + m.add_at_edge (X_AXIS, RIGHT, colon, kern); + + } + else if (str == ":|.:") + { + m.add_at_edge (X_AXIS, LEFT, thick, 0); + m.add_at_edge (X_AXIS, LEFT, thin, kern); + m.add_at_edge (X_AXIS, LEFT, colon, kern); + m.add_at_edge (X_AXIS, RIGHT, colon, kern); + } else if (str == ".|.") { m.add_at_edge (X_AXIS, LEFT, thick, thinkern); m.add_at_edge (X_AXIS, RIGHT, thick, kern); } + else if (str == "|.|") + { + m.add_at_edge (X_AXIS, LEFT, thick, 0); + m.add_at_edge (X_AXIS, LEFT, thin, kern); + m.add_at_edge (X_AXIS, RIGHT, thin, kern); + } else if (str == "||") { /* diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index cf42756..5d7b98d 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -83,7 +83,7 @@ Repeat_acknowledge_engraver::process_music () } if (start && end) - s = ":|:"; + s = robust_scm2string (get_property ("doubleRepeatType"), ":|:"); else if (start) s = "|:"; else if (end) @@ -116,6 +116,7 @@ ADD_TRANSLATOR (Repeat_acknowledge_engraver, "", /* read */ + "doubleRepeatType " "repeatCommands " "whichBar ", diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 76e1b60..48a1df4 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -186,6 +186,10 @@ Span_bar::calc_glyph_name (SCM smob) type = "|."; else if (type == ":|:") type = ".|."; + else if (type == ":|.|:") + type = "|.|"; + else if (type == ":|.:") + type = "|."; return ly_string2scm (type); } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 022fb8a..3741ab1 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -513,6 +513,7 @@ automatically when an output definition (a @code{\score} or decrescendoSpanner = #'hairpin defaultBarType = #"|" + doubleRepeatType = #":|:" barNumberVisibility = #first-bar-number-invisible automaticBars = ##t diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index a7dd3ab..b43291d 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -175,6 +175,8 @@ non-hairpin decrescendo, i.e., @samp{dim.}.") This variable is read by @rinternals{Timing_translator} at @rinternals{Score} level.") + (doubleRepeatType ,string? "Set the default bar line for double +repeats.") (doubleSlurs ,boolean? "If set, two slurs are created for every slurred note, one above and one below the chord.") (drumPitchTable ,hash-table? "A table mapping percussion diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 7a50af6..eb6d98d 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -226,6 +226,8 @@ centered, X==1 is at the right, X == -1 is at the left." ;; How should a bar line behave at a break? (define bar-glyph-alist '((":|:" . (":|" . "|:")) + (":|.|:" . (":|" . "|:")) + (":|.:" . (":|" . "|:")) ("||:" . ("||" . "|:")) ("dashed" . ("dashed" . '())) ("|" . ("|" . ())) @@ -239,6 +241,7 @@ centered, X==1 is at the right, X == -1 is at the left." (":|" . (":|" . ())) ("||" . ("||" . ())) (".|." . (".|." . ())) + ("|.|" . ("|.|" . ())) ("" . ("" . "")) (":" . (":" . "")) ("." . ("." . ())) -- 1.5.4.3