]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/gourlay-breaking.cc
release: 1.5.4
[lilypond.git] / lily / gourlay-breaking.cc
index 696a0d88a66fb0d9657f87061a27372ba3408125..04112971d318513083b415e3f3373c949da1f243 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include <math.h>              // rint
 
@@ -54,7 +54,7 @@ Array<Column_x_positions>
 Gourlay_breaking::do_solve () const
 {
   Array<Break_node> optimal_paths;
-  Link_array<Paper_column> all =
+  Link_array<Grob> all =
     pscore_l_->line_l_->column_l_arr ();
   
   Array<int> breaks = find_break_indices ();
@@ -62,7 +62,6 @@ Gourlay_breaking::do_solve () const
   optimal_paths.set_size (breaks.size ());
 
   Break_node first_node ;
-  first_node.line_config_.energy_f_ = 0;  
   
   optimal_paths[0] = first_node; 
   int break_idx=1;
@@ -81,10 +80,10 @@ Gourlay_breaking::do_solve () const
 
       for (int start_idx = break_idx; start_idx--;)
        {
-         Link_array<Paper_column> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
+         Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
   
-         line[0]     = dynamic_cast<Paper_column*> (line[0]    ->find_prebroken_piece (RIGHT));
-         line.top () = dynamic_cast<Paper_column*> (line.top ()->find_prebroken_piece (LEFT));
+         line[0]     = dynamic_cast<Item*> (line[0])    ->find_prebroken_piece (RIGHT);
+         line.top () = dynamic_cast<Item*> (line.top ())->find_prebroken_piece (LEFT);
            
          Column_x_positions cp;
          cp.cols_ = line;
@@ -136,8 +135,8 @@ Gourlay_breaking::do_solve () const
     }
 
   /* do the last one */
-  if  (break_idx % HAPPY_DOTS_I)
-       progress_indication (String ("[") + to_str (break_idx) + "]");    
+  if (break_idx % HAPPY_DOTS_I)
+    progress_indication (String ("[") + to_str (break_idx) + "]");    
 
 
   progress_indication ("\n");
@@ -166,7 +165,6 @@ Gourlay_breaking::do_solve () const
 
 Gourlay_breaking::Gourlay_breaking ()
 {
-  energy_bound_f_ = infinity_f;
 }
 
 
@@ -179,10 +177,10 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
                                    Column_x_positions const &this_one) const
 {
   Real break_penalties = 0.0;
-  Paper_column * pc = this_one.cols_.top ();
+  Grob * pc = this_one.cols_.top ();
   if (pc->original_l_)
     {
-      SCM pen = pc->get_elt_property ("penalty");
+      SCM pen = pc->get_grob_property ("penalty");
       if (gh_number_p (pen))
        {
          break_penalties += gh_scm2double (pen);