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--2009 Joe Neeman <joeneeman@gmail.com>
11 #ifndef PAGE_TURN_PAGE_BREAKING_HH
12 #define PAGE_TURN_PAGE_BREAKING_HH
14 #include "page-breaking.hh"
17 A dynamic programming solution to breaking pages
19 class Page_turn_page_breaking: public Page_breaking
24 Page_turn_page_breaking (Paper_book *pb);
25 virtual ~Page_turn_page_breaking ();
31 int first_page_number_;
34 /* true if every score here is too widely spaced */
38 vsize break_pos_; /* index into breaks_ */
41 vector<vsize> system_count_; /* systems per page */
45 prev_ = break_pos_ = VPOS;
46 demerits_ = infinity_f;
47 first_page_number_ = 0;
49 too_many_lines_ = false;
53 vector<Break_node> state_;
55 vsize total_page_count (Break_node const &b);
56 Break_node put_systems_on_pages (vsize start,
61 SCM make_lines (vector<Break_node> *breaks);
62 SCM make_pages (vector<Break_node> const &breaks, SCM systems);
64 void calc_subproblem (vsize i);
65 void print_break_node (Break_node const &b);
67 #endif /* PAGE_TURN_PAGE_BREAKING_HH */