]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.52
authorfred <fred>
Sun, 24 Mar 2002 20:07:37 +0000 (20:07 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:07:37 +0000 (20:07 +0000)
init/engraver.ly
lily/break.cc
lily/general-script-def.cc
lily/include/general-script-def.hh
lily/include/spring-spacer.hh
lily/include/text-def.hh
lily/leastsquares.cc
lily/text-item.cc
lily/word-wrap.cc

index 6ab87d1c812a756c3c982a1eed4022b253ceec80..f31288c87dd875c6b08aac95f0bc4b438d1d7281 100644 (file)
@@ -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";
index 8475f79db4aa4f73f55d3c860bd8292841a782a2..2b29b433f502ded30c7a87bb5489d11e50e85ad5 100644 (file)
@@ -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
index 66370135f8b66d4a3869f46788a2d73fd5b7286d..e434e356092447ab4361a7362875402019341aaf 100644 (file)
@@ -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;
+}
index 3788df867cbd0fddc933595376e7b05076ddd891..4faf568ae939bde4788dedb4f3799fc8844d0b56 100644 (file)
  */
 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
index 04c9184f56ada169f9c916f4c682dd0c92f4560f..ffd59f5f688407efffe80be7f757179ad91bbe0e 100644 (file)
@@ -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;
index 6624959140b8e9f5dce4a7fda8bdb81707225f42..13fb25511bc27e6ae93f1cf40a97813a2c13174e 100644 (file)
 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
index ab718a97f76bca922a7deed174a2836cbdb00469..0f1568f29f82f44f2ac714b2e1d064666a685dbd 100644 (file)
@@ -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)
 {
index 952e917052ac4fac493f9d55eedfcf7e9d51f93d..c471fa1453f7c96c82c8ec14a077c1c319d74f06 100644 (file)
@@ -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.
index 6b7abf398bd089b3512dc3128adcddc43ba07759..c41e3ed9b2eff346b1beabbf061779abbc6b8f65 100644 (file)
@@ -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;