From: David Kastrup Date: Wed, 12 Jan 2011 12:08:44 +0000 (+0100) Subject: lily/stem-engraver.cc: Improve error message for incompatible durations while stemming X-Git-Tag: release/2.13.60-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3cfbe76597441ea915603c4e6e60d3e660fce647;p=lilypond.git lily/stem-engraver.cc: Improve error message for incompatible durations while stemming --- diff --git a/input/regression/incompatible-stem-warning.ly b/input/regression/incompatible-stem-warning.ly new file mode 100644 index 0000000000..95dc1c1d2c --- /dev/null +++ b/input/regression/incompatible-stem-warning.ly @@ -0,0 +1,22 @@ +\version "2.13.59" + +\header { + + texidoc = " +Combine several kinds of stems in parallel voices. +" + +} + +\new Voice { \time 4/1 + << c'\breve e'8 >> + << c'8 e'\breve >> | + << c'\longa e'1 >> | + << c'1 e'\longa >> | + << c'2 e'1 >> + << c'1 e'2 >> + << c'2 e'4 >> + << c'4 e'2 >> + << c'2 e'8 >> + << c'8 e'2 >> +} diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 137040766a..e21d796765 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -134,11 +134,13 @@ Stem_engraver::acknowledge_rhythmic_head (Grob_info gi) if (!stem_) make_stem (gi); - if (Stem::duration_log (stem_) != d->duration_log ()) + int ds = Stem::duration_log (stem_); + + if (ds != d->duration_log ()) { - // FIXME: - gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d)", - 1 << Stem::duration_log (stem_))); + gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d/%d)", + ds < 0 ? 1 << -ds : 1, + ds > 0 ? 1 << ds : 1)); gi.event_cause ()->origin ()->warning (_ ("maybe input should specify polyphonic voices")); }