2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2006--2012 Joe Neeman <joeneeman@gmail.com>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef PAGE_TURN_PAGE_BREAKING_HH
21 #define PAGE_TURN_PAGE_BREAKING_HH
23 #include "page-breaking.hh"
26 A dynamic programming solution to breaking pages
28 class Page_turn_page_breaking: public Page_breaking
33 Page_turn_page_breaking (Paper_book *pb);
34 virtual ~Page_turn_page_breaking ();
40 int first_page_number_;
43 /* true if every score here is too widely spaced */
47 vsize break_pos_; /* index into breaks_ */
50 vector<vsize> system_count_; /* systems per page */
54 prev_ = break_pos_ = VPOS;
55 demerits_ = infinity_f;
56 first_page_number_ = 0;
58 too_many_lines_ = false;
62 vector<Break_node> state_;
64 vsize total_page_count (Break_node const &b);
65 Break_node put_systems_on_pages (vsize start,
70 SCM make_lines (vector<Break_node> *breaks);
71 SCM make_pages (vector<Break_node> const &breaks, SCM systems);
73 void calc_subproblem (vsize i);
74 void print_break_node (Break_node const &b);
76 #endif /* PAGE_TURN_PAGE_BREAKING_HH */