]> git.donarmstrong.com Git - lilypond.git/blob - lily/tie-specification.cc
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / lily / tie-specification.cc
1 #include "tie-formatting-problem.hh"
2 #include "grob.hh"
3 #include "tie.hh"
4 #include "libc-extension.hh"
5 #include "tie-specification.hh"
6
7 Tie_specification::Tie_specification ()
8 {
9   tie_grob_ = 0;
10   has_manual_position_ = false;
11   has_manual_dir_ = false;
12   has_manual_delta_y_ = false;
13   position_ = 0;
14   manual_position_ = 0;
15   manual_dir_ = CENTER;
16   note_head_drul_[LEFT]
17     = note_head_drul_[RIGHT] = 0;
18   column_ranks_[RIGHT]
19     = column_ranks_[LEFT] = 0;
20 }
21
22 void
23 Tie_specification::from_grob (Grob *tie)
24 {
25   tie_grob_ = tie;
26   if (scm_is_number (tie->get_property_data ("direction")))
27     {
28       manual_dir_ = to_dir (tie->get_property ("direction"));
29       has_manual_dir_ = true;
30     }
31
32   position_ = Tie::get_position (tie);
33   SCM pos_scm = tie->get_property ("staff-position");
34   if (scm_is_number (pos_scm))
35     {
36       has_manual_delta_y_ = (scm_inexact_p (pos_scm) == SCM_BOOL_T);
37       manual_position_ = scm_to_double (tie->get_property ("staff-position"));
38       has_manual_position_ = true;
39     }
40 }
41
42 int
43 Tie_specification::column_span () const
44 {
45   return column_ranks_[RIGHT] - column_ranks_[LEFT];
46 }