source file of the GNU LilyPond music typesetter
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
-
-
*/
-
-
#include <math.h>
#include "warn.hh"
Do stem computations. These depend on YL and YR linearly, so we can
precompute for every stem 2 factors.
*/
- Link_array<Grob> stems=
+ Link_array<Grob> stems =
Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
Array<Stem_info> stem_infos;
Array<Real> base_lengths;
Array<Real> stem_xposns;
- Drul_array<bool> dirs_found (0,0);
+ Drul_array<bool> dirs_found (0, 0);
Grob *common[2];
for (int a = 2; a--;)
common[a] = common_refpoint_of_array (stems, me, Axis (a));
stem_y != 0.0, when we're cross staff.
*/
- for (int i= 0; i < stems.size (); i++)
+ for (int i = 0; i < stems.size (); i++)
{
Grob*s = stems[i];
&& s != lvs && s != fvs;
base_lengths.push (calc_stem_y (me, s, common, xl, xr,
- Interval (0,0), f) / ss);
+ Interval (0, 0), f) / ss);
stem_xposns.push (s->relative_coordinate (common[X_AXIS], X_AXIS));
}
- bool xstaff= false;
+ bool xstaff = false;
if (lvs && fvs)
{
Grob *commony = fvs->common_refpoint (lvs, Y_AXIS);
Array<Quant_score> qscores;
- for (int l =0; l < quantsl.size (); l++)
- for (int r =0; r < quantsr.size (); r++)
+ for (int l = 0; l < quantsl.size (); l++)
+ for (int r = 0; r < quantsr.size (); r++)
{
Quant_score qs;
qs.yl = quantsl[l];
qscores[i].demerits += d;
#if DEBUG_QUANTING
- qscores[i].score_card_ += to_string ("S%.2f",d);
+ qscores[i].score_card_ += to_string ("S%.2f", d);
#endif
}
Real rad = Staff_symbol_referencer::staff_radius (me);
-
-
-
Drul_array<int> edge_beam_counts
(Stem::beam_multiplicity (stems[0]).length () + 1,
Stem::beam_multiplicity (stems.top ()).length () + 1);
if (qscores[i].demerits < reasonable_score)
{
Real d = score_forbidden_quants (qscores[i].yl, qscores[i].yr,
- rad, slt, thickness, beam_translation,
- edge_beam_counts, ldir, rdir);
+ rad, slt, thickness, beam_translation,
+ edge_beam_counts, ldir, rdir);
qscores[i].demerits += d;
#if DEBUG_QUANTING
for (int i = qscores.size (); i--;)
if (qscores[i].demerits < reasonable_score)
{
- Real d=score_stem_lengths (stems, stem_infos,
+ Real d = score_stem_lengths (stems, stem_infos,
base_lengths, stem_xposns,
xl, xr,
is_knee,
Real mindist = 1e6;
for (; i < qscores.size (); i ++)
{
- Real d =fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]);
+ Real d = fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]);
if (d < mindist)
{
best_idx = i;
- mindist= d;
+ mindist = d;
}
}
if (mindist > 1e5)
Drul_array<Real> score (0, 0);
Drul_array<int> count (0, 0);
- for (int i=0; i < stems.size (); i++)
+ for (int i = 0; i < stems.size (); i++)
{
Grob* s = stems[i];
if (Stem::is_invisible (s))
Direction ldir, Direction rdir)
{
Real dy = yr - yl;
- Drul_array<Real> y (yl,yr);
- Drul_array<Direction> dirs (ldir,rdir);
+ Drul_array<Real> y (yl, yr);
+ Drul_array<Direction> dirs (ldir, rdir);
Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]);
/*
The 2.2 factor is to provide a little leniency for
borderline cases. If we do 2.0, then the upper outer line
- will be in the gap of the (2,sit) quant, leading to a
+ will be in the gap of the (2, sit) quant, leading to a
false demerit.
*/
Real gap1 = y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2.2 );