X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbeaming-pattern.cc;h=b823d2ecdaafb7e1c84d8a1c291601c993fb80cd;hb=4a03918c90866800b208ad12ffc019f577c8ab83;hp=3659525f115eb91c6e2b86973876cb1889c53469;hpb=a6bd229f7fe1dc4a03478e14ccc0c0c66b225061;p=lilypond.git diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc index 3659525f11..b823d2ecda 100644 --- a/lily/beaming-pattern.cc +++ b/lily/beaming-pattern.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2010 Han-Wen Nienhuys + Copyright (C) 1999--2011 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ */ #include "context.hh" -#include "beam-settings.hh" #include "beaming-pattern.hh" /* @@ -174,10 +173,10 @@ Beaming_pattern::find_rhythmic_importance (Beaming_options const &options) if (infos_[i].start_moment_ == measure_pos) infos_[i].rhythmic_importance_ = -2; - // Mark the start of each beat up to the end of this beat group. - for (int beat = 1; beat <= count; beat++) + // Mark the start of each unit up to the end of this beat group. + for (int unit = 1; unit <= count; unit++) { - Moment next_measure_pos = measure_pos + options.beat_length_; + Moment next_measure_pos = measure_pos + options.base_moment_; while (i < infos_.size () && infos_[i].start_moment_ < next_measure_pos) { @@ -190,7 +189,7 @@ Beaming_pattern::find_rhythmic_importance (Beaming_options const &options) // in an 8th-note triplet with a quarter-note beat, 1/3 of a beat should be // more important than 1/2. if (infos_[i].rhythmic_importance_ >= 0) - infos_[i].rhythmic_importance_ = (dt / options.beat_length_).den (); + infos_[i].rhythmic_importance_ = (int) (dt / options.base_moment_).den (); i++; } @@ -293,10 +292,12 @@ Beaming_pattern::split_pattern (int i) void Beaming_options::from_context (Context *context) { - grouping_ = ly_beat_grouping (context->self_scm ()); + grouping_ = context->get_property ("beatStructure"); subdivide_beams_ = to_boolean (context->get_property ("subdivideBeams")); - beat_length_ = robust_scm2moment (context->get_property ("beatLength"), Moment (1, 4)); - measure_length_ = robust_scm2moment (context->get_property ("measureLength"), Moment (4, 4)); + base_moment_ = robust_scm2moment (context->get_property ("baseMoment"), + Moment (1, 4)); + measure_length_ = robust_scm2moment (context->get_property ("measureLength"), + Moment (4, 4)); } Beaming_options::Beaming_options ()