X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fpage-turn-engraver.cc;h=874ebe7e7e56ce62791f5d2281e5270f8a609e72;hb=0e91bb16e020081fbbecab38fb7a8ed1c1a761dd;hp=d7c7ccec3258a19940c6bb92eb1fdddeda525efb;hpb=233fb6a8b3b6e31de1841641dbbd4c4f43423151;p=lilypond.git diff --git a/lily/page-turn-engraver.cc b/lily/page-turn-engraver.cc index d7c7ccec32..874ebe7e7e 100644 --- a/lily/page-turn-engraver.cc +++ b/lily/page-turn-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2012 Joe Neeman + Copyright (C) 2006--2015 Joe Neeman LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,9 @@ #include "translator.icc" +using std::string; +using std::vector; + class Page_turn_event { public: @@ -61,12 +64,12 @@ public: return ret; } - Real new_pen = max (penalty_, penalty.penalty_); + Real new_pen = std::max (penalty_, penalty.penalty_); if (duration_[LEFT] < penalty.duration_[LEFT]) ret.push_back (Page_turn_event (duration_[LEFT], penalty.duration_[LEFT], permission_, penalty_)); - if (penalty.permission_ != SCM_EOL) + if (!scm_is_null (penalty.permission_)) ret.push_back (Page_turn_event (intersect[LEFT], intersect[RIGHT], permission_, new_pen)); if (penalty.duration_[RIGHT] < duration_[RIGHT]) @@ -118,8 +121,8 @@ Page_turn_engraver::Page_turn_engraver () Grob * Page_turn_engraver::breakable_column (Page_turn_event const &brk) { - vsize start = lower_bound (breakable_moments_, brk.duration_[LEFT], less ()); - vsize end = upper_bound (breakable_moments_, brk.duration_[RIGHT], less ()); + vsize start = lower_bound (breakable_moments_, brk.duration_[LEFT], std::less ()); + vsize end = upper_bound (breakable_moments_, brk.duration_[RIGHT], std::less ()); if (start == breakable_moments_.size ()) return NULL; @@ -148,7 +151,7 @@ Page_turn_engraver::acknowledge_note_head (Grob_info gi) Stream_event *cause = gi.event_cause (); Duration *dur_ptr = cause - ? unsmob_duration (cause->get_property ("duration")) + ? unsmob (cause->get_property ("duration")) : 0; if (!dur_ptr) @@ -208,7 +211,7 @@ Page_turn_engraver::start_translation_timestep () void Page_turn_engraver::stop_translation_timestep () { - Grob *pc = unsmob_grob (get_property ("currentCommandColumn")); + Grob *pc = unsmob (get_property ("currentCommandColumn")); if (pc) { @@ -229,9 +232,9 @@ Page_turn_engraver::stop_translation_timestep () for (; scm_is_pair (cs); cs = scm_cdr (cs)) { SCM command = scm_car (cs); - if (command == ly_symbol2scm ("start-repeat")) + if (scm_is_eq (command, ly_symbol2scm ("start-repeat"))) start = true; - else if (command == ly_symbol2scm ("end-repeat")) + else if (scm_is_eq (command, ly_symbol2scm ("end-repeat"))) end = true; } @@ -239,7 +242,7 @@ Page_turn_engraver::stop_translation_timestep () { Rational now = now_mom ().main_part_; Real pen = penalty ((now_mom () - rest_begin_).main_part_ + repeat_begin_rest_length_); - Moment *m = unsmob_moment (get_property ("minimumRepeatLengthForPageTurn")); + Moment *m = unsmob (get_property ("minimumRepeatLengthForPageTurn")); if (m && *m > (now_mom () - repeat_begin_)) pen = infinity_f; @@ -265,9 +268,10 @@ Page_turn_engraver::stop_translation_timestep () SCM Page_turn_engraver::max_permission (SCM perm1, SCM perm2) { - if (perm1 == SCM_EOL) + if (scm_is_null (perm1)) return perm2; - if (perm1 == ly_symbol2scm ("allow") && perm2 == ly_symbol2scm ("force")) + if (scm_is_eq (perm1, ly_symbol2scm ("allow")) + && scm_is_eq (perm2, ly_symbol2scm ("force"))) return perm2; return perm1; } @@ -319,7 +323,7 @@ Page_turn_engraver::finalize () if (pc) { SCM perm = max_permission (pc->get_property ("page-turn-permission"), brk.permission_); - Real pen = min (robust_scm2double (pc->get_property ("page-turn-penalty"), infinity_f), brk.penalty_); + Real pen = std::min (robust_scm2double (pc->get_property ("page-turn-penalty"), infinity_f), brk.penalty_); pc->set_property ("page-turn-permission", perm); pc->set_property ("page-turn-penalty", scm_from_double (pen)); }