X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flayout-beam.scm;h=8edfd9c757f33365f1fcf65ba9d5d0f2665ffb51;hb=f9214bac21e9926dc3248416f58190c98c4167a9;hp=6c790e02b5e3f37aafb4b0a071fbe71be41b410c;hpb=203a92f82635caff2c1eec57d64c7ba581adbc82;p=lilypond.git diff --git a/scm/layout-beam.scm b/scm/layout-beam.scm index 6c790e02b5..8edfd9c757 100644 --- a/scm/layout-beam.scm +++ b/scm/layout-beam.scm @@ -3,27 +3,17 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2000--2005 Jan Nieuwenhuizen +;;;; (c) 2000--2006 Jan Nieuwenhuizen ;;;; -;; -;; width in staff space. -;; -(define (beam-flag-width-function type) - (cond - ((eq? type 1) 1.98) - ((eq? type 1) 1.65) ;; FIXME: check what this should be and why - (else 1.32))) - -(define ((check-beam-quant posl posr) beam) +(define ((check-beam-quant posl posr) beam posns) "Check whether BEAM has POSL and POSR quants. POSL are (POSITION . QUANT) pairs, where QUANT is -1 (hang), 0 (center), 1 (sit) or -2/ 2 (inter) " - (let* ((posns (ly:grob-property beam 'positions)) - (thick (ly:grob-property beam 'thickness)) + (let* ((thick (ly:grob-property beam 'thickness)) (layout (ly:grob-layout beam)) - (lthick (ly:output-def-lookup layout 'linethickness)) + (lthick (ly:output-def-lookup layout 'line-thickness)) (staff-thick lthick) ; fixme. (quant->coord (lambda (p q) (if (= 2 (abs q)) @@ -40,12 +30,15 @@ want-l want-r posns) (set! (ly:grob-property beam 'quant-score) (format "(~S,~S)" want-l want-r))) - (set! (ly:grob-property beam 'quant-score) "")))) + (set! (ly:grob-property beam 'quant-score) "")) + + posns + )) + -(define ((check-beam-slope-sign comparison) beam) +(define ((check-beam-slope-sign comparison) beam posns) "Check whether the slope of BEAM is correct wrt. COMPARISON." - (let* ((posns (ly:grob-property beam 'positions)) - (slope-sign (- (cdr posns) (car posns))) + (let* ((slope-sign (- (cdr posns) (car posns))) (correct (comparison slope-sign 0))) (if (not correct) @@ -54,22 +47,25 @@ (procedure-name comparison) "0" slope-sign) (set! (ly:grob-property beam 'quant-score) (format "~S 0" (procedure-name comparison)))) - (set! (ly:grob-property beam 'quant-score) "")))) + + (set! (ly:grob-property beam 'quant-score) "")) + posns)) + (define-public (check-quant-callbacks l r) - (list Beam::least_squares - Beam::check_concave - Beam::slope_damping - Beam::shift_region_to_valid - Beam::quanting - (check-beam-quant l r))) + (list ly:beam::calc-least-squares-positions + ly:beam::slope-damping + ly:beam::shift-region-to-valid + ly:beam::quanting + (check-beam-quant l r) + )) (define-public (check-slope-callbacks comparison) - (list Beam::least_squares - Beam::check_concave - Beam::slope_damping - Beam::shift_region_to_valid - Beam::quanting - (check-beam-slope-sign comparison))) + (list ly:beam::calc-least-squares-positions + ly:beam::slope-damping + ly:beam::shift-region-to-valid + ly:beam::quanting + (check-beam-slope-sign comparison) + ))