X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fslur-scoring.cc;h=1973102650a063d3cefdc9cd9b7e14896abee52e;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=bbd257f932bc1254ba3b0e630dea3d727d3e073e;hpb=752f53e6c616f12ff92a6628d8cf5c9149528887;p=lilypond.git diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index bbd257f932..1973102650 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1996--2006 Han-Wen Nienhuys + (c) 1996--2008 Han-Wen Nienhuys Jan Nieuwenhuizen */ @@ -273,7 +273,7 @@ Slur_score_state::fill (Grob *me) } -MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1) +MAKE_SCHEME_CALLBACK (Slur, calc_control_points, 1) SCM Slur::calc_control_points (SCM smob) { @@ -362,7 +362,7 @@ Slur_score_state::get_best_curve () } slur_->set_property ("quant-score", - scm_makfrom0str (total.c_str ())); + ly_string2scm (total)); } #endif @@ -621,7 +621,7 @@ Slur_score_state::generate_avoid_offsets () const 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; @@ -783,34 +783,21 @@ Slur_score_state::get_extra_encompass_infos () const 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_; } }