]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/display-lily.scm
Merge branch 'translation' of ssh://git.sv.gnu.org/srv/git/lilypond into translation
[lilypond.git] / scm / display-lily.scm
index 6fc933499df5c0ace9bb92ef2fda02b70d4683d9..16f809fc8bca2306e6c71d57cc5722bdfdc009fc 100644 (file)
@@ -2,7 +2,7 @@
 ;;;
 ;;;
 ;;;
-;;; Copyright (C) 2005--2011 Nicolas Sceaux  <nicolas.sceaux@free.fr>
+;;; Copyright (C) 2005--2012 Nicolas Sceaux  <nicolas.sceaux@free.fr>
 ;;;
 
 ;;; - This file defines the procedures used to define display methods for each
@@ -79,6 +79,18 @@ display method will be called."
                 (format #f "~a\\tag #'~a" (if post-event? "-" "") tag))
               (ly:music-property expr 'tags))))
 
+(define* (tweaks->lily-string expr #:optional (post-event? #f))
+  (format #f "~{~a ~}"
+          (map (lambda (tweak)
+                 (format #f "~a\\tweak ~a #~a"
+                         (if post-event? "-" "")
+                        (if (pair? (car tweak))
+                            (format #f "~a #'~a"
+                                    (caar tweak) (cdar tweak))
+                            (format #f "#'~a" (car tweak)))
+                         (scheme-expr->lily-string (cdr tweak))))
+               (ly:music-property expr 'tweaks))))
+
 (define-public (music->lily-string expr parser)
   "Print @var{expr}, a music expression, in LilyPond syntax."
   (if (ly:music? expr)
@@ -90,8 +102,9 @@ display method will be called."
                                              (proc expr parser))
                                            procs))))
        (if result-string
-           (format #f "~a~a" 
-                   (tag->lily-string expr (post-event? expr))
+           (format #f "~a~a~a"
+                    (tag->lily-string expr (post-event? expr))
+                    (tweaks->lily-string expr (post-event? expr))
                    result-string)
            (format #f "%{ Print method not implemented for music type ~a %}"
                    music-type)))
@@ -272,8 +285,7 @@ inside body."
 (define *max-element-number-before-break* (make-parameter 6))
 
 ;; \times factor (used in durations)
-(define *time-factor-denominator* (make-parameter #f))
-(define *time-factor-numerator* (make-parameter #f))
+(define *time-scale* (make-parameter 1))
 
 (define *current-context* (make-parameter 'Bottom))