2 break.cc -- implement Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "paper-column.hh"
10 #include "break-algorithm.hh"
11 #include "paper-def.hh"
13 #include "line-of-score.hh"
14 #include "paper-score.hh"
15 #include "paper-column.hh"
16 #include "cpu-timer.hh"
17 #include "command-request.hh"
18 #include "simple-spacer.hh"
19 #include "group-interface.hh"
23 Break_algorithm::find_break_indices () const
25 Link_array<Score_element> all = pscore_l_->line_l_->column_l_arr ();
28 for (int i=0; i < all.size (); i++)
29 if (Item::breakable_b (all[i]))
33 while (retval.size () >2)
40 Link_array<Score_element>
41 Break_algorithm::find_breaks () const
43 Link_array<Score_element> all = pscore_l_->line_l_->column_l_arr ();
44 Link_array<Score_element> retval;
46 for (int i=0; i < all.size (); i++)
47 if (Item::breakable_b (all[i]))
51 while (retval.size () >2)
59 Break_algorithm::generate_spacing_problem (Link_array<Score_element> curline, Interval line) const
61 Simple_spacer * sp = new Simple_spacer;
62 Paper_def * d = pscore_l_->paper_l_;
63 sp->default_space_f_ = d->get_var ("loose_column_distance");
65 sp->indent_f_ = line[LEFT];
68 sort out how interfacing this should work;
75 sp->line_len_f_ = line.length ();
77 sp->add_columns (curline);
83 Break_algorithm::Break_algorithm ()
90 Break_algorithm::set_pscore (Paper_score*s)
93 linewidth_f_ = s->paper_l_->get_var("linewidth");
96 Array<Column_x_positions>
97 Break_algorithm::solve () const
99 Array<Column_x_positions> h= do_solve ();