2 axis-group-spanner.cc -- implement Axis_group_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "axis-group-spanner.hh"
13 /** Do stuff if we're not broken. In this case the last and first
14 columns usually are pre- and postbreak respectively,
15 so the items from these columns need adjusting.
18 Axis_group_spanner::do_break_processing_if_unbroken()
20 Link_array
<Score_elem
> elems
= elem_l_arr ();
21 Line_of_score
*my_line
= line_l();
22 for (int i
=0; i
< elems
.size(); i
++)
24 if (!elems
[i
]->line_l())
26 Item
* item_l
= elems
[i
]->item();
28 && item_l
->breakable_b_
29 && item_l
->break_status_i() == 0)
31 // last two checks are paranoia
32 Item
* broken_item_l
=
33 item_l
->find_prebroken_piece (my_line
);
34 add_element (broken_item_l
);
36 remove_element (elems
[i
]);
41 Axis_group_spanner::do_break_processing()
43 bool breaking_self_b
= ! Spanner::line_l();
46 do_break_processing_if_unbroken();
47 Spanner::do_break_processing();
52 Link_array
<Score_elem
> loose_elems
= elem_l_arr ();
55 for (int i
=0; i
< loose_elems
.size(); i
++)
57 Score_elem
* elt
= loose_elems
[i
];
58 Line_of_score
*elt_line
= elt
->line_l();
62 /* this piece doesn't know where it belongs.
63 Find out if it was broken, and use the broken remains
67 Spanner
* sp
= elt
->spanner();
69 for (int j
=0; j
< broken_into_l_arr_
.size(); j
++)
71 Axis_group_spanner
* my_broken_l
72 = (Axis_group_spanner
*)broken_into_l_arr_
[j
];
74 Spanner
* broken_span_l
75 = sp
->find_broken_piece (
76 ((Score_elem
*)my_broken_l
)->line_l());
79 my_broken_l
->add_element (broken_span_l
);
84 && elt
->item()->breakable_b_
85 && elt
->item()->break_status_i () == 0)
91 Item
* my_item
= elt
->item()->broken_to_drul_
[j
];
92 Line_of_score
* item_line_l
= my_item
->line_l() ;
96 Axis_group_spanner
* v
97 = (Axis_group_spanner
*)find_broken_piece (item_line_l
);
99 v
->add_element (my_item
);
101 while ((j
*=-1) != LEFT
);
106 /* this piece *does* know where it belongs.
107 Put it in appropriate piece of this spanner
109 Axis_group_spanner
* my_broken_l
110 = (Axis_group_spanner
*)find_broken_piece (elt
->line_l());
111 my_broken_l
->add_element (elt
);
115 Spanner::do_break_processing();
119 Axis_group_spanner::do_print() const
121 Axis_group_element::do_print();
126 IMPLEMENT_IS_TYPE_B2(Axis_group_spanner
, Spanner
, Axis_group_element
);