From 4d72fbd4dfaee89256f8b84e5eeb15b280c6a510 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:44:52 +0000 Subject: [PATCH] lilypond-0.0.66 --- lily/.version | 2 +- lily/p-score.cc | 38 ++++++++++++++++++++++++++++++++---- lily/spanner.cc | 52 ++++++++++++++++++++++++------------------------- 3 files changed, 61 insertions(+), 31 deletions(-) diff --git a/lily/.version b/lily/.version index b7c968121e..de91678501 100644 --- a/lily/.version +++ b/lily/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 65 +PATCH_LEVEL = 66 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/p-score.cc b/lily/p-score.cc index bf91890d77..6bec375634 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -1,7 +1,7 @@ /* p-score.cc -- implement PScore - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996, 1997 Han-Wen Nienhuys */ @@ -12,12 +12,9 @@ #include "lookup.hh" #include "spanner.hh" #include "paper-def.hh" -#include "molecule.hh" -#include "dimen.hh" #include "scoreline.hh" #include "p-score.hh" #include "tex-stream.hh" -#include "item.hh" #include "break.hh" #include "p-col.hh" @@ -238,7 +235,23 @@ PScore::process() *mlog << "\nPostprocessing elements..." << endl; postprocess(); } +/** Get all breakable columns between l and r, (not counting l and r). */ +Link_array +PScore::breakable_col_range(PCol*l,PCol*r)const +{ + Link_array ret; + + PCursor start(l ? find_col(l)+1 : cols.top() ); + PCursor stop(r ? find_col(r) : cols.bottom()); + + while ( start < stop ) { + if (start->breakable_b()) + ret.push(start); + start++; + } + return ret; +} Link_array PScore::col_range(PCol*l,PCol*r)const { @@ -252,3 +265,20 @@ PScore::col_range(PCol*l,PCol*r)const ret.push(r); return ret; } + +Link_array +PScore::broken_col_range(PCol*l,PCol*r)const +{ + Link_array ret; + + PCursor start(l ? find_col(l)+1 : cols.top() ); + PCursor stop(r ? find_col(r) : cols.bottom()); + + while ( start < stop ) { + if (start->breakable_b() && !start->line_l_ ) + ret.push(start); + start++; + } + + return ret; +} diff --git a/lily/spanner.cc b/lily/spanner.cc index 4c8376ce5a..10ee753e19 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -17,7 +17,7 @@ void Spanner::do_print()const { if (broken_into_l_arr_.size()) - mtor << "Spanner with broken pieces\n"; + mtor << "with broken pieces\n"; } void @@ -25,35 +25,35 @@ Spanner::break_into_pieces() { PCol * left = left_col_l_; PCol * right = right_col_l_; - if (left->daddy_l_) - left = left->daddy_l_; - if (right->daddy_l_) - right = right->daddy_l_; + if(left->daddy_l_) left = left->daddy_l_; + if(right->daddy_l_) right = right->daddy_l_; - Link_array all_cols = pscore_l_->col_range(left, right); - Line_of_score *line = left->line_l_; - if (!line) { - left = left->postbreak_p_; - line = left->line_l_; + Link_array break_cols = pscore_l_->broken_col_range(left,right); + Link_array broken_into_l_arr; + + break_cols.insert(left,0); + break_cols.push(right); + + for (int i=1; i < break_cols.size(); i++) { + Spanner* span_p = clone(); + left = break_cols[i-1]; + right = break_cols[i]; + if (!right->line_l_) + right = right->prebreak_p_; + if (!left->line_l_) + left = left->postbreak_p_; + + assert(left&&right && left->line_l_ == right->line_l_); + + span_p->left_col_l_ = left; + span_p->right_col_l_ = right; + + pscore_l_->typeset_broken_spanner(span_p); + broken_into_l_arr.push( span_p ); } - for (int i=1; i < all_cols.size(); i++) { - if (!all_cols[i]->line_l_) { - - Spanner* span_p = clone(); - right = all_cols[i]->prebreak_p_; - assert(left&&right && left->line_l_ == right->line_l_); - - span_p->left_col_l_ = left; - span_p->right_col_l_ = right; - left = all_cols[i]->postbreak_p_; - line = left->line_l_; - - pscore_l_->typeset_broken_spanner(span_p); - broken_into_l_arr_.push( span_p ); - } - } + broken_into_l_arr_ = broken_into_l_arr; } void -- 2.39.5