]> git.donarmstrong.com Git - lilypond.git/commitdiff
lily/stem-engraver.cc: Improve error message for incompatible durations while stemming
authorDavid Kastrup <dak@gnu.org>
Wed, 12 Jan 2011 12:08:44 +0000 (13:08 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 13 Apr 2011 10:30:26 +0000 (12:30 +0200)
input/regression/incompatible-stem-warning.ly [new file with mode: 0644]
lily/stem-engraver.cc

diff --git a/input/regression/incompatible-stem-warning.ly b/input/regression/incompatible-stem-warning.ly
new file mode 100644 (file)
index 0000000..95dc1c1
--- /dev/null
@@ -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 >>
+}
index 137040766a5f6a1c710595b350f1a6dd039c4691..e21d796765ccd1cc1de4daf188b18be068e82d48 100644 (file)
@@ -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"));
     }