]> git.donarmstrong.com Git - lilypond.git/blob - lily/tie-specification.cc
Add more links to Developers resources
[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
23 void
24 Tie_specification::from_grob (Grob *tie)
25 {
26   tie_grob_ = tie;
27   if (scm_is_number (tie->get_property_data ("direction")))
28     {
29       manual_dir_ = to_dir (tie->get_property ("direction"));
30       has_manual_dir_ = true;
31     }
32   
33   position_ = Tie::get_position (tie);
34   SCM pos_scm = tie->get_property ("staff-position");
35   if (scm_is_number (pos_scm))
36     {
37       has_manual_delta_y_ = (scm_inexact_p (pos_scm) == SCM_BOOL_T);
38       manual_position_ = scm_to_double (tie->get_property ("staff-position"));
39       has_manual_position_ = true;
40     }
41 }
42
43 int
44 Tie_specification::column_span () const
45 {
46   return column_ranks_[RIGHT] - column_ranks_[LEFT];
47 }