]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dynamic-engraver.cc
Doc: CG - Tightening up of the Bug Squad intro
[lilypond.git] / lily / dynamic-engraver.cc
index 6baceb1f31ccd63d0869457c414ebc29bb846bd3..4b51d904140e9f0a6e4d87d716a5c534cf174308 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2008--2014 Han-Wen Nienhuys <hanwen@lilypond.org>
+  Copyright (C) 2008--2015 Han-Wen Nienhuys <hanwen@lilypond.org>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -107,7 +107,7 @@ Dynamic_engraver::get_property_setting (Stream_event *evt,
                                         char const *ctxprop)
 {
   SCM spanner_type = evt->get_property (evprop);
-  if (spanner_type == SCM_EOL)
+  if (scm_is_null (spanner_type))
     spanner_type = get_property (ctxprop);
   return spanner_type;
 }
@@ -141,7 +141,7 @@ Dynamic_engraver::process_music ()
       SCM cresc_type = get_property_setting (current_span_event_, "span-type",
                                              (start_type + "Spanner").c_str ());
 
-      if (cresc_type == ly_symbol2scm ("text"))
+      if (scm_is_eq (cresc_type, ly_symbol2scm ("text")))
         {
           current_spanner_
             = make_spanner ("DynamicTextSpanner",
@@ -156,12 +156,13 @@ Dynamic_engraver::process_music ()
             early: this allows dynamics to be spaced individually instead of
             being linked together.
           */
-          if (current_spanner_->get_property ("style") == ly_symbol2scm ("none"))
+          if (scm_is_eq (current_spanner_->get_property ("style"),
+                         ly_symbol2scm ("none")))
             current_spanner_->set_property ("spanner-broken", SCM_BOOL_T);
         }
       else
         {
-          if (cresc_type != ly_symbol2scm ("hairpin"))
+          if (!scm_is_eq (cresc_type, ly_symbol2scm ("hairpin")))
             {
               string as_string = ly_scm_write_string (cresc_type);
               current_span_event_
@@ -208,12 +209,12 @@ Dynamic_engraver::stop_translation_timestep ()
   if (finished_spanner_ && !finished_spanner_->get_bound (RIGHT))
     finished_spanner_
     ->set_bound (RIGHT,
-                 Grob::unsmob (get_property ("currentMusicalColumn")));
+                 unsmob<Grob> (get_property ("currentMusicalColumn")));
 
   if (current_spanner_ && !current_spanner_->get_bound (LEFT))
     current_spanner_
     ->set_bound (LEFT,
-                 Grob::unsmob (get_property ("currentMusicalColumn")));
+                 unsmob<Grob> (get_property ("currentMusicalColumn")));
   script_ = 0;
   script_event_ = 0;
   accepted_spanevents_drul_.set (0, 0);
@@ -244,9 +245,9 @@ Dynamic_engraver::get_spanner_type (Stream_event *ev)
   string type;
   SCM start_sym = scm_car (ev->get_property ("class"));
 
-  if (start_sym == ly_symbol2scm ("decrescendo-event"))
+  if (scm_is_eq (start_sym, ly_symbol2scm ("decrescendo-event")))
     type = "decrescendo";
-  else if (start_sym == ly_symbol2scm ("crescendo-event"))
+  else if (scm_is_eq (start_sym, ly_symbol2scm ("crescendo-event")))
     type = "crescendo";
   else
     programming_error ("unknown dynamic spanner type");
@@ -266,7 +267,7 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info)
       */
       Grob *x_parent = (heads.size ()
                         ? info.grob ()
-                        : Grob::unsmob (info.grob ()->get_object ("rest")));
+                        : unsmob<Grob> (info.grob ()->get_object ("rest")));
       if (x_parent)
         script_->set_parent (x_parent, X_AXIS);
     }