]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-turn-engraver.cc
Doc: NR - changing-defaults.itely - various improvements
[lilypond.git] / lily / page-turn-engraver.cc
index d9c1bd12fa4c17b8520e0f344ef39d768cdcdc3e..dd90ba71cf196afea1691f7d348f9c550ce129d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2014 Joe Neeman <joeneeman@gmail.com>
+  Copyright (C) 2006--2015 Joe Neeman <joeneeman@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -66,7 +66,7 @@ public:
     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])
@@ -148,7 +148,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<Duration> (cause->get_property ("duration"))
                       : 0;
 
   if (!dur_ptr)
@@ -208,7 +208,7 @@ Page_turn_engraver::start_translation_timestep ()
 void
 Page_turn_engraver::stop_translation_timestep ()
 {
-  Grob *pc = unsmob_grob (get_property ("currentCommandColumn"));
+  Grob *pc = unsmob<Grob> (get_property ("currentCommandColumn"));
 
   if (pc)
     {
@@ -229,9 +229,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 +239,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<Moment> (get_property ("minimumRepeatLengthForPageTurn"));
       if (m && *m > (now_mom () - repeat_begin_))
         pen = infinity_f;
 
@@ -265,9 +265,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;
 }