[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix CueEndClef with parenthesized ClefModifier (issue 353720043 by addre
From: |
lilypond |
Subject: |
fix CueEndClef with parenthesized ClefModifier (issue 353720043 by address@hidden) |
Date: |
Wed, 20 Jun 2018 12:04:31 -0700 |
Reviewers: ,
https://codereview.appspot.com/353720043/diff/1/input/regression/cue-clef-after-barline.ly
File input/regression/cue-clef-after-barline.ly (right):
https://codereview.appspot.com/353720043/diff/1/input/regression/cue-clef-after-barline.ly#newcode8
input/regression/cue-clef-after-barline.ly:8: Solo = \relative {
Ooops … These whitespace fixes (introduced by Frescobaldi’s autoformat)
have nothing to do with the bug and patch itself.
https://codereview.appspot.com/353720043/diff/1/input/regression/cue-clef-transposition-optional.ly
File input/regression/cue-clef-transposition-optional.ly (right):
https://codereview.appspot.com/353720043/diff/1/input/regression/cue-clef-transposition-optional.ly#newcode1
input/regression/cue-clef-transposition-optional.ly:1: \version "2.21.0"
When should the version number be updated? Only if new features are
used? Or should it reflect the last changes to the file?
https://codereview.appspot.com/353720043/diff/1/scm/parser-clef.scm
File scm/parser-clef.scm (right):
https://codereview.appspot.com/353720043/diff/1/scm/parser-clef.scm#newcode177
scm/parser-clef.scm:177: (clefTranspositionFormatter .
cueClefTranspositionFormatter)
Do we need this? I think so. Though it has nothing to do with the bug.
Description:
fix CueEndClef with parenthesized ClefModifier
If the main clef has a parenthesized or bracketed ClefModifier, ending a
cue now prints those parentheses/brackets.
Contains regtest.
This was reported at the german speaking LilyPond forum:
https://lilypondforum.de/index.php?topic=324
Please review this at https://codereview.appspot.com/353720043/
Affected files (+22, -16 lines):
M input/regression/cue-clef-after-barline.ly
M input/regression/cue-clef-transposition-optional.ly
M lily/cue-clef-engraver.cc
M scm/parser-clef.scm
Index: input/regression/cue-clef-after-barline.ly
diff --git a/input/regression/cue-clef-after-barline.ly
b/input/regression/cue-clef-after-barline.ly
index
64d606fb8bd9b503b643540d0b19a2997ac6c110..d25e992db49c0246e1581000af621296bec27a68
100644
--- a/input/regression/cue-clef-after-barline.ly
+++ b/input/regression/cue-clef-after-barline.ly
@@ -5,9 +5,9 @@ instrument = \relative {
}
\addQuote "instrQuote" \instrument
-Solo = \relative {
+Solo = \relative {
c'2 c |
-
+
% Change the break-align-orders of the score so that cue-clef comes
after bar-line
\override Score.BarLine.space-alist.cue-clef = #'(minimum-space . 1.0)
\override Score.BreakAlignment.break-align-orders =
@@ -23,7 +23,7 @@ Solo = \relative {
\cueDuringWithClef #"instrQuote" #UP #"bass" { R1 }
c2 c2 |
-
+
% Revert back to default
\revert Score.BarLine.space-alist.cue-clef
\revert Score.BreakAlignment.break-align-orders
Index: input/regression/cue-clef-transposition-optional.ly
diff --git a/input/regression/cue-clef-transposition-optional.ly
b/input/regression/cue-clef-transposition-optional.ly
index
a0a78660eec490535f44210043249a719ea51e20..406781e81173bae4f757f22f92a2ac3cba03a4ba
100644
--- a/input/regression/cue-clef-transposition-optional.ly
+++ b/input/regression/cue-clef-transposition-optional.ly
@@ -1,4 +1,4 @@
-\version "2.19.21"
+\version "2.21.0"
\header {
texidoc = "Optional transposition for clefs for cue notes is supported
@@ -10,14 +10,18 @@ vI = \relative { \clef "treble" \repeat unfold 40 g'4 }
Solo = \relative {
\clef "treble_8" c'1 |
- \cueDuringWithClef #"vIQuote" #UP #"bass^(15)" { R1 } |
- c1 | \break
- c c
- \clef "bass^8" c1 |
- \cueDuringWithClef #"vIQuote" #UP #"G_[8]" { R1 R1 } |
+ \cueDuringWithClef #"vIQuote" #UP #"bass^(15)" { R }
+ c
+
+ \clef "bass^8" c |
+ \cueDuringWithClef #"vIQuote" #UP #"treble_[8]" { R } |
c
\cueDuringWithClef #"vIQuote" #UP #"treble_(8)" { R1 \break R } |
c
+
+ \clef "treble_[8]" c'1 |
+ \cueDuringWithClef #"vIQuote" #UP #"bass^(15)" { R }
+ c
}
\score {
Index: lily/cue-clef-engraver.cc
diff --git a/lily/cue-clef-engraver.cc b/lily/cue-clef-engraver.cc
index
baee8b76ddd457d27298f1abef5c45c72995decd..be95fe050dc1f5c2530230a62faa0913972472c6
100644
--- a/lily/cue-clef-engraver.cc
+++ b/lily/cue-clef-engraver.cc
@@ -55,7 +55,7 @@ private:
void create_end_clef ();
void set_glyph ();
void inspect_clef_properties ();
- void create_clef_modifier (SCM oct);
+ void create_clef_modifier (SCM transp, SCM style, SCM formatter);
};
void
@@ -101,7 +101,7 @@ Cue_clef_engraver::acknowledge_bar_line (Grob_info info)
}
void
-Cue_clef_engraver::create_clef_modifier (SCM transp)
+Cue_clef_engraver::create_clef_modifier (SCM transp, SCM style, SCM
formatter)
{
if (scm_is_number (transp) && scm_to_int (transp))
{
@@ -114,9 +114,6 @@ Cue_clef_engraver::create_clef_modifier (SCM transp)
SCM txt = scm_number_to_string (scm_from_int (abs_transp),
scm_from_int (10));
- SCM style = get_property ("cueClefTranspositionStyle");
-
- SCM formatter = get_property ("cueClefTranspositionFormatter");
if (ly_is_procedure (formatter))
g->set_property ("text", scm_call_2 (formatter, txt, style));
@@ -141,7 +138,9 @@ Cue_clef_engraver::create_clef ()
if (scm_is_number (cpos))
clef_->set_property ("staff-position", cpos);
- create_clef_modifier (get_property ("cueClefTransposition"));
+ create_clef_modifier (get_property ("cueClefTransposition"),
+ get_property ("cueClefTranspositionStyle"),
+ get_property ("cueClefTranspositionFormatter"));
}
}
@@ -155,7 +154,9 @@ Cue_clef_engraver::create_end_clef ()
if (scm_is_number (cpos))
clef_->set_property ("staff-position", cpos);
- create_clef_modifier (get_property ("clefTransposition"));
+ create_clef_modifier (get_property ("clefTransposition"),
+ get_property ("clefTranspositionStyle"),
+ get_property ("clefTranspositionFormatter"));
}
}
Index: scm/parser-clef.scm
diff --git a/scm/parser-clef.scm b/scm/parser-clef.scm
index
9832753445166c55b0dc1986c60db29b39d039ad..5ab1c1175b1d19dde29a58aac583f510ba81af56
100644
--- a/scm/parser-clef.scm
+++ b/scm/parser-clef.scm
@@ -174,6 +174,7 @@
(middleCClefPosition . middleCCuePosition)
(clefPosition . cueClefPosition)
(clefTransposition . cueClefTransposition)
+ (clefTranspositionFormatter . cueClefTranspositionFormatter)
(clefTranspositionStyle . cueClefTranspositionStyle)))
(let ((clef (make-clef-set clef-name)))
(for-each
- fix CueEndClef with parenthesized ClefModifier (issue 353720043 by address@hidden),
lilypond <=