2 tie-column.cc -- implement Tie_column
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "tie-column.hh"
11 #include "group-interface.hh"
13 #include "directional-element-interface.hh"
14 #include "note-head.hh"
16 Tie_column::Tie_column (SCM s)
19 set_elt_pointer ("ties", SCM_EOL);
20 set_extent_callback (0, X_AXIS);
21 set_extent_callback (0, Y_AXIS);
22 set_elt_property ("transparent", SCM_BOOL_T);
26 Tie_column::add_tie (Tie *s)
28 Pointer_group_interface g (this, "ties");
31 set_bound (LEFT, s->head (LEFT));
32 set_bound (RIGHT, s->head (RIGHT));
35 Pointer_group_interface (this, "ties").add_element (s);
36 s->add_dependency (this);
41 tie_compare (Tie* const & s1,
44 return sign (s1->position_f () - s2->position_f());
51 In normal chord cases, the outer ties point outwards, and the
52 direction of the rest is determined by their staff position.
54 Ross forgets about the tie that is *on* the middle staff line. We
55 assume it goes UP. (TODO: make this settable) */
57 Tie_column::set_directions ()
60 Pointer_group_interface__extract_elements (this, (Tie*)0, "ties");
63 Direction d = directional_element (this).get ();
67 for (int i = s.size (); i--;)
68 directional_element (s[i]).set (d);
74 directional_element (s[0]).set (s[0]->get_default_dir ());
79 directional_element (s[0]).set (DOWN);
81 directional_element (s.pop ()).set (UP);
83 for (int i=s.size(); i--; )
85 Real p = s[i]->position_f ();
86 Direction d = (Direction) sign (p);
90 directional_element (s[i]).set (d);
96 Tie_column::after_line_breaking ()