]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.62
authorfred <fred>
Sun, 24 Mar 2002 19:42:54 +0000 (19:42 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:42:54 +0000 (19:42 +0000)
lily/.version
lily/calcideal.cc
lily/colhpos.cc
lily/include/colhpos.hh
lily/include/linespace.hh
lily/include/p-score.hh
lily/include/scoreline.hh
lily/p-score.cc
lily/scoreline.cc
make/lilypond.lsm

index cc03f17df4279b38cd445bbf81bc3b1ca0016c22..2438befc5444fca13a0fe147376b6bb18fabcd03 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 61
+PATCH_LEVEL = 62
 
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
index fa015012b3fc1914c5af5e279179dfdcaa8b5606..af654d15bd1bfa055d125ca5717181ee9ff51b06 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  calcideal.cc -- implement Score::calc_idealspacing()
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "idealspacing.hh"
 #include "score.hh"
 #include "p-score.hh"
@@ -13,7 +21,7 @@
   effects into account, should be local (measure wide), should check
   smallest divisions.
     
-
+  plus, calc_idealspacing() should be called per line.
   */
 void
 Score::calc_idealspacing()
index 530e4d4483c7581ede61c6202bd00d8014bc5da0..e96b3f99ad19c6d5d6a2ad5a50ad3622c8932a93 100644 (file)
@@ -7,6 +7,7 @@
 Col_hpositions::Col_hpositions()
 {
     energy = INFTY;
+    ugh_b_ = false;
 }
 
 void
index 5398417ab134202630b22b9f3a5c3dc4950c574c..c62b70e6546f6ce065a1afbbc50aa251c7e9bfdd 100644 (file)
@@ -12,6 +12,8 @@
 typedef Array<PCol*>  Line_of_cols;
 
 struct Col_hpositions {
+    bool ugh_b_;
+    Line_of_cols error_col_l_arr_;
     Line_of_cols cols;
     Array<Real> config;
     Real energy;
index 28e2abc01c564f0dcdee61c04f80233fdfd94fa1..bd8685383aa6aac5361200cb8f194f9c01734951 100644 (file)
@@ -1,27 +1,36 @@
-#ifndef PROBLEM_HH
-#define PROBLEM_HH
+/*
+  linespace.hh -- declare Colinfo, Spacing_problem
 
+  source file of the LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef LINESPACE_HH
+#define LINESPACE_HH
 #include "glob.hh"
 #include "plist.hh"
 #include "varray.hh"
 #include "vector.hh"
 #include "interval.hh"
+#include "pointer.hh"
 
 /// helper struct for #Spacing_problem#
 struct Colinfo {
-    PCol const *pcol_;
-    Real const * fixpos;
+    PCol *pcol_l_;
+    P<Real> fixpos_p_;
     Interval width;
-    
+    int rank_i_;
+    /// did some tricks to make this column come out.
+    bool ugh_b_;               
     /* *************** */
     Colinfo();
-    void operator=(Colinfo const&);
-    Colinfo(Colinfo const&);
-    ~Colinfo();
-    Colinfo(PCol const *,Real const *);
+    Colinfo(PCol *,Real const *);
+
     void print() const;
-    bool fixed() const { return fixpos;}
-    Real fixed_position()const { return *fixpos; }
+    bool fixed() const { return fixpos_p_.get_C();}
+    Real fixed_position()const { return *fixpos_p_; }
     Real minright() const { return width.right; }
     Real minleft() const { return -width.left; }
 };
@@ -52,7 +61,10 @@ struct Colinfo {
 class Spacing_problem {
     Array<Idealspacing const *> ideals;
     Array<Colinfo> cols;
-
+    Array<Colinfo> loose_col_arr_;
+    
+    /// mark column #i# as being loose.
+    void loosen_column(int i);
     /// the index of #c# in #cols#
     int col_id(PCol const *c) const;
 
@@ -71,7 +83,12 @@ class Spacing_problem {
     /// generate the LP constraints
     void make_constraints(Mixed_qp& lp) const;
 
+
+    void handle_loose_cols();
+    void position_loose_cols(Vector &) const;
 public:
+    Array<PCol*> error_pcol_l_arr() const;
+
     /** solve the spacing problem
       
       @return the column positions, and the energy (last element)
@@ -93,7 +110,7 @@ public:
     /** add a col to the problem. columns have to be added left to right. The column contains
       info on it's minimum width.
     */
-    void add_column(PCol const *, bool fixed=false, Real fixpos=0.0);
+    void add_column(PCol  *, bool fixed=false, Real fixpos=0.0);
  
 
 
@@ -103,6 +120,7 @@ public:
     void OK() const;
     void print() const;
     void print_ideal(Idealspacing const *)const;
+    void prepare();
 };
 
 
index 0cc7a2bc15469ca7dcde167d21e7cb07f6192034..15c123fdb6017fafbb4cf8ab677b95a3b0fcf3f8 100644 (file)
@@ -1,7 +1,14 @@
-// the breaking problem for a score.
+/*
+  p-score.hh -- declare PScore
 
-#ifndef PSCORE_HH
-#define PSCORE_HH
+  source file of the LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef P_SCORE_HH
+#define P_SCORE_HH
 
 #include "colhpos.hh"
 #include "varray.hh"
@@ -43,7 +50,7 @@ struct PScore {
     
     PScore(Paper_def*);
     /// add a line to the broken stuff. Positions given in #config#
-    void set_breaking(Array<Col_hpositions>);
+    void set_breaking(Array<Col_hpositions> const &);
 
     void add(PStaff *);
     
index 33bbc4a2d874aa4632a55ac46b6dea742421696b..814cb7e8c267eb59772b5b5571ac0e7212bf3f93 100644 (file)
@@ -15,6 +15,7 @@ struct
 Line_of_score {
     Pointer_list<PCol *> cols;
 
+    bool error_mark_b_;
     // need to store height of each staff.
     IPointer_list<Line_of_staff*> staffs;
     PScore * pscore_l_;        // needed to generate staffs
index 184e90db3f4fe166d7e0f05033f18ea838c3860f..24421334ab955f99922618156380bfd918ef9368 100644 (file)
@@ -228,17 +228,21 @@ PScore::add_broken(Spanner*s)
 }
 
 void
-PScore::set_breaking(Array<Col_hpositions> breaking)
+PScore::set_breaking(Array<Col_hpositions> const &breaking)
 {
     for (int j=0; j < breaking.size(); j++) {
-       Array<PCol*> &curline(breaking[j].cols);
-       Array<Real> &config(breaking[j].config);
+       const Array<PCol*> &curline(breaking[j].cols);
+       const Array<PCol*> &errors(breaking[j].error_col_l_arr_);
+       const Array<Real> &config(breaking[j].config);
        
        Line_of_score *s_p = new Line_of_score(curline,this);
+       s_p->error_mark_b_ =  breaking[j].ugh_b_;
        lines.bottom().add(s_p);        
        for (int i=0; i < curline.size(); i++){
            curline[i]->hpos = config[i];
        }
+       for (int i=0; i < errors.size(); i++)
+           errors[i]->error_mark_b_ = true;
     }
 }
 
index 65c6546b5a27f77bc4ca0dbedb5b4b7ace82b332..d1837b4a679eed47d71e36124a7db226d459b2a3 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  scoreline.cc -- implement Line_of_score
+
+  source file of the LilyPond music typesetter
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "scoreline.hh"
 #include "staffline.hh"
 #include "dimen.hh"
@@ -12,6 +20,8 @@ String
 Line_of_score::TeXstring() const
 {
      String s("\\vbox{%<- line of score\n");
+     if (error_mark_b_)
+        s+= "\\scorelineerrormark";
      for (iter_top(staffs,sc); sc.ok(); sc++){
         s += sc->TeXstring();
         if ((sc+1).ok())
@@ -25,6 +35,7 @@ Line_of_score::TeXstring() const
 Line_of_score::Line_of_score(Array<PCol *> sv,
                             PScore *ps)
 {
+    error_mark_b_ = 0;
     pscore_l_ = ps;
     for (int i=0; i< sv.size(); i++) {
        PCol *p=(PCol *) sv[i];
index 00c79bcf92ea453cfca63840c0fceda26e7eea23..ad7b4d70e20c3fd394bc3052f91deb44cf2aa3f3 100644 (file)
@@ -2,8 +2,8 @@
 
 Begin3
 Title: LilyPond
-Version: 0.0.61
-Entered-date: 05/12/97
+Version: 0.0.62
+Entered-date: 05/14/97
 Description: LilyPond is a program which converts a music-script (mudela) into
 TeX output, or MIDI to produce multi-staff scores. Features include multiple
 meters, clefs, keys, lyrics, versatile input-language, cadenzas
@@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: pcnov095.win.tue.nl /pub/lilypond/  
-       300k lilypond-0.0.61.tar.gz
+       300k lilypond-0.0.62.tar.gz
 Alternate-site: 
 Original-site: 
 Platform: unix/win32, GNU C++