]> git.donarmstrong.com Git - lilypond.git/blob - scm/basic-properties.scm
be293a5b7609952c1a130f65274b7c3eef989ed7
[lilypond.git] / scm / basic-properties.scm
1 ; Definition of backend properties (aka. element properties).
2
3 ;; See documentation of Item::visibility_lambda_
4 (define (begin-of-line-visible d) (if (= d 1) '(#f . #f) '(#t . #t)))
5 (define (end-of-line-visible d) (if (= d -1) '(#f . #f) '(#t . #t)))
6 (define (spanbar-begin-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
7 (define (all-visible d) '(#f . #f))
8 (define (all-invisible d) '(#t . #t))
9 (define (begin-of-line-invisible d) (if (= d 1) '(#t . #t) '(#f . #f)))
10 (define (end-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
11
12
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14 ; Bar lines.
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16
17 ;
18 ; How should a  bar line behave at a break? 
19 ;
20 ;; Why prepend `default-' to every scm identifier?
21 (define (default-break-barline glyph dir)
22    (let ((result (assoc glyph 
23                         '((":|:" . (":|" . "|:"))
24                           ("||:" . ("||" . "|:"))
25                           ("|" . ("|" . ()))
26                           ("||:" . ("||" . "|:"))
27                           ("|s" . (() . "|"))
28                           ("|:" . ("|" . "|:"))
29                           ("|." . ("|." . ()))
30                           (".|" . (() . ".|"))
31                           (":|" . (":|" . ()))
32                           ("||" . ("||" . ()))
33                           (".|." . (".|." . ()))
34                           ("" . ("" . ""))
35                           ("empty" . (() . ()))
36                           ("brace" . (() . "brace"))
37                           ("bracket" . (() . "bracket"))  
38                           )
39                         )))
40
41      (if (equal? result #f)
42          (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
43          (index-cell (cdr result) dir))
44      )
45    )
46      
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
48 ;  Prefatory matter: break align item.
49 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50 ;; Spacing constants 
51 ;;
52 ;; rules for this spacing are much more complicated than this. 
53 ;; See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147
54 ;;
55
56 ;; documentme: difference between extra-space and minimum-space-pair 
57
58 ;; (Measured in staff space)
59 (define default-break-align-space-alist
60  '(
61    ((none Instrument_name) . (extra-space 1.0))
62    ((none Left_edge_item) . (extra-space 0.0))
63    ((none Clef_item) . (minimum-space-pair  1.0))
64    ((none Staff_bar) . (minimum-space-pair  0.0))
65    ((none Clef_item) . (minimum-space-pair  1.0))
66    ((none Key_item) . (minimum-space-pair  0.5))
67    ((none Time_signature) . (extra-space 0.0))
68    ((none Breathing_sign) . (minimum-space-pair  0.0))
69
70    
71
72
73
74
75    ((none begin-of-note) . (minimum-space-pair  1.5))
76
77    )
78 )
79