2 g-script-column.cc -- implement Script_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "script-column.hh"
10 #include "staff-side.hh"
11 #include "dimension-cache.hh"
15 Script_column::add_staff_sided (Item *i)
17 SCM p = i->get_elt_property ("script-priority");
18 if (p == SCM_UNDEFINED)
21 staff_sided_item_l_arr_.push (i);
26 staff_side_compare (Item * const &i1,
29 SCM p1 = i1->get_elt_property ("script-priority");
30 SCM p2 = i2->get_elt_property ("script-priority");
32 return gh_scm2int (p1) - gh_scm2int (p2);
36 Script_column::do_pre_processing ()
38 Drul_array<Link_array<Item> > arrs;
40 for (int i=0; i < staff_sided_item_l_arr_.size (); i++)
42 Side_position_interface st (staff_sided_item_l_arr_[i]);
43 arrs[st.get_direction ()].push (staff_sided_item_l_arr_[i]);
48 Link_array<Item> &arr(arrs[d]);
50 arr.sort (staff_side_compare);
53 for (int i=0; i < arr.size (); i++)
55 Side_position_interface s (arr[i]);
61 arr[i]->remove_elt_property ("script-priority");
65 } while (flip (&d) != DOWN);