From 40b0982cb4f00317c3d50c7f1d4e26fde912f3cd Mon Sep 17 00:00:00 2001 From: Dan Eble Date: Sat, 25 Oct 2014 22:20:55 -0400 Subject: [PATCH] Issue 3286: add single-C time signature style This style is identical to single-digit except that C is printed instead of 4 and cut-C is printed instead of 2. --- input/regression/time-signature-single-c.ly | 20 ++++++++++++++++++++ lily/time-signature.cc | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 input/regression/time-signature-single-c.ly diff --git a/input/regression/time-signature-single-c.ly b/input/regression/time-signature-single-c.ly new file mode 100644 index 0000000000..5e115e4070 --- /dev/null +++ b/input/regression/time-signature-single-c.ly @@ -0,0 +1,20 @@ +\version "2.19.16" + +\header { + texidoc = "The single-C time signature style prints a C for any time signature with 4 in the numerator and prints a cut-C for any time signature with 2 in the numerator." +} + +\layout { indent = 0 } + +\new Staff { + \relative f' { + \override Staff.TimeSignature.style = #'single-C + \time 1/2 f2^"1/2" + \time 2/2 f2^"2/2" f + \time 2/1 f1^"2/1" f + \time 3/4 f4^"3/4" f f + \time 4/4 f4^"4/4" f f f + \time 4/2 f2^"4/2" f f f + \time 4/1 f1^"4/1" f f f + } +} diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 96ab197581..c85b891932 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -68,6 +68,14 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) if ((style == "default") || (style == "")) style = ::to_string ("C"); + else if (style == "single-C") + { + if ((n != 2) && (n != 4)) + return numbered_time_signature (me, n, 0); + /* for any d, print 2/d as cut-C, 4/d as C */ + style = ::to_string ("C"); + d = n; + } if (style == "C") { -- 2.39.2