X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fauto-beam-engraver.cc;h=7500ec9ef09bf9fb9af7dc4d272c2e8d2c0e3218;hb=48c0f8c8843785c20f84bd113c6dea1a0c95a70c;hp=cc756b7e21c2eec0991ba1b3c98cf53d6eb7884b;hpb=e8b68d8a878a0ee0381719230cf911dbcefa168d;p=lilypond.git diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index cc756b7e21..7500ec9ef0 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2014 Jan Nieuwenhuizen + Copyright (C) 1999--2015 Jan Nieuwenhuizen LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include "context-handle.hh" #include "duration.hh" #include "engraver.hh" +#include "grob-properties.hh" #include "item.hh" #include "rest.hh" #include "spanner.hh" @@ -152,6 +153,7 @@ Auto_beam_engraver::Auto_beam_engraver () process_acknowledged_count_ = 0; stems_ = 0; shortest_mom_ = Moment (Rational (1, 4)); + extend_mom_ = Moment (-1); finished_beam_ = 0; finished_grouping_ = 0; grouping_ = 0; @@ -168,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 @@ -240,7 +241,7 @@ Auto_beam_engraver::begin_beam () stems_ = new vector; grouping_ = new Beaming_pattern (); beaming_options_.from_context (context ()); - beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam")); + beam_settings_ = Grob_property_info (context (), ly_symbol2scm ("Beam")).updated (); beam_start_context_.set_context (context ()->get_parent_context ()); beam_start_moment_ = now_mom (); @@ -394,7 +395,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info) return; } - int durlog = Duration::unsmob (ev->get_property ("duration"))->duration_log (); + int durlog = unsmob (ev->get_property ("duration"))->duration_log (); if (durlog <= 2) { @@ -410,10 +411,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 (ev->get_property ("duration")); Moment dur = stem_duration->get_length (); - //Moment dur = Duration::unsmob (ev->get_property ("duration"))->get_length (); + //Moment dur = unsmob (ev->get_property ("duration"))->get_length (); Moment measure_now = measure_position (context ()); bool recheck_needed = false; @@ -436,7 +437,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);