]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/line-of-score.cc
release: 1.2.9
[lilypond.git] / lily / line-of-score.cc
index ec786d7815cb2f4797bc5b14ceaab285b6cf84fd..b648ea10c5822d970c494206671ddf54b9ff2e00 100644 (file)
@@ -9,13 +9,13 @@
 #include "line-of-score.hh"
 #include "paper-def.hh"
 #include "paper-outputter.hh"
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
 #include "warn.hh"
 
 Line_of_score::Line_of_score()
 {
-  set_axes (Y_AXIS,Y_AXIS);
+  set_axes (Y_AXIS,X_AXIS);
 }
 
 bool
@@ -26,14 +26,15 @@ Line_of_score::contains_b (Paper_column const* c) const
 
 // const?
 Line_of_score*
-Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
+Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) 
 {
-  const Link_array<Paper_column> &curline (breaking[j].cols);
-  const Array<Real> &config (breaking[j].config);
+  const Link_array<Paper_column> &curline (breaking[j].cols_);
+  const Array<Real> &config (breaking[j].config_);
   Line_of_score *line_l=0;
 
   line_l = dynamic_cast <Line_of_score*> (clone());
-
+  line_l->rank_i_ = j;
+  
   line_l->cols_ = curline;
   line_l->set_bounds(LEFT,curline[0]);
   line_l->set_bounds(RIGHT,curline.top());
@@ -41,16 +42,10 @@ Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) c
   for (int i=0; i < curline.size(); i++)
     {
       curline[i]->translate_axis (config[i],X_AXIS);
-      curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
+      curline[i]->line_l_ = dynamic_cast<Line_of_score*> (line_l);
     }
 
-  Breaking_information b;
-  b.bounds_ = line_l->spanned_drul_;
-  b.broken_spanner_l_ = line_l;
-  b.line_l_ = line_l;
-  
-  broken_info_.push (b);
-
+  broken_into_l_arr_.push (line_l);
   return line_l;
 }
 
@@ -58,6 +53,7 @@ void
 Line_of_score::add_column (Paper_column*p)
 {
   cols_.push (p);
+  add_element (p);
 }
 
 void
@@ -88,7 +84,7 @@ Line_of_score::output_all (bool last_line)
 {
   Interval i(extent(Y_AXIS));
   if (i.empty_b())
-    warning ("Huh? Empty Line_of_score?");
+    warning (_ ("Huh?  Empty Line_of_score?"));
   else
     translate_axis (- i[MAX], Y_AXIS);
   
@@ -99,3 +95,9 @@ Line_of_score::output_all (bool last_line)
   else
     pscore_l_->outputter_l_->stop_line ();
 }
+
+int
+Line_of_score::compare (Line_of_score* const &p1,Line_of_score* const &p2)
+{
+  return p1->rank_i_ - p2->rank_i_;
+}