X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fslur-scoring.cc;h=1ad831789e4ffbf07fab57f961e2ade2895cb21d;hb=0a0da41d935f7744e7ffd934034f25c40d4c59be;hp=85c06bf95ac6c9a51cdcad1e5cf28a63cc418e50;hpb=883e317d51c5e50011bc0e764a785631e5ea8689;p=lilypond.git diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 85c06bf95a..1ad831789e 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -1,10 +1,21 @@ /* - slur-scoring.cc -- Score based slur formatting + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter - - (c) 1996--2006 Han-Wen Nienhuys + Copyright (C) 1996--2009 Han-Wen Nienhuys Jan Nieuwenhuizen + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ @@ -116,7 +127,7 @@ Slur_score_state::get_encompass_info (Grob *col) const { ei.stem_ = stem->extent (common_[Y_AXIS], Y_AXIS)[dir_]; if (Grob *b = Stem::get_beam (stem)) - ei.stem_ += stem_dir * 0.5 * Beam::get_thickness (b); + ei.stem_ += stem_dir * 0.5 * Beam::get_beam_thickness (b); Interval x = stem->extent (common_[X_AXIS], X_AXIS); ei.x_ = x.is_empty () @@ -273,7 +284,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 +373,7 @@ Slur_score_state::get_best_curve () } slur_->set_property ("quant-score", - scm_makfrom0str (total.c_str ())); + ly_string2scm (total)); } #endif @@ -621,7 +632,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 +794,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 alt = g->get_property ("alteration"); + Rational alt = ly_scm2rational (g->get_property ("alteration")); SCM scm_style = g->get_property ("style"); if (!scm_is_symbol (scm_style) - && !parens + && !to_boolean (g->get_property ("parenthesized")) && !to_boolean (g->get_property ("restore-first"))) { /* End copy accidental.cc */ - switch (scm_to_int (alt)) - { - 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_; } }