X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreak.cc;h=f6c374dce5c88f3cdb745131398adb0190422ba3;hb=1cf3d59c1559fb9774c4c1c8cae155cfe54a927c;hp=cc5c6f92a420487135a4c47b9c07496b01f34129;hpb=1e95a0be01466d1c98644f7705c8e07e41cc645c;p=lilypond.git diff --git a/lily/break.cc b/lily/break.cc index cc5c6f92a4..f6c374dce5 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1996, 1997--1998 Han-Wen Nienhuys + (c) 1996, 1997--1998 Han-Wen Nienhuys */ #include "score-column.hh" @@ -11,7 +11,7 @@ #include "paper-def.hh" #include "spring-spacer.hh" #include "debug.hh" -#include "scoreline.hh" +#include "line-of-score.hh" #include "p-score.hh" #include "p-col.hh" #include "cpu-timer.hh" @@ -20,11 +20,14 @@ String Col_stats::str () const { - String s (count_i_); - s += _ (" lines"); - if (count_i_) - s += String (Real (cols_i_)/count_i_, _(", (with an average of %.1f columns)")); - + String s; + if (!count_i_) + s = _ ("0 lines"); + else if (count_i_ == 1) + s = _f ("1 line (of %.0f columns)", (Real)cols_i_/count_i_); + else + s = _f ("%d lines (with an average of %.1f columns)", + count_i_, (Real)cols_i_/count_i_); return s; } @@ -103,7 +106,7 @@ Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) Spring_spacer * sp= (Spring_spacer*) (*get_line_spacer) (); // ugh sp->paper_l_ = pscore_l_->paper_l_; - sp->add_column (curline[0], true, line.min ()); + sp->add_column (curline[0], true, line[LEFT]); for (int i=1; i< curline.size ()-1; i++) sp->add_column (curline[i]); @@ -153,7 +156,7 @@ void Break_algorithm::problem_OK () const { if (!pscore_l_->col_p_list_.size ()) - error (_("Score does not have any columns")); + error (_("score does not have any columns")); OK (); } @@ -169,18 +172,18 @@ Break_algorithm::OK () const #endif } -Array +Array Break_algorithm::solve () const { Cpu_timer timer; - Array h= do_solve (); + Array h= do_solve (); if (approx_stats_.count_i_) - *mlog << _ ("\n(Approximated: ") << approx_stats_.str () << ")\n"; + *mlog << '\n' << _f ("approximated: %s", approx_stats_.str ()) << endl; if (exact_stats_.count_i_) - *mlog << _ ("(Calculated exactly: ") << exact_stats_.str () << ")\n"; - *mlog << _ ("Time: ") << String (timer.read (), "%.2f") << _ (" seconds\n"); + *mlog << _f ("calculated exactly: %s", exact_stats_.str ()) << endl; + *mlog << _f ("time: %.2f seconds", timer.read ()) << endl; return h; }