]> git.donarmstrong.com Git - lilypond.git/blob - lily/slur-score-parameters.cc
Web-ja: update introduction
[lilypond.git] / lily / slur-score-parameters.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2006--2015 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   edge_attraction_factor_
46     = get_detail (details, ly_symbol2scm ("edge-attraction-factor"));
47   same_slope_penalty_
48     = get_detail (details, ly_symbol2scm ("same-slope-penalty"));
49   steeper_slope_factor_
50     = get_detail (details, ly_symbol2scm ("steeper-slope-factor"));
51   non_horizontal_penalty_
52     = get_detail (details, ly_symbol2scm ("non-horizontal-penalty"));
53   max_slope_
54     = get_detail (details, ly_symbol2scm ("max-slope"));
55   max_slope_factor_
56     = get_detail (details, ly_symbol2scm ("max-slope-factor"));
57   free_head_distance_
58     = get_detail (details, ly_symbol2scm ("free-head-distance"));
59   gap_to_staffline_inside_
60     = get_detail (details, ly_symbol2scm ("gap-to-staffline-inside"));
61   gap_to_staffline_outside_
62     = get_detail (details, ly_symbol2scm ("gap-to-staffline-outside"));
63   absolute_closeness_measure_
64     = get_detail (details, ly_symbol2scm ("absolute-closeness-measure"));
65   extra_object_collision_penalty_
66     = get_detail (details, ly_symbol2scm ("extra-object-collision-penalty"));
67   accidental_collision_
68     = get_detail (details, ly_symbol2scm ("accidental-collision"));
69   extra_encompass_free_distance_
70     = get_detail (details, ly_symbol2scm ("extra-encompass-free-distance"));
71   extra_encompass_collision_distance_
72     = get_detail (details, ly_symbol2scm ("extra-encompass-collision-distance"));
73   head_slur_distance_factor_
74     = get_detail (details, ly_symbol2scm ("head-slur-distance-factor"));
75   head_slur_distance_max_ratio_
76     = get_detail (details, ly_symbol2scm ("head-slur-distance-max-ratio"));
77   free_slur_distance_
78     = get_detail (details, ly_symbol2scm ("free-slur-distance"));
79   edge_slope_exponent_
80     = get_detail (details, ly_symbol2scm ("edge-slope-exponent"));
81   close_to_edge_length_
82     = get_detail (details, ly_symbol2scm ("close-to-edge-length"));
83   encompass_object_range_overshoot_
84     = get_detail (details, ly_symbol2scm ("encompass-object-range-overshoot"));
85   slur_tie_extrema_min_distance_
86     = get_detail (details, ly_symbol2scm ("slur-tie-extrema-min-distance"));
87   slur_tie_extrema_min_distance_penalty_
88     = get_detail (details, ly_symbol2scm ("slur-tie-extrema-min-distance-penalty"));
89 }