X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpage-turn-engraver.cc;h=522ae7559eb46e029d539549607f274534a7d7ff;hb=9880906860b1ba94a03e1509b2c17a13e9844fa3;hp=a00c5922ad26131f163b499d630d89d7549312f7;hpb=970e8c7877fd9cb3197a04a611943e2b96a0d303;p=lilypond.git diff --git a/lily/page-turn-engraver.cc b/lily/page-turn-engraver.cc index a00c5922ad..522ae7559e 100644 --- a/lily/page-turn-engraver.cc +++ b/lily/page-turn-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2006 Joe Neeman + (c) 2006--2007 Joe Neeman */ #include "engraver.hh" @@ -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" @@ -134,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 ()) { @@ -152,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); @@ -286,7 +287,7 @@ Page_turn_engraver::finalize () /* it's possible that the last of my newly-split events overlaps the next repeat_penalty, in which case we need to refilter that event */ - if (rep_index < repeat_penalties_.size () - 1 + if (rep_index + 1 < repeat_penalties_.size () && split.size () && split.back ().duration_[RIGHT] > repeat_penalties_[rep_index+1].duration_[LEFT]) { @@ -326,10 +327,10 @@ Page_turn_engraver::finalize () } 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 ",