]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/lilypond-book.py (Lilypond_file_snippet.my_system):
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Oct 2006 11:33:45 +0000 (11:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Oct 2006 11:33:45 +0000 (11:33 +0000)
write snippet-names binary.

* scripts/lilypond-book.py (bindir): use os.pathsep for prepending
to $PATH.

* scm/define-grobs.scm (all-grob-descriptions): use callback to
calc dot count.

* scm/output-lib.scm (string-number::calc-text): new function.
(note-head::calc-duration-log): new function.

* scm/output-lib.scm (fingering::calc-text): new function.

ChangeLog
lily/stem-engraver.cc
scm/define-grobs.scm
scm/output-lib.scm
scripts/lilypond-book.py

index e831e6d217206a27b85831def695135d76411626..8c721f536376a6802dd3875baf6e2d6390224ef8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-10-04  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * scripts/lilypond-book.py (Lilypond_file_snippet.my_system):
+       write snippet-names binary.
+
        * python/lilylib.py (system): use os.system for mingw32
 
        * scripts/lilypond-book.py (bindir): use os.pathsep for prepending
index 6ca9368d8688def88f123241518690948e3222c5..d9d278799d9a584369a70a9c0bd83b5bb8327fe0 100644 (file)
@@ -58,15 +58,6 @@ Stem_engraver::make_stem (Grob_info gi)
      stem needs a rhythmic structure to fit it into a beam.  */
   stem_ = make_item ("Stem", gi.grob ()->self_scm ());
 
-  /*
-    we take the duration log from the Event, since the duration-log
-    for a note head is always <= 2.
-  */
-  Stream_event *ev = gi.event_cause ();
-  Duration *dur = unsmob_duration (ev->get_property ("duration"));
-
-  stem_->set_property ("duration-log", dur ? scm_from_int (dur->duration_log ()) : 0);
-
   if (tremolo_ev_)
     {
       /* Stem tremolo is never applied to a note by default,
@@ -89,6 +80,14 @@ Stem_engraver::make_stem (Grob_info gi)
       else
        context ()->set_property ("tremoloFlags", scm_from_int (requested_type));
 
+
+      /*
+       we take the duration log from the Event, since the duration-log
+       for a note head is always <= 2.
+      */
+      Stream_event *ev = gi.event_cause ();
+      Duration *dur = unsmob_duration (ev->get_property ("duration"));
+      
       int tremolo_flags = intlog2 (requested_type) - 2
        - (dur->duration_log () > 2 ? dur->duration_log () - 2 : 0);
       if (tremolo_flags <= 0)
@@ -172,14 +171,20 @@ Stem_engraver::listen_tremolo (Stream_event *ev)
 ADD_ACKNOWLEDGER (Stem_engraver, rhythmic_head);
 
 ADD_TRANSLATOR (Stem_engraver,
+
                /* doc */ "Create stems and single-stem tremolos.  It also works together with "
                "the beam engraver for overriding beaming.",
+
                /* create */
                "Stem "
                "StemTremolo ",
-               /* accept */ "tremolo-event",
+               
+               /* accept */
+               "tremolo-event",
+
                /* read */
                "tremoloFlags "
                "stemLeftBeamCount "
                "stemRightBeamCount ",
+
                /* write */ "");
index b818532294b9d122d1b4f86203d24eb5f36f4f9c..333c6a8e9e1179521727b056976fc916fc570090 100644 (file)
     (Stem
      . (
        (direction . ,ly:stem::calc-direction)
+       (duration-log . ,note-head::calc-duration-log)
        (default-direction . ,ly:stem::calc-default-direction)
        (stem-end-position . ,ly:stem::calc-stem-end-position)
        (neutral-direction . ,DOWN)
index 7281fee947a87e0dbb79956746ee14499c402785..90edde716a4c0e082334b7901665ca9d9a3b8c4f 100644 (file)
@@ -241,18 +241,15 @@ centered, X==1 is at the right, X == -1 is at the left."
 ;; Tuplets
 
 (define-public (tuplet-number::calc-denominator-text grob)
-  (let*
-      ((ev (ly:grob-property grob 'cause)))
-    
-    (number->string (ly:event-property ev 'denominator))))
-
+  (number->string (ly:event-property (event-cause grob) 'denominator)))
 
 (define-public (tuplet-number::calc-fraction-text grob)
   (let*
-      ((ev (ly:grob-property grob 'cause)))
+      ((ev (event-cause grob)))
+
     (format "~a:~a" 
-      (ly:event-property ev 'denominator)
-      (ly:event-property ev 'numerator))))
+           (ly:event-property ev 'denominator)
+           (ly:event-property ev 'numerator))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Color
@@ -403,7 +400,7 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (fingering::calc-text grob)
   (let*
-      ((event (ly:grob-property grob 'cause))
+      ((event (event-cause grob))
        (digit (ly:event-property event 'digit)))
     
     (if (> digit 5)
@@ -415,8 +412,7 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (string-number::calc-text grob)
   (let*
-      ((event (ly:grob-property grob 'cause))
-       (digit (ly:event-property event 'string-number)))
+      ((digit (ly:event-property (event-cause  grob) 'string-number)))
     
     (number->string digit 10)
   ))
index 1442555d2971be104934f7472fc2b657016fc6c7..3f306560d6e2d2a89be6969257a0599685a35e76 100644 (file)
@@ -1382,7 +1382,7 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets):
             my_system ('latex %s.texstr' % l)
 
     if ly_names:
-        open ('snippet-names', 'w').write ('\n'.join (['snippet-map.ly']
+        open ('snippet-names', 'wb').write ('\n'.join (['snippet-map.ly']
                                                       + ly_names))
         
         my_system (string.join ([cmd, 'snippet-names']))