From: fred Date: Sun, 24 Mar 2002 20:07:37 +0000 (+0000) Subject: lilypond-0.1.52 X-Git-Tag: release/1.5.59~3331 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b8378eea6eca8a29e96f7326da3d544f55846be3;p=lilypond.git lilypond-0.1.52 --- diff --git a/init/engraver.ly b/init/engraver.ly index 6ab87d1c81..f31288c87d 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -14,7 +14,9 @@ Staff = \translator { \consists "Staff_sym_engraver"; \consists "Collision_engraver"; \consists "Rest_collision_engraver"; + \consists "Separating_line_group_engraver"; \consists "Line_group_engraver"; + \accepts "Voice"; } @@ -78,6 +80,7 @@ Lyric_voice = \translator{ \type "Engraver_group_engraver"; + \consists "Separating_line_group_engraver"; \consists "Lyric_engraver"; \consists "Line_group_engraver"; \consists "Beam_req_swallow_translator"; diff --git a/lily/break.cc b/lily/break.cc index 8475f79db4..2b29b433f5 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -135,16 +135,13 @@ Break_algorithm::feasible (Line_of_cols curline) const if (linelength <= 0) return true; - Real l =0; for (int i=0; i < curline.size (); i++) { if (i && i < curline.size () -1 && ((Score_column*)curline[i])->forced_break_b ()) return false; - - l +=curline[i]->width ().length (); } - return l < linelength; + return true; } void diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc index 66370135f8..e434e35609 100644 --- a/lily/general-script-def.cc +++ b/lily/general-script-def.cc @@ -71,3 +71,11 @@ General_script_def::get_atom (Paper_def*, Direction) const } IMPLEMENT_IS_TYPE_B(General_script_def); + + +Interval +General_script_def::width (Paper_def*) const +{ + Interval t; + return t; +} diff --git a/lily/include/general-script-def.hh b/lily/include/general-script-def.hh index 3788df867c..4faf568ae9 100644 --- a/lily/include/general-script-def.hh +++ b/lily/include/general-script-def.hh @@ -20,20 +20,21 @@ */ class General_script_def : public Input { public: - VIRTUAL_COPY_CONS(General_script_def,General_script_def); - DECLARE_MY_RUNTIME_TYPEINFO; - virtual Direction staff_dir() const; - void print() const; - virtual Direction rel_stem_dir() const; - virtual int priority_i() const; - virtual bool inside_b() const; - virtual Atom get_atom (Paper_def* p, Direction dir_) const; - bool equal_b (General_script_def const&) const; - virtual ~General_script_def() {} + VIRTUAL_COPY_CONS(General_script_def,General_script_def); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual Direction staff_dir() const; + void print() const; + virtual Direction rel_stem_dir() const; + virtual int priority_i() const; + virtual bool inside_b() const; + virtual Atom get_atom (Paper_def* p, Direction dir_) const; + bool equal_b (General_script_def const&) const; + virtual ~General_script_def() {} + virtual Interval width (Paper_def *) const; protected: - virtual bool do_equal_b (General_script_def const *) const; - virtual void do_print() const; + virtual bool do_equal_b (General_script_def const *) const; + virtual void do_print() const; }; #endif // GENERAL_SCRIPT_DEF_HH diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index 04c9184f56..ffd59f5f68 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -69,6 +69,7 @@ class Spring_spacer : public Line_spacer { void handle_loose_cols(); void position_loose_cols (Vector &) const; + bool try_initial_solution_and_tell (Vector&)const; Vector try_initial_solution() const; void calc_idealspacing(); void set_fixed_cols (Mixed_qp&) const; diff --git a/lily/include/text-def.hh b/lily/include/text-def.hh index 6624959140..13fb25511b 100644 --- a/lily/include/text-def.hh +++ b/lily/include/text-def.hh @@ -15,27 +15,27 @@ class Text_def : public General_script_def { public: - DECLARE_MY_RUNTIME_TYPEINFO; - VIRTUAL_COPY_CONS(Text_def,General_script_def); + DECLARE_MY_RUNTIME_TYPEINFO; + VIRTUAL_COPY_CONS(Text_def,General_script_def); - /** - centered , or aligned? + /** + centered , or aligned? - -1 = raggedright, 0 = center, 1 = raggedleft - */ - Direction align_i_; + -1 = raggedright, 0 = center, 1 = raggedleft + */ + Direction align_i_; - String text_str_; - String style_str_; + String text_str_; + String style_str_; - virtual void do_print() const; - virtual Direction staff_dir() const; - virtual Atom get_atom (Paper_def* p, Direction dir_) const; - virtual ~Text_def() {}; - virtual bool do_equal_b (const General_script_def*) const; - Text_def(); - virtual void print() const; - Interval width (Paper_def*) const; + virtual void do_print() const; + virtual Direction staff_dir() const; + virtual Atom get_atom (Paper_def* p, Direction dir_) const; + virtual ~Text_def() {}; + virtual bool do_equal_b (const General_script_def*) const; + Text_def(); + virtual void print() const; + virtual Interval width (Paper_def*) const; }; #endif // TEXT_DEF_HH diff --git a/lily/leastsquares.cc b/lily/leastsquares.cc index ab718a97f7..0f1568f29f 100644 --- a/lily/leastsquares.cc +++ b/lily/leastsquares.cc @@ -1,4 +1,5 @@ #include "leastsquares.hh" + void Least_squares::OK() const { @@ -9,6 +10,7 @@ Least_squares::OK() const assert (dx); } + void Least_squares::minimise (Real &coef, Real &offset) { diff --git a/lily/text-item.cc b/lily/text-item.cc index 952e917052..c471fa1453 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -65,10 +65,9 @@ Text_item::brew_molecule_p () const { Atom a (tdef_p_->get_atom (paper (), dir_)); - /* - if (fat_b_) - a.sym.dim.x = tdef_p_->width (paper ()); - */ + + if (fat_b_) + a.dim_[X_AXIS] = tdef_p_->width (paper ()); Molecule* mol_p = new Molecule (a); if (dir_<0) // should do something better anyway. diff --git a/lily/word-wrap.cc b/lily/word-wrap.cc index 6b7abf398b..c41e3ed9b2 100644 --- a/lily/word-wrap.cc +++ b/lily/word-wrap.cc @@ -41,6 +41,7 @@ Word_wrap::do_solve() const // do another line line_no_i ++; Paper_column *post = breakpoints[break_idx_i]->postbreak_l(); + int start_break_idx = break_idx_i; current.add (post); curcol++; // skip the breakable. break_idx_i++; @@ -75,7 +76,6 @@ Word_wrap::do_solve() const } else { - current.solve_line(); current.print(); } @@ -83,7 +83,13 @@ Word_wrap::do_solve() const delete current.spacer_l_; current.spacer_l_ =0; - // update minimum, or backup. + if (!current.satisfies_constraints_b_ && start_break_idx == break_idx_i - 1) + { + warning ( _ ("I don't fit. Put me on Montignac")); + minimum = current; + break; + } + if (current.energy_f_ < minimum.energy_f_ || current.energy_f_ < 0) { minimum = current;