diff options
author | David Kastrup <dak@gnu.org> | 2011-01-12 13:08:44 +0100 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2011-04-13 12:30:26 +0200 |
commit | 3cfbe76597441ea915603c4e6e60d3e660fce647 (patch) | |
tree | c6eb3b37d73aacecc8ec94e88f8513a5d1fe0283 | |
parent | 9ee41ab7352ca3df7aa2ddd8e7097660924f3e36 (diff) |
lily/stem-engraver.cc: Improve error message for incompatible durations while stemming
-rw-r--r-- | input/regression/incompatible-stem-warning.ly | 22 | ||||
-rw-r--r-- | lily/stem-engraver.cc | 10 |
2 files changed, 28 insertions, 4 deletions
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")); } |