]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/completion-note-heads-engraver.cc (class
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Aug 2002 17:34:10 +0000 (17:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Aug 2002 17:34:10 +0000 (17:34 +0000)
Completion_heads_engraver): don't be confused by polyphonic rhythms.

* input/regression/completion-heads-polyphony.ly: new file.

ChangeLog
input/regression/completion-heads-polyphony.ly [new file with mode: 0644]
lily/completion-note-heads-engraver.cc
make/lilypond.redhat.spec.in
make/ly-rules.make

index 789526ad4ec0c960eb07586994f7d136c4993dfa..743d4f0d44e1eb50a553c65e809f547b298b41b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-20  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/completion-note-heads-engraver.cc (class
+       Completion_heads_engraver): don't be confused by polyphonic rhythms.
+
+       * input/regression/completion-heads-polyphony.ly: new file.
+
 2002-08-19  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * GNUmakefile.in (web-ext): distribute .ly with web tarball too.
diff --git a/input/regression/completion-heads-polyphony.ly b/input/regression/completion-heads-polyphony.ly
new file mode 100644 (file)
index 0000000..ceed250
--- /dev/null
@@ -0,0 +1,23 @@
+\header {\r
+\r
+    texidoc = "Completion heads are broken across bar lines. This was\r
+intended as a debugging tool, but it can be used to ease music entry.\r
+Completion heads are not fooled by polyphony with a different rhythm.\r
+"\r
+\r
+}\r
+\r
+\score{ \r
+       \context Staff \notes \relative c'' < \r
+           { c2. c bes2 } \\\r
+           { c,2. a8 g4 f4. g4 f  }\r
+       >\r
+\r
+       \paper {\r
+               \translator{\r
+                       \ThreadContext\r
+                       \remove "Note_heads_engraver"\r
+                       \consists "Completion_heads_engraver"\r
+               }\r
+       }\r
+}\r
index 14d4d405c239e36aacfbf7d5350e9ee1260fc9b2..ca90b3d5db56156c7c90032625bef99329a8d05a 100644 (file)
@@ -43,7 +43,8 @@ class Completion_heads_engraver : public Engraver
   Moment note_end_mom_;
   bool first_b_;
   Rational left_to_do_;
-
+  Rational do_nothing_until_;
+  
   Moment next_barline_moment ();
   Duration find_nearest_duration (Rational length);
   
@@ -81,6 +82,8 @@ Completion_heads_engraver::try_music (Music *m)
          musiclen.main_part_ = Rational (0,1);
        }
       note_end_mom_  = note_end_mom_ >? (now + musiclen);
+      do_nothing_until_ = Rational (0,0);
+      
       return true;
     }
   else if (dynamic_cast<Busy_playing_req*> (m))
@@ -92,6 +95,9 @@ Completion_heads_engraver::try_music (Music *m)
   
 }
 
+/*
+  The duration _until_ the next barline.
+ */
 Moment
 Completion_heads_engraver::next_barline_moment ( )
 {
@@ -146,8 +152,12 @@ Completion_heads_engraver::process_music ()
 {
   if (!first_b_ && !left_to_do_)
     return ;
-
+  
   first_b_ = false;
+
+  Moment now =  now_mom ();
+  if (do_nothing_until_ > now.main_part_)
+    return ;
   
   Duration note_dur;
   Duration *orig = 0;
@@ -160,15 +170,15 @@ Completion_heads_engraver::process_music ()
       orig = unsmob_duration (note_reqs_[0]->get_mus_property ("duration"));
       note_dur = *orig;
     }
-
   Moment nb = next_barline_moment ();
   if (nb < note_dur.length_mom ())
     {
       note_dur = find_nearest_duration (nb.main_part_);
 
-      Moment next = now_mom();
+      Moment next = now;
       next.main_part_ += note_dur.length_mom ();
       top_engraver ()->add_moment_to_process (next);
+      do_nothing_until_ = next.main_part_;
     }
 
   if (orig)
index 763d1f0c8a179a965ea9b54ffe225918c17dff25..ad858229bb714d9a7589e9fdf0523a63ef9a43e9 100644 (file)
@@ -26,7 +26,7 @@ Group: Applications/Publishing
 
 %description documentation
 
-The documentation of LilyPond, both in HTML and PostScript.
+The documentation and example files of LilyPond.
 
 %prep
 %setup
index f36ae8d718c0a2844207f76b17456d82c2c66cf3..dd3f297c4f5cea5c0d14172f894085c5121b9739 100644 (file)
@@ -30,7 +30,7 @@ $(outdir)/%.texi: $(outdir)/%.tely
 # nexi: no-lily texi
 # for plain info doco: don't run lily
 $(outdir)/%.nexi: %.tely
-       chmod a+w $@
+       -chmod a+w $@
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --no-lily $(LILYPOND_BOOK_FLAGS) $<
        mv $(@D)/$(*F).texi $@
        chmod -w $@