CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/05/25 10:22:34

Modified files:
        .              : ChangeLog 
        lily           : global-context.cc 
        scm            : define-grobs.scm define-music-properties.scm 
                         lily-library.scm music-functions.scm 

Log message:
        * scm/define-music-properties.scm (all-music-properties): document
        length-callback and start-callback as "read-only".
        
        * scm/music-functions.scm (unfold-repeats): rewrite. Cannot set
        length-callback after creation.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3656&tr2=1.3657&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/global-context.cc.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grobs.scm.diff?tr1=1.198&tr2=1.199&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-music-properties.scm.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily-library.scm.diff?tr1=1.35&tr2=1.36&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/music-functions.scm.diff?tr1=1.146&tr2=1.147&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3656 lilypond/ChangeLog:1.3657
--- lilypond/ChangeLog:1.3656   Wed May 25 09:04:06 2005
+++ lilypond/ChangeLog  Wed May 25 10:22:34 2005
@@ -1,5 +1,11 @@
 2005-05-25  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * scm/define-music-properties.scm (all-music-properties): document
+       length-callback and start-callback as "read-only".
+
+       * scm/music-functions.scm (unfold-repeats): rewrite. Cannot set
+       length-callback after creation. 
+
        * scripts/convert-ly.py (conv): unfoldrepeats -> unfoldRepeats,
        compressmusic -> compressMusic.
 
Index: lilypond/lily/global-context.cc
diff -u lilypond/lily/global-context.cc:1.30 
lilypond/lily/global-context.cc:1.31
--- lilypond/lily/global-context.cc:1.30        Tue Apr 12 22:49:28 2005
+++ lilypond/lily/global-context.cc     Wed May 25 10:22:34 2005
@@ -155,7 +155,8 @@
       if (!get_score_context ())
        {
          SCM sym = ly_symbol2scm ("Score");
-         Context_def *t = unsmob_context_def (find_context_def (get_output_def 
(), sym));
+         Context_def *t = unsmob_context_def (find_context_def (get_output_def 
(),
+                                                                sym));
          if (!t)
            error (_f ("can't find `%s' context", "Score"));
 
@@ -177,6 +178,7 @@
   SCM lst = get_property ("finalizations");
   set_property ("finalizations", SCM_EOL);
   for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s))
+    
     /* TODO: make safe.  */
     scm_primitive_eval (scm_car (s));
 }
Index: lilypond/scm/define-grobs.scm
diff -u lilypond/scm/define-grobs.scm:1.198 lilypond/scm/define-grobs.scm:1.199
--- lilypond/scm/define-grobs.scm:1.198 Wed May 25 01:16:45 2005
+++ lilypond/scm/define-grobs.scm       Wed May 25 10:22:34 2005
@@ -861,7 +861,7 @@
        (before-line-breaking-callback . ,Paper_column::before_line_breaking)
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
 
-;              (print-function . ,Paper_column::print) (font-name . "ecrm8") 
(Y-extent-callback . #f)
+               (print-function . ,Paper_column::print) (font-name . "ecrm8") 
(Y-extent-callback . #f)
        (meta . ((interfaces . (paper-column-interface axis-group-interface 
spaceable-grob-interface item-interface ))))
        ))
 
Index: lilypond/scm/define-music-properties.scm
diff -u lilypond/scm/define-music-properties.scm:1.36 
lilypond/scm/define-music-properties.scm:1.37
--- lilypond/scm/define-music-properties.scm:1.36       Tue Apr 12 22:49:25 2005
+++ lilypond/scm/define-music-properties.scm    Wed May 25 10:22:34 2005
@@ -58,7 +58,8 @@
      (label ,markup? "label of a mark.")
      (last-pitch ,ly:pitch? "The last pitch after relativization.")
      (length ,ly:moment? "The duration of this music")
-     (length-callback ,procedure? "How to compute the duration of this music")
+     (length-callback ,procedure? "How to compute the duration of this music. 
This property
+can only be defined as initializer in @file{define-music-types.scm}.")
      (internal-class-name ,string? "C++ class to use for this Music object") 
      (name ,symbol? "Name of this music object")
      (numerator ,integer? "numerator of a time signature")
@@ -73,7 +74,8 @@
      (pitch-alist ,list? "list of pitches jointly forming the scale of a key 
signature")
      (pop-first ,boolean? "Do a revert before we try to do a override on some 
grob property.")
      (procedure ,procedure?
-               "The function to run with \\applycontext. It must take a single 
argument, being the context.")
+               "The function to run with \\applycontext.
+It must take a single argument, being the context.")
      (property-operations ,list?
                          "Do these operations for instantiating the context.")
      (predicate ,procedure? "the predicate of a \\outputproperty.")
@@ -86,9 +88,10 @@
      (repeat-count  ,integer? "do a @code{\repeat} how ofen?")
      (span-direction ,ly:dir? "Does this start or stop a spanner?")
      (split-list ,list? "splitting moments for part combiner.")
-     (start-callback ,procedure? "Function to compute the negative length of
-starting grace notes.")
-     (string-number ,integer? "The number of the string in a 
String_number_req")
+     (start-callback ,procedure? "Function to compute the negative
+length of starting grace notes.  This property can only be defined as
+initializer in @file{define-music-types.scm}.")
+     (string-number ,integer? "The number of the string in a 
StringNumberEvent")
      (symbol ,symbol? "Grob name to perform an override/revert on.")
      (text ,markup? "markup expression to be printed")
      (tremolo-type ,integer? "")
@@ -106,7 +109,7 @@
 a string) for figured bass")
      (alteration ,number? "alteration for figured bass")
      (bracket-start ,boolean? "start a bracket
-here. TODO: use span requests?")
+here. TODO: use SpanEvents?")
      (bracket-stop ,boolean? "stop a bracket here.")
      (untransposable ,boolean? "If set, this music is not transposed.")
      )))
Index: lilypond/scm/lily-library.scm
diff -u lilypond/scm/lily-library.scm:1.35 lilypond/scm/lily-library.scm:1.36
--- lilypond/scm/lily-library.scm:1.35  Tue May 10 21:58:45 2005
+++ lilypond/scm/lily-library.scm       Wed May 25 10:22:34 2005
@@ -134,6 +134,13 @@
       (let ((k (assoc (car keys) lst)))
        (if k k (first-assoc (cdr keys) lst)))))
 
+(define-public (flatten-alist alist)
+  (if (null? alist)
+      '()
+      (cons (caar alist)
+           (cons (cdar alist)
+                 (flatten-alist (cdr alist))))))
+
 ;;;;;;;;;;;;;;;;
 ;; vector
 (define-public (vector-for-each proc vec)
Index: lilypond/scm/music-functions.scm
diff -u lilypond/scm/music-functions.scm:1.146 
lilypond/scm/music-functions.scm:1.147
--- lilypond/scm/music-functions.scm:1.146      Mon Apr 18 21:55:16 2005
+++ lilypond/scm/music-functions.scm    Wed May 25 10:22:34 2005
@@ -213,14 +213,21 @@
 (define-public (unfold-repeats music)
   "
 This function replaces all repeats  with unfold repeats. "
-  
+
   (let ((es (ly:music-property music 'elements))
        (e  (ly:music-property music 'element))
        )
     (if (memq 'repeated-music (ly:music-property music 'types))
-       (begin
-         (if (equal? (ly:music-property music 'iterator-ctor)
-                     Chord_tremolo_iterator::constructor)
+       (let*
+           ((props (ly:music-mutable-properties music))
+            (old-name (ly:music-property music 'name))
+            (flattened  (flatten-alist props)))
+
+         (set! music (apply make-music (cons 'UnfoldedRepeatedMusic
+                                             flattened)))
+
+         (display old-name)
+         (if (equal? old-name 'TremoloRepeatedMusic)
              (let* ((seq-arg? (memq 'sequential-music
                                     (ly:music-property e 'types)))
                     (count  (ly:music-property music 'repeat-count))
@@ -234,14 +241,9 @@
                                             (ly:intlog2 count)) dot-shift)
                
                (if seq-arg?
-                   (ly:music-compress e (ly:make-moment (length 
(ly:music-property e 'elements)) 1)))))
+                   (ly:music-compress e (ly:make-moment (length 
(ly:music-property
+                                                                 e 'elements)) 
1)))))))
          
-         (set! (ly:music-property music 'length-callback)
-               Repeated_music::unfolded_music_length)
-         (set! (ly:music-property music 'start-callback)
-               Repeated_music::first_start)
-         (set! (ly:music-property music 'iterator-ctor)
-               Unfolded_repeat_iterator::constructor)))
     
     (if (pair? es)
        (set! (ly:music-property music 'elements)


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to