X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbeaming-pattern.cc;h=3659525f115eb91c6e2b86973876cb1889c53469;hb=a1c2a3a778efafbb8abbd44eb212a3f52f34c5f9;hp=ab89bc386e90b05fceb8c184b0f7257fb4b7c6df;hpb=b7a0cffbf9d1069860368f289a5b50e9d1d90ba8;p=lilypond.git diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc index ab89bc386e..3659525f11 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--2009 Han-Wen Nienhuys + Copyright (C) 1999--2010 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 @@ -245,6 +245,51 @@ Beaming_pattern::beamlet_count (int i, Direction d) const return infos_.at (i).beam_count_drul_[d]; } +Moment +Beaming_pattern::start_moment (int i) const +{ + return infos_.at (i).start_moment_; +} + +Moment +Beaming_pattern::end_moment (int i) const +{ + Duration *dur = new Duration (2 + max (beamlet_count (i, LEFT), + beamlet_count (i, RIGHT)), + 0); + + return infos_.at (i).start_moment_ + dur->get_length(); +} + +bool +Beaming_pattern::invisibility (int i) const +{ + return infos_.at (i).invisible_; +} + +/* + Split a beamin pattern at index i and return a new + Beaming_pattern containing the removed elements +*/ +Beaming_pattern * +Beaming_pattern::split_pattern (int i) +{ + Beaming_pattern* new_pattern=0; + int count; + + new_pattern = new Beaming_pattern (); + for (vsize j=i+1; jadd_stem (start_moment (j), + count, + invisibility (j)); + } + for (vsize j=i+1; j