]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/convert-ly.py (FatalConversionError.conv): add
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 4 Mar 2003 16:11:56 +0000 (16:11 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 4 Mar 2003 16:11:56 +0000 (16:11 +0000)
ly:molecule-XXX conversions.

* lily/molecule-scheme.cc: change names to ly:molecule-XXX

* scm/new-markup.scm (center-markup): \center markup.

ChangeLog
lily/molecule-scheme.cc
scm/bass-figure.scm
scm/chord-name.scm
scm/molecule.scm
scm/new-markup.scm
scm/output-lib.scm
scripts/convert-ly.py

index 06e120596f448ed074e2f5eb12c53a7e409b91ab..02f39b1ce4d4102614f98f99cf7f40651827d157 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2003-03-04  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scripts/convert-ly.py (FatalConversionError.conv): add
+       ly:molecule-XXX conversions.
+
+       * lily/molecule-scheme.cc: change names to ly:molecule-XXX
+
        * input/regression/multi-measure-rest-text.ly: new file.
 
        * scm/music-functions.scm (glue-mm-rest-texts): automatically
@@ -75,6 +80,8 @@
 
 2003-02-22  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * VERSION: 1.7.13 released
+       
        * input/test/*: lots of cleanups/comment-outs/removals in chord
        examples
        
index d275c39c2e0e57ab97433a3da09992c5fb531506..be94c0d8b634da129c4aff34213b34861dc5b177 100644 (file)
@@ -9,7 +9,7 @@
 #include "molecule.hh"
 #include "font-metric.hh"
 
-LY_DEFINE(ly_set_molecule_extent_x,"ly:set-molecule-extent!", 3 , 0, 0, 
+LY_DEFINE(ly_molecule_set_extent_x,"ly:molecule-set-extent!", 3 , 0, 0, 
          (SCM mol, SCM axis, SCM np),
          "Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in \n"
 "@var{axis} direction (0 or 1 for x- and y-axis respectively).\n"
@@ -61,7 +61,7 @@ LY_DEFINE(ly_translate_molecule,"ly:molecule-translate", 2, 0, 0,
 }
 
 LY_DEFINE(ly_get_molecule_extent,
-         "ly:get-molecule-extent", 2 , 0, 0,  (SCM mol, SCM axis),
+         "ly:molecule-get-extent", 2 , 0, 0,  (SCM mol, SCM axis),
          "Return a pair of numbers signifying the extent of @var{mol} in "
 "@var{axis} direction (0 or 1 for x and y axis respectively)."
 )
@@ -75,7 +75,7 @@ LY_DEFINE(ly_get_molecule_extent,
 
 
 LY_DEFINE(ly_molecule_combined_at_edge,
-         "ly:combine-molecule-at-edge",
+         "ly:molecule-combine-at-edge",
          4, 2, 0,  (SCM first, SCM axis, SCM direction,
                     SCM second,
                     SCM padding,
@@ -121,8 +121,8 @@ LY_DEFINE(ly_molecule_combined_at_edge,
 /*
   FIXME: support variable number of arguments "
  */
-LY_DEFINE(ly_add_molecule , 
-         "ly:add-molecule", 2, 0, 0, (SCM first, SCM second),
+LY_DEFINE(ly_molecule_add , 
+         "ly:molecule-add", 2, 0, 0, (SCM first, SCM second),
          "Combine two molecules."
          )
 {
@@ -201,7 +201,7 @@ LY_DEFINE(ly_fontify_atom,"ly:fontify-atom", 2, 0, 0,
 
   return fontify_atom (unsmob_metrics (met), f);
 }
-LY_DEFINE(ly_align_to_x,"ly:align-to!", 3, 0, 0,  (SCM mol, SCM axis, SCM dir),
+LY_DEFINE(ly_align_to_x,"ly:molecule-align-to!", 3, 0, 0,  (SCM mol, SCM axis, SCM dir),
          "Align @var{mol} using its own extents.")
 {
   SCM_ASSERT_TYPE(unsmob_molecule (mol), mol, SCM_ARG1, __FUNCTION__, "molecule");
index 4f26ba953d05756e3298df405484586d3972e07d..4c7c969239bd3bf3b2b559f72fc1e3469482731a 100644 (file)
     (if (number? fig)
        (begin
          (set! mol   (fontify-text nf (number->string fig)))
-         (ly:align-to! mol Y CENTER)
+         (ly:molecule-align-to! mol Y CENTER)
        ))
     
     (if (number? acc)
        (set! mol
-             (ly:combine-molecule-at-edge
+             (ly:molecule-combine-at-edge
               mol X RIGHT (ly:find-glyph-by-name mf (string-append "accidentals-" (number->string acc)))
               0.2))
        )
     (if (ly:molecule? mol)
-       (ly:align-to! mol X CENTER)
+       (ly:molecule-align-to! mol X CENTER)
        )
     mol))
 
                     )
                (brew-complete-figure
                 grob (cdr gather-todo)
-                (ly:combine-molecule-at-edge mol Y dir br-mol kerning)
+                (ly:molecule-combine-at-edge mol Y dir br-mol kerning)
                 )
                )
              (brew-complete-figure
               grob (cdr figs)
-              (ly:combine-molecule-at-edge mol Y dir (brew-one-figure grob (car figs))
+              (ly:molecule-combine-at-edge mol Y dir (brew-one-figure grob (car figs))
                                            kerning))
              )
          ))
 
     
     (set! mol (brew-complete-figure grob (reverse figs) mol))
-    (ly:align-to! mol Y (- dir))
+    (ly:molecule-align-to! mol Y (- dir))
     mol
     ))
 
index b576c9e8d211e3805ccd8047a0cd0945e588146b..70ea70090ec3ec2b4386717448d660956329a364 100644 (file)
@@ -888,7 +888,7 @@ pitches. EXCEPTIONS is an alist (see scm file).
     ;;
     ;; chord names aren't in staffs, so WS is in global staff space.
     (if (number? ws)
-       (ly:combine-molecule-at-edge
+       (ly:molecule-combine-at-edge
         molecule
         X RIGHT (ly:make-molecule "" (cons 0 ws) '(-1 . 1) )
         0.0)
index 5de26e4a5804a18199b49b3da76c6fd455f1fe08..c994c926299da008c4a5fceeec2d9df2f3d1d647 100644 (file)
@@ -4,7 +4,7 @@
   (if (null? mols)
       '()
       (if (pair? mols)
-         (ly:combine-molecule-at-edge (car mols) axis dir 
+         (ly:molecule-combine-at-edge (car mols) axis dir 
                                       (stack-molecules axis dir padding (cdr mols))
                                       padding
                                       )
@@ -18,7 +18,7 @@
       '()
       (if (null? (cdr mols))
          (car mols)
-         (ly:combine-molecule-at-edge (car mols) Y dir 
+         (ly:molecule-combine-at-edge (car mols) Y dir 
                                       (stack-lines dir padding baseline (cdr mols))
                                       padding baseline
                                       )
   "Add brackets around MOL, producing a new molecule."
 
   (let* (
-        (ext (ly:get-molecule-extent mol axis))
+        (ext (ly:molecule-get-extent mol axis))
         (lb (ly:bracket axis ext thick (- protusion)))
         (rb (ly:bracket axis ext thick protusion))
         )
-    (set! mol (ly:combine-molecule-at-edge mol (other-axis  axis) 1 lb padding))
-    (set! mol (ly:combine-molecule-at-edge mol (other-axis  axis) -1 rb padding))
+    (set! mol (ly:molecule-combine-at-edge mol (other-axis  axis) 1 lb padding))
+    (set! mol (ly:molecule-combine-at-edge mol (other-axis  axis) -1 rb padding))
     mol
   ))
 
@@ -64,9 +64,9 @@ encloses the contents.
         (thick 0.1)
         )
 
-    (set! mol (ly:add-molecule mol (box-molecule xext (cons (- (car yext) thick) (car yext) ))))
-    (set! mol (ly:add-molecule mol (box-molecule xext (cons  (cdr yext) (+ (cdr yext) thick) ))))
-    (set! mol (ly:add-molecule mol (box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext)))
-    (set! mol (ly:add-molecule mol (box-molecule (cons (- (car xext) thick) (car xext)) yext)))
+    (set! mol (ly:molecule-add mol (box-molecule xext (cons (- (car yext) thick) (car yext) ))))
+    (set! mol (ly:molecule-add mol (box-molecule xext (cons  (cdr yext) (+ (cdr yext) thick) ))))
+    (set! mol (ly:molecule-add mol (box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext)))
+    (set! mol (ly:molecule-add mol (box-molecule (cons (- (car xext) thick) (car xext)) yext)))
     mol
   ))
index 4730184fde800694bbef1a389d22928cff170ff3..b11ab35123c0c1d1769444fcc23d682d4fdd0b47 100644 (file)
@@ -55,10 +55,10 @@ for the reader.
          (let* (
                 (tail (stack-molecule-line  space (cdr molecules)))
                 (head (car molecules))
-                (xoff (+ space (cdr (ly:get-molecule-extent head X))))
+                (xoff (+ space (cdr (ly:molecule-get-extent head X))))
                 )
            
-           (ly:add-molecule
+           (ly:molecule-add
             head
             (ly:molecule-translate-axis tail xoff X))
          )
@@ -74,11 +74,11 @@ for the reader.
 
 (define (combine-molecule-list lst)
   (if (null? (cdr lst)) (car lst)
-      (ly:add-molecule (car lst) (combine-molecule-list (cdr lst)))
+      (ly:molecule-add (car lst) (combine-molecule-list (cdr lst)))
       ))
 
 (define-public (combine-markup grob props . rest)
-  (ly:add-molecule
+  (ly:molecule-add
    (interpret-markup grob props (car rest))
    (interpret-markup grob props (cadr rest))))
   
@@ -137,7 +137,7 @@ for the reader.
   (let*
     (
      (mols (map (lambda (x) (interpret-markup grob props x)) (car rest)))
-     (cmols (map (lambda (x) (ly:align-to! x X CENTER)) mols))
+     (cmols (map (lambda (x) (ly:molecule-align-to! x X CENTER)) mols))
      )
     
     (stack-lines
index 3845138d35c7309e0cf14b62505dcb9530c343c8..0885e8d3d4e053a5a0407b35e32830604c93be16 100644 (file)
     (let ((slur (Slur::brew_molecule grob))
           (text (fontify-text (ly:get-default-font grob) letter)))
     
-      (let ((x (/ (- (cdr (ly:get-molecule-extent slur 0)) 
-                     (/ (cdr (ly:get-molecule-extent text 0)) 2.0)
+      (let ((x (/ (- (cdr (ly:molecule-get-extent slur 0)) 
+                     (/ (cdr (ly:molecule-get-extent text 0)) 2.0)
                      )
                   -2.0)))
       
-        (ly:set-molecule-extent! text 0 (cons x x))
-        (ly:align-to! text 0 1)
+        (ly:molecule-set-extent! text 0 (cons x x))
+        (ly:molecule-align-to! text 0 1)
         )
-      
-      (ly:combine-molecule-at-edge slur 1 1 text -0.6)
+
+      (ly:molecule-combine-at-edge slur 1 1 text -0.6)
       )
     )
   )
   (let*
    (
     (mol    (callback grob))
-    (x-ext (widen-interval (ly:get-molecule-extent mol 0) x-padding))
-    (y-ext (widen-interval (ly:get-molecule-extent mol 1) y-padding))
+    (x-ext (widen-interval (ly:molecule-get-extent mol 0) x-padding))
+    (y-ext (widen-interval (ly:molecule-get-extent mol 1) y-padding))
     (x-rule (box-molecule (widen-interval x-ext line-thick)
                               (cons 0 line-thick)))
     (y-rule (box-molecule (cons 0 line-thick) y-ext))
     )
     
-    (set! mol (ly:combine-molecule-at-edge mol 0 1 y-rule x-padding))
-    (set! mol (ly:combine-molecule-at-edge mol 0 -1  y-rule x-padding))
-    (set! mol (ly:combine-molecule-at-edge mol 1 1  x-rule 0))  
-    (set! mol (ly:combine-molecule-at-edge mol 1 -1 x-rule 0))
+    (set! mol (ly:molecule-combine-at-edge mol 0 1 y-rule x-padding))
+    (set! mol (ly:molecule-combine-at-edge mol 0 -1  y-rule x-padding))
+    (set! mol (ly:molecule-combine-at-edge mol 1 1  x-rule 0))  
+    (set! mol (ly:molecule-combine-at-edge mol 1 -1 x-rule 0))
     
     mol
  ))
index 851916ba0e7e3a79c93dd46c786229a472e59a2f..ed2e099ddae168b1d6f63bf5d56620b4bf136bcb 100644 (file)
@@ -1131,6 +1131,19 @@ if 1:
                
                return str
        conversions.append (((1,7,11), conv, "transpose-pitch -> pitch-transpose"))
+
+if 1:
+       def conv(str):
+               str = re.sub (r"ly:get-molecule-extent", "ly:molecule-get-extent", str)
+               str = re.sub (r"ly:set-molecule-extent!", "ly:molecule-set-extent!", str)
+               str = re.sub (r"ly:add-molecule", "ly:molecule-add", str)
+               str = re.sub (r"ly:combine-molecule-at-edge", "ly:molecule-combine-at-edge", str)
+               str = re.sub (r"ly:align-to!", "ly:molecule-align-to!", str)
+               
+               return str
+       
+       conversions.append (((1,7,13), conv, "ly:XX-molecule-YY -> ly:molecule-XX-YY")) 
+
        
 
 ################################