]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/auto-beam-engraver.cc
s/appogiatura/appoggiatura/.
[lilypond.git] / lily / auto-beam-engraver.cc
index d9a3dd8ff62e5d45483af0a5819924338b35a388..68c61d97a8f011dd9d2ae7152a6b59c619671857 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2014 Jan Nieuwenhuizen <janneke@gnu.org>
+  Copyright (C) 1999--2015 Jan Nieuwenhuizen <janneke@gnu.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
@@ -170,12 +170,11 @@ Auto_beam_engraver::listen_beam_forbid (Stream_event *ev)
 bool
 Auto_beam_engraver::test_moment (Direction dir, Moment test_mom, Moment dur)
 {
-  return scm_call_4 (get_property ("autoBeamCheck"),
-                     context ()->self_scm (),
-                     scm_from_int (dir),
-                     test_mom.smobbed_copy (),
-                     dur.smobbed_copy ())
-         != SCM_BOOL_F;
+  return scm_is_true (scm_call_4 (get_property ("autoBeamCheck"),
+                                    context ()->self_scm (),
+                                    scm_from_int (dir),
+                                    test_mom.smobbed_copy (),
+                                    dur.smobbed_copy ()));
 }
 
 void
@@ -224,8 +223,7 @@ Auto_beam_engraver::create_beam ()
     Beam::add_stem (beam, (*stems_)[i]);
 
   Grob_info i = make_grob_info (beam, (*stems_)[0]->self_scm ());
-  i.rerouting_daddy_context_ = beam_start_context_.get_context ();
-  announce_grob (i);
+  announce_grob (i, beam_start_context_.get_context ());
 
   return beam;
 }
@@ -284,9 +282,8 @@ Auto_beam_engraver::end_beam ()
       if (finished_beam_)
         {
           Grob_info i = make_grob_info (finished_beam_, SCM_EOL);
-          i.rerouting_daddy_context_ = beam_start_context_.get_context ();
 
-          announce_end_grob (i);
+          announce_end_grob (i, beam_start_context_.get_context ());
           finished_grouping_ = grouping_;
           finished_beaming_options_ = beaming_options_;
         }
@@ -396,7 +393,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info)
       return;
     }
 
-  int durlog = Duration::unsmob (ev->get_property ("duration"))->duration_log ();
+  int durlog = unsmob<Duration> (ev->get_property ("duration"))->duration_log ();
 
   if (durlog <= 2)
     {
@@ -412,10 +409,10 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info)
   if (!is_same_grace_state (beam_start_location_, now))
     return;
 
-  Duration *stem_duration = Duration::unsmob (ev->get_property ("duration"));
+  Duration *stem_duration = unsmob<Duration> (ev->get_property ("duration"));
   Moment dur = stem_duration->get_length ();
 
-  //Moment dur = Duration::unsmob (ev->get_property ("duration"))->get_length ();
+  //Moment dur = unsmob<Duration> (ev->get_property ("duration"))->get_length ();
   Moment measure_now = measure_position (context ());
   bool recheck_needed = false;
 
@@ -438,7 +435,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info)
                        durlog - 2,
                        Stem::is_invisible (stem),
                        stem_duration->factor (),
-                       (stem->get_property ("tuplet-start") == SCM_BOOL_T));
+                       (to_boolean (stem->get_property ("tuplet-start"))));
   stems_->push_back (stem);
   last_add_mom_ = now;
   extend_mom_ = max (extend_mom_, now) + get_event_length (ev, now);
@@ -577,6 +574,7 @@ ADD_TRANSLATOR (Auto_beam_engraver,
 class Grace_auto_beam_engraver : public Auto_beam_engraver
 {
   TRANSLATOR_DECLARATIONS (Grace_auto_beam_engraver);
+  TRANSLATOR_INHERIT (Auto_beam_engraver)
   DECLARE_TRANSLATOR_LISTENER (beam_forbid);
 
 private: