]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/page-spacing.hh
Merge branch 'lilypond/translation'
[lilypond.git] / lily / include / page-spacing.hh
index bf8a7e1826c3f8a3e2e06f9b2d27874a7fbf1650..f57060a647cde67ec15f6eb39e2cfceb16d210d8 100644 (file)
@@ -1,10 +1,20 @@
 /*
-  page-spacing.hh -- routines for spacing systems
-  vertically across pages
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2006--2010 Joe Neeman <joeneeman@gmail.com>
 
-  (c) 2006--2009 Joe Neeman <joeneeman@gmail.com>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef PAGE_SPACING_HH
@@ -43,6 +53,7 @@ class Page_spacer
 public:
   Page_spacer (vector<Line_details> const &lines, vsize first_page_num, Page_breaking const*);
   Page_spacing_result solve (vsize page_count);
+  Page_spacing_result solve ();
 
 private:
   struct Page_spacing_node
@@ -54,19 +65,27 @@ private:
       penalty_ = infinity_f;
       prev_ = VPOS;
       system_count_status_ = SYSTEM_COUNT_OK;
+      page_ = 0;
     }
 
     Real demerits_;
     Real force_;
     Real penalty_;
     vsize prev_;
+    vsize page_;
     int system_count_status_;
   };
 
   Page_breaking const *breaker_;
   vsize first_page_num_;
   vector<Line_details> lines_;
+
+  // If a page-count is requested, we use state_, which
+  // is indexed by page*system, for our dynamic programming
+  // intermediate storage.  Otherwise, we use simple_state_,
+  // which is indexed only by system.
   Matrix<Page_spacing_node> state_;
+  vector<Page_spacing_node> simple_state_;
   vsize max_page_count_;
 
   bool ragged_;