]> git.donarmstrong.com Git - lilypond.git/blob - lily/slur-score-parameters.cc
Merge branch 'release/unstable'
[lilypond.git] / lily / slur-score-parameters.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2006--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6
7   LilyPond is free software: you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation, either version 3 of the License, or
10   (at your option) any later version.
11
12   LilyPond is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "slur-score-parameters.hh"
22 #include "grob.hh"
23
24 Real
25 get_detail (SCM alist, SCM sym)
26 {
27   SCM entry = scm_assq (sym, alist);
28   return robust_scm2double (scm_is_pair (entry)
29                             ? scm_cdr (entry)
30                             : SCM_EOL,
31                             0.0);
32 }
33
34 void
35 Slur_score_parameters::fill (Grob *me)
36 {
37   SCM details = me->get_property ("details");
38
39   region_size_
40     = (int) get_detail (details, ly_symbol2scm ("region-size"));
41   head_encompass_penalty_
42     = get_detail (details, ly_symbol2scm ("head-encompass-penalty"));
43   stem_encompass_penalty_
44     = get_detail (details, ly_symbol2scm ("stem-encompass-penalty"));
45   closeness_factor_
46     = get_detail (details, ly_symbol2scm ("closeness-factor"));
47   edge_attraction_factor_
48     = get_detail (details, ly_symbol2scm ("edge-attraction-factor"));
49   same_slope_penalty_
50     = get_detail (details, ly_symbol2scm ("same-slope-penalty"));
51   steeper_slope_factor_
52     = get_detail (details, ly_symbol2scm ("steeper-slope-factor"));
53   non_horizontal_penalty_
54     = get_detail (details, ly_symbol2scm ("non-horizontal-penalty"));
55   max_slope_
56     = get_detail (details, ly_symbol2scm ("max-slope"));
57   max_slope_factor_
58     = get_detail (details, ly_symbol2scm ("max-slope-factor"));
59   free_head_distance_
60     = get_detail (details, ly_symbol2scm ("free-head-distance"));
61   absolute_closeness_measure_
62     = get_detail (details, ly_symbol2scm ("absolute-closeness-measure"));
63   extra_object_collision_penalty_
64     = get_detail (details, ly_symbol2scm ("extra-object-collision-penalty"));
65   accidental_collision_
66     = get_detail (details, ly_symbol2scm ("accidental-collision"));
67   extra_encompass_free_distance_
68     = get_detail (details, ly_symbol2scm ("extra-encompass-free-distance"));
69   extra_encompass_collision_distance_
70     = get_detail (details, ly_symbol2scm ("extra-encompass-collision-distance"));
71   head_slur_distance_factor_
72     = get_detail (details, ly_symbol2scm ("head-slur-distance-factor"));
73   head_slur_distance_max_ratio_
74     = get_detail (details, ly_symbol2scm ("head-slur-distance-max-ratio"));
75   free_slur_distance_
76     = get_detail (details, ly_symbol2scm ("free-slur-distance"));
77   edge_slope_exponent_
78     = get_detail (details, ly_symbol2scm ("edge-slope-exponent"));
79   close_to_edge_length_
80     = get_detail (details, ly_symbol2scm ("close-to-edge-length"));
81 }