source file of the GNU LilyPond music typesetter
- (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "beaming-pattern.hh"
}
+void
+Beam_rhythmic_element::de_grace ()
+{
+ if (start_moment_.grace_part_)
+ {
+ start_moment_.main_part_ = start_moment_.grace_part_;
+ start_moment_.grace_part_ = 0;
+ }
+}
+
int
count_factor_twos (int x)
{
return min (thisbeam.beam_count_drul_[-d], next.beam_count_drul_[d]);
}
+void
+Beaming_pattern::de_grace ()
+{
+ for (vsize i = 0; i < infos_.size (); i ++)
+ {
+ infos_[i].de_grace ();
+ }
+}
+
void
Beaming_pattern::beamify (Context *context)
{
if (infos_.size () <= 1)
return;
+
+ if (infos_[0].start_moment_.grace_part_)
+ de_grace ();
bool subdivide_beams = to_boolean (context->get_property ("subdivideBeams"));
Moment beat_length = robust_scm2moment (context->get_property ("beatLength"), Moment (1, 4));
vsize k = 0;
for (vsize i = 0; i < infos_.size(); i++)
{
- while (j < group_starts.size() - 1
+ while (j + 1 < group_starts.size()
&& group_starts[j+1] <= infos_[i].start_moment_)
j++;
infos_[i].group_start_ = group_starts[j];
infos_[i].beat_length_ = beat_length;
- while (k < beat_starts.size() - 1
+ while (k + 1 < beat_starts.size()
&& beat_starts[k+1] <= infos_[i].start_moment_)
k++;