OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
11 ;;;; LilyPond is distributed in the hope that it will be useful, | 11 ;;;; LilyPond is distributed in the hope that it will be useful, |
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 ;;;; GNU General Public License for more details. | 14 ;;;; GNU General Public License for more details. |
15 ;;;; | 15 ;;;; |
16 ;;;; You should have received a copy of the GNU General Public License | 16 ;;;; You should have received a copy of the GNU General Public License |
17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
19 | 19 |
20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
21 ;; general | 21 ;; general |
22 | 22 |
23 (define-public (grob::has-interface grob iface) | 23 (define-public (grob::has-interface grob iface) |
24 (memq iface (ly:grob-interfaces grob))) | 24 (memq iface (ly:grob-interfaces grob))) |
25 | 25 |
26 (define-public (grob::is-live? grob) | 26 (define-public (grob::is-live? grob) |
27 (pair? (ly:grob-basic-properties grob))) | 27 (pair? (ly:grob-basic-properties grob))) |
28 | 28 |
| 29 (define-public (grob::rhythmic-location grob) |
| 30 "Return a pair consisting of the measure number and moment within |
| 31 the measure of grob @var{grob}." |
| 32 (let* (; all grobs support either spanner- or item-interface |
| 33 (item (if (grob::has-interface grob 'spanner-interface) |
| 34 (ly:spanner-bound grob LEFT) |
| 35 grob)) |
| 36 (col (ly:item-get-column item))) |
| 37 (if (ly:grob? col) |
| 38 (ly:grob-property col 'rhythmic-location) |
| 39 '()))) |
| 40 |
| 41 (define-public (grob::when grob) |
| 42 "Return the global timestep (a moment) of grob @var{grob}." |
| 43 (let* (; all grobs support either spanner- or item-interface |
| 44 (item (if (grob::has-interface grob 'spanner-interface) |
| 45 (ly:spanner-bound grob LEFT) |
| 46 grob)) |
| 47 (col (ly:item-get-column item))) |
| 48 (if (ly:grob? col) |
| 49 (ly:grob-property col 'when) |
| 50 '()))) |
| 51 |
29 (define-public (make-stencil-boxer thickness padding callback) | 52 (define-public (make-stencil-boxer thickness padding callback) |
30 "Return function that adds a box around the grob passed as argument." | 53 "Return function that adds a box around the grob passed as argument." |
31 (lambda (grob) | 54 (lambda (grob) |
32 (box-stencil (callback grob) thickness padding))) | 55 (box-stencil (callback grob) thickness padding))) |
33 | 56 |
34 (define-public (make-stencil-circler thickness padding callback) | 57 (define-public (make-stencil-circler thickness padding callback) |
35 "Return function that adds a circle around the grob passed as argument." | 58 "Return function that adds a circle around the grob passed as argument." |
36 (lambda (grob) | 59 (lambda (grob) |
37 (circle-stencil (callback grob) thickness padding))) | 60 (circle-stencil (callback grob) thickness padding))) |
38 | 61 |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 with the subordinate symbols being interfaces." | 1458 with the subordinate symbols being interfaces." |
1436 (let loop ((forms forms)) | 1459 (let loop ((forms forms)) |
1437 (if (or (null? forms) (pair? forms)) | 1460 (if (or (null? forms) (pair? forms)) |
1438 `(list | 1461 `(list |
1439 ,@(map (lambda (form) | 1462 ,@(map (lambda (form) |
1440 (if (pair? (car form)) | 1463 (if (pair? (car form)) |
1441 `(cons ',(caar form) (lambda ,(cdar form) ,@(cdr form))) | 1464 `(cons ',(caar form) (lambda ,(cdar form) ,@(cdr form))) |
1442 `(cons ',(car form) ,(loop (cdr form))))) | 1465 `(cons ',(car form) ,(loop (cdr form))))) |
1443 forms)) | 1466 forms)) |
1444 forms))) | 1467 forms))) |
OLD | NEW |