2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
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.
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.
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/>.
21 #include "semi-tie-column.hh"
22 #include "semi-tie.hh"
23 #include "directional-element-interface.hh"
25 #include "paper-column.hh"
28 #include "staff-symbol-referencer.hh"
30 ADD_INTERFACE (Semi_tie,
31 "A tie which is only connected to a note head on one side."
33 "The following properties may be set in the @code{details}"
37 "@item height-limit\n"
38 "Maximum tie height: The longer the tie, the closer it is"
41 "Parameter for tie shape. The higher this number, the"
42 " quicker the tie attains its @code{height-limit}.\n"
54 MAKE_SCHEME_CALLBACK (Semi_tie, calc_control_points, 1)
56 Semi_tie::calc_control_points (SCM smob)
58 Grob *me = unsmob<Grob> (smob);
59 (void) me->get_property ("direction");
61 if (Semi_tie_column::has_interface (me->get_parent (Y_AXIS)))
63 me->get_parent (Y_AXIS)->get_property ("positioning-done");
67 programming_error ("lv tie without Semi_tie_column. Killing lv tie.");
71 return me->get_property_data ("control-points");
75 Semi_tie::get_column_rank (Item *me)
77 return Paper_column::get_rank (me->get_column ());
81 Semi_tie::get_position (Item *me)
83 return (int) rint (Staff_symbol_referencer::get_position (head (me)));
87 Semi_tie::less (Grob *const &s1,
90 return Tie::get_position_generic (s1) < Tie::get_position_generic (s2);
94 Semi_tie::head (Item *me)
96 return unsmob<Item> (me->get_object ("note-head"));
100 Semi_tie::head (Item *me, Direction d)
102 SCM head_dir = me->get_property ("head-direction");
103 return (is_direction (head_dir) && (to_dir (head_dir) == d)) ? head (me) : 0;