source file of the GNU LilyPond music typesetter
- (c) 1996--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1996--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
junk_pointers (configurations_);
}
-Real
-broken_trend_y (Slur_score_state const &state, Direction hdir)
-{
- /* A broken slur should maintain the same vertical trend
- the unbroken slur would have had. */
- Real by = 0.0;
- if (Spanner *mother = dynamic_cast<Spanner *> (state.slur_->original ()))
- {
- Grob *neighbor = mother->broken_neighbor (hdir);
- if (!neighbor)
- return by;
-
-
- Spanner *common_mother
- = dynamic_cast<Spanner *> (state.common_[Y_AXIS]->original ());
- int common_k
- = broken_spanner_index (dynamic_cast<Spanner *> (state.common_[Y_AXIS]));
- int common_j = common_k + hdir;
-
- if (common_j < 0 || vsize (common_j) >= common_mother->broken_intos_.size ())
- return by;
-
- Grob *common_next_system = common_mother->broken_intos_[common_j];
-
- SCM last_point = scm_car (scm_last_pair (neighbor->get_property ("control-points")));
-
- return scm_to_double (scm_cdr (last_point))
- + neighbor->relative_coordinate (common_next_system, Y_AXIS);
- }
- return by;
-}
-
/*
copy slur dir forwards across line break.
*/
}
-MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_control_points, 1)
SCM
Slur::calc_control_points (SCM smob)
{
}
slur_->set_property ("quant-score",
- scm_makfrom0str (total.c_str ()));
+ ly_string2scm (total));
}
#endif
if (!xe.is_empty ()
&& !ye.is_empty ())
- avoid.push_back (Offset (xe.center(), ye[dir_]));
+ avoid.push_back (Offset (xe.center (), ye[dir_]));
}
}
return avoid;
if (Accidental_interface::has_interface (g))
{
penalty = parameters_.accidental_collision_;
- /* Begin copy accidental.cc */
- bool parens = false;
- if (to_boolean (g->get_property ("cautionary")))
- {
- SCM cstyle = g->get_property ("cautionary-style");
- parens = ly_is_equal (cstyle, ly_symbol2scm ("parentheses"));
- }
- SCM accs = g->get_property ("accidentals");
+ Rational alt = ly_scm2rational (g->get_property ("alteration"));
SCM scm_style = g->get_property ("style");
if (!scm_is_symbol (scm_style)
- && !parens
- && scm_ilength (accs) == 1)
+ && !to_boolean (g->get_property ("parenthesized"))
+ && !to_boolean (g->get_property ("restore-first")))
{
/* End copy accidental.cc */
- switch (scm_to_int (scm_car (accs)))
- {
- case FLAT:
- case DOUBLE_FLAT:
- xp = LEFT;
- break;
- case SHARP:
- xp = 0.5 * dir_;
- break;
- case NATURAL:
- xp = -dir_;
- break;
- }
+ if (alt == FLAT_ALTERATION
+ || alt == DOUBLE_FLAT_ALTERATION)
+ xp = LEFT;
+ else if (alt == SHARP_ALTERATION)
+ xp = 0.5 * dir_;
+ else if (alt == NATURAL_ALTERATION)
+ xp = -dir_;
}
}