]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Merge branch 'master' into dev/texi2html
[lilypond.git] / scm / output-lib.scm
index eea76143769952258f68b3dd449f889a1d20b7f1..de4e658fe4860231433da840f6ff3df50a60283d 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2007 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
@@ -224,45 +224,49 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 ;;
 ;; How should a  bar line behave at a break? 
-;;
-;; Why prepend `default-' to every scm identifier?
+(define bar-glyph-alist
+  '((":|:" . (":|" . "|:"))
+    ("||:" . ("||" . "|:"))
+    ("dashed" . ("dashed" . '())) 
+    ("|" . ("|" . ()))
+    ("||:" . ("||" . "|:"))
+    ("|s" . (() . "|"))
+    ("|:" . ("|" . "|:"))
+    ("|." . ("|." . ()))
+    
+    ;; hmm... should we end with a bar line here?
+    (".|" . ("|" . ".|"))
+    (":|" . (":|" . ()))
+    ("||" . ("||" . ()))
+    (".|." . (".|." . ()))
+    ("" . ("" . ""))
+    (":" . (":" . ""))
+    ("." . ("." . ()))
+    ("empty" . (() . ()))
+    ("brace" . (() . "brace"))
+    ("bracket" . (() . "bracket")) 
+    ))
+
 (define-public (bar-line::calc-glyph-name grob)
   (let* (
         (glyph (ly:grob-property grob 'glyph))
         (dir (ly:item-break-dir grob))
-        (result (assoc glyph 
-                      '((":|:" . (":|" . "|:"))
-                        ("||:" . ("||" . "|:"))
-                        ("dashed" . ("dashed" . '())) 
-                        ("|" . ("|" . ()))
-                        ("||:" . ("||" . "|:"))
-                        ("|s" . (() . "|"))
-                        ("|:" . ("|" . "|:"))
-                        ("|." . ("|." . ()))
-
-                        ;; hmm... should we end with a bar line here?
-                        (".|" . ("|" . ".|"))
-                        (":|" . (":|" . ()))
-                        ("||" . ("||" . ()))
-                        (".|." . (".|." . ()))
-                        ("" . ("" . ""))
-                        (":" . (":" . ""))
-                        ("." . ("." . ()))
-                        ("empty" . (() . ()))
-                        ("brace" . (() . "brace"))
-                        ("bracket" . (() . "bracket"))  )))
+        (result (assoc glyph  bar-glyph-alist))
         (glyph-name (if (= dir CENTER)
                         glyph
                         (if (and result (string? (index-cell (cdr result) dir)))
                             (index-cell (cdr result) dir)
                             #f)))
         )
-
-    (if (not glyph-name)
-       (ly:grob-suicide! grob))
-
     glyph-name))
 
+(define-public (bar-line::calc-break-visibility grob)
+  (let* ((glyph (ly:grob-property grob 'glyph))
+        (result (assoc glyph bar-glyph-alist)))
+    (if result
+       (vector (string? (cadr result)) #t (string? (cddr result)))
+       #(#f #f #f))))
+
 
 (define-public (shift-right-at-line-begin g)
   "Shift an item to the right, but only at the start of the line."
@@ -289,6 +293,7 @@ centered, X==1 is at the right, X == -1 is at the left."
 ;; Color
 
 (define-public color? list?)
+(define-public (rgb-color r g b) (list r g b))
 
 ; predefined colors
 (define-public black       '(0.0 0.0 0.0))
@@ -379,6 +384,9 @@ centered, X==1 is at the right, X == -1 is at the left."
        (-3/4 . "accidentals.mirroredflat.flat")
        ))
 
+;; FIXME: standard vs default, alteration-FOO vs FOO-alteration
+(define-public alteration-default-glyph-name-alist standard-alteration-glyph-name-alist)
+
 (define-public makam-alteration-glyph-name-alist
      '((1 . "accidentals.doublesharp")
        (8/9 . "accidentals.sharp.slashslashslash.stemstem")
@@ -394,24 +402,24 @@ centered, X==1 is at the right, X == -1 is at the left."
        ))
   
 (define-public alteration-hufnagel-glyph-name-alist
-   '((1/2 . "accidentals.hufnagel-1")
+   '((-1/2 . "accidentals.hufnagelM1")
      (0 . "accidentals.vaticana0")
-     (-1/2 . "accidentals.mensural1")))
+     (1/2 . "accidentals.mensural1")))
 
 (define-public alteration-medicaea-glyph-name-alist
-   '((1/2 . "accidentals.medicaea-1")
+   '((-1/2 . "accidentals.medicaeaM1")
      (0 . "accidentals.vaticana0")
-     (-1/2 . "accidentals.mensural1")))
+     (1/2 . "accidentals.mensural1")))
 
 (define-public alteration-vaticana-glyph-name-alist
-   '((1/2 . "accidentals.vaticana-1")
+   '((-1/2 . "accidentals.vaticanaM1")
      (0 . "accidentals.vaticana0")
-     (-1/2 . "accidentals.mensural1")))
+     (1/2 . "accidentals.mensural1")))
 
 (define-public alteration-mensural-glyph-name-alist
-   '((1/2 . "accidentals.mensural-1")
+   '((-1/2 . "accidentals.mensuralM1")
      (0 . "accidentals.vaticana0")
-     (-1/2 . "accidentals.mensural1")))
+     (1/2 . "accidentals.mensural1")))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -671,11 +679,15 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (fret-board::calc-stencil grob)
   (let* ((string-frets (ly:grob-property grob 'string-fret-finger-combinations))
-        (string-count (ly:grob-property grob 'string-count)))
+        (string-count (assoc-get 
+                         'string-count 
+                         (ly:grob-property grob 'fret-diagram-details)
+                         6)))
     
-    (grob-interpret-markup grob
-                          (make-fret-diagram-verbose-markup
-                           (string-frets->description string-frets string-count)))))
+    (grob-interpret-markup 
+      grob
+      (make-fret-diagram-verbose-markup
+       (string-frets->description string-frets string-count)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; scripts