CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/10/16 14:20:45
Modified files:
. : ChangeLog
lily : beam.cc
lily/include : beam.hh
ly : engraver-init.ly
scm : define-grob-properties.scm define-grobs.scm
layout-beam.scm
Log message:
* lily/beam.cc: use length-fraction too.
* scm/define-grob-properties.scm (all-user-grob-properties):
remove property flag-width-function
(all-user-grob-properties): remove space-function.
* scm/layout-beam.scm: remove flag-width-function.
* lily/beam.cc: remove flag-width-function
* scm/layout-beam.scm: remove beam dir functions.
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): use
length-fraction.
* lily/beam.cc: remove dir-function.
* scm/define-grobs.scm: change print-function to stencil callback
everywhere.
* lily/beam.cc (calc_direction): use pseudo-property for beam
direction callback.
(calc_positions): use callback
* scm/define-grob-properties.scm (all-user-grob-properties): doc
callbacks property.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4183&tr2=1.4184&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/beam.cc.diff?tr1=1.318&tr2=1.319&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/beam.hh.diff?tr1=1.105&tr2=1.106&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ly/engraver-init.ly.diff?tr1=1.258&tr2=1.259&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grob-properties.scm.diff?tr1=1.130&tr2=1.131&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grobs.scm.diff?tr1=1.253&tr2=1.254&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/layout-beam.scm.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.4183 lilypond/ChangeLog:1.4184
--- lilypond/ChangeLog:1.4183 Sun Oct 16 14:11:14 2005
+++ lilypond/ChangeLog Sun Oct 16 14:20:44 2005
@@ -1,5 +1,15 @@
2005-10-16 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+ * lily/beam.cc: use length-fraction too.
+
+ * scm/define-grob-properties.scm (all-user-grob-properties):
+ remove property flag-width-function
+ (all-user-grob-properties): remove space-function.
+
+ * scm/layout-beam.scm: remove flag-width-function.
+
+ * lily/beam.cc: remove flag-width-function
+
* scm/layout-beam.scm: remove beam dir functions.
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): use
length-fraction.
Index: lilypond/lily/beam.cc
diff -u lilypond/lily/beam.cc:1.318 lilypond/lily/beam.cc:1.319
--- lilypond/lily/beam.cc:1.318 Sun Oct 16 14:09:30 2005
+++ lilypond/lily/beam.cc Sun Oct 16 14:20:44 2005
@@ -69,15 +69,17 @@
Real
Beam::get_beam_translation (Grob *me)
{
- SCM func = me->get_property ("space-function");
+ int beam_count = get_beam_count (me);
+ Real staff_space = Staff_symbol_referencer::staff_space (me);
+ Real line = Staff_symbol_referencer::line_thickness (me);
+ Real thickness = get_thickness (me);
+ Real fract = robust_scm2double (me->get_property ("length-fraction"), 1.0);
+
+ Real beam_translation = beam_count < 4
+ ? (2 * staff_space + line - thickness) / 2.0
+ : (3 * staff_space + line - thickness) / 3.0;
- if (ly_is_procedure (func))
- {
- SCM s = scm_call_2 (func, me->self_scm (), scm_from_int (get_beam_count
(me)));
- return scm_to_double (s);
- }
- else
- return 0.81;
+ return fract * beam_translation;
}
/* Maximum beam_count. */
@@ -95,25 +97,6 @@
return m;
}
-/*
- Space return space between beams.
-*/
-MAKE_SCHEME_CALLBACK (Beam, space_function, 2);
-SCM
-Beam::space_function (SCM smob, SCM beam_count)
-{
- Grob *me = unsmob_grob (smob);
-
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real line = Staff_symbol_referencer::line_thickness (me);
- Real thickness = get_thickness (me);
-
- Real beam_translation = scm_to_int (beam_count) < 4
- ? (2 * staff_space + line - thickness) / 2.0
- : (3 * staff_space + line - thickness) / 3.0;
-
- return scm_from_double (beam_translation);
-}
/* After pre-processing all directions should be set.
Several post-processing routines (stem, slur, script) need stem/beam
@@ -427,10 +410,11 @@
if (stem)
{
int t = Stem::duration_log (stem);
-
- SCM proc = me->get_property ("flag-width-function");
- SCM result = scm_call_1 (proc, scm_from_int (t));
- nw_f = scm_to_double (result);
+ // ugh. hardcoded.
+ if (t == 1)
+ nw_f = 1.98;
+ else
+ nw_f = 1.32;
}
else
nw_f = break_overshoot[RIGHT] / 2;
@@ -1395,11 +1379,11 @@
"damping "
"details "
"direction "
- "flag-width-function "
"gap "
"gap-count "
"inspect-quants "
"knee "
+ "length-fraction "
"least-squares-dy "
"neutral-direction "
"position-callbacks "
Index: lilypond/lily/include/beam.hh
diff -u lilypond/lily/include/beam.hh:1.105 lilypond/lily/include/beam.hh:1.106
--- lilypond/lily/include/beam.hh:1.105 Sun Oct 16 01:06:19 2005
+++ lilypond/lily/include/beam.hh Sun Oct 16 14:20:45 2005
@@ -56,7 +56,6 @@
static void connect_beams (Grob *me);
DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
- DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
Index: lilypond/ly/engraver-init.ly
diff -u lilypond/ly/engraver-init.ly:1.258 lilypond/ly/engraver-init.ly:1.259
--- lilypond/ly/engraver-init.ly:1.258 Sun Oct 16 14:09:30 2005
+++ lilypond/ly/engraver-init.ly Sun Oct 16 14:20:45 2005
@@ -551,14 +551,12 @@
graceSettings = #`(
(Voice Stem direction 1)
(Voice Stem font-size -3)
- (Voice NoteHead font-size -3)
+ (Voice NoteHead font-size -3)
(Voice Dots font-size -3)
(Voice Stem length-fraction 0.8)
(Voice Stem no-stem-extend #t)
(Voice Beam thickness 0.384)
- (Voice Beam space-function ,(lambda (beam mult)
- (* 0.8 (Beam::space_function
- beam mult))))
+ (Voice Beam length-fraction 0.8)
(Voice Accidental font-size -4)
(Voice Slur direction -1)
)
Index: lilypond/scm/define-grob-properties.scm
diff -u lilypond/scm/define-grob-properties.scm:1.130
lilypond/scm/define-grob-properties.scm:1.131
--- lilypond/scm/define-grob-properties.scm:1.130 Sun Oct 16 14:09:31 2005
+++ lilypond/scm/define-grob-properties.scm Sun Oct 16 14:20:45 2005
@@ -192,7 +192,6 @@
@code{mensural}. Additionally, @code{\"no-flag\"} switches off the
flag.")
- (flag-width-function ,procedure? "Procedure that computes the width of a
half-beam (a non-connecting beam.).")
(strict-note-spacing ,boolean? "If set, unbroken columns
with non-musical material (clefs, barlines, etc.) are not spaced
separately, but put before musical columns.")
@@ -390,9 +389,6 @@
of spacing tuples: @code{(@var{break-align-symbol} @var{type}
. @var{distance})}, where @var{type} can be the symbols
@code{minimum-space} or @code{extra-space}.")
- (space-function ,procedure? "Calculate the vertical space between
-two beams. This function takes a beam grob and the maximum number of
-beams.")
(spacing-increment ,number? "Add this much space for a doubled
duration. Typically, the width of a note head. See also
Index: lilypond/scm/define-grobs.scm
diff -u lilypond/scm/define-grobs.scm:1.253 lilypond/scm/define-grobs.scm:1.254
--- lilypond/scm/define-grobs.scm:1.253 Sun Oct 16 14:09:31 2005
+++ lilypond/scm/define-grobs.scm Sun Oct 16 14:20:45 2005
@@ -286,15 +286,11 @@
;; isolated shortened beams look nice and a bit shortened,
;; sadly possibly breaking patterns with high order beams.
(beamed-stem-shorten . (1.0 0.5 0.25))
-
- (flag-width-function . ,beam-flag-width-function)
(damping . 1)
(auto-knee-gap . 5.5)
;; only for debugging.
(font-family . roman)
-
- (space-function . ,Beam::space_function)
(meta . ((class . Spanner)
(interfaces . (staff-symbol-referencer-interface
beam-interface))))))
Index: lilypond/scm/layout-beam.scm
diff -u lilypond/scm/layout-beam.scm:1.2 lilypond/scm/layout-beam.scm:1.3
--- lilypond/scm/layout-beam.scm:1.2 Sun Oct 16 14:11:14 2005
+++ lilypond/scm/layout-beam.scm Sun Oct 16 14:20:45 2005
@@ -6,15 +6,6 @@
;;;; (c) 2000--2005 Jan Nieuwenhuizen <[EMAIL PROTECTED]>
;;;;
-;;
-;; 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)
"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)
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs