From 18037c60a42e96cf61b13006bb391e3699bdc45e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 16 Sep 2006 21:26:48 +0000 Subject: [PATCH] * lily/note-column.cc: reformat. * lily/rest-collision.cc (calc_positioning_done): fix whole/half step positioning for note/rest combinations. * input/regression/rest-note-collision.ly: new file. * scm/define-grobs.scm (all-grob-descriptions): add springs-and-rods * flower/include/std-vector.hh: switch off again. * VERSION (PATCH_LEVEL): bump to 2.9.18 * flower/include/std-string.hh: idem. * flower/include/std-vector.hh (_GLIBCXX_DEBUG): set if NDEBUG not set. --- ChangeLog | 18 ++++++++++++-- VERSION | 2 +- flower/include/std-string.hh | 9 +++++++ flower/include/std-vector.hh | 10 ++++++++ flower/std-string.cc | 3 ++- input/regression/rest-note-collision.ly | 31 +++++++++++++++++++++++++ lily/font-config.cc | 2 +- lily/note-column.cc | 12 +++++++++- lily/rest-collision.cc | 19 +++++++++------ scm/define-grobs.scm | 1 + scm/part-combiner.scm | 6 ++++- stepmake/aclocal.m4 | 2 -- 12 files changed, 99 insertions(+), 16 deletions(-) create mode 100644 input/regression/rest-note-collision.ly diff --git a/ChangeLog b/ChangeLog index 971f21d093..0e8b212ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,20 @@ -2006-09-15 Han-Wen Nienhuys +2006-09-16 Han-Wen Nienhuys - * stepmake/aclocal.m4: use -D_GLIBCXX_DEBUG if optimize not set. + * lily/rest-collision.cc (calc_positioning_done): fix whole/half + step positioning for note/rest combinations. + + * input/regression/rest-note-collision.ly: new file. + + * scm/define-grobs.scm (all-grob-descriptions): add + springs-and-rods + + * flower/include/std-vector.hh: switch off again. + + * VERSION (PATCH_LEVEL): bump to 2.9.18 + + * flower/include/std-string.hh: idem. + + * flower/include/std-vector.hh (_GLIBCXX_DEBUG): set if NDEBUG not set. 2006-09-15 Mats Bengtsson diff --git a/VERSION b/VERSION index f14c281e48..9d5789cd29 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=9 -PATCH_LEVEL=17 +PATCH_LEVEL=18 MY_PATCH_LEVEL= diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index bc2fd61ee5..d0fdd9c978 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -11,6 +11,15 @@ #include "compare.hh" +#if 0 +/* + leads to dubious crashes - libstdc++ bug? + */ +#ifndef NDEBUG +#define _GLIBCXX_DEBUG 1 +#endif +#endif + #include using namespace std; diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh index 55b28d7da6..da3686a07c 100644 --- a/flower/include/std-vector.hh +++ b/flower/include/std-vector.hh @@ -9,6 +9,16 @@ #ifndef STD_VECTOR_HH #define STD_VECTOR_HH +#if 0 + +/* + leads to dubious crashes - libstdc++ bug? +*/ +#ifndef NDEBUG +#define _GLIBCXX_DEBUG 1 +#endif +#endif + #include /* find, reverse, sort */ #include /* unary_function */ #include diff --git a/flower/std-string.cc b/flower/std-string.cc index 4069278cb2..6d8ebd52f5 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -106,8 +106,9 @@ string_compare (string const &a, string const &b) vector string_split (string str, char c) { - vector a; ssize i = str.find (c); + + vector a; while (i != NPOS) { string s = str.substr (0, i); diff --git a/input/regression/rest-note-collision.ly b/input/regression/rest-note-collision.ly new file mode 100644 index 0000000000..9b8f1a8028 --- /dev/null +++ b/input/regression/rest-note-collision.ly @@ -0,0 +1,31 @@ + +\header { + + texidoc = "In rest-note collisions, the rest moves in discrete + steps, and inside the staff, it moves in whole staff spaces." + + } + + +\version "2.9.18" +\new Staff { + + << + \relative c'' { + f e d c b a g f e d c + } + \\ + { + r4 r r r r r r r r r r + } + >> + << + { + r4 r r r r r r r r r r + } + \\ + \relative c'' { + f e d c b a g f e d c + } + >> +} diff --git a/lily/font-config.cc b/lily/font-config.cc index 0993f81837..afa210a7ad 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -50,7 +50,7 @@ init_fontconfig () { string dir = dirs[i]; if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ())) - error (_f ("adding font directory: %s", dir.c_str ())); + error (_f ("failed adding font directory: %s", dir.c_str ())); else if (be_verbose_global) message (_f ("adding font directory: %s", dir.c_str ())); } diff --git a/lily/note-column.cc b/lily/note-column.cc index ba8ebd6fd8..c77aa351f5 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -188,4 +188,14 @@ Note_column::arpeggio (Grob *me) ADD_INTERFACE (Note_column, "note-column-interface", "Stem and noteheads combined", - "arpeggio note-heads rest-collision rest horizontal-shift stem accidentals force-hshift"); + + /* properties */ + "accidentals " + "arpeggio " + "force-hshift " + "horizontal-shift " + "note-heads " + "rest " + "rest-collision " + "stem " + ); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 589dd0dbec..e10a7f0cc4 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -212,13 +212,14 @@ Rest_collision::calc_positioning_done (SCM smob) for (vsize i = rests.size (); !rcol && i--;) if (Note_column::dir (rests[i])) { - dir = Note_column::dir (rests[i]); rcol = rests[i]; + dir = Note_column::dir (rcol); } if (!rcol) return SCM_UNSPECIFIED; + Grob *rest = Note_column::get_rest (rcol); Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS); Interval restdim = rcol->extent (common, Y_AXIS); @@ -232,9 +233,10 @@ Rest_collision::calc_positioning_done (SCM smob) for (vsize i = 0; i < notes.size (); i++) notedim.unite (notes[i]->extent (common, Y_AXIS)); - Real dist - = minimum_dist + dir * max (notedim[dir] - restdim[-dir], 0.0); + Real y = dir * max (0.0, + -dir * restdim[-dir] + dir * notedim[dir] + minimum_dist); + int stafflines = Staff_symbol_referencer::line_count (me); if (!stafflines) { @@ -243,13 +245,16 @@ Rest_collision::calc_positioning_done (SCM smob) } // move discretely by half spaces. - int discrete_dist = int (ceil (dist / (0.5 * staff_space))); + int discrete_y = dir * int (ceil (y / (0.5 * dir * staff_space))); // move by whole spaces inside the staff. - if (discrete_dist < stafflines + 1) - discrete_dist = int (ceil (discrete_dist / 2.0) * 2.0); + if (fabs (Staff_symbol_referencer::get_position (rest) + + discrete_y) < stafflines + 1) + { + discrete_y = dir * int (ceil (dir * discrete_y / 2.0) * 2.0); + } - Note_column::translate_rests (rcol, dir * discrete_dist); + Note_column::translate_rests (rcol, discrete_y); } return SCM_UNSPECIFIED; } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 07971e2f91..05b7d5eb2c 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1690,6 +1690,7 @@ (Tie . ( (control-points . ,ly:tie::calc-control-points) + (springs-and-rods . ,ly:spacing-spanner::set-springs) (avoid-slur . inside) (direction . ,ly:tie::calc-direction) (stencil . ,ly:tie::print) diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index c92ea2f3db..bd9ce0f720 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -400,7 +400,10 @@ Only set if not set previously. (define (try-solo type start-idx current-idx) "Find a maximum stretch that can be marked as solo. Only set -the mark when there are no spanners active." +the mark when there are no spanners active. + + return next idx to analyse. +" (if (< current-idx (vector-length result)) (let* ((now-state (vector-ref result current-idx)) (solo-state (current-voice-state now-state (if (equal? type 'solo1) 1 2))) @@ -416,6 +419,7 @@ the mark when there are no spanners active." current-idx) ((and (null? (span-state solo-state))) + ;; ;; This includes rests. This isn't a problem: long rests ;; will be shared with the silent voice, and be marked diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index 4cc525ea2a..813b830977 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -194,8 +194,6 @@ AC_DEFUN(STEPMAKE_COMPILE, [ AC_DEFINE(NDEBUG) DEFINES="$DEFINES -DNDEBUG" OPTIMIZE=" -O2 -finline-functions" - else - DEFINES="$DEFINES -D_GLIBCXX_DEBUG" fi if test $profile_b = yes; then -- 2.39.2