2 page-turn-page-breaking.hh -- break lines and pages optimally
3 for a whole Paper_book such that page turns can only occur
6 source file of the GNU LilyPond music typesetter
8 (c) 2006 Joe Neeman <joeneeman@gmail.com>
11 #ifndef PAGE_TURN_PAGE_BREAKING_HH
12 #define PAGE_TURN_PAGE_BREAKING_HH
14 #include "constrained-breaking.hh"
15 #include "page-breaking.hh"
16 #include "lily-guile.hh"
19 A dynamic programming solution to breaking pages
21 class Page_turn_page_breaking: public Page_breaking
26 Page_turn_page_breaking (Paper_book *pb);
27 virtual ~Page_turn_page_breaking ();
33 int first_page_number_;
36 /* true if every score here is too widely spaced */
40 vsize break_pos_; /* index into breaks_ */
43 vector<vsize> system_count_; /* systems per page */
47 prev_ = break_pos_ = VPOS;
48 demerits_ = infinity_f;
49 first_page_number_ = 0;
51 too_many_lines_ = false;
55 vector<Break_node> state_;
57 vsize final_page_num (Break_node const &b);
58 Break_node put_systems_on_pages (vsize start,
60 vector<Line_details> const &lines,
61 Line_division const &div,
64 SCM make_lines (vector<Break_node> *breaks);
65 SCM make_pages (vector<Break_node> const &breaks, SCM systems);
67 void calc_subproblem (vsize i);
69 #endif /* PAGE_TURN_PAGE_BREAKING_HH */