From 9af4ebb47d947aeb8875b5bd1cce9d3a652d4c4d Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 28 Feb 2001 20:11:48 +0100 Subject: [PATCH] patch::: 1.3.133.jcn3 1.3.133.jcn3 ============ * Small ez play tweaks. Guess I'm a sucker too. * --- CHANGES | 7 ++++ VERSION | 2 +- lily/line-of-score.cc | 61 +++++++++++++++---------------- ps/lily.ps | 26 ++++++++++++- scm/grob-description.scm | 3 +- scm/grob-property-description.scm | 1 + 6 files changed, 65 insertions(+), 35 deletions(-) diff --git a/CHANGES b/CHANGES index b3416049fd..a5127e2557 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +1.3.133.jcn3 +============ + +* Small ez play tweaks. Guess I'm a sucker too. + +* + 1.3.133.jcn2 ============ diff --git a/VERSION b/VERSION index 67f82fc622..deaf83e0fe 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=133 -MY_PATCH_LEVEL=jcn2 +MY_PATCH_LEVEL=jcn3 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 924b2c9ec4..c662d33599 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -321,38 +321,35 @@ Line_of_score::post_processing (bool last_line) gh_double2scm (height), SCM_UNDEFINED)); - /* - all elements. - */ -#if 0 - for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) -#else - /* - Output the staff-symbol (the last element in this list) first, - this fixes easy-play. - Maybe scm_reverse () is too inefficient, we could cache/remove - last element from list traversal above. - */ - for (SCM s = scm_reverse (get_grob_property ("all-elements")); gh_pair_p (s); s = gh_cdr (s)) -#endif - { - Grob *sc = unsmob_grob (gh_car (s)); - Molecule *m = sc->get_molecule (); - if (!m) - continue; - - Offset o (sc->relative_coordinate (this, X_AXIS), - sc->relative_coordinate (this, Y_AXIS)); - - SCM e = sc->get_grob_property ("extra-offset"); - if (gh_pair_p (e)) - { - o[X_AXIS] += gh_scm2double (gh_car (e)); - o[Y_AXIS] += gh_scm2double (gh_cdr (e)); - } - - output_molecule (m->get_expr (), o); - } + /* Output elements in three layers, 0, 1, 2. + The default layer is 1. */ + for (int i = 0; i < 3; i++) + for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); + s = gh_cdr (s)) + { + Grob *sc = unsmob_grob (gh_car (s)); + Molecule *m = sc->get_molecule (); + if (!m) + continue; + + SCM s = sc->get_grob_property ("layer"); + int layer = gh_number_p (s) ? gh_scm2int (s) : 1; + if (layer != i) + continue; + + Offset o (sc->relative_coordinate (this, X_AXIS), + sc->relative_coordinate (this, Y_AXIS)); + + SCM e = sc->get_grob_property ("extra-offset"); + if (gh_pair_p (e)) + { + o[X_AXIS] += gh_scm2double (gh_car (e)); + o[Y_AXIS] += gh_scm2double (gh_cdr (e)); + } + + output_molecule (m->get_expr (), o); + } + if (last_line) { output_scheme (gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED)); diff --git a/ps/lily.ps b/ps/lily.ps index 5956635e65..de0f845dd0 100644 --- a/ps/lily.ps +++ b/ps/lily.ps @@ -77,7 +77,7 @@ stroke } bind def -/draw_ez_ball % ch letter_col ball_col font +/difficult_draw_ez_ball % ch letter_col ball_col font { % font findfont 0.7 scalefont setfont @@ -100,6 +100,30 @@ show } bind def +% simple, but does it work everywhere? +/draw_ez_ball % ch letter_col ball_col font +{ + % font + findfont 0.85 scalefont setfont + /origin { 0.45 0 } def + 0 setgray + 1.1 setlinewidth + origin moveto + origin lineto stroke + % ball_col + setgray + 0.9 setlinewidth + origin moveto + origin lineto stroke + % letter_col + setgray + % 0.25 is empiric centering. Change to taste + origin moveto + -0.28 -0.30 rmoveto + % ch + show +} bind def + /draw_volta % h w thick vert_start vert_end { /vert_end exch def diff --git a/scm/grob-description.scm b/scm/grob-description.scm index f9bbfab167..c7fd1745b0 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -498,7 +498,8 @@ (StaffSymbol . ( (molecule-callback . ,Staff_symbol::brew_molecule) (staff-space . 1.0) - (line-count . 5 ) + (line-count . 5) + (layer . 0) (meta . ,(grob-description "StaffSymbol" staff-symbol-interface )) )) (SostenutoPedal . ( diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 0430b0f73e..1305a01d21 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -179,6 +179,7 @@ FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the For text, this is `relative'(?) to the current alignment. For barline, space after a thick line.") +(grob-property-description 'layer number? "The output layer [0..2]. The default is 1.") (grob-property-description 'left-padding number? "space left of accs.") (grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.") (grob-property-description 'lengths list? "Stem length given multiplicity of flag.") -- 2.39.5