]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/auto-beam-engraver.cc
* lily/parser.yy (relative_music): start at middle C without pitch
[lilypond.git] / lily / auto-beam-engraver.cc
index df4fb7495b7a500267ae7bd530430afd76c51b9a..fda74a0cf00e8c05c92458a042aa78ae6bcb11c6 100644 (file)
 #include "duration.hh"
 #include "context.hh"
 
-/*
-  TODO: documentme.
- */
 class Auto_beam_engraver : public Engraver
 {
-  TRANSLATOR_DECLARATIONS(Auto_beam_engraver);
+  TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
 protected:
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
@@ -78,7 +75,7 @@ private:
 void
 Auto_beam_engraver::process_music ()
 {
-  if (gh_string_p (get_property ("whichBar")))
+  if (ly_c_string_p (get_property ("whichBar")))
     {
       consider_end (shortest_mom_);
       junk_beam ();
@@ -144,7 +141,7 @@ Auto_beam_engraver::try_music (Music*m)
 bool
 Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
 {
-  Moment now = now_mom();
+  Moment now = now_mom ();
   if (dir == START
       && now.grace_part_)
     {
@@ -188,23 +185,23 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
     }
 
   /* second guess: property generic time exception */
-  SCM m = scm_assoc (gh_append3 (function, wild, time), settings);
+  SCM m = scm_assoc (ly_append3 (function, wild, time), settings);
   
   if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
     moment = * unsmob_moment (ly_cdr (m));
 
   /* third guess: property time exception, specific for duration type */
-  m = scm_assoc (gh_append3 (function, type, time), settings);
+  m = scm_assoc (ly_append3 (function, type, time), settings);
   if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
     moment = * unsmob_moment (ly_cdr (m));
 
   /* fourth guess [user override]: property plain generic */
-  m = scm_assoc (gh_append3 (function, wild, wild), settings);
+  m = scm_assoc (ly_append3 (function, wild, wild), settings);
   if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
     moment = * unsmob_moment (ly_cdr (m));
 
   /* fifth guess [user override]: property plain, specific for duration type */
-  m = scm_assoc (gh_append3 (function, type, wild), settings);
+  m = scm_assoc (ly_append3 (function, type, wild), settings);
   if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
     moment = * unsmob_moment (ly_cdr (m));
   
@@ -284,7 +281,7 @@ Auto_beam_engraver::create_beam ()
       Beam::add_stem (beam, (*stems_)[i]);
     }
   
-  announce_grob(beam, SCM_EOL);
+  announce_grob (beam, (*stems_)[0]->self_scm ());
 
   return beam;
 }
@@ -300,11 +297,11 @@ Auto_beam_engraver::begin_beam ()
   
   stems_ = new Link_array<Item>;
   grouping_ = new Beaming_info_list;
-  beam_settings_ = updated_grob_properties (daddy_context_, ly_symbol2scm ("Beam"));
+  beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
   
   beam_start_moment_ = now_mom ();
   beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
-  subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams"));
+  subdivide_beams_ = ly_scm2bool (get_property ("subdivideBeams"));
   beat_length_ = *unsmob_moment (get_property ("beatLength"));
 }
 
@@ -349,9 +346,8 @@ Auto_beam_engraver::typeset_beam ()
 {
   if (finished_beam_)
     {
-      finished_grouping_->beamify(beat_length_, subdivide_beams_);
+      finished_grouping_->beamify (beat_length_, subdivide_beams_);
       Beam::set_beaming (finished_beam_, finished_grouping_);
-      typeset_grob (finished_beam_);
       finished_beam_ = 0;
     
       delete finished_grouping_;
@@ -529,8 +525,8 @@ ENTER_DESCRIPTION (Auto_beam_engraver,
 /* descr */       "Generate beams based on measure characteristics and observed "
 "Stems.  Uses beatLength, measureLength and measurePosition to decide "
 "when to start and stop a beam.  Overriding beaming is done through "
-"@ref{Stem_engraver} properties stemLeftBeamCount and "
-"stemRightBeamCount. "
+"@ref{Stem_engraver} properties @code{stemLeftBeamCount} and "
+"@code{stemRightBeamCount}. "
 ,
 /* creats*/       "Beam",
 /* accepts */     "beam-forbid-event",