From c7a8723e7c8743068e480c92b67baa51d7695480 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:42:54 +0000 Subject: [PATCH] lilypond-0.0.62 --- lily/.version | 2 +- lily/calcideal.cc | 10 ++++++++- lily/colhpos.cc | 1 + lily/include/colhpos.hh | 2 ++ lily/include/linespace.hh | 44 +++++++++++++++++++++++++++------------ lily/include/p-score.hh | 15 +++++++++---- lily/include/scoreline.hh | 1 + lily/p-score.cc | 10 ++++++--- lily/scoreline.cc | 11 ++++++++++ make/lilypond.lsm | 6 +++--- 10 files changed, 77 insertions(+), 25 deletions(-) diff --git a/lily/.version b/lily/.version index cc03f17df4..2438befc54 100644 --- a/lily/.version +++ b/lily/.version @@ -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 diff --git a/lily/calcideal.cc b/lily/calcideal.cc index fa015012b3..af654d15bd 100644 --- a/lily/calcideal.cc +++ b/lily/calcideal.cc @@ -1,3 +1,11 @@ +/* + calcideal.cc -- implement Score::calc_idealspacing() + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #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() diff --git a/lily/colhpos.cc b/lily/colhpos.cc index 530e4d4483..e96b3f99ad 100644 --- a/lily/colhpos.cc +++ b/lily/colhpos.cc @@ -7,6 +7,7 @@ Col_hpositions::Col_hpositions() { energy = INFTY; + ugh_b_ = false; } void diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index 5398417ab1..c62b70e654 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -12,6 +12,8 @@ typedef Array Line_of_cols; struct Col_hpositions { + bool ugh_b_; + Line_of_cols error_col_l_arr_; Line_of_cols cols; Array config; Real energy; diff --git a/lily/include/linespace.hh b/lily/include/linespace.hh index 28e2abc01c..bd8685383a 100644 --- a/lily/include/linespace.hh +++ b/lily/include/linespace.hh @@ -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 +*/ + + +#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 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 ideals; Array cols; - + Array 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 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(); }; diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 0cc7a2bc15..15c123fdb6 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -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 +*/ + + +#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); + void set_breaking(Array const &); void add(PStaff *); diff --git a/lily/include/scoreline.hh b/lily/include/scoreline.hh index 33bbc4a2d8..814cb7e8c2 100644 --- a/lily/include/scoreline.hh +++ b/lily/include/scoreline.hh @@ -15,6 +15,7 @@ struct Line_of_score { Pointer_list cols; + bool error_mark_b_; // need to store height of each staff. IPointer_list staffs; PScore * pscore_l_; // needed to generate staffs diff --git a/lily/p-score.cc b/lily/p-score.cc index 184e90db3f..24421334ab 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -228,17 +228,21 @@ PScore::add_broken(Spanner*s) } void -PScore::set_breaking(Array breaking) +PScore::set_breaking(Array const &breaking) { for (int j=0; j < breaking.size(); j++) { - Array &curline(breaking[j].cols); - Array &config(breaking[j].config); + const Array &curline(breaking[j].cols); + const Array &errors(breaking[j].error_col_l_arr_); + const Array &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; } } diff --git a/lily/scoreline.cc b/lily/scoreline.cc index 65c6546b5a..d1837b4a67 100644 --- a/lily/scoreline.cc +++ b/lily/scoreline.cc @@ -1,3 +1,11 @@ +/* + scoreline.cc -- implement Line_of_score + + source file of the LilyPond music typesetter + + (c) 1996, 1997 Han-Wen Nienhuys +*/ + #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 sv, PScore *ps) { + error_mark_b_ = 0; pscore_l_ = ps; for (int i=0; i< sv.size(); i++) { PCol *p=(PCol *) sv[i]; diff --git a/make/lilypond.lsm b/make/lilypond.lsm index 00c79bcf92..ad7b4d70e2 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -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++ -- 2.39.5