]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/to-xml.scm
update links
[lilypond.git] / scm / to-xml.scm
index b345b7969bb9ade03acb73405a639d65c0558b95..f14e40e329a5c0038e84013a10e021cd8202a1f5 100644 (file)
@@ -1,4 +1,9 @@
-(use-modules (ice-9 regex))
+(use-modules (ice-9 regex)
+            (srfi srfi-1))
+
+
+;; should make module?
+
 "
 
 
@@ -86,19 +91,19 @@ is then separated.
 
 (define (dump-duration d port)
  (display (open-tag 'duration
-           `((log . ,(duration-log d))
-             (dots . ,(duration-dot-count d))
-             (numer . ,(car (duration-factor d)))
-             (denom . ,(cdr (duration-factor d)))
+           `((log . ,(ly:duration-log d))
+             (dots . ,(ly:duration-dot-count d))
+             (numer . ,(car (ly:duration-factor d)))
+             (denom . ,(cdr (ly:duration-factor d)))
              )
            '() ) port)
  (display  (close-tag 'duration) port))
 
 (define (dump-pitch p port)
  (display (open-tag 'pitch
-           `((octave . ,(pitch-octave p))
-             (notename . ,(pitch-notename p))
-             (alteration . ,(pitch-alteration p))
+           `((octave . ,(ly:pitch-octave p))
+             (notename . ,(ly:pitch-notename p))
+             (alteration . ,(ly:pitch-alteration p))
              )
            '() ) port)
  (display  (close-tag 'pitch) port))
@@ -140,18 +145,15 @@ is then separated.
      "\n   "
     (symbol->string sym)
     "=\""
-
     (let ((s (call-with-output-string (lambda (port) (display val port)))))
       (re-sub-alist s xml-entities-alist))
-    
     "\""
     )))
 
   (string-append
    "<" (symbol->string tag)
    (apply string-append
-         (map dump-attr (filter-list candidate? attrs)))
-
+         (map dump-attr (filter candidate? attrs)))
    ">\n")
    
   )
@@ -162,12 +164,12 @@ is then separated.
 (define (music-to-xml-helper music port)
    (let*
        (
-       (name (ly-get-mus-property music 'name))
-       (e (ly-get-mus-property music 'element))
-       (es (ly-get-mus-property music 'elements))
-       (mprops (ly-get-mutable-properties music))
-       (p (ly-get-mus-property music 'pitch))
-       (d (ly-get-mus-property music 'duration))
+       (name (ly:get-mus-property music 'name))
+       (e (ly:get-mus-property music 'element))
+       (es (ly:get-mus-property music 'elements))
+       (mprops (ly:get-mutable-properties music))
+       (p (ly:get-mus-property music 'pitch))
+       (d (ly:get-mus-property music 'duration))
        (ignore-props '(origin elements duration pitch element))
        )
 
@@ -176,24 +178,27 @@ is then separated.
      
      (display (open-tag 'music (cons `(type . ,name) mprops) ignore-props)
              port)
-     (if (duration? d)
+     (if (ly:duration? d)
         (dump-duration d port))
-     (if (pitch? p)
+     (if (ly:pitch? p)
         (dump-pitch p port))
      (if (pair? es)
         (map (lambda (x) (music-to-xml-helper x port)) es)
         )
 
-     (if (music? e)
+     (if (ly:music? e)
         (begin
           (music-to-xml-helper e port)))
      (display (close-tag 'music) port)
-   ))
-   
-   
+     ))
+
 (define-public (music-to-xml music port)
   "Dump XML-ish stuff to PORT."
-  (display (dtd-header) port)
+
+  ;; dtd contains # -- This confuses tex during make web.
+  ;;
+  ;;  (display (dtd-header) port)
+  
   (display (open-tag 'music '((type . score)) '()) port)
   (music-to-xml-helper music port)
   (display (close-tag 'music) port))