]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/completion-note-heads-engraver.cc
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / lily / completion-note-heads-engraver.cc
index b116cb50b4bc9e41c6031fdc89fc330f4f6f83c9..eb454e71524660de3583832578bf60fa4c1a7fd2 100644 (file)
@@ -1,7 +1,20 @@
 /*
-  completion-note-heads-engraver.cc -- Completion_heads_engraver
+  This file is part of LilyPond, the GNU music typesetter.
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include <cctype>
@@ -74,6 +87,8 @@ class Completion_heads_engraver : public Engraver
   Rational left_to_do_;
   Rational do_nothing_until_;
 
+  Rational factor_;
+
   Moment next_barline_moment ();
   Item *make_note_head (Stream_event*);
 
@@ -174,16 +189,17 @@ Completion_heads_engraver::process_music ()
   Duration note_dur;
   Duration *orig = 0;
   if (left_to_do_)
-    note_dur = Duration (left_to_do_, false);
+    note_dur = Duration (left_to_do_ / factor_, false).compressed (factor_);
   else
     {
       orig = unsmob_duration (note_events_[0]->get_property ("duration"));
       note_dur = *orig;
+      factor_ = note_dur.factor ();
     }
   Moment nb = next_barline_moment ();
   if (nb.main_part_ && nb < note_dur.get_length ())
     {
-      note_dur = Duration (nb.main_part_, false);
+      note_dur = Duration (nb.main_part_ / factor_, false).compressed (factor_);
 
       do_nothing_until_ = now.main_part_ + note_dur.get_length ();
     }