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 ()
18 set_elt_property ("ties", SCM_EOL
);
21 set_elt_property ("transparent", SCM_BOOL_T
);
25 Tie_column::add_tie (Tie
*s
)
27 Group_interface
g (this, "ties");
30 set_bounds (LEFT
, s
->head (LEFT
));
31 set_bounds (RIGHT
, s
->head (RIGHT
));
34 group (this, "ties").add_element (s
);
35 s
->add_dependency (this);
40 tie_compare (Tie
* const & s1
,
43 return sign (s1
->position_f () - s2
->position_f());
50 In normal chord cases, the outer ties point outwards, and the
51 direction of the rest is determined by their staff position.
53 Ross forgets about the tie that is *on* the middle staff line. We
54 assume it goes UP. (TODO: make this settable) */
56 Tie_column::set_directions ()
59 Group_interface__extract_elements (this, (Tie
*)0, "ties");
62 Direction d
= directional_element (this).get ();
66 for (int i
= s
.size (); i
--;)
67 directional_element (s
[i
]).set (d
);
73 directional_element (s
[0]).set (s
[0]->get_default_dir ());
78 directional_element (s
[0]).set (DOWN
);
80 directional_element (s
.pop ()).set (UP
);
82 for (int i
=s
.size(); i
--; )
84 Real p
= s
[i
]->position_f ();
85 Direction d
= (Direction
) sign (p
);
89 directional_element (s
[i
]).set (d
);
95 Tie_column::do_post_processing ()