1 #include "tie-formatting-problem.hh"
7 #include "libc-extension.hh"
8 #include "tie-specification.hh"
10 Tie_specification::Tie_specification ()
13 has_manual_position_ = false;
14 has_manual_dir_ = false;
15 has_manual_delta_y_ = false;
20 = note_head_drul_[RIGHT] = 0;
22 = column_ranks_[LEFT] = 0;
26 Tie_specification::from_grob (Grob *tie)
28 // In this method, Tie and Semi_tie require the same logic with different
29 // types. It might be clearer to use a template.
31 if (scm_is_number (tie->get_property_data ("direction")))
33 manual_dir_ = to_dir (tie->get_property ("direction"));
34 has_manual_dir_ = true;
37 if (Spanner *spanner = dynamic_cast<Spanner *> (tie))
38 position_ = Tie::get_position (spanner);
39 else if (Item *item = dynamic_cast<Item *> (tie))
40 position_ = Semi_tie::get_position (item);
43 programming_error ("grob is neither a tie nor a semi-tie");
47 SCM pos_scm = tie->get_property ("staff-position");
48 if (scm_is_number (pos_scm))
50 has_manual_delta_y_ = !ly_is_rational (pos_scm);
51 manual_position_ = scm_to_double (tie->get_property ("staff-position"));
52 has_manual_position_ = true;
57 Tie_specification::column_span () const
59 return column_ranks_[RIGHT] - column_ranks_[LEFT];