]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-turn-engraver.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / page-turn-engraver.cc
index 56abfb256c2dcef31b63a01c00d1b3b5962fe863..4064efa37e2fd9f12921dfc8c5cab56df2f219c0 100644 (file)
@@ -12,7 +12,6 @@
 #include "duration.hh"
 #include "grob.hh"
 #include "international.hh"
-#include "moment.hh"
 #include "paper-column.hh"
 #include "stream-event.hh"
 #include "warn.hh"
@@ -59,7 +58,7 @@ public:
       ret.push_back (Page_turn_event (intersect[LEFT], intersect[RIGHT], permission_, new_pen));
 
     if (penalty.duration_[RIGHT] < duration_[RIGHT])
-      ret.push_back (Page_turn_event (penalty.duration_[RIGHT], duration_[LEFT], permission_, penalty_));
+      ret.push_back (Page_turn_event (penalty.duration_[RIGHT], duration_[RIGHT], permission_, penalty_));
 
     return ret;
   }
@@ -112,12 +111,9 @@ Page_turn_engraver::breakable_column (Page_turn_event const &brk)
 
   if (start == breakable_moments_.size ())
     return NULL;
-  if (end == breakable_moments_.size () || breakable_moments_[end] > brk.duration_[RIGHT])
-    {
-      if (end == 0)
-       return NULL;
-      end--;
-    }
+  if (end == 0)
+    return NULL;
+  end--;
 
   for (vsize i = end + 1; i-- > start;)
     if (special_barlines_[i])
@@ -137,12 +133,14 @@ Page_turn_engraver::penalty (Rational rest_len)
 void
 Page_turn_engraver::acknowledge_note_head (Grob_info gi)
 {
-  SCM dur_log_scm = gi.grob ()->get_property ("duration-log");
-  if (!scm_is_number (dur_log_scm))
-    return;
+  Stream_event *cause = gi.event_cause ();
 
-  int dur_log = scm_to_int (dur_log_scm);
-  int dot_count = robust_scm2int (gi.grob ()->get_property ("dot-count"), 0);
+  Duration *dur_ptr = cause
+    ? unsmob_duration (cause->get_property ("duration"))
+    : 0;
+  
+  if (!dur_ptr)
+    return;
 
   if (rest_begin_ < now_mom ())
     {
@@ -155,7 +153,7 @@ Page_turn_engraver::acknowledge_note_head (Grob_info gi)
 
   if (rest_begin_ <= repeat_begin_)
     repeat_begin_rest_length_ = (now_mom () - repeat_begin_).main_part_;
-  note_end_ = now_mom () + Moment (Duration (dur_log, dot_count).get_length ());
+  note_end_ = now_mom () + dur_ptr->get_length ();
 }
 
 IMPLEMENT_TRANSLATOR_LISTENER (Page_turn_engraver, break);
@@ -332,7 +330,6 @@ ADD_ACKNOWLEDGER (Page_turn_engraver, note_head);
 ADD_TRANSLATOR (Page_turn_engraver,
                 /* doc */ "Decide where page turns are allowed to go",
                 /* create */ "",
-                /* accept */ "",
                 /* read */
                "minimumPageTurnLength "
                "minimumRepeatLengthForPageTurn ",