1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 2014 Daniel Eble <dan@faithful.be>
5 ;;;; LilyPond is free software: you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version.
10 ;;;; LilyPond is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;;; GNU General Public License for more details.
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
18 (define-public (ly:time-signature::print grob)
19 "Print routine for time signatures."
20 (let* ((fraction (ly:grob-property grob 'fraction '(4 . 4)))
21 (style (ly:grob-property grob 'style 'default))
22 (proc (assoc-get style time-signature-style-markup-procedures))
23 (markup (if (procedure? proc)
25 (make-glyph-time-signature-markup style fraction))))
26 (grob-interpret-markup grob markup)))
28 (define-public (add-simple-time-signature-style style proc)
29 "Specify the procedure @{proc} returning markup for a time signature
30 style @var{style}. The procedure is called with one argument, the
31 pair @code{(@var{numerator} . @var{denominator})}."
32 (set! time-signature-style-markup-procedures
33 (acons style proc time-signature-style-markup-procedures)))
35 (define-session time-signature-style-markup-procedures `())