]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorGraham Percival <graham@percival-music.ca>
Wed, 6 Aug 2008 07:15:13 +0000 (00:15 -0700)
committerGraham Percival <graham@percival-music.ca>
Wed, 6 Aug 2008 07:15:13 +0000 (00:15 -0700)
12 files changed:
GNUmakefile.in
input/regression/dot-rest-beam-trigger.ly [new file with mode: 0644]
input/regression/tuplet-full-length-extent.ly [new file with mode: 0644]
lily/dot-column.cc
lily/dots-engraver.cc
lily/staff-symbol-referencer.cc
lily/tuplet-bracket.cc
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/framework-ps.scm
scm/lily.scm
scm/stencil.scm

index 0cd13623ca424b7f24121594cd3421f89585107b..5160939baa0669c84a907da04235d36dd3d92332 100644 (file)
@@ -204,7 +204,7 @@ RESULT_DIR=$(top-build-dir)/out/test-results
 
 test:
        @echo -en 'For tracking crashes: use\n\n\t'
-       @echo 'grep sourcefilename `grep -L systems.texi input/regression/out-test/*log|sed s/log/ly/g`'
+       @echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
        @echo
        $(MAKE) -C input/regression/ out=test local-test
        $(MAKE) -C input/regression/musicxml out=test local-test
diff --git a/input/regression/dot-rest-beam-trigger.ly b/input/regression/dot-rest-beam-trigger.ly
new file mode 100644 (file)
index 0000000..3714cf7
--- /dev/null
@@ -0,0 +1,19 @@
+\header {
+
+  texidoc = "Dotted rests connected with beams do not trigger
+  premature beam calculations.  In this case, the beam should be
+  sloped, and there should be no programming_error() warnings."
+
+}
+
+\version "2.11.54"
+\new Staff \relative c''
+{
+  <<
+    { \time 12/16 c16[ b a r  b g] }
+    \\
+    { r8. r }
+  >>
+}
+
+
diff --git a/input/regression/tuplet-full-length-extent.ly b/input/regression/tuplet-full-length-extent.ly
new file mode 100644 (file)
index 0000000..e2b1575
--- /dev/null
@@ -0,0 +1,20 @@
+\header {
+  
+  texidoc = "With @code{full-length-to-extent}, the extent of the
+  attaching column for a full-length tuplet bracket can be ignored."
+
+}
+\version "2.11.55"
+
+\new Staff {
+   \set tupletFullLength = ##t
+   
+   \time 1/8
+   \times 2/3 { c'16 c'16 c'16 }
+   \times 2/3 { c'16 c'16 c'16 }
+   \override TupletBracket #'full-length-to-extent = ##f
+   \times 2/3 { c'16 c'16 c'16 }
+   \override Score.RehearsalMark #'break-visibility = ##(#t #t #t)
+   \override Score.RehearsalMark #'direction = #down
+   \mark "xxxxxxxxxxxxxxxxxxxxxxx"
+}
index b2645ba6dd20f26b295ee57f0e95de83f6c5952b..249eb9b8cdf42c74ec5758806d63c8df6d4140c5 100644 (file)
 
 using namespace std;
 
-#include "dots.hh"
-#include "dot-column.hh"
-#include "rhythmic-head.hh"
-#include "staff-symbol-referencer.hh"
-#include "directional-element-interface.hh"
-#include "side-position-interface.hh"
 #include "axis-group-interface.hh"
-#include "stem.hh"
-#include "grob.hh"
-#include "pointer-group-interface.hh"
+#include "directional-element-interface.hh"
+#include "dot-column.hh"
 #include "dot-configuration.hh"
+#include "dot-formatting-problem.hh"
+#include "dots.hh"
+#include "grob.hh"
 #include "note-head.hh"
+#include "pointer-group-interface.hh"
 #include "rest.hh"
-#include "dot-formatting-problem.hh"
+#include "rhythmic-head.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "stem.hh"
 
 MAKE_SCHEME_CALLBACK (Dot_column, calc_positioning_done, 1);
 SCM
@@ -178,7 +178,6 @@ Dot_column::calc_positioning_done (SCM smob)
        */
       Staff_symbol_referencer::set_position (i->second.dot_, i->first);
     }
-
   
   me->translate_axis (cfg.x_offset () - me->relative_coordinate (commonx, X_AXIS),
                      X_AXIS);
@@ -186,16 +185,19 @@ Dot_column::calc_positioning_done (SCM smob)
 }
 
 void
-Dot_column::add_head (Grob *me, Grob *rh)
+Dot_column::add_head (Grob *me, Grob *head)
 {
-  Grob *d = unsmob_grob (rh->get_object ("dot"));
+  Grob *d = unsmob_grob (head->get_object ("dot"));
   if (d)
     {
-      Side_position_interface::add_support (me, rh);
+      Side_position_interface::add_support (me, head);
 
       Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
       d->set_property ("Y-offset", Grob::x_parent_positioning_proc);
-      d->set_property ("X-offset", Grob::x_parent_positioning_proc);
+      // Dot formatting requests the Y-offset, -which- for rests may
+      // trigger post-linebreak callbacks.
+      if (!Rest::has_interface (head))
+       d->set_property ("X-offset", Grob::x_parent_positioning_proc);
       Axis_group_interface::add_element (me, d);
     }
 }
index bf0d67fd0b7c5ab3f42fb050ad12845c42353145..83eef1c05dbdc8a29049c8dfce2a672afa1c0f9a 100644 (file)
@@ -36,7 +36,6 @@ Dots_engraver::acknowledge_rhythmic_head (Grob_info gi)
   Grob *note = gi.grob ();
   if (unsmob_grob (note->get_object ("dot")))
     return;
-
   
   Duration *dur = unsmob_duration (cause->get_property ("duration"));
   if (dur && dur->dot_count ())
index d623bd35b35412f93893a5c7c24497181bf54714..dbff0245c609874af177b329914bafcc8d1056d5 100644 (file)
@@ -108,8 +108,6 @@ Staff_symbol_referencer::extent_in_staff (Grob *me)
   return retval;
 }
 
-
-
 int
 Staff_symbol_referencer::get_rounded_position (Grob *me)
 {
index dde38da22d9fc984a029a6c6b48ca81a5a79207a..639472399c3737bf4c52a9f372bff87856eef92c 100644 (file)
@@ -231,17 +231,20 @@ Tuplet_bracket::calc_control_points (SCM smob)
          /*
            We're connecting to a column, for the last bit of a broken
            fullLength bracket.
-           
-           TODO: make padding tunable?
          */
-         Real padding = 1.0;
+         Real padding =
+           robust_scm2double(me->get_property("full-length-padding"), 1.0);
 
          if (bounds[d]->break_status_dir ())
            padding = 0.0;
-         
-         x_span[d]
-           = robust_relative_extent (bounds[d], commonx, X_AXIS) [LEFT]
-           - padding;
+
+         Real coord = bounds[d]->relative_coordinate(commonx, X_AXIS);
+         if (to_boolean (me->get_property ("full-length-to-extent")))
+           coord = robust_relative_extent(bounds[d], commonx, X_AXIS)[LEFT];
+
+         coord = max (coord, x_span[LEFT]);
+
+         x_span[d] = coord - padding;
        }
     }
   while (flip (&d) != LEFT);
@@ -782,6 +785,8 @@ ADD_INTERFACE (Tuplet_bracket,
               "direction "
               "edge-height "
               "edge-text "
+              "full-length-padding "
+              "full-length-to-extent "
               "gap "
               "positions "
               "note-columns "
index 7e57b5e8a76e1cd755c17c38089f247133ff74d1..b48cbc25fc95444db3acdeede64daa92b55f6c8e 100644 (file)
@@ -290,10 +290,13 @@ open string indicators.  Default value 0.5.
 @item
 @code{xo-padding} -- Padding for open and mute indicators from top fret.  Default
 value 0.25.
-@end itemize")
+@end itemize")      ;"
 
 
     ;; ugh: double, change.
+     (full-length-padding ,number? "How much padding to use at the right side of a full-length tuplet bracket.")
+     (full-length-to-extent ,boolean? "Run to the extent of the column for a full-length tuplet bracket.")
+     
      (full-size-change ,boolean? "Don't make a change clef smaller.")
 
      (gap ,ly:dimension? "Size of a gap in a variable symbol.")
index ab6b270f2437edcd8c384f14b0d205e992dcce2a..84c0e5fae644a267a54218ef19c243b9fedc9a91 100644 (file)
        (edge-height . (0.7 . 0.7))
        (shorten-pair . (-0.2 . -0.2))
        (staff-padding . 0.25)
+       (full-length-to-extent . #t)
        (direction  . ,ly:tuplet-bracket::calc-direction)
        (positions . ,ly:tuplet-bracket::calc-positions)
        (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
 
 (define pure-print-callbacks
   (list
+   fret-board::calc-stencil
    print-circled-text-callback
    lyric-text::print
    ly:arpeggio::print
index 44427dbd09e272f45f365199cba17bca31c5f724..c7214da3c597d25c5dcf49210a1f90efe829ab1c 100644 (file)
 (define-public (dump-stencil-as-EPS-with-bbox paper dump-me filename
                                              load-fonts
                                              bbox)
-  (define (to-bp-box mmbox)
+  "Create an EPS file from stencil DUMP-ME to FILENAME. BBOX has format
+   (left-x, lower-y, right x, up-y).  If LOAD-FONTS set, include fonts inline." 
+
+  (define (to-rounded-bp-box box)
+    "Convert box to 1/72 inch with rounding to enlarge the box."
     (let* ((scale (ly:output-def-lookup paper 'output-scale))
-          (box (map
-                (lambda (x)
-                  (if (or (nan? x) (inf? x))
-                      0
-                      (inexact->exact
-                       (round (/ (* x scale) (ly:bp 1)))))) mmbox)))
-      
-    (list (car box)
-         (cadr box)
-         (max (1+ (car box)) (caddr box))
-         (max (1+ (cadr box)) (cadddr box))
+          (strip-non-number (lambda (x)
+                              (if (or (nan? x) (inf? x)) 0.0 x)))
+          (directed-round (lambda (x rounder)
+                            (inexact->exact
+                             (rounder (/ (* (strip-non-number x) scale)
+                                         (ly:bp 1)))))))
+      (list (directed-round (car box) floor)
+           (directed-round (cadr box) floor)
+           (directed-round (max (1+ (car box)) (caddr box)) ceiling)
+           (directed-round (max (1+ (cadr box)) (cadddr box)) ceiling)
          )))
 
   (let* ((outputter (ly:make-paper-outputter
                     'ps))
 
         (port (ly:outputter-port outputter))
-        (rounded-bbox (to-bp-box bbox))
+        (rounded-bbox (to-rounded-bp-box bbox))
         (port (ly:outputter-port outputter))
         (header (eps-header paper rounded-bbox load-fonts)))
 
           ((xext (car ext-system-pair))
            (paper-system (cdr ext-system-pair))
            (yext (paper-system-extent paper-system Y))
-           (bbox (list (car  xext) (car yext)
+           (bbox (list (car xext) (car yext)
                        (cdr xext) (cdr yext)))
            (filename (if (< 0 count)
                          (format "~a-~a" basename count)
index b8f9a672b7169a249d0d1e5995bcc8146f4a12bf..c324e2bab83b73a4d1c80aed03a697876e48f643 100644 (file)
@@ -546,6 +546,8 @@ The syntax is the same as `define*-public'."
 
 
 (define (multi-fork count)
+  "Split this process in COUNT helpers. Returns either a list of pids,
+or the number of the process."
   (define (helper count acc)
     (if (> count 0)
       (let*
@@ -593,7 +595,6 @@ The syntax is the same as `define*-public'."
   
   (if (and (number? (ly:get-option 'job-count))
           (>= (length files) (ly:get-option 'job-count)))
-      
       (let*
          ((count (ly:get-option 'job-count))
           (split-todo (split-list files count)) 
@@ -605,8 +606,9 @@ The syntax is the same as `define*-public'."
        
        (if (number? joblist)
            (begin
-             (ly:set-option 'log-file (format "~a-~a"
-                                              (ly:get-option 'log-file) joblist))
+             (ly:set-option
+              'log-file (format "~a-~a"
+                                (ly:get-option 'log-file) joblist))
              (set! files (vector-ref split-todo joblist)))
 
            (begin
@@ -616,25 +618,29 @@ The syntax is the same as `define*-public'."
                 (let* ((stat (cdr (waitpid pid))))
                   
                   (if (not (= stat 0))
-                      (set! errors (acons (list-element-index joblist pid) stat errors)))))
+                      (set! errors
+                            (acons (list-element-index joblist pid)
+                                   stat errors)))))
               joblist)
 
              (for-each
               (lambda (x)
                 (let* ((job (car x))
                        (state (cdr x))
-                       (logfile  (format "~a-~a.log"
+                       (logfile (format "~a-~a.log"
                                          (ly:get-option 'log-file) job))
                        (log (ly:gulp-file logfile))
                        (len (string-length log))
                        (tail (substring  log (max 0 (- len 1024)))))
 
                   (if (status:term-sig state)
-                      (ly:message "\n\n~a\n"
-                                  (format (_ "job ~a terminated with signal: ~a")
-                                          job
-                                          (status:term-sig state)))
-                      (ly:message (_ "logfile ~a (exit ~a):\n~a") logfile (status:exit-val state) tail))))
+                      (ly:message
+                       "\n\n~a\n"
+                       (format (_ "job ~a terminated with signal: ~a")
+                               job (status:term-sig state)))
+                      (ly:message
+                       (_ "logfile ~a (exit ~a):\n~a")
+                       logfile (status:exit-val state) tail))))
 
               errors)
 
@@ -646,18 +652,15 @@ The syntax is the same as `define*-public'."
                  (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
 
            (exit (if (null? errors) 0 1))))))
-             
           
   (if (string-or-symbol? (ly:get-option 'log-file))
       (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w"))
-
   
   (let ((failed (lilypond-all files)))
     (if (ly:get-option 'trace-scheme-coverage)
        (begin
          (coverage:show-all (lambda (f) (string-contains f "lilypond"))
                             )))
-         
     
     (if (pair? failed)
        (begin
@@ -671,6 +674,11 @@ The syntax is the same as `define*-public'."
 (define-public (lilypond-all files)
   (let* ((failed '())
         (separate-logs (ly:get-option 'separate-log-files))
+        (ping-log
+         (if separate-logs
+             (open-file (if (string-or-symbol? (ly:get-option 'log-file))
+                            (format "~a.log" (ly:get-option 'log-file))
+                            "/dev/tty") "a") #f))
         (do-measurements (ly:get-option 'dump-profile))
         (handler (lambda (key failed-file)
                    (set! failed (append (list failed-file) failed)))))
@@ -687,6 +695,9 @@ The syntax is the same as `define*-public'."
 
         (if separate-logs
             (ly:stderr-redirect (format "~a.log" base) "w"))
+        (if ping-log
+            (format ping-log "Procesing ~a\n" base))
+             
         (if (ly:get-option 'trace-memory-frequency) 
             (mtrace:start-trace  (ly:get-option 'trace-memory-frequency)))
         
@@ -718,12 +729,9 @@ The syntax is the same as `define*-public'."
      files)
 
     ;; we want the failed-files notice in the aggregrate logfile.
-    (if (ly:get-option 'separate-logs)
-       (ly:stderr-redirect
-        (if (string-or-symbol? (ly:get-option 'log-file))
-            (format "~a.log" (ly:get-option 'log-file))
-            "/dev/tty") "a"))
-
+    (if ping-log
+       (format ping-log "Failed files: ~a\n" failed))
+        
     (if (ly:get-option 'dump-profile)
        (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
 
index fb46ef7251cf7eef4733eeff09711ced4da1b44a..6a4b88d7b2c24a3f0d22e351cb277f2c68d4f2ec 100644 (file)
@@ -94,8 +94,8 @@ encloses the contents.
 "
   (let* ((xext (ly:grob-extent grob grob 0))
         (yext (ly:grob-extent grob grob 1))
-        (thick 0.1))
-    
+        (thick 0.01))
+
     (ly:stencil-add
      (make-filled-box-stencil xext (cons (- (car yext) thick) (car yext)))
      (make-filled-box-stencil xext (cons (cdr yext) (+ (cdr yext) thick)))