From 18eeef19962f32212af806a42da7e1089109b46f Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:47:23 +0000 Subject: [PATCH] lilypond-1.1.32 --- Documentation/GNUmakefile | 2 +- Documentation/tex/lilypond-overview.doc | 25 +- NEWS | 27 ++ TODO | 53 +--- aclocal.m4 | 3 +- buildscripts/set-lily.sh | 6 +- configure.in | 8 + flower/include/direction.hh | 60 ++++ flower/include/drul-array.hh | 53 ++++ flower/include/interval.hh | 88 +++--- flower/include/interval.tcc | 45 +-- input/test/memory.ly | 13 + lily/abbrev.cc | 2 +- lily/align-element.cc | 2 +- lily/axis-group-spanner.cc | 15 +- lily/bar-script-engraver.cc | 5 +- lily/beam.cc | 2 +- lily/bow.cc | 14 +- lily/break.cc | 22 +- lily/collision.cc | 2 +- lily/direction.cc | 2 + lily/dot-column.cc | 2 +- lily/engraver-group.cc | 1 - lily/extender-spanner.cc | 2 +- lily/g-staff-side.cc | 2 +- lily/gourlay-breaking.cc | 14 +- lily/hara-kiri-vertical-group-spanner.cc | 2 +- lily/include/abbrev.hh | 2 +- lily/include/align-element.hh | 2 +- lily/include/atom.hh | 1 + lily/include/bar.hh | 2 - lily/include/beam.hh | 4 +- lily/include/bow.hh | 2 - lily/include/break.hh | 1 - lily/include/collision.hh | 2 +- lily/include/cons.hh | 68 +++-- lily/include/dot-column.hh | 2 +- lily/include/extender-spanner.hh | 2 +- lily/include/g-staff-side.hh | 2 +- .../hara-kiri-vertical-group-spanner.hh | 2 +- lily/include/killing-cons.tcc | 23 +- lily/include/local-key-item.hh | 2 +- lily/include/multi-measure-rest.hh | 2 +- lily/include/music-iterator.hh | 2 +- lily/include/note-column.hh | 2 +- lily/include/p-score.hh | 33 +-- lily/include/rest-collision.hh | 2 +- lily/include/rhythmic-head.hh | 2 +- lily/include/score-element.hh | 10 +- lily/include/script-column.hh | 2 +- lily/include/script.hh | 2 +- lily/include/separating-group-spanner.hh | 6 +- lily/include/simultaneous-music-iterator.hh | 3 +- lily/include/single-malt-grouping-item.hh | 9 +- lily/include/slur.hh | 4 +- lily/include/span-bar.hh | 4 +- lily/include/spanner.hh | 20 +- lily/include/spring-spacer.hh | 4 +- lily/include/staff-side.hh | 2 +- lily/include/stem.hh | 2 +- lily/include/text-spanner.hh | 2 +- lily/include/tie.hh | 2 +- lily/include/translator-group.hh | 4 +- lily/include/tuplet-spanner.hh | 2 +- lily/include/volta-spanner.hh | 2 +- lily/item.cc | 12 +- lily/local-key-item.cc | 2 +- lily/lookup.cc | 4 +- lily/main.cc | 1 - lily/molecule.cc | 4 +- lily/multi-measure-rest.cc | 2 +- lily/note-column.cc | 4 +- lily/p-col.cc | 4 - lily/p-score.cc | 266 +++++++++--------- lily/parser.yy | 80 +++--- lily/rest-collision.cc | 10 +- lily/rhythmic-grouping.cc | 28 +- lily/rhythmic-head.cc | 2 +- lily/score-element.cc | 19 +- lily/script-column.cc | 2 +- lily/script.cc | 4 +- lily/separating-group-spanner.cc | 6 +- lily/separating-line-group-engraver.cc | 2 +- lily/simultaneous-music-iterator.cc | 29 +- lily/single-malt-grouping-item.cc | 3 +- lily/slur-engraver.cc | 1 - lily/slur.cc | 37 +-- lily/span-bar.cc | 2 +- lily/spanner.cc | 113 +++++--- lily/spring-spacer.cc | 48 ++-- lily/staff-side.cc | 2 +- lily/stem.cc | 17 +- lily/template7.cc | 3 +- lily/text-spanner.cc | 2 +- lily/tie.cc | 2 +- lily/translator-ctors.cc | 1 - lily/translator-group.cc | 60 ++-- lily/tuplet-spanner.cc | 10 +- lily/volta-spanner.cc | 2 +- lily/warn.cc | 3 +- lily/word-wrap.cc | 55 ++-- ly/script.ly | 7 + make/lilypond.spec.in | 19 +- make/toplevel.make.in | 2 - stepmake/NEWS | 7 + stepmake/VERSION | 2 +- stepmake/aclocal.m4 | 1 + stepmake/stepmake/c-vars.make | 2 +- stepmake/stepmake/yodl-rules.make | 2 +- 109 files changed, 919 insertions(+), 677 deletions(-) create mode 100644 flower/include/direction.hh create mode 100644 flower/include/drul-array.hh create mode 100644 input/test/memory.ly diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 76f54de971..1bba1d360f 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -6,7 +6,7 @@ NAME = documentation SUBDIRS=man tex pictures topdocs ntweb STEPMAKE_TEMPLATES=documentation README_TOP_FILES=NEWS DEDICATION TODO ANNOUNCE-0.1 -# INFO_FILES = $(wildcard $(outdir)/$(package).info*) +INFO_FILES = $(wildcard $(outdir)/$(package).info*) EXTRA_DIST_FILES = gnu-music-history TODO diff --git a/Documentation/tex/lilypond-overview.doc b/Documentation/tex/lilypond-overview.doc index eae2c17b7c..dbbd19d296 100644 --- a/Documentation/tex/lilypond-overview.doc +++ b/Documentation/tex/lilypond-overview.doc @@ -505,17 +505,16 @@ Figure~\ref{fig:spacing}. \end{center} \end{figure} -Another clearly visible example of music typography is visible in -collisions. When chords or separate voices are printed, the notes -that start at the same time should be printed aligned (ie., with the -same $x$ position). If the pitches are close to each other, the note -heads would collide. To prevent this, some notes (or note heads) have -to be shifted horizontally. An example of this is given in Figure~\ref{fig:collision}. +Another example of music typography is clearly visible in collisions. +When chords or separate voices are printed, the notes that start at +the same time should be printed aligned (ie., with the same $x$ +position). If the pitches are close to each other, the note heads +would collide. To prevent this, some notes (or note heads) have to be +shifted horizontally. An example of this is given in +Figure~\ref{fig:collision}. \begin{figure}[h] \begin{center} - \begin{mudela} - c4 - \end{mudela} + [todo] \caption{Collisions} \label{fig:collision} \end{center} @@ -524,6 +523,14 @@ to be shifted horizontally. An example of this is given in Figure~\ref{fig:coll \bibliographystyle{hw-plain} \bibliography{engraving,boeken,colorado,computer-notation,other-packages} +\section{Requirements} + +\section{Approach} + +\subsection{Input} + +\section{Discussion} + \end{document} diff --git a/NEWS b/NEWS index a1ec9abbfb..2ad024d647 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,30 @@ +pl 31.hwn2 + - be somewhat lazy in break/object multiplication. + - print # elements for memory usage impression (try -t) + - Paper_score cleanup + - junked various Pointer_list instances. Executable now is smaller. + - junked various cruft + - merged do_substitute_dependen{t,cy} to +do_substitute_element_pointer () + - more parser cleanup + - Interval uses Drul_array + - bf: I've been drinking too much + - delete break helpers before object breaking/multiplication. Try +to save some memory. + +pl 31.jcn4 + - bf: toplevel install, kpsewhich + - sm 71, require yodl-1.31.11 + - fix: slur macros + - bf: info in rpm, if available + - fix: rat != float + - bf: slur-follow-music + +pl 31.uu1 + - config.make: include GUILE_LDFLAGS + +****** +pl 31 (feb 16) pl 30.jcn1 - sm fixes, intl/ fixes diff --git a/TODO b/TODO index 92f7be13bf..c4ca40e195 100644 --- a/TODO +++ b/TODO @@ -5,8 +5,8 @@ Features you cannot find in the doco as working, should be mentioned here. This is an assorted collection of stuff that will be done, might be done, or is an idea that I want to think about -Most of the items are marked in the code as well, with full explanation. -grep for TODO and ugh/ugr/urg +Most of the items are marked in the code as well +Grep for TODO and ugh/ugr/urg. .* BUGS . * .ly files @@ -63,18 +63,15 @@ c2 c | . * fix singleStaffBracket . * \shape 1st dim skipped? . * turn slope-damping on/off -. * c4 \! \> c4 . * tremolo stuff . * fix height of / collisions with lyrics (chords), see input/test/vertical-text.ly; input/test/repeat.ly . * We need feta-din*.mf files for more sizes than 10. . * latex bla.tex broken (titles / \lilyfooter stuff?) . * fix dynamics decently, ie. use kerning & ligatures. -. * fix "I've been drinking too much" . * support_l_arr_ empty in staff-margin's G_staff_side_item . * minVerticalAlign for StaffGroups. . * declaring \score -. * is \break broken? input/test/hara-kiri.ly . * fix OrchestralScore and Hara-kiri (i.e., fix Coriolan) . * Phrasing: Indicating the textual underlay of a piece, or otherwise dividing a piece into phrases. @@ -87,6 +84,7 @@ specify the third. Should there be? . * Check gcc 2.8.1 compatibility . * make "in-between" engraver (Tie, Extender) . * use Drul_array for Interval. +. * compulsory hshift . * ties to tie only notes of the same pitch, so that < a~ a,> a works as you'd expect it to. @@ -174,7 +172,6 @@ The beams are at the right angle, but they aren't in the right place. . * do --safe for PS output? . * convert-mudela --output . * Staff_margin (with a partial measure.) -. * fix "I've been drinking too much" . * fix pletvisibility properties: . * bracket on/off/no-bracket-when-beam . * num on/off/no-num-when-beam @@ -208,7 +205,6 @@ The beams are at the right angle, but they aren't in the right place. . * capitalization/use of underscores in property names . * fix SkipBars -> skipBars -. * fix marks/barnumbers/marginal notes . * broken scripts: lbheel = \script { "bheel" 0 0 -1 0 0 } rbheel = \script { "bheel" 0 0 1 0 0 } @@ -226,7 +222,6 @@ The beams are at the right angle, but they aren't in the right place. . * deps for ly2dvi .* STUFF . * check out legal/(c) matters for scores. -. * check out GCC signatures? . * Align_element::padding ? . * uniformise property names... . * ydirection <-> yDirection @@ -279,7 +274,7 @@ ydirection and hshift preset {\voicetwo cis,4 r r | r2. | r1 }> | } . * try to use template iso MACRO(Type) -. * NEWS: ... Musical_pitch (analogous to Duration and Rhythmic_req) +. * Musical_pitch (analogous to Duration and Rhythmic_req) think about, analogous to pitch: * { a4 a16 } c <-- duration of c? * < a4 b8 > c <-- duration of c? @@ -327,13 +322,14 @@ ydirection and hshift preset in the middle: . * the bracket is ugly (wings are too parabolic, should be more circular) . * better hshift (dots, distance, head dependent) - * clefs (AG): The "8" should appear closer to the actual clef, - touching it. +. * clefs (AG): The "8" should appear closer to the actual clef, +touching it. . * put errorlevel in Input class . * junk nesting slurs . * integrate midi-elts from mi2mu and lily? .* 3RD PARTY BUGS . * GNU diff 2.7: diff -rN does not see a new directory with empty file +. * check out GCC signatures? . * glibc 2.0: f = fopen ("/dev/null", "r") assert (feof (f)) @@ -367,11 +363,8 @@ ydirection and hshift preset . * fontlock: \melodic \melodic . * use properties for: -. * plet? . * Staff_sym size . * default tempo. -. * font size -. * bartypes (get rid of derived Span_bar_engravers) . * cadenza mode? . * page handling: @@ -443,20 +436,11 @@ ydirection and hshift preset . * quiet/ignore-version options . * logfile output -. * elaborate Staff_side baseclass: -. * scripts -. * text -. * slur start/end - . * PS . * speed up PS code. . * PS lines to .eps files . * write custom prolog -. * Output an output format independent (ofi) typeset file; and - make ofi2 TeX, MusiXTex, Display PostScript, PostScript, - Ascii... interpreters. (difficult) - . * NIFF ? . * Common Music Notation . * PostScript output (esp. Beams, Slurs, etc) @@ -474,14 +458,14 @@ ydirection and hshift preset . * Rewrite Stem, Beam and Rhythmic_grouping (hairy) . * [c8. c32 c32] - **** doc on Rhythmic_grouping +. * doc on Rhythmic_grouping . * general shaving on Beam and Stem . * use plet grouping . * separate visual from rhythmic info even more . * beams over bars . * lines: -. * Ledger lines, should be separate item: Ledger_lines, Ledger_lines +. * Ledger lines, should be separate item: Ledger_lines . * set different line sizes / thicknesses . * beam stem showthrough, inter beam sizes (french vs german style) @@ -503,11 +487,10 @@ ydirection and hshift preset . * caching breakpoints . * saving them . * specify number of lines + .* INPUTLANGUAGE . * c4 4 4 4 for c4 c4 c4 c4? -. * neatly (and readably) expressing concurrent - voices . * 4 ? . * Viola mode? @@ -518,15 +501,12 @@ ydirection and hshift preset @A c g e g for cis gis e gis -. * relative mode for pitch entering . * configure pitch_byte . * rest name configurable .* SMALLISH PROJECTS -. * limit memory usage; the full coriolan takes up too much resources. - . * fix confusing naming in Engraver vs Engraver_group_engraver (context) . * progress when creating MIDI elts. @@ -547,19 +527,13 @@ ydirection and hshift preset . * handle EOF graciously in error messages. -. * declare notenametab? - . * midi esp.: use I32 iso int where 32 bits are needed (or assumed...) . * stafftypes: voice names/ instrument names. . * lily \tempo -. * C meter iso 4/4, idem for alla breve, etc. - -. * textspanner: center position - - * % toe to bheel four to five +. * % toe to bheel four to five % ^_u 4_5 % - % --|x-- --|x-- @@ -574,6 +548,7 @@ ydirection and hshift preset . * clean solution for staffsize in items. . * revise calcideal + .* IDEAS . * Output data structures of Mudela in XML/SGML. . * create libmudela, or liblily_frontend @@ -582,11 +557,7 @@ ydirection and hshift preset . * caching breakpoints . * used fixedpoint arithmetic for min. energy. . * move towards incremental algorithms. -. * far fetched language ideas -. * design meta-language like TeX and Metafont -. * programming/macros input . * versioning stuff (cvt mudela, mudela, etc.) -. * Klavarskribo? . * dynamic loading of engravers? .* SMOBS Han-Wen Nienhuys writes: diff --git a/aclocal.m4 b/aclocal.m4 index cf4a69b433..38ec73410c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,3 @@ -dnl WARNING WARNING WARNING WARNING -dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in @@ -444,6 +442,7 @@ AC_DEFUN(AC_STEPMAKE_GETTEXT, [ ]) AC_DEFUN(AC_STEPMAKE_MAN, [ + AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff) AC_CHECK_PROGS(TROFF, troff, -echo no troff) AC_CHECK_PROGS(TBL, tbl, cat) ]) diff --git a/buildscripts/set-lily.sh b/buildscripts/set-lily.sh index 39833eb7c0..dcc41e444e 100644 --- a/buildscripts/set-lily.sh +++ b/buildscripts/set-lily.sh @@ -51,8 +51,10 @@ ln -sf $LILYPOND_SOURCEDIR/mf/out/ afm TFMDIR=`kpsewhich cmr10.tfm` ln -sf `dirname $TFMDIR` tfm mkdir -p $prefix/share/ -ln -sf $prefix/lilypond/ $sources/lilypond - +if [ ! -x $prefix/share/lilypond ]; then + echo ln -sf $sources/lilypond $prefix/share + ln -sf $sources/lilypond $prefix/ +fi if [ -f ../.gdbinit ]; then ln ../.gdbinit . diff --git a/configure.in b/configure.in index 854c957dd4..43abc3439b 100644 --- a/configure.in +++ b/configure.in @@ -54,5 +54,13 @@ AC_CHECK_PROGS(MAKEINFO, makeinfo, error) AC_CHECK_SEARCH_RESULT($YODL2TEXINFO, yodl, You should install Yodl 1.30.2 or newer) + +AC_MSG_CHECKING(Checking TFM directory) +CMR10=`kpsewhich tfm cmr10.tfm` +TEX_TFMDIR=`dirname $CMR10` +AC_MSG_RESULT($TEX_TFMDIR) + +AC_SUBST(TEX_TFMDIR) AC_STEPMAKE_END + diff --git a/flower/include/direction.hh b/flower/include/direction.hh new file mode 100644 index 0000000000..33792a4849 --- /dev/null +++ b/flower/include/direction.hh @@ -0,0 +1,60 @@ +/* + direction.hh -- declare Direction + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef DIRECTION_HH +#define DIRECTION_HH + +#include "axes.hh" + +enum Direction +{ + UP=1, + DOWN=-1, + LEFT=-1, + RIGHT=1, + MIN=-1, + MAX=1, + CENTER=0, + SMALLER=-1, + BIGGER=1, + START = -1, + STOP = 1 +}; + +inline Direction +other_dir (Direction const d) +{ + return (Direction)(-d); +} + +inline Direction +operator - (Direction const d) +{ + return other_dir (d); +} + +// huh? +inline Direction +flip (Direction *i) { + if (*i == (Direction)1) + *i = (Direction)-1; + else if (*i == (Direction)-1) + *i = (Direction)1; + return *i; +} + +/** + if d > 0: the max operator + if d < 0: the min operator + */ +template T minmax (Direction d, T, T); + +// String direction_str (Direction, Axis); + +#endif // DIRECTION_HH diff --git a/flower/include/drul-array.hh b/flower/include/drul-array.hh new file mode 100644 index 0000000000..467cf9f40c --- /dev/null +++ b/flower/include/drul-array.hh @@ -0,0 +1,53 @@ +/* + drul-array.hh -- declare Drul_array + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef DRUL_ARRAY_HH +#define DRUL_ARRAY_HH + +#include "direction.hh" + +#include + +/** + Left/right or Up/down arrays. Drul is nicer sounding than udlr + */ +template +struct Drul_array +{ + T array_[2]; + T &elem (Direction d) + { + assert (d==1 || d== -1); + return array_[(d+1)/2]; + + } + T &operator[] (Direction d) + { + return elem (d); + } + T elem (Direction d) const + { + assert (d==1 || d== -1); + return array_[(d+1)/2]; + } + + T operator[] (Direction d) const + { + return elem (d); + } + Drul_array () + {} + Drul_array (T t1, T t2) + { + array_[0] = t1; + array_[1] = t2; + } +}; + +#endif // DRUL_ARRAY_HH diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 20f5987e43..5f43a3c0e0 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -10,7 +10,7 @@ #include #include "fproto.hh" #include "real.hh" - +#include "drul-array.hh" /** a T interval. this represents the closed interval [left,right]. No invariants. T must be a totally ordered ring (with division, anyway ..) @@ -18,48 +18,30 @@ */ template -struct Interval_t { - T left, right; +struct Interval_t : public Drul_array { /* ************** */ static T infinity() ; static String T_to_str (T arg); - // ugh, egcs 1.02 ices on this -// T center() { return (left + right) / T(2);} - // and can't handle this either - // anyone want to make a bug report? - // better make one soon, egcs in rh5.1 barfs on this! - T center() { - T two (2); -// return (left + right) / two; - T result ((left + right) / two); - return result; - } - void translate (T t) { - left += t; - right += t; - } - T& idx (int j) { - if (j==-1) - return left; - else if (j==1) - return right; - else - assert (false); - return left; - } - T& operator[](int j) { - return idx (j); - } - T operator[](int j) const { - return ((Interval_t *)this)->idx (j); - } - T &max() { return right;} - T max() const { return right;} - T min() const{ return left; } - T &min(){ return left; } + /* + ugh, egcs 1.02 ices on this + */ + T center() { return (elem (LEFT) + elem (RIGHT)) / T(2);} + void translate (T t) + { + elem (LEFT) += t; + elem (RIGHT) += t; + } + + /* + junk us + */ + T &max() { return elem (RIGHT);} + T max() const { return elem (RIGHT);} + T min() const{ return elem (LEFT); } + T &min(){ return elem (LEFT); } /** PRE *this and h are comparable @@ -69,32 +51,30 @@ struct Interval_t { T length() const; void set_empty() ; - bool empty_b() const { return left > right; } + bool empty_b() const { return elem (LEFT) > elem (RIGHT); } bool contains_b (Interval_t const&) const; Interval_t() { set_empty(); } - Interval_t (T m, T M) { - left =m; - right = M; - } + Interval_t (T m, T M) : Drul_array (m,M) + {} Interval_t &operator -= (T r) { *this += -r; return *this; } Interval_t &operator += (T r) { - left += r; - right +=r; + elem (LEFT) += r; + elem (RIGHT) +=r; return *this; } Interval_t &operator *=(T r) { - left *= r; - right *= r; + elem (LEFT) *= r; + elem (RIGHT) *= r; if (r < T(0)) { - T t = left; - left = right; - right = t; + T t = elem (LEFT); + elem (LEFT) = elem (RIGHT); + elem (RIGHT) = t; } return *this; } @@ -102,10 +82,10 @@ struct Interval_t { void print () const; bool elem_b (T r); void negate () { - T r = -left; - T l = -right; - left = l; - right =r; + T r = -elem (LEFT); + T l = -elem (RIGHT); + elem (LEFT) = l; + elem (RIGHT) =r; } }; @@ -181,7 +161,7 @@ Interval_t operator *(Interval_t i,T a){ // again? see fproto.hh typedef Interval_t Interval; -typedef Interval_t Slice; +typedef Interval_t Slice; // weird name #endif // INTERVAL_HH diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 65f1976ad7..df74ef3164 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -27,13 +27,13 @@ template int _Interval__compare (const Interval_t&a,Interval_t const&b) { - if (a.left == b.left && a.right == b.right) + if (a.elem (LEFT) == b.elem (LEFT) && a.elem (RIGHT) == b.elem (RIGHT)) return 0; - if (a.left <= b.left && a.right >= b.right) + if (a.elem (LEFT) <= b.elem (LEFT) && a.elem (RIGHT) >= b.elem (RIGHT)) return 1; - if (a.left >= b.left && a.right <= b.right) + if (a.elem (LEFT) >= b.elem (LEFT) && a.elem (RIGHT) <= b.elem (RIGHT)) return -1; return -2; @@ -63,44 +63,49 @@ template void Interval_t::set_empty() { - left = (T) infinity(); - right = (T) -infinity(); + elem (LEFT) = (T) infinity(); + elem (RIGHT) = (T) -infinity(); } template T Interval_t::length() const { - if (right < left) + if (elem (RIGHT) < elem (LEFT)) return 0; else - return right-left; + return elem (RIGHT)-elem (LEFT); } +/** + smallest Interval which includes *this and #h# + */ template void Interval_t::unite (Interval_t h) { - if (h.leftright) - right = h.right; + elem (LEFT) = h.elem (LEFT) ?elem (RIGHT); + +#if 0 + if (h.elem (LEFT)elem (RIGHT)) + elem (RIGHT) = h.elem (RIGHT); +#endif } -/** - smallest Interval which includes *this and #h# - */ template void Interval_t::intersect (Interval_t h) { #if defined (__GNUG__) && ! defined (__STRICT_ANSI__) - left = h.left >? left; - right = h.right ? elem (LEFT); + elem (RIGHT) = h.elem (RIGHT) ::str() const return "[empty]"; String s ("["); - return s + T_to_str (left) + String ("," ) + T_to_str (right ) + String ("]" ); + return s + T_to_str (elem (LEFT)) + String ("," ) + T_to_str (elem (RIGHT) ) + String ("]" ); } template bool Interval_t::elem_b (T r) { - return r >= left && r <= right; + return r >= elem (LEFT) && r <= elem (RIGHT); } diff --git a/input/test/memory.ly b/input/test/memory.ly new file mode 100644 index 0000000000..fad3f4e313 --- /dev/null +++ b/input/test/memory.ly @@ -0,0 +1,13 @@ +%{ +do a memory stress test. +%} + + +bla = \notes { + c1(((( c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break c1 \break ))))c1} + +\score { \type Score < + \bla \bla \bla \bla \bla \bla \bla + > + \paper { Gourlay_maxmeaures = 2.; } +} diff --git a/lily/abbrev.cc b/lily/abbrev.cc index d58eeaec81..d476552f27 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -121,7 +121,7 @@ Abbreviation::do_brew_molecule_p () const } void -Abbreviation::do_substitute_dependent (Score_element*o, Score_element*n) +Abbreviation::do_substitute_element_pointer (Score_element*o, Score_element*n) { if (stem_l_ == o) stem_l_ = dynamic_cast (n); diff --git a/lily/align-element.cc b/lily/align-element.cc index a0afa0dac9..c10392cda4 100644 --- a/lily/align-element.cc +++ b/lily/align-element.cc @@ -50,7 +50,7 @@ Align_element::add_element_priority (Score_element *el, int p) } void -Align_element::do_substitute_dependency (Score_element*o, +Align_element::do_substitute_element_pointer (Score_element*o, Score_element*n) { int i; diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 3c9ce0ca7f..8517e93862 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -65,21 +65,22 @@ Axis_group_spanner::do_break_processing() /* this piece doesn't know where it belongs. Find out if it was broken, and use the broken remains */ - Spanner * sp =dynamic_cast (elt); + Item *it = dynamic_cast (elt) ; - if (sp) + if (Spanner * sp =dynamic_cast (elt)) { - for (int j =0; j < broken_into_l_arr_.size(); j++) + for (int j =0; j < sp->broken_info_.size(); j++) { + Line_of_score *l = sp->broken_info_[j].line_l_; + Axis_group_spanner * my_broken_l - = dynamic_cast(broken_into_l_arr_[j]); - + = dynamic_cast(find_broken_piece (l)); + Spanner * broken_span_l - = sp->find_broken_piece (dynamic_cast(my_broken_l)->line_l()); + = sp->find_broken_piece (l); if (broken_span_l) my_broken_l->add_element (broken_span_l); - } } else if (it && it->breakable_b_ && it->break_status_dir () == 0) diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index 63e6155438..5af8d286ff 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -90,14 +90,12 @@ Bar_script_engraver::do_pre_move_processing () { if (text_p_) { - text_p_->breakable_b_ = true; // ugh typeset_element (text_p_); text_p_ =0; } if (staff_side_p_) { - staff_side_p_->breakable_b_ = true; // ugh typeset_element (staff_side_p_); staff_side_p_ = 0; } @@ -112,8 +110,11 @@ Bar_script_engraver::create_items (Request *rq) staff_side_p_ = new G_staff_side_item; staff_side_p_->axis_ = axis_; + staff_side_p_->breakable_b_ = true; // ugh + text_p_ = new G_text_item; + text_p_->breakable_b_ = true; // ugh Scalar prop = get_property (type_ + "Direction", 0); if (prop.isnum_b ()) diff --git a/lily/beam.cc b/lily/beam.cc index 429970ac0c..be8f73b1e1 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -123,7 +123,7 @@ Beam::do_post_processing () } void -Beam::do_substitute_dependent (Score_element*o,Score_element*n) +Beam::do_substitute_element_pointer (Score_element*o,Score_element*n) { if (Stem * os = dynamic_cast (o)) stems_.substitute (os, diff --git a/lily/bow.cc b/lily/bow.cc index 873613b121..db08356b32 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -44,8 +44,6 @@ Bow::do_brew_molecule_p () const { static int i = 1; cout << "******" << i++ << "******" << endl; - // gcc 2.7.2: ices -// cout << "c0.y: " << c[0].y << endl; cout << "c0.y: " << c[0].y () << endl; cout << "c3.y: " << c[3].y () << endl; cout << "dy: " << dy << endl; @@ -75,8 +73,7 @@ Bow::center () const /* - - ugh . Control points are too crude measures. + Ugh. Control points are too crude measures. */ Interval Bow::do_height () const @@ -92,15 +89,6 @@ Bow::do_height () const return iv; } -#if 0 -Interval -Bow::do_width () const -{ - Interval i = Spanner::do_width (); - Real dx = i.length(); - return Interval (0, dx); -} -#endif Array Bow::get_controls () const diff --git a/lily/break.cc b/lily/break.cc index 9211bfcf1e..a836d62da3 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -47,23 +47,11 @@ Col_stats::Col_stats () /* **************************************************************** */ -Line_of_cols -Break_algorithm::all_cols () const -{ - Line_of_cols retval; - for (PCursor c (pscore_l_->col_p_list_.top ()); - c.ok (); c++) - { - - retval.push (c); - } - return retval; -} Array Break_algorithm::find_break_indices () const { - Line_of_cols all (all_cols ()); + Line_of_cols all (pscore_l_->col_l_arr_); Array retval; for (int i=0; i < all.size (); i++) @@ -81,7 +69,7 @@ Break_algorithm::find_break_indices () const Line_of_cols Break_algorithm::find_breaks () const { - Line_of_cols all (all_cols ()); + Line_of_cols all (pscore_l_->col_l_arr_); Line_of_cols retval; for (int i=0; i < all.size (); i++) @@ -156,7 +144,7 @@ Break_algorithm::feasible (Line_of_cols curline) const void Break_algorithm::problem_OK () const { - if (!pscore_l_->col_p_list_.size ()) + if (pscore_l_->col_l_arr_.empty ()) error (_("score does not have any columns")); OK (); } @@ -165,11 +153,13 @@ void Break_algorithm::OK () const { #ifndef NDEBUG - iter_top (pscore_l_->col_p_list_,start); + #if 0 + iter_top (pscore_l_->col_p_list_,start); PCursor end (pscore_l_->col_p_list_.bottom ()); assert (start->breakable_b_); assert (end->breakable_b_); + #endif #endif } diff --git a/lily/collision.cc b/lily/collision.cc index 09b34bf27c..5da7436713 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -165,7 +165,7 @@ Collision::do_pre_processing() void -Collision::do_substitute_dependency (Score_element*o_l,Score_element*n_l) +Collision::do_substitute_element_pointer (Score_element*o_l,Score_element*n_l) { if (o_l) { diff --git a/lily/direction.cc b/lily/direction.cc index d073a901d8..a0ac3e6bbf 100644 --- a/lily/direction.cc +++ b/lily/direction.cc @@ -9,6 +9,7 @@ #include "direction.hh" +#if 0 String direction_str (Direction d, Axis a) { String s("center"); @@ -22,3 +23,4 @@ String direction_str (Direction d, Axis a) } return s; } +#endif diff --git a/lily/dot-column.cc b/lily/dot-column.cc index ccf4d1f912..c2e1d912b0 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -30,7 +30,7 @@ Dot_column::add_head (Rhythmic_head *r) } void -Dot_column::do_substitute_dependency (Score_element*o,Score_element*n) +Dot_column::do_substitute_element_pointer (Score_element*o,Score_element*n) { Item *oi =dynamic_cast (o); diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 8e33175deb..104793dca4 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -7,7 +7,6 @@ */ #include "proto.hh" -#include "plist.hh" #include "engraver-group.hh" #include "engraver.hh" #include "debug.hh" diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 4a06ed13f6..764d42c77a 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -100,7 +100,7 @@ Extender_spanner::do_post_processing () } void -Extender_spanner::do_substitute_dependency (Score_element* o, Score_element* n) +Extender_spanner::do_substitute_element_pointer (Score_element* o, Score_element* n) { Item* new_l = n ? dynamic_cast (n) : 0; if (dynamic_cast (o) == item_l_drul_[LEFT]) diff --git a/lily/g-staff-side.cc b/lily/g-staff-side.cc index 2a144dcfd2..660e9fefc2 100644 --- a/lily/g-staff-side.cc +++ b/lily/g-staff-side.cc @@ -53,7 +53,7 @@ G_staff_side_item::add_support (Score_element*e) void -G_staff_side_item::do_substitute_dependency (Score_element*o, Score_element*n) +G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element*n) { if (o == to_position_l_) to_position_l_ = n; diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index b25cc0493d..c8dbf35e49 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -14,6 +14,9 @@ #include "p-score.hh" #include "paper-def.hh" +#include "killing-cons.tcc" + +/// How often to print operator pacification marks? const int HAPPY_DOTS_I = 3; /** @@ -36,14 +39,15 @@ struct Break_node { }; /** - This algorithms is adapted from + This algorithms is adapted from the OSU Tech report on breaking lines. + */ Array Gourlay_breaking::do_solve () const { Array optimal_paths; - Line_of_cols all = all_cols (); + Line_of_cols all = pscore_l_->col_l_arr_ ; Array breaks = find_break_indices (); optimal_paths.set_size (breaks.size ()); @@ -61,7 +65,7 @@ Gourlay_breaking::do_solve () const { Array candidates; Array candidate_lines; - Pointer_list spacer_p_list; + Cons_list spacer_p_list; /* start with a short line, add measures. At some point @@ -90,7 +94,7 @@ Gourlay_breaking::do_solve () const approx.spacer_l_ = generate_spacing_problem (line, pscore_l_->paper_l_->line_dimensions_int (optimal_paths[start_idx].line_i_)); - spacer_p_list.bottom ().add (approx.spacer_l_); + spacer_p_list.append (new Killing_cons (approx.spacer_l_,0)); ( (Break_algorithm*)this)->approx_stats_.add (approx.cols); approx.approximate_solve_line (); @@ -149,6 +153,8 @@ Gourlay_breaking::do_solve () const if (! (break_idx % HAPPY_DOTS_I)) *mlog << "[" << break_idx << "]" << flush; + + spacer_p_list.junk (); } if (break_idx % HAPPY_DOTS_I) diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index fa95b295cc..70a7f57ccb 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -39,7 +39,7 @@ Hara_kiri_vertical_group_spanner::do_post_processing () } void -Hara_kiri_vertical_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n) +Hara_kiri_vertical_group_spanner::do_substitute_element_pointer (Score_element*o, Score_element*n) { if (Item *it = dynamic_cast (o)) interesting_items_.substitute (it, dynamic_cast (n)); diff --git a/lily/include/abbrev.hh b/lily/include/abbrev.hh index 7f8580228d..960956548a 100644 --- a/lily/include/abbrev.hh +++ b/lily/include/abbrev.hh @@ -16,7 +16,7 @@ class Abbreviation : public Item { protected: virtual void do_print () const; virtual Molecule *do_brew_molecule_p () const; - virtual void do_substitute_dependent (Score_element*, Score_element*); + virtual void do_substitute_element_pointer (Score_element*, Score_element*); public: int abbrev_flags_i_; Abbreviation (); diff --git a/lily/include/align-element.hh b/lily/include/align-element.hh index 3034773d45..0a9f1e6958 100644 --- a/lily/include/align-element.hh +++ b/lily/include/align-element.hh @@ -50,7 +50,7 @@ public: protected: virtual void do_print() const; - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual void do_post_processing() ; virtual void do_pre_processing (); virtual void do_side_processing (); diff --git a/lily/include/atom.hh b/lily/include/atom.hh index 52d17f88f2..eb231dc7fd 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -15,6 +15,7 @@ #include "lily-proto.hh" #include "lily-guile.hh" + #ifdef ATOM_SMOB /// a symbol which can be translated, and freely copied diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 7579c1dbdf..ee3ae12af8 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -9,8 +9,6 @@ #include "item.hh" /** A vertical bar. - - TODO: connections with pre and postbreak */ class Bar:public Item { public: diff --git a/lily/include/beam.hh b/lily/include/beam.hh index acfb81803b..f30098a427 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -59,10 +59,8 @@ protected: void set_steminfo (); virtual void do_pre_processing (); virtual void do_post_processing (); - virtual void do_substitute_dependent (Score_element*, Score_element*); - + virtual void do_substitute_element_pointer (Score_element*, Score_element*); virtual void do_print() const; - virtual void quantise_left_y (bool extend_b); virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const; virtual void calculate_slope (); diff --git a/lily/include/bow.hh b/lily/include/bow.hh index ba7e20ff6e..c6b946e87b 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -23,8 +23,6 @@ public: Bow (); Offset center () const; - - int dash_i_; Real interstaff_f_; Drul_array vertical_align_drul_; diff --git a/lily/include/break.hh b/lily/include/break.hh index af1cbcd699..f2b9d9df90 100644 --- a/lily/include/break.hh +++ b/lily/include/break.hh @@ -42,7 +42,6 @@ protected: /// search all pcols which are breakable. Line_of_cols find_breaks() const; - Line_of_cols all_cols() const; Array find_break_indices() const; diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 4f6ef42da8..832ac89704 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -22,7 +22,7 @@ */ class Collision : public Horizontal_vertical_group_item { protected: - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual void do_pre_processing(); public: Link_array clash_l_arr_; diff --git a/lily/include/cons.hh b/lily/include/cons.hh index 472f0a89a8..d0ba58d9cf 100644 --- a/lily/include/cons.hh +++ b/lily/include/cons.hh @@ -9,29 +9,6 @@ #ifndef CONS_HH #define CONS_HH -#if 0 -template -class NCons -{ -public: - T car_; - U cdr_; - NCons (T t, U u) : car_ (t), cdr_ (u) {} - virtual ~NCons () {} -}; - -template -class Pointer_cons : public NCons -{ - Pointer_cons () : Cons (0,0){} - Pointer_cons (T t, Pointer_cons*c) - : Cons (t,c) - { - car_ = t; - next_ = c; - } -}; -#endif template @@ -40,10 +17,11 @@ class Cons public: T * car_; Cons * next_; - Cons () { - car_=0; - next_ =0; - } + Cons () + { + car_=0; + next_ =0; + } Cons (T*t, Cons*c) { car_ = t; @@ -67,6 +45,17 @@ public: }; +/// remove the link pointed to by *p. +template +Cons *remove_cons (Cons **pp) +{ + Cons *knip = *pp; + *pp = (*pp)->next_; + knip->next_ = 0; + return knip; +} + + template class Cons_list { @@ -74,13 +63,34 @@ public: Cons * head_; Cons ** tail_; Cons_list () { head_ =0; tail_ = &head_; } + void append (Cons *c) + { + assert (!c->next_); + *tail_ = c; + while (*tail_) + tail_ = &(*tail_)->next_; + } + Cons *remove_cons (Cons **pp) + { + if (&(*pp)->next_ == tail_) + tail_ = pp; + + return ::remove_cons (pp); + } + void junk () + { + delete head_; + head_ =0; + } + ~Cons_list () { junk (); } }; template -Cons_list copy_killing_cons_list (Cons *src); +void copy_killing_cons_list (Cons_list&, Cons *src); template -Cons_list clone_killing_cons_list (Cons *src); +void +clone_killing_cons_list (Cons_list&, Cons *src); #endif /* CONS_HH */ diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 42dfc2dd14..67a62429c2 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -27,6 +27,6 @@ public: protected: virtual void do_pre_processing (); - virtual void do_substitute_dependency (Score_element *o, Score_element*n); + virtual void do_substitute_element_pointer (Score_element *o, Score_element*n); }; #endif // DOT_COLUMN_HH diff --git a/lily/include/extender-spanner.hh b/lily/include/extender-spanner.hh index ca061a2fc9..d97edc8401 100644 --- a/lily/include/extender-spanner.hh +++ b/lily/include/extender-spanner.hh @@ -41,7 +41,7 @@ protected: virtual Molecule* do_brew_molecule_p () const; void do_add_processing (); Interval do_height () const; - void do_substitute_dependency (Score_element* o, Score_element* n); + void do_substitute_element_pointer (Score_element* o, Score_element* n); void do_post_processing (); VIRTUAL_COPY_CONS (Score_element); diff --git a/lily/include/g-staff-side.hh b/lily/include/g-staff-side.hh index b6c55dd7c9..b489844e8f 100644 --- a/lily/include/g-staff-side.hh +++ b/lily/include/g-staff-side.hh @@ -29,7 +29,7 @@ public: virtual void set_default_direction (); VIRTUAL_COPY_CONS(Score_element); protected: - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual void do_pre_processing (); virtual void do_post_processing (); }; diff --git a/lily/include/hara-kiri-vertical-group-spanner.hh b/lily/include/hara-kiri-vertical-group-spanner.hh index 33bf0a4f6f..3f5031ba48 100644 --- a/lily/include/hara-kiri-vertical-group-spanner.hh +++ b/lily/include/hara-kiri-vertical-group-spanner.hh @@ -26,7 +26,7 @@ public: protected: VIRTUAL_COPY_CONS(Score_element); - virtual void do_substitute_dependency (Score_element*, Score_element*); + virtual void do_substitute_element_pointer (Score_element*, Score_element*); virtual void do_print ()const; Link_array interesting_items_; diff --git a/lily/include/killing-cons.tcc b/lily/include/killing-cons.tcc index d67e6b56b7..9135aae3d8 100644 --- a/lily/include/killing-cons.tcc +++ b/lily/include/killing-cons.tcc @@ -10,6 +10,7 @@ #ifndef KILLING_CONS_TCC #define KILLING_CONS_TCC +#include "cons.hh" template Killing_cons::~Killing_cons () @@ -18,35 +19,25 @@ Killing_cons::~Killing_cons () } template -Cons_list -copy_killing_cons_list (Cons *src) +void +copy_killing_cons_list (Cons_list &dest, Cons *src) { - Cons_list kl; - for (; src; src = src->next_) { T *t = new T(*src->car_); - *kl.tail_ = new Killing_cons (t, 0); - kl.tail_ = &(*kl.tail_)->next_; + dest.append ( new Killing_cons (t, 0)); } - - return kl; } template -Cons_list -clone_killing_cons_list (Cons *src) +void +clone_killing_cons_list (Cons_list & dest, Cons *src) { - Cons_list kl; - for (; src; src = src->next_) { T *t = src->car_->clone (); - *kl.tail_ = new Killing_cons (t, 0); - kl.tail_ = &(*kl.pp)->next_; + dest.append (new Killing_cons (t, 0)); } - - return kl; } diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 01d3171563..2e85d6dc56 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -32,7 +32,7 @@ public: void add (Musical_pitch); protected: virtual void do_pre_processing(); - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual Molecule* do_brew_molecule_p() const; }; #endif // LOCALKEYITEM_HH diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index 7a62fcdc05..b675686929 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -28,7 +28,7 @@ protected: virtual void do_add_processing (); virtual void do_post_processing (); virtual void do_print () const; - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); }; #endif /* MULTI_MEASURE_REST_HH */ diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index aaf67c6aea..7060c70576 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -18,7 +18,7 @@ #include "interpretation-context-handle.hh" /** Walk through music and deliver music to translation units, synced - in time. This classa provides both the implementation of the shared + in time. This class provides both the implementation of the shared code, and the public interface. Derived classes should only have a public constructor. diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 097079c712..88417f162d 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -19,7 +19,7 @@ class Note_column : public Script_column { protected: virtual void do_pre_processing(); virtual void do_print () const; - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); public: /** The relative position of the "voice" containing this chord. Normally this would be the same as the stem direction, diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 8f8a5f7bbf..88e2d54f24 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -13,7 +13,6 @@ #include "colhpos.hh" #include "parray.hh" #include "lily-proto.hh" -#include "plist.hh" #include "music-output.hh" /** all stuff which goes onto paper. notes, signs, symbols in a score @@ -23,18 +22,19 @@ class Paper_score : public Music_output { + /// crescs etc; no particular order + Link_array span_p_arr_; + + /// other elements + Link_array elem_p_arr_; + + public: Paper_def *paper_l_; /// the columns, ordered left to right - Link_list col_p_list_; - - /// crescs etc; no particular order - Pointer_list span_p_list_; + Link_array col_l_arr_; - /// other elements - Pointer_list elem_p_list_; - Paper_outputter *outputter_l_; Line_of_score * line_l_; @@ -45,12 +45,10 @@ public: void add_column (Paper_column*); /** - @return argument as a cursor of the list + @return index of argument. */ - PCursor find_col (Paper_column const *) const; + int find_col_idx (Paper_column const *) const; - Link_array col_range (Paper_column *left_l, Paper_column *right_l) const; - Link_array breakable_col_range (Paper_column*,Paper_column*) const; Link_array broken_col_range (Item const*,Item const*) const; @@ -69,12 +67,13 @@ protected: /* MAIN ROUTINES */ virtual void process(); -// can't instantiate template with cygnus' gcc... -// virtual ~Paper_score(); private: - void remove_line (Line_of_score*); + + Link_array remove_line (Line_of_score*); + Link_array remove_break_helpers (); + /// before calc_breaking void preprocess(); @@ -84,9 +83,7 @@ private: /// after calc_breaking void postprocess(); - - /// delete unused columns - void clean_cols(); + Paper_score (Paper_score const &); }; #endif diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index f380032604..2ddb2da351 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -24,6 +24,6 @@ protected: virtual void do_post_processing(); virtual void do_pre_processing(); virtual void do_print() const; - virtual void do_substitute_dependency (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); }; #endif // REST_COLLISION_HH diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 49669f77ab..6187a2f645 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -26,7 +26,7 @@ public: protected: virtual void do_add_processing (); virtual void do_print () const; - virtual void do_substitute_dependent (Score_element*,Score_element*); + virtual void do_substitute_element_pointer (Score_element*,Score_element*); }; #endif // RHYTHMIC_HEAD_HH diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 919333c9a6..69f8eb998f 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -1,7 +1,7 @@ /* - score-element.hh -- part of GNU LilyPond + score-element.hh -- declare Score_element - (c) 1996,97 Han-Wen Nienhuys + (c) 1996-1999 Han-Wen Nienhuys */ #ifndef STAFFELEM_HH @@ -26,6 +26,8 @@ typedef void (Score_element::*Score_element_method_pointer) (void); (elem) */ class Score_element : private Directed_graph_node, public virtual Graphical_element { public: + /// delete after linebreak calculation. + bool break_helper_only_b_; Paper_score *pscore_l_; Molecule * output_p_; Score_element (); @@ -101,8 +103,7 @@ protected: /// do calculations after determining horizontal spacing virtual void do_post_processing (); - virtual void do_substitute_dependency (Score_element * , Score_element *); - virtual void do_substitute_dependent (Score_element *, Score_element *); + virtual void do_substitute_element_pointer (Score_element * , Score_element *); virtual void do_break_processing (); virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); @@ -110,7 +111,6 @@ protected: virtual Link_array get_extra_dependencies () const; virtual void do_unlink (); virtual void do_junk_links (); - }; diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 70464204f3..94d1e481e1 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -18,7 +18,7 @@ class Script_column : public Horizontal_vertical_group_item { protected: virtual void do_print() const; - virtual void do_substitute_dependency (Score_element*, Score_element*); + virtual void do_substitute_element_pointer (Score_element*, Score_element*); virtual void do_pre_processing() ; public: Link_array