]> git.donarmstrong.com Git - lilypond.git/commitdiff
Provide value->lily-string function
authorDavid Kastrup <dak@gnu.org>
Wed, 1 Jan 2014 19:54:15 +0000 (20:54 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 6 Jan 2014 15:57:25 +0000 (16:57 +0100)
scm/define-music-display-methods.scm

index 892d1c069554bc69e7eccee4542cd9c2ca1bfbbe..0c4674384d133cb68b783b9659354e90a952fb36 100644 (file)
@@ -817,13 +817,19 @@ Otherwise, return #f."
                       (music->lily-string element parser))
         #f)))
 
-(define (property-value->lily-string arg parser)
+(define-public (value->lily-string arg parser)
   (cond ((ly:music? arg)
          (music->lily-string arg parser))
         ((string? arg)
          (format #f "#~s" arg))
         ((markup? arg)
          (markup->lily-string arg))
+        ((ly:duration? arg)
+         (format #f "##{ ~a #}" (duration->lily-string arg #:force-duration #t)))
+        ((ly:pitch? arg)
+         (format #f "~a~a"
+                 (note-name->lily-string arg parser)
+                 (octave->lily-string arg)))
         (else
          (format #f "#~a" (scheme-expr->lily-string arg)))))
 
@@ -839,7 +845,7 @@ Otherwise, return #f."
                 ""
                 (format #f "~a . " (*current-context*)))
             property
-            (property-value->lily-string value parser)
+            (value->lily-string value parser)
             (new-line->lily-string))))
 
 (define-display-method PropertyUnset (expr parser)
@@ -867,7 +873,7 @@ Otherwise, return #f."
             (if (eqv? (*current-context*) 'Bottom)
                 (cons symbol properties)
                 (cons* (*current-context*) symbol properties))
-            (property-value->lily-string value parser)
+            (value->lily-string value parser)
             (new-line->lily-string))))
 
 (define-display-method RevertProperty (expr parser)