From: Han-Wen Nienhuys Date: Mon, 29 Mar 1999 07:03:09 +0000 (+0200) Subject: release: 1.1.37 X-Git-Tag: release/1.1.37 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=67a763d2c94cf4e24c01186d9f2df06b31778778;p=lilypond.git release: 1.1.37 --- diff --git a/Documentation/tex/GNUmakefile b/Documentation/tex/GNUmakefile index 4d5c1ecc18..aaea8b17a7 100644 --- a/Documentation/tex/GNUmakefile +++ b/Documentation/tex/GNUmakefile @@ -74,3 +74,6 @@ $(outdir)/%.html: %.bib #out/%: $(outdir)/% # cp -f $< $@ + +localclean: + rm -f fonts.aux fonts.log feta*.tfm feta*.*pk diff --git a/Documentation/tex/feta.tex b/Documentation/tex/feta.tex index 36633bea1b..c713e128af 100644 --- a/Documentation/tex/feta.tex +++ b/Documentation/tex/feta.tex @@ -14,7 +14,7 @@ \font\title = cmbx12 scaled \magstep 4 \font\subtitle = cmr9 -\def\lilyfooter{Lily was here, 1.1.0} +\def\lilyfooter{Lily was here} \def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}\hss}} \def\charsperline{6} @@ -22,23 +22,23 @@ \def\charwidth{60pt} \def\listfont#1#2#3{ - \n=#2 - \advance\n by-1 - \advance\n by-\charsperline + \n=#2 + \advance\n by-1 + \advance\n by-\charsperline \loop\ifnum\n<#3 - \advance\n by\charsperline - \i=0 - {\vbox to\charheight{\vss\centerline{ - {\loop\ifnum\i<\charsperline - \advance\i by1 - \advance\n by1 + \advance\n by\charsperline + \i=0 + {\vbox to\charheight{\vss\centerline{ + {\loop\ifnum\i<\charsperline + \advance\i by1 + \advance\n by1 {\setchar{#1}{\number\n}} - \repeat}}}}\repeat} + \repeat}}}}\repeat} \centerline{\title FETA} -\centerline{\subtitle (definately not an abbreviation for Font-En-Tja)} +\centerline{\subtitle (definitely not an abbreviation for Font-En-Tja)} \vskip5mm diff --git a/Documentation/tex/other-packages.bib b/Documentation/tex/other-packages.bib index 866659ee0d..e2c7aaafc9 100644 --- a/Documentation/tex/other-packages.bib +++ b/Documentation/tex/other-packages.bib @@ -168,7 +168,14 @@ html= {http://www.musicwareinc.com/}, note={A rewrite of MusicTeX. After licensing quarrels, MusiXTeX has been split into two (both still non-GNU GPL licensed) branches.}, } - + + + +@Misc{opus, + title = {opus}, +html={http://www.sincrosoft.com} +} + @misc{musixtex2, title = {MusiXTeX}, HTML={http://www.gmd.de/Misc/Music/}, diff --git a/NEWS b/NEWS index ab116dcc2c..8c09cf7b0e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,31 @@ + + - diamond heads (probably really ugly). + - cross head. + - tweaked harmonic head a bit. + - property noteHeadStyle + +pl 36.mb2 + - bf: timeSignatureStyle + - Added dynamic fz (forzando) to Lilypond + - bf: N.W.Gade, sfz -> fz + +pl 36.hwn1 + - debian fixes. + - don't insert extra alignment space for empty stuff. + - Align_element derives from Axis_group_element + - junk all *{horizontal,vertical}* Score_element derived classes. + - G_staff_side_item::padding_f_ now generic property. + - some tweaking of beam & stem. + - junk pointerlist in Sources + - junk Stem::mult_i_, Stem::beam_gap_i_, G_staff_side_item::padding + Bar::at_line_start_b_, Key_item::c_position_, Note_head::type_str_, + Note_head::staff_size, Stem::xdir_ + pl 36.mb1 - bf: N.W.Gade +************** + pl 35.uu1 - more memory tweaks: don't do Score_element::line_l () when deleting lines. - more generic properties. @@ -13,6 +38,7 @@ pl 35.uu1 pl 35.jcn1 - some ps fixes +************ pl 35 pl 34.hwn2 diff --git a/TODO b/TODO index 10fca2894a..328e9d3615 100644 --- a/TODO +++ b/TODO @@ -10,8 +10,17 @@ Grep for TODO and ugh/ugr/urg. .* BUGS . * header for PS enteredby = "bla " +. * Hash_table::remove (). +. * 1. With "lilypond -f ps": The black notes with ledger lines seem to +> have extra "blobs" over and to the left of them and all the ledger +> lines from the staff to the note will have a blob too. For example, +> with the note "a4" there will be a black note at the ledger line where +> "c" would be too. However, only the "a4" will have the extra blob. + . * ps/lily.ps . * AFM for BlueSky AFM files. +. * devise standard for functioning of Vertical_align_element. +. * fix interstaff slurs & beams. . * staff size for post/prebreaks . * .ly files . * input/star-spangled-banner @@ -49,7 +58,7 @@ Grep for TODO and ugh/ugr/urg. } } . * midi key. -. *P.P.S. It can be cool in mudela-book to distinguish in pre,postMudelaExample, +. * P.P.S. It can be cool in mudela-book to distinguish in pre,postMudelaExample, whether MudelaExample is epsed or not: ( if this fragment is floating eps, than 1, otherwise 2). say preMudelaExample[eps]{}, and change it in document body sometimes. . * fix singleStaffBracket @@ -61,7 +70,7 @@ otherwise 2). say preMudelaExample[eps]{}, and change it in document body someti . * 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?) +. * latex bla.tex broken (titles / \lilyfooter stuff? . * fix dynamics decently, ie. use kerning & ligatures. . * support_l_arr_ empty in staff-margin's G_staff_side_item . * minVerticalAlign for StaffGroups. @@ -108,7 +117,6 @@ specify the third. Should there be? . * make "in-between" engraver (Tie, Extender) . * make wide_spanner_engraver (line_group_spanne,r staff_symbol) . * remove Interval dim_ from Dimension_cache and rename the struct. -. * merge align_element and axis_element_group. . * do scaled fonts generally . * The Lilypond accidental symbols are available through the TeX macros, \textflat, \textsharp and \textnatural defined in the init file @@ -124,7 +132,7 @@ compilation. . * junk Script_def . * include examples in RPM. . * fix partial measures in meaningful way. -. * working notehead style. + . * add scripts to bars eg. |^"bla" . * relative mode for mi2mu . * uniformise recent feta contributions. @@ -146,8 +154,6 @@ But what if I want a chord that lasts for 3 whole notes? Or what about 2.5 whole notes? Is there a mechanism for getting this kind of length? - - . * fractional chord durs. . * hang Item on Spanner . * do --safe for PS output? @@ -206,7 +212,6 @@ length? . * strip EXEs before installing . * zip target for binary windows dist (JBR) . * junking \skip req in lyrics -. * percussion note heads . * mi2mu empty staffs. . * horizontal centering of dynamics . * $DEPENDENCIES_OUTPUT support @@ -222,7 +227,6 @@ gs: Operand stack: organ you want to be able to give stop indications on the way through, so the \property Voice.Instrument would be a stop, and \property GrandStaff.instrument would be PipeOrgan...) -. * revise the Score_priority_align_engraver concept. It sucks. . * *.yo: fix pod manpage layout legacy . * text-items clash with stems/beams . * --include, -I option for ly2dvi (pass on to lily) @@ -537,6 +541,7 @@ hesitate to ask. . * specify number of lines .* INPUTLANGUAGE +. * \rhythms 4 16 16 16 16; c c c c c -> c4 c16 etc. . * Language: . * \type -> \context ? . * \translator -> ? diff --git a/VERSION b/VERSION index bba7d95450..c24cec832a 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=36 -MY_PATCH_LEVEL=mb1 +PATCH_LEVEL=37 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/debian/changelog b/debian/changelog index c31123b6ba..804e47bb20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +lilypond (1.1.36-1) unstable; urgency=low + + * New upstream release. + * [debian/rules]: + - Make and install info files. + - Removed "CC=egcc" because the default gcc on all platforms is + now the one from egcs. + - Install *.png instead of *.xpm. + - Minor clean-ups. + * Added debian/compress to make sure *.png are not compressed. + * Added debian/doc-base and postinst/prerm for the LilyPond info files. + + -- Anthony Fok Sun, 21 Mar 1999 13:39:39 -0700 + lilypond (1.1.31-1) unstable; urgency=low * New upstream release. diff --git a/debian/copyright b/debian/copyright index aa4d619705..dcd268aca5 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,12 +1,8 @@ -This package was debianized by Anthony Fok on +This package was Debianized by Anthony Fok on Wed, 6 Aug 1997 04:30:28 -0600 It was downloaded from - ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/v1.1/lilypond-1.1.31.tar.gz - -It is also available from: - - ftp://sca.uwaterloo.ca/pub/lilypond/development/ + ftp://ftp.lilypond.org/pub/LilyPond/v1.1/lilypond-1.1.36.tar.gz For more information about GNU LilyPond, please visit: http://www.cs.uu.nl/~hanwen/lilypond/ diff --git a/debian/postinst b/debian/postinst index 7f781eb295..ac8e261b95 100755 --- a/debian/postinst +++ b/debian/postinst @@ -19,6 +19,10 @@ TEXMFMAIN=`/usr/bin/kpsewhich -expand-var '$TEXMFMAIN'` echo " Running /usr/bin/mktexlsr ..." /usr/bin/mktexlsr +install-info --description='LilyPond, the GNU Project music typesetter' \ + --section "Music" "Music" \ + --quiet /usr/info/lilypond.info.gz + #DEBHELPER# # If we are the last package to use the old /usr/lib/texmf/doc, diff --git a/debian/rules b/debian/rules index 38207cad73..7a94ca326f 100755 --- a/debian/rules +++ b/debian/rules @@ -14,19 +14,6 @@ SHELL = /bin/sh r = debian/tmp d = usr/doc/$(package) -strayfiles := stepmake/bin/*.pyc \ - stepmake/stepmake/stepmake \ - stepmake/stepmake/bin \ - stepmake/stepmake/aclocal.m4 \ - stepmake/GNUmakefile \ - GNUmakefile \ - config.h \ - wwwlist \ - Documentation/tex/fonts.aux \ - Documentation/tex/fonts.log \ - Documentation/tex/feta*.tfm \ - Documentation/tex/feta*.*pk - # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -34,15 +21,18 @@ build: build-stamp build-stamp: dh_testdir - CC=egcc ./configure --disable-checking --disable-debugging \ + ./configure --disable-checking --disable-debugging \ --enable-printing --prefix=/usr --disable-optimise \ --enable-shared $(MAKE) all - # $(MAKE) htmldoc + $(MAKE) -C Documentation/pictures pngs # Remove the "-" and the "-k" once the \times segfault # bug is fixed. (lilypond-1.1.31, 1999-02-17) -$(MAKE) -k -C Documentation/tex dvi + -$(MAKE) -C Documentation info + + # $(MAKE) htmldoc touch build-stamp @@ -51,11 +41,9 @@ clean: dh_testroot rm -f build-stamp install-stamp -$(MAKE) distclean + rm -f stepmake/stepmake/aclocal.m4 dh_clean - # Remove the following line once the *.make files are fixed - rm -f $(strayfiles) - # Correct the owner of the out/dummy.dep files when built with sudo. if [ -n "$$SUDO_USER" -a -n "$$SUDO_GID" ]; then \ find . -user root | xargs -r chown --dereference $$SUDO_USER.$$SUDO_GID; \ @@ -80,7 +68,7 @@ install-stamp: build-stamp ln -s ../../../share/lilypond/tex $(r)/usr/lib/texmf/tex/lilypond ln -s ../../../../../share/lilypond/mf $(r)/usr/lib/texmf/fonts/source/public/lilypond ln -s ../../../../../share/lilypond/afm $(r)/usr/lib/texmf/fonts/afm/public/lilypond - ln -s ../../../../../share/lilypond/afm $(r)/usr/lib/texmf/fonts/tfm/public/lilypond + ln -s ../../../../../share/lilypond/tfm $(r)/usr/lib/texmf/fonts/tfm/public/lilypond touch install-stamp @@ -92,9 +80,9 @@ binary-arch: build install dh_testdir dh_testroot cp -av mudela-mode.el $(r)/usr/lib/emacs/site-lisp - dh_installdocs ANNOUNCEMENT ANNOUNCE-0.1 NEWS-* DEDICATION \ + dh_installdocs ANNOUNCE* NEWS-* DEDICATION \ BUGS TODO *.txt \ - Documentation/pictures/*.xpm \ + Documentation/pictures/out/*.png \ Documentation/out/*.txt \ Documentation/tex/*.doc \ Documentation/tex/*.bib \ @@ -110,7 +98,7 @@ binary-arch: build install # dh_installmanpages # dh_undocumented dh_installchangelogs -k NEWS -# dh_strip + dh_strip dh_compress dh_fixperms dh_suidregister diff --git a/flower/include/cons.hh b/flower/include/cons.hh new file mode 100644 index 0000000000..6e62c4c865 --- /dev/null +++ b/flower/include/cons.hh @@ -0,0 +1,123 @@ +/* + cons.hh -- declare LISP like datatypes + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef CONS_HH +#define CONS_HH + + +template +class Cons +{ +public: + T * car_; + Cons * next_; + Cons () + { + car_=0; + next_ =0; + } + Cons (T*t, Cons*c) + { + car_ = t; + next_ = c; + } + virtual ~Cons () + { + delete next_; + } +}; + +template +class Killing_cons : public Cons +{ +public: + Killing_cons (T *t, Cons *p) + : Cons( t,p) + { + } + virtual ~Killing_cons (); +}; + + +/// remove the link pointed to by *p. +template +Cons *remove_cons (Cons **pp) +{ + Cons *knip = *pp; + *pp = (*pp)->next_; + knip->next_ = 0; + return knip; +} + +/** + + Invariants: + + (*tail_) is either the head_ pointer, or a next_ pointer from the list. + + **tail_ == NULL + */ + +template +class Cons_list +{ +public: + Cons * head_; + Cons ** tail_; + Cons_list () { init_list (); } + void init_list () {head_ =0; tail_ = &head_; } + void append (Cons *c) + { + assert (!c->next_); + *tail_ = c; + while (*tail_) + tail_ = &(*tail_)->next_; + } + /** + PRE: *pp should either be the head_ pointer, or the next_ pointer + from a list cell. + */ + 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 +void copy_killing_cons_list (Cons_list&, Cons *src); +template +void +clone_killing_cons_list (Cons_list&, Cons *src); + +template int cons_list_size_i (Cons *l) +{ + int i=0; + while (l) + { + l = l->next_; + i++; + } + return i; +} + + + + +#endif /* CONS_HH */ + diff --git a/flower/include/hash-table.hh b/flower/include/hash-table.hh index ef497f1c75..3ce52c944c 100644 --- a/flower/include/hash-table.hh +++ b/flower/include/hash-table.hh @@ -12,6 +12,14 @@ unsigned int int_hash (int); unsigned long prime_list (int idx); + +template +unsigned int +pointer_hash (K *p) +{ + return int_hash ((unsigned int) p); +} + template struct Hash_table_entry { @@ -71,16 +79,19 @@ public: /// remove #s# from the hash table. V remove (K s, unsigned int initial_hash) { - assert (false); // Untested routine. int sz =dict_arr_.size (); int i = initial_hash % sz; int j = 0; V retval; + + /* + duplicate with lookup, but we need value of j + */ + while (j <= sz/2 && dict_arr_[i].key_ != s) { assert (!dict_arr_[i].free_b_); - - + j ++; i = (i + j*j) % sz; } @@ -187,8 +198,8 @@ public: V const_elem (K k) const { V retval; - if (elem_b (k)) - retval = ((Hash_table*)this)->elem (k); + assert (elem_b (k)); + retval = ((Hash_table*)this)->elem (k); return retval; } V& operator [] (K k) diff --git a/flower/include/killing-cons.tcc b/flower/include/killing-cons.tcc new file mode 100644 index 0000000000..f6fcff7bd1 --- /dev/null +++ b/flower/include/killing-cons.tcc @@ -0,0 +1,44 @@ +/* + killing-cons.tcc -- declare Killing_cons + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef KILLING_CONS_TCC +#define KILLING_CONS_TCC + +#include "cons.hh" + +template +Killing_cons::~Killing_cons () +{ + delete car_; +} + +template +void +copy_killing_cons_list (Cons_list &dest, Cons *src) +{ + for (; src; src = src->next_) + { + T *t = new T(*src->car_); + dest.append ( new Killing_cons (t, 0)); + } +} + +template +void +clone_killing_cons_list (Cons_list & dest, Cons *src) +{ + for (; src; src = src->next_) + { + T *t = src->car_->clone (); + dest.append (new Killing_cons (t, 0)); + } +} + +#endif /* KILLING_CONS_TCC */ + diff --git a/input/bugs/biem.ly b/input/bugs/biem.ly new file mode 100644 index 0000000000..36a6cba0c4 --- /dev/null +++ b/input/bugs/biem.ly @@ -0,0 +1,32 @@ +basloopje = \notes\relative c{ + [d,8 a' d f] [a\translator Staff=treble d f d] \translator Staff=bass +} + + + +lower = \type Voice=two \notes \relative c{ + < \basloopje > +} +\score { + \type PianoStaff < +\notes \type Staff = treble { c1 } + + \type Staff = bass < + \clef bass; + \lower + > + > + + \paper { + gourlay_maxmeasures = 4.; + indent = 8.\mm; + textheight = 295.\mm; + + % no slur damping + slur_slope_damping = 100.0; + } + \midi { + \tempo 4 = 54; + } +} + diff --git a/input/test/bar-scripts.ly b/input/test/bar-scripts.ly index d618a2073f..789a6e3aa9 100644 --- a/input/test/bar-scripts.ly +++ b/input/test/bar-scripts.ly @@ -1,5 +1,5 @@ - \version "1.0.14"; +\version "1.0.14"; onestaff = \type Staff = foo\notes { \property Staff.instr = instr @@ -29,4 +29,6 @@ stscore = \score { \onestaff \paper { }} %\score {\stscore} -\score {\scscore} +\score {\scscore +\header { title = "bar scripts"; } +} diff --git a/input/test/big-test.ly b/input/test/big-test.ly new file mode 100644 index 0000000000..71e43baba5 --- /dev/null +++ b/input/test/big-test.ly @@ -0,0 +1,16 @@ + +\score { +\notes \relative c { +\include "noteheadstyle.fly" +}\header { title = "notehead style"; } +} + +\score { +\notes \relative c { +\include "number-staff-lines.fly" +}\header { title = "number of staff lines"; } +} + +\include "bar-scripts.ly" + +\include "font20.ly" diff --git a/input/test/font-body.ly b/input/test/font-body.ly index d8603fb2cf..8578815cf7 100644 --- a/input/test/font-body.ly +++ b/input/test/font-body.ly @@ -3,8 +3,8 @@ FontBody= \notes\transpose c''{ \bar "|:"; \time 4/4; - \type Staff < { \stemup e'\longa a\breve | } - { \stemdown + \type Staff < \type Voice = VB { \stemup e'\longa a\breve | } + \type Voice = VA { \stemdown c1 \clef "bass"; b,, \clef "violin"; c' a' c2 \clef "alto"; g c' \clef "violin"; a' } > @@ -12,7 +12,7 @@ FontBody= \notes\transpose c''{ c4 g c' a' \bar ":|"; a\ppp-\upbow a\pp-\downbow a\p^\turn a\mp^\fermata | a\mf_\fermata a\f-\stopped a\ff-\open a\fff^\trill| - a\fp-\reverseturn a4.\sf a4.\sfz | % a\fz a\rf + a\fp-\reverseturn a4.\sf a4.\sfz | a\fz % a\rf [c8-\prall c-\mordent] [a'-\prallmordent a'-\prallprall] [c-\upprall a'-\downprall] [a' c] | [c \< d e f] [as' ges' f' e'] @@ -20,9 +20,9 @@ FontBody= \notes\transpose c''{ \clef "bass"; r\longa * 1/4 r\breve *1/2 r1 r2 r4 r8 r16 r32 r64 r128 r128 | - \type Staff < { \stemup r2 r2} {\stemdown c c }> - \type Staff < { \stemup c,,1 } {\stemdown r1}> - \stemboth + \type Staff < \type Voice = VA { \stemup r2 c'2 c,,,1 } + \type Voice = VB {\stemdown r2 c2 r1 }> + \stemboth \clef "violin"; e8_. g'8-> e16^^ g'16_^ e32 _| g'32^| g''32-\ltoe g''32-\lheel @@ -31,8 +31,13 @@ FontBody= \notes\transpose c''{ \transpose c'{ \time 4/4; \property Voice . textstyle = "finger" - c4^"1" d^"2" e^"3" f^"4" g^"5" - + \property Voice . noteHeadStyle = "diamond" + c1^"1" d2^"2" e4^"3" + \property Voice . noteHeadStyle = "cross" + f4^"4" + \property Voice . noteHeadStyle = "harmonic" + g4^"5" + \property Voice . noteHeadStyle = "" % Music to the Martians! < bes4^"6" e_"7" c_"8" > a^"0"_"9" diff --git a/input/test/font16.ly b/input/test/font16.ly index 49c4db5098..0a742345a7 100644 --- a/input/test/font16.ly +++ b/input/test/font16.ly @@ -8,6 +8,7 @@ description = "This file tests the Feta music font"; } \version "1.0.14"; +\include "paper16.ly" \include "font-body.ly" \score{ @@ -15,6 +16,7 @@ description = "This file tests the Feta music font"; \paper{ % don't change this. % otherwise 16pt and 20pt layouts differ. + \paper_sixteen linewidth = 12.5 \cm; gourlay_maxmeasures =5.; } diff --git a/input/test/hara-kiri.ly b/input/test/hara-kiri.ly index 0ab043ba56..3acad5cad5 100644 --- a/input/test/hara-kiri.ly +++ b/input/test/hara-kiri.ly @@ -24,11 +24,9 @@ toeter_ii = \notes \relative c { g g g g } -toeters = \type StaffGroup = xtoeters < - \type Staff = toeters < +toeters = \type Staff = toeters < \toeter_i \toeter_ii - > > zager = \type Staff = zager \notes \relative c { diff --git a/input/test/noteheadstyle.fly b/input/test/noteheadstyle.fly new file mode 100644 index 0000000000..c1fcca075a --- /dev/null +++ b/input/test/noteheadstyle.fly @@ -0,0 +1,10 @@ + +c''4 c2 c8 c16 c16 c1 +\property Voice.noteHeadStyle = "diamond" +c4 c2 c8 c16 c16 c1 +\property Voice.noteHeadStyle = "transparent" +c4 c2 c8 c16 c16 c1 +\property Voice.noteHeadStyle = "cross" +c4 c2 c8 c16 c16 c1 +\property Voice.noteHeadStyle = "harmonic" +c4 c2 c8 c16 c16 c1 diff --git a/input/test/number-staff-lines.fly b/input/test/number-staff-lines.fly index 50e188e55b..4794afadc7 100644 --- a/input/test/number-staff-lines.fly +++ b/input/test/number-staff-lines.fly @@ -1,2 +1,2 @@ -c c c \property Staff . numberOfStaffLines = 3 +c' c c \property Staff . numberOfStaffLines = 3 diff --git a/lib/include/source.hh b/lib/include/source.hh index 395a9d8bb4..7f4a21e7d1 100644 --- a/lib/include/source.hh +++ b/lib/include/source.hh @@ -5,9 +5,9 @@ #ifndef SOURCE_HH #define SOURCE_HH - +#include "cons.hh" #include "proto.hh" -#include "plist.hh" + class Sources { @@ -22,7 +22,7 @@ public: private: const File_path * path_C_; - Pointer_list sourcefile_p_list_; + Cons *sourcefile_p_list_; bool binary_b_ ; }; diff --git a/lib/source.cc b/lib/source.cc index ead33c63a9..66372945de 100644 --- a/lib/source.cc +++ b/lib/source.cc @@ -8,11 +8,10 @@ #include - +#include "killing-cons.tcc" #include "binary-source-file.hh" #include "string.hh" #include "proto.hh" -#include "plist.hh" #include "source-file.hh" #include "source.hh" #include "file-path.hh" @@ -62,7 +61,7 @@ Sources::get_file_l (String &file_str) //UGH void Sources::add (Source_file* sourcefile_p) { - sourcefile_p_list_.bottom ().add (sourcefile_p); + sourcefile_p_list_ = new Killing_cons (sourcefile_p, sourcefile_p_list_); } /** @@ -73,10 +72,10 @@ Sources::add (Source_file* sourcefile_p) Source_file* Sources::sourcefile_l (char const* ch_C) { - PCursor sourcefile_l_pcur (sourcefile_p_list_.top ()); - for (; sourcefile_l_pcur.ok (); sourcefile_l_pcur++) - if (sourcefile_l_pcur->in_b (ch_C)) - return *sourcefile_l_pcur; + + for (Cons *i = sourcefile_p_list_; i; i = i->next_) + if (i->car_->in_b (ch_C)) + return i->car_; return 0; } diff --git a/lib/template.cc b/lib/template.cc deleted file mode 100644 index 3f6b91c9d0..0000000000 --- a/lib/template.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - template.cc -- instantiate Pointer_list - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "config.hh" -#include "source-file.hh" -#include "plist.tcc" -#include "pcursor.tcc" -#include "cursor.tcc" -#include "list.tcc" - -#ifdef NEED_EXPLICIT_INSTANTIATION -LIST_INSTANTIATE (void *); -#endif - -POINTERLIST_INSTANTIATE (Source_file); - diff --git a/lily/abbrev.cc b/lily/abbrev.cc index b2ff4b8e75..58f2fbe86a 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -30,8 +30,16 @@ Abbreviation::do_print () const Molecule* Abbreviation::do_brew_molecule_p () const { - Real interbeam_f = paper_l ()->interbeam_f (stem_l_->mult_i_); - Real w = 1.5 * lookup_l ()->ball (2).dim_.x ().length (); + Beam * b = stem_l_->beam_l_; + int mult =0; + if (b) + { + Stem_info i = b->get_stem_info (stem_l_); + mult = i.mult_i_; + } + + Real interbeam_f = paper_l ()->interbeam_f (mult); + Real w = 1.5 * lookup_l ()->notehead (2, "").dim_.x ().length (); Real space = stem_l_->staff_line_leading_f (); Real internote_f = space/2; diff --git a/lily/abbreviation-beam-engraver.cc b/lily/abbreviation-beam-engraver.cc index 6f67fab90a..4b58b02be4 100644 --- a/lily/abbreviation-beam-engraver.cc +++ b/lily/abbreviation-beam-engraver.cc @@ -88,7 +88,8 @@ Abbreviation_beam_engraver::acknowledge_element (Score_element_info i) abeam_p_->multiple_i_ = s->flag_i_; if (s->type_i () != 1) // no abbrev gaps on half note - s->beam_gap_i_ = s->flag_i_ - ((s->type_i () >? 2) - 2); + s->set_elt_property (beam_gap_scm_sym, + gh_int2scm(s->flag_i_ - ((s->type_i () >? 2) - 2))); abeam_p_->add_stem (s); } diff --git a/lily/afm.cc b/lily/afm.cc index d9984847a6..8ba8b9703f 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -122,9 +122,12 @@ Adobe_font_char_metric dummy_static_char_metric; Adobe_font_char_metric const & Adobe_font_metric::find_char (String nm, bool warn) const { - if (warn && !name_to_metric_dict_.elem_b (nm)) + if (!name_to_metric_dict_.elem_b (nm)) { - warning (_f ("can't find character called `%s'", nm.ch_C())); + if (warn) + { + warning (_f ("can't find character called `%s'", nm.ch_C())); + } return dummy_static_char_metric; } diff --git a/lily/align-element.cc b/lily/align-element.cc index b637ebd5d0..dc41b5de7f 100644 --- a/lily/align-element.cc +++ b/lily/align-element.cc @@ -10,9 +10,10 @@ #include "interval.hh" #include "direction.hh" #include "debug.hh" +#include "hash-table-iter.hh" struct Align_element_content { - Score_element * elem_l_; + Graphical_element * elem_l_; int priority_i_; static int compare (Align_element_content const &h1, @@ -20,7 +21,7 @@ struct Align_element_content { { return h1.priority_i_ - h2.priority_i_; } - Align_element_content (Score_element *elem_l, int p) + Align_element_content (Graphical_element *elem_l, int p) { priority_i_ = p; elem_l_ = elem_l; @@ -36,7 +37,7 @@ struct Align_element_content { void Align_element::add_element (Score_element*el_l) { - int p = priority_i_arr_.size (); + int p = elem_l_arr_.size (); add_element_priority (el_l, p); } @@ -44,8 +45,8 @@ void Align_element::add_element_priority (Score_element *el, int p) { assert (! contains_b (el)); - elem_l_arr_.push (el); - priority_i_arr_.push (p); + Axis_group_element::add_element (el); + priority_i_hash_[el] = p; add_dependency (el); } @@ -53,30 +54,32 @@ void Align_element::do_substitute_element_pointer (Score_element*o, Score_element*n) { - int i; - while ((i = elem_l_arr_.find_i (o))>=0) - if (n) - elem_l_arr_[i] = n; - else - elem_l_arr_.del (i); - + Axis_group_element :: do_substitute_element_pointer (o,n); if (o == center_l_) { center_l_ = n; } + if (priority_i_hash_.elem_b (o)) + { + priority_i_hash_[n] = priority_i_hash_[o]; + /* + Huh? It seems the old pointers are still used. Why? + */ + // priority_i_hash_.remove (o); + } } void Align_element::do_post_processing() { - if (axis_ == Y_AXIS) + if (axis () == Y_AXIS) do_side_processing (); } void Align_element::do_pre_processing () { - if (axis_ == X_AXIS) + if (axis () == X_AXIS) do_side_processing (); } @@ -85,19 +88,22 @@ Align_element::do_side_processing () { sort_elements (); Array dims; - + + Link_array elems; for (int i=0; i < elem_l_arr_.size(); i++) { - Interval y = elem_l_arr_[i]->extent(axis_) ; - if (y.empty_b()) - y = Interval (0,0); - - dims.push (y); + Interval y = elem_l_arr_[i]->extent(axis ()); + if (!y.empty_b()) + { + dims.push (y); + Score_element *e =dynamic_cast(elem_l_arr_[i]); + elems.push (e); + } } Real where_f=0; Real center_f = 0.0; - for (int i=0 ; i < elem_l_arr_.size(); i++) + for (int i=0 ; i < elems.size(); i++) { Real dy = - stacking_dir_ * dims[i][-stacking_dir_]; if (i) @@ -109,33 +115,48 @@ Align_element::do_side_processing () translate_axis (where_f, axis_); + elems[i]->translate_axis (where_f, axis ()); } + if (dims.size ()) + where_f += dims.top ()[stacking_dir_]; if (align_dir_ == RIGHT) center_f = where_f; - + else if (align_dir_ == CENTER && !center_l_) + center_f = where_f / 2; + if (center_f) - for (int i=0 ; i < elem_l_arr_.size(); i++) - elem_l_arr_[i]->translate_axis (- center_f, axis_); + translate_axis ( - center_f, axis ()); + + dim_cache_[axis ()].invalidate (); } Align_element::Align_element() { + ordered_b_ = true; threshold_interval_ = Interval (0, Interval::infinity ()); - set_elt_property (transparent_scm_sym, SCM_BOOL_T); - set_empty (true); stacking_dir_ = DOWN; - align_dir_ = LEFT; - axis_ = X_AXIS; + align_dir_ = CENTER; center_l_ =0; + priority_i_hash_.hash_func_ = pointer_hash; +} + +Axis +Align_element::axis () const +{ + return axes_[0]; +} + +void +Align_element::set_axis (Axis a) +{ + set_axes (a,a); } @@ -149,17 +170,21 @@ void Align_element::sort_elements () { Array content; - for (int i =0; i < elem_l_arr_.size(); i++) - content.push (Align_element_content (elem_l_arr_[i], priority_i_arr_[i])); + for (int i =0; i < elem_l_arr_.size(); i++) + { + Score_element * e = dynamic_cast (elem_l_arr_[i]); + assert (priority_i_hash_.elem_b (e)); + int p = priority_i_hash_[e]; + content.push (Align_element_content (e, p)); + } content.sort (Align_element_content::compare); elem_l_arr_.clear(); - priority_i_arr_.clear(); + priority_i_hash_.clear(); for (int i =0; i < content.size(); i++) { elem_l_arr_.push (content[i].elem_l_); - priority_i_arr_.push (content[i].priority_i_); } } @@ -176,10 +201,19 @@ Align_element::do_print () const Score_element* Align_element::get_elt_by_priority (int p) const { - for (int i=0; i < priority_i_arr_.size (); i++) + for (Hash_table_iter i(priority_i_hash_); i.ok (); i++) { - if (priority_i_arr_[i] == p) - return elem_l_arr_[i]; + if (i.val () == p) + return i.key(); } return 0; } + +int +Align_element::get_priority (Score_element* e) const +{ + if ( priority_i_hash_.elem_b (e)) + return priority_i_hash_[e]; + else + return elem_l_arr_.find_i (e); +} diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 1396f68e75..c38fd2c531 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -179,16 +179,6 @@ Auto_beam_engraver::create_beam_p () if (prop.isnum_b ()) beam_p->quantisation_ = (Beam::Quantisation)(int)prop; - // must set minVerticalAlign = = maxVerticalAlign to get sane results - // see input/test/beam-interstaff.ly - prop = get_property ("minVerticalAlign", 0); - if (prop.isnum_b ()) - beam_p->vertical_align_drul_[MIN] = prop; - - prop = get_property ("maxVerticalAlign", 0); - if (prop.isnum_b ()) - beam_p->vertical_align_drul_[MAX] = prop; - announce_element (Score_element_info (beam_p, 0)); return beam_p; } diff --git a/lily/axis-align-item.cc b/lily/axis-align-item.cc new file mode 100644 index 0000000000..a8859ba588 --- /dev/null +++ b/lily/axis-align-item.cc @@ -0,0 +1,14 @@ +/* + axis-align-item.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#include "axis-align-item.hh" + +Axis_align_item::Axis_align_item () +{ +} diff --git a/lily/axis-align-spanner.cc b/lily/axis-align-spanner.cc new file mode 100644 index 0000000000..4aaf48e2ab --- /dev/null +++ b/lily/axis-align-spanner.cc @@ -0,0 +1,13 @@ +/* + axis-align-spanner.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ +#include "axis-align-spanner.hh" + +Axis_align_spanner::Axis_align_spanner() +{ +} diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index 0bce567aca..cd6000b464 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -53,17 +53,40 @@ Axis_group_element::do_print() const Graphical_axis_group::do_print(); } -Axis_group_element::Axis_group_element(Axis a1, Axis a2) - : Graphical_axis_group (a1,a2) +Axis_group_element::Axis_group_element() { set_elt_property (transparent_scm_sym, SCM_BOOL_T); } -Axis_group_element::Axis_group_element () - : Graphical_axis_group (X_AXIS, Y_AXIS) +void +Axis_group_element::set_axes (Axis a1, Axis a2) { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + Graphical_axis_group::set_axes (a1,a2); + dim_cache_[X_AXIS].set_empty ((a1 != X_AXIS && a2 != X_AXIS)); + dim_cache_[Y_AXIS].set_empty ((a1 != Y_AXIS && a2 != Y_AXIS)); } +void +Axis_group_element::do_substitute_element_pointer (Score_element*o, + Score_element*n) +{ + int i; + while ((i = elem_l_arr_.find_i (o))>=0) + if (n) + elem_l_arr_[i] = n; + else + elem_l_arr_.del (i); +} + +Interval +Axis_group_element::do_height () const +{ + return Graphical_axis_group::extent (Y_AXIS); +} +Interval +Axis_group_element::do_width () const +{ + return Graphical_axis_group::extent (X_AXIS); +} diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index c78cac0e11..58214f5137 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -131,5 +131,8 @@ Axis_group_spanner::do_print() const } - - +Interval +Axis_group_spanner::do_width () const +{ + return Spanner::do_width (); +} diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 71655de8e1..434f5bb88d 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -38,15 +38,7 @@ Bar_engraver::do_try_music (Music*r_l) } -void -Bar_engraver::acknowledge_element (Score_element_info i) -{ - if (Bar *b = dynamic_cast (i.elem_l_)) - { - // only bar-engraver should create bars - assert (0); - } -} + void Bar_engraver::create_bar () @@ -69,7 +61,7 @@ Bar_engraver::create_bar () Scalar prop = get_property ("barAtLineStart", 0); if (prop.to_bool ()) { - bar_p_->at_line_start_b_ = true; + bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T); } announce_element (Score_element_info (bar_p_, bar_req_l_)); } diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index a623c132e5..2fc8e86b17 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -138,7 +138,7 @@ Bar_script_engraver::create_items (Request *rq) Scalar padding = get_property (type_ + "ScriptPadding", 0); if (padding.length_i() && padding.isnum_b ()) { - staff_side_p_->padding_f_ = Real(padding); + staff_side_p_->set_elt_property (padding_scm_sym, gh_double2scm(Real(padding))); } diff --git a/lily/bar.cc b/lily/bar.cc index 7fb6d30530..1d572e235e 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -18,7 +18,6 @@ Bar::Bar () { set_elt_property (breakable_scm_sym, SCM_BOOL_T); type_str_ = "|"; - at_line_start_b_ = false; } void @@ -57,7 +56,7 @@ static char const *bar_breaks[][3] ={ {":|", ":|", ""}, {"||", "||", ""}, {".|.", ".|.", ""}, - {"", "scorebar", "|"}, + {"", "scorebar", "scorepostbreak"}, {"", "{", "{"}, {"", "[", "["}, {0,0,0} @@ -71,7 +70,8 @@ Bar::do_pre_processing () if (bar_breaks[i][1] == type_str_) { type_str_ = bar_breaks[i][break_status_dir ()+1]; - if (at_line_start_b_ && (break_status_dir () == RIGHT) && (type_str_ == "")) + if (remove_elt_property (at_line_start_scm_sym)!= SCM_BOOL_F + && (break_status_dir () == RIGHT) && (type_str_ == "")) { type_str_ = "|"; } diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index e0716f15f2..53aa547cd5 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -9,7 +9,7 @@ #include "lily-guile.hh" #include "span-bar.hh" #include "base-span-bar-engraver.hh" -#include "vertical-align-spanner.hh" +#include "axis-align-spanner.hh" Base_span_bar_engraver::Base_span_bar_engraver() { @@ -71,10 +71,10 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_; } } - else if (dynamic_cast (i.elem_l_) + else if (dynamic_cast (i.elem_l_) && i.origin_grav_l_arr_.size() <= 2) { - valign_l_ = dynamic_cast (i.elem_l_); + valign_l_ = dynamic_cast (i.elem_l_); } } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 9afca27c9f..4260dfc44c 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -79,16 +79,6 @@ Beam_engraver::do_process_requests () if (prop.isnum_b ()) beam_p_->quantisation_ = (Beam::Quantisation)(int)prop; - // must set minVerticalAlign == maxVerticalAlign to get sane results - // see input/test/beam-interstaff.ly - prop = get_property ("minVerticalAlign", 0); - if (prop.isnum_b ()) - beam_p_->vertical_align_drul_[MIN] = prop; - - prop = get_property ("maxVerticalAlign", 0); - if (prop.isnum_b ()) - beam_p_->vertical_align_drul_[MAX] = prop; - announce_element (Score_element_info (beam_p_, reqs_drul_[START])); } } diff --git a/lily/beam.cc b/lily/beam.cc index d5f9d9e9a9..53a5eb34e9 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -11,19 +11,22 @@ /* [TODO] - * centre beam symbol + * center beam symbol * less hairy code * redo grouping - */ + +TODO: + +The relationship Stem <-> Beam is way too hairy. Let's figure who +needs what, and what information should be available when. + + */ #include -#include "p-col.hh" -#include "array.hh" #include "proto.hh" #include "dimensions.hh" #include "beam.hh" -#include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" #include "molecule.hh" @@ -39,13 +42,17 @@ Beam::Beam () left_y_ = 0; quantisation_ = NORMAL; multiple_i_ = 0; - vertical_align_drul_[MIN] = 0; - vertical_align_drul_[MAX] = -1; } void Beam::add_stem (Stem*s) { +#if 0 + if (!stems_.size ()) + { + dim_cache_[Y_AXIS].parent_l_ = &s->dim_cache_[Y_AXIS]; + } +#endif stems_.push (s); s->add_dependency (this); s->beam_l_ = this; @@ -56,6 +63,19 @@ Beam::add_stem (Stem*s) set_bounds (RIGHT,s); } +Stem_info +Beam::get_stem_info (Stem *s) +{ + Stem_info i; + for (int i=0; i < sinfo_.size (); i++) + { + if (sinfo_[i].stem_l_ == s) + return sinfo_[i]; + } + assert (false); + return i; +} + Molecule* Beam::do_brew_molecule_p () const { @@ -81,7 +101,7 @@ Beam::do_brew_molecule_p () const // correct if last note (and therefore reference point of beam) // is on different staff - Stem_info si = sinfo_.top (); + Stem_info si = sinfo_.top (); mol_p->translate_axis (-si.interstaff_f_ * si.stem_l_->staff_line_leading_f ()/2, Y_AXIS); @@ -94,7 +114,7 @@ Beam::center () const Stem_info si = sinfo_[0]; Real w= (si.stem_l_->note_delta_f () + extent (X_AXIS).length ())/2.0; - return Offset (w, (left_y_ + w* slope_f_) * + return Offset (w, ( w* slope_f_) * si.stem_l_->staff_line_leading_f ()/2); } @@ -216,9 +236,6 @@ Beam::set_default_dir () void Beam::solve_slope () { - /* - should use minimum energy formulation (cf linespacing) - */ assert (sinfo_.size () > 1); DOUT << "Beam::solve_slope: \n"; @@ -284,7 +301,7 @@ Beam::set_steminfo () for (int i=0; i < stems_.size (); i++) { Stem *s = stems_[i]; - s->mult_i_ = multiple_i_; + s->set_default_extents (); if (s->invisible_b ()) continue; @@ -306,7 +323,7 @@ Beam::set_steminfo () if (s->invisible_b ()) continue; - Stem_info info (s); + Stem_info info (s, multiple_i_); if (leftx == 0) leftx = info.x_; info.x_ -= leftx; @@ -669,9 +686,13 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const a.translate_axis( - stemdx/2, X_AXIS); int j = 0; Real gap_f = 0; - if (here->beam_gap_i_) + + SCM gap = get_elt_property (beam_gap_scm_sym); + if (gap != SCM_BOOL_F) { - int nogap = rwholebeams - here->beam_gap_i_; + int gap_i = gh_scm2int (gap); + int nogap = rwholebeams - gap_i; + for (; j < nogap; j++) { Molecule b (a); diff --git a/lily/bow.cc b/lily/bow.cc index 9f198376d5..046a95ee98 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -15,16 +15,10 @@ #include "bezier.hh" #include "main.hh" - - Bow::Bow () { dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0; dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; - dash_i_ = 0; - interstaff_f_ = 0; - vertical_align_drul_[MIN] = 0; - vertical_align_drul_[MAX] = -1; } Molecule* @@ -56,7 +50,6 @@ Bow::do_brew_molecule_p () const Molecule* mol_p = new Molecule; mol_p->add_molecule (a); - mol_p->translate_axis (-interstaff_f_, Y_AXIS); return mol_p; } @@ -86,7 +79,6 @@ Bow::do_height () const Real y = c[i][Y_AXIS]; iv.unite (Interval (y,y)); } - iv -= interstaff_f_; return iv; } diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 598556daee..8fd12ab3b6 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -13,9 +13,13 @@ void Break_align_item::do_pre_processing() { align_dir_ = break_status_dir(); - threshold_interval_[SMALLER] = 1.5 PT; flip (&align_dir_); - Horizontal_align_item::do_pre_processing(); + Axis_align_item::do_pre_processing(); } - +Break_align_item::Break_align_item () +{ + stacking_dir_ = RIGHT; + threshold_interval_[SMALLER] = 1.5 PT; + set_axis (X_AXIS); +} diff --git a/lily/chord.cc b/lily/chord.cc index e08ce282e6..03594ceed3 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -9,7 +9,7 @@ #include "chord.hh" #include "warn.hh" -// doesn't seem common, and we should know about this during purple hit +// doesn't seem common, and we should know about this during parsing // #define INVERSION_ADDED_AS_BASE 1 Chord::Chord (Array pitch_arr) diff --git a/lily/collision.cc b/lily/collision.cc index b995639eda..706301aad1 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -13,6 +13,7 @@ Collision::Collision() { + set_axes (X_AXIS, Y_AXIS); } void diff --git a/lily/dot-column.cc b/lily/dot-column.cc index c2e1d912b0..b673b77092 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -54,3 +54,8 @@ Dot_column::do_pre_processing () } + +Dot_column::Dot_column () +{ + set_axes(X_AXIS,X_AXIS); +} diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc index 02f5b28686..452d825aa6 100644 --- a/lily/encompass-info.cc +++ b/lily/encompass-info.cc @@ -16,6 +16,7 @@ #include "staff-symbol.hh" #include "note-head.hh" #include "debug.hh" +#include "align-element.hh" Encompass_info::Encompass_info () { @@ -62,20 +63,36 @@ Encompass_info::Encompass_info (Note_column const* note, Direction dir, Slur con if (stem_l->dir_ != dir) o_.y () += 1.0 * internote * dir; - if (slur_l->encompass_arr_.size () - && stem_l->staff_symbol_l () != slur_l->encompass_arr_[0]->stem_l_->staff_symbol_l ()) + + Dimension_cache *common = note->common_group (slur_l, Y_AXIS); + Align_element * align = dynamic_cast (common->element_l ()); + if (align && align->axis() == Y_AXIS) { - if (slur_l->vertical_align_drul_[MIN] != - slur_l->vertical_align_drul_[MAX]) - warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff slurs may be broken")); - interstaff_f_ = slur_l->vertical_align_drul_[MIN]; - /* urg, guess staff order */ - int d = note->head_l_arr_.top ()->position_i_ - - slur_l->encompass_arr_[0]->head_l_arr_[0]->position_i_; - if (abs (d > 3)) - interstaff_f_ *= sign (d); - else if (stem_l->chord_start_f () > - slur_l->encompass_arr_[0]->stem_l_->chord_start_f ()) + if (align->threshold_interval_[MIN] != + align->threshold_interval_[MAX]) + warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff beams/slurs may be broken")); + + interstaff_f_ = align->threshold_interval_[MIN]; + + Dimension_cache * slur_refpoint = &slur_l->dim_cache_[Y_AXIS]; + Dimension_cache * note_refpoint = ¬e->dim_cache_[Y_AXIS]; + + while (slur_refpoint->parent_l_ != common) + slur_refpoint = slur_refpoint->parent_l_; + while (note_refpoint->parent_l_ != common) + note_refpoint = note_refpoint->parent_l_; + + + int slur_prio = + align->get_priority (dynamic_cast (slur_refpoint->element_l ())); + int stem_prio = + align->get_priority (dynamic_cast (note_refpoint->element_l ())); + + /* + our staff is lower -> interstaff_f_ *= -1 + */ + // ? Is this OK? + if (slur_prio < stem_prio) interstaff_f_ *= -1; o_.y () += interstaff_f_; } diff --git a/lily/g-staff-side.cc b/lily/g-staff-side.cc index 4c3920dca1..20812e55ad 100644 --- a/lily/g-staff-side.cc +++ b/lily/g-staff-side.cc @@ -15,7 +15,7 @@ G_staff_side_item::G_staff_side_item () dir_ = CENTER; to_position_l_ = 0; set_elt_property (transparent_scm_sym, SCM_BOOL_T); - padding_f_ = 0; + axis_ = Y_AXIS; } @@ -86,8 +86,13 @@ G_staff_side_item::position_self () common = dim_cache_[axis_].parent_l_; } Interval sym_dim = to_position_l_->extent (axis_); - Real off = dim_cache_[axis_].relative_coordinate (common) - padding_f_ * dir_; - + Real off = dim_cache_[axis_].relative_coordinate (common); + + SCM pad = remove_elt_property (padding_scm_sym); + if (pad != SCM_BOOL_F) + { + off -= gh_scm2double (SCM_CDR(pad)) * dir_; + } dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] - off); } diff --git a/lily/graphical-axis-group.cc b/lily/graphical-axis-group.cc index c6a6137d3c..b26e805518 100644 --- a/lily/graphical-axis-group.cc +++ b/lily/graphical-axis-group.cc @@ -5,6 +5,7 @@ (c) 1997--1999 Han-Wen Nienhuys */ + #include "interval.hh" #include "graphical-axis-group.hh" #include "axis-group-element.hh" @@ -15,8 +16,8 @@ Graphical_axis_group at one time. */ Graphical_axis_group::Graphical_axis_group (Graphical_axis_group const&s) { - axes_[0] = s.axes_[0]; - axes_[1] = s.axes_[1]; + axes_ = s.axes_; + ordered_b_ = s.ordered_b_; } bool @@ -42,6 +43,7 @@ Graphical_axis_group::add_element (Graphical_element*e) for (int i = 0; i < 2; i++) { Axis a = axes_[i]; + assert (a>=0); Dimension_cache * &d = e->dim_cache_[a].parent_l_; assert (!d || d == &dim_cache_[a]); d = &dim_cache_[a]; @@ -57,7 +59,10 @@ void Graphical_axis_group::remove_element (Graphical_element*e) { assert (contains_b (e)); - elem_l_arr_.unordered_substitute (e,0); + if (ordered_b_) + elem_l_arr_.substitute (e,0); + else + elem_l_arr_.unordered_substitute (e,0); for (int i=0; i< 2; i++) { @@ -96,10 +101,16 @@ Graphical_axis_group::do_print() const #endif } -Graphical_axis_group::Graphical_axis_group (Axis a1, Axis a2) +Graphical_axis_group::Graphical_axis_group () { - axes_[0] = a1; - axes_[1] = a2; + ordered_b_ = false; + axes_[0] = -1 ; + axes_[1] = -1 ; } - +void +Graphical_axis_group::set_axes (Axis a1, Axis a2) +{ + axes_[0] = a1 ; + axes_[1] = a2 ; +} diff --git a/lily/hara-kiri-line-group-engraver.cc b/lily/hara-kiri-line-group-engraver.cc index 5fc4ede7b3..2d9fe8a916 100644 --- a/lily/hara-kiri-line-group-engraver.cc +++ b/lily/hara-kiri-line-group-engraver.cc @@ -16,7 +16,8 @@ ADD_THIS_TRANSLATOR (Hara_kiri_line_group_engraver); void Hara_kiri_line_group_engraver::create_line_spanner () { - staffline_p_ = new Hara_kiri_vertical_group_spanner; + staffline_p_ = new Hara_kiri_group_spanner; + } void @@ -24,7 +25,7 @@ Hara_kiri_line_group_engraver::typeset_element(Score_element * e) { if (Rhythmic_head *h = dynamic_cast (e)) { - dynamic_cast (staffline_p_) + dynamic_cast (staffline_p_) ->add_interesting_item (h); } Line_group_engraver_group::typeset_element (e); diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index 84872173a4..5b80d2cddb 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -12,19 +12,20 @@ #include "debug.hh" #include "item.hh" -Hara_kiri_vertical_group_spanner::Hara_kiri_vertical_group_spanner() +Hara_kiri_group_spanner::Hara_kiri_group_spanner() { + set_axes(Y_AXIS,Y_AXIS); } void -Hara_kiri_vertical_group_spanner::add_interesting_item (Item* n) +Hara_kiri_group_spanner::add_interesting_item (Item* n) { add_dependency (n); interesting_items_.push (n); } void -Hara_kiri_vertical_group_spanner::do_post_processing () +Hara_kiri_group_spanner::do_post_processing () { if (!interesting_items_.empty ()) return; @@ -39,7 +40,7 @@ Hara_kiri_vertical_group_spanner::do_post_processing () } void -Hara_kiri_vertical_group_spanner::do_substitute_element_pointer (Score_element*o, Score_element*n) +Hara_kiri_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)); @@ -47,7 +48,7 @@ Hara_kiri_vertical_group_spanner::do_substitute_element_pointer (Score_element*o void -Hara_kiri_vertical_group_spanner::do_print () const +Hara_kiri_group_spanner::do_print () const { Axis_group_spanner::do_print (); } diff --git a/lily/heads-engraver.cc b/lily/heads-engraver.cc index ee5c040c3c..fee3bd41b0 100644 --- a/lily/heads-engraver.cc +++ b/lily/heads-engraver.cc @@ -36,6 +36,7 @@ Note_heads_engraver::do_process_requests() if (note_p_arr_.size ()) return ; + String noteheadstyle = get_property ("noteHeadStyle", 0); for (int i=0; i < note_req_l_arr_.size (); i++) { Note_head *note_p = new Note_head; @@ -53,10 +54,14 @@ Note_heads_engraver::do_process_requests() // note_p->steps_i_ = note_req_l->pitch_.steps (); note_p->position_i_ = note_req_l->pitch_.steps (); - String noteheadstyle = get_property ("noteheadStyle", 0); - if (noteheadstyle.length_i ()) - note_p->note_head_type_str_ = noteheadstyle; - + + if (noteheadstyle == "transparent") + note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + else + note_p->set_elt_property (style_scm_sym, + gh_str02scm (noteheadstyle.ch_C())); + + Score_element_info itinf (note_p,note_req_l); announce_element (itinf); note_p_arr_.push (note_p); diff --git a/lily/horizontal-align-item.cc b/lily/horizontal-align-item.cc deleted file mode 100644 index 8a15780d62..0000000000 --- a/lily/horizontal-align-item.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* - horizontal-align-item.cc -- implement Horizontal_align_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "horizontal-align-item.hh" -#include "debug.hh" - - - -void -Horizontal_align_item::add_item (Item *i,int p) -{ - add_element_priority (i,p); -} - -void -Horizontal_align_item::do_print() const -{ -#ifndef NPRINT - Item::do_print (); - Align_element::do_print (); -#endif -} - - -Horizontal_align_item::Horizontal_align_item () -{ - align_dir_ = CENTER; - stacking_dir_ = RIGHT; - axis_ = X_AXIS; -} diff --git a/lily/horizontal-group-element.cc b/lily/horizontal-group-element.cc deleted file mode 100644 index 6801861409..0000000000 --- a/lily/horizontal-group-element.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include "horizontal-group-element.hh" -#include "interval.hh" -#include "item.hh" -#include "debug.hh" - - - - -Horizontal_group_element::Horizontal_group_element () - : Axis_group_element (X_AXIS,X_AXIS) -{ -} - -Interval -Horizontal_group_element::do_width() const -{ - return Graphical_axis_group::extent (X_AXIS); -} - diff --git a/lily/horizontal-group-item.cc b/lily/horizontal-group-item.cc deleted file mode 100644 index 3919d28a41..0000000000 --- a/lily/horizontal-group-item.cc +++ /dev/null @@ -1,23 +0,0 @@ -/* - horizontal-group-item.cc -- implement Horizontal_group_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "p-col.hh" -#include "horizontal-group-item.hh" - - - -void -Horizontal_group_item::do_print() const -{ - Axis_group_item::do_print(); -} - -Horizontal_group_item::Horizontal_group_item () -{ - axes_[0] = axes_[1] = X_AXIS; -} diff --git a/lily/horizontal-vertical-group-element.cc b/lily/horizontal-vertical-group-element.cc deleted file mode 100644 index b8b09b7bda..0000000000 --- a/lily/horizontal-vertical-group-element.cc +++ /dev/null @@ -1,15 +0,0 @@ - -#include "horizontal-vertical-group-element.hh" -#include "interval.hh" -#include "item.hh" -#include "debug.hh" - -Horizontal_vertical_group_element::Horizontal_vertical_group_element() -{ - axes_[0] = X_AXIS; - axes_[1] = Y_AXIS; -} - - - - diff --git a/lily/horizontal-vertical-group-item.cc b/lily/horizontal-vertical-group-item.cc deleted file mode 100644 index abb1c6febf..0000000000 --- a/lily/horizontal-vertical-group-item.cc +++ /dev/null @@ -1,25 +0,0 @@ -/* - horizontal-vertical-group-item.cc -- implement Horizontal_vertical_group_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#include "horizontal-vertical-group-item.hh" -#include "p-col.hh" - -void -Horizontal_vertical_group_item::do_print() const -{ - Horizontal_vertical_group_element::do_print(); -} - - - -Horizontal_vertical_group_item::Horizontal_vertical_group_item () -{ - axes_[0] = X_AXIS; - axes_[1] = Y_AXIS; -} diff --git a/lily/include/afm.hh b/lily/include/afm.hh index 305007eccd..757ed776ee 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -29,7 +29,6 @@ struct Adobe_font_char_metric : Character_metric { String str () const; Adobe_font_char_metric (); - Box dimensions () const; }; @@ -56,7 +55,6 @@ struct Adobe_font_metric : Font_metric { Adobe_font_metric (); void read_char_metrics (Data_file &input, int size); - Character_metric *get_char (int, bool) const; }; diff --git a/lily/include/align-element.hh b/lily/include/align-element.hh index fbb84f77d7..edc88cab90 100644 --- a/lily/include/align-element.hh +++ b/lily/include/align-element.hh @@ -10,19 +10,21 @@ #ifndef VERTICAL_ALIGN_ITEM_HH #define VERTICAL_ALIGN_ITEM_HH -#include "score-element.hh" +#include "axis-group-element.hh" #include "interval.hh" #include "direction.hh" #include "axes.hh" +#include "hash-table.hh" /** Order elements top to bottom/left to right/right to left etc.. TODO: implement padding. + + document usage of this. */ -class Align_element : virtual public Score_element { - Link_array elem_l_arr_; - Array priority_i_arr_; +class Align_element : public virtual Axis_group_element { + Hash_table priority_i_hash_; void sort_elements (); public: Interval threshold_interval_ ; @@ -34,21 +36,25 @@ public: Direction stacking_dir_; /** - Which side to align? - -1: left side, 0: centered (around center_l_ if not nil), 1: right side + Which side to align? -1: left side, 0: centered (around + center_l_ if not nil, or around center of width), 1: right side + + URG. Unintuitive if stacking_dir_ == -1 */ Direction align_dir_; - Axis axis_; + Axis axis () const; Score_element * center_l_; Align_element (); + void set_axis (Axis); void add_element (Score_element*); void add_element_priority (Score_element*, int); bool contains_b (Score_element const*) const; Score_element *get_elt_by_priority (int) const; + int get_priority (Score_element*) const; protected: virtual void do_print() const; virtual void do_substitute_element_pointer (Score_element*,Score_element*); diff --git a/lily/include/axis-align-item.hh b/lily/include/axis-align-item.hh new file mode 100644 index 0000000000..659919425b --- /dev/null +++ b/lily/include/axis-align-item.hh @@ -0,0 +1,25 @@ +/* + axis-align-item.hh -- declare Axis_align_item + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef AXIS_ALIGN_ITEM_HH +#define AXIS_ALIGN_ITEM_HH + +#include "align-element.hh" +#include "axis-group-item.hh" + +class Axis_align_item : public virtual Align_element, + public virtual Axis_group_item +{ +public: + Axis_align_item (); +protected: + virtual void do_print () const {} +}; +#endif /* AXIS_ALIGN_ITEM_HH */ + diff --git a/lily/include/axis-align-spanner.hh b/lily/include/axis-align-spanner.hh new file mode 100644 index 0000000000..04ebf26d35 --- /dev/null +++ b/lily/include/axis-align-spanner.hh @@ -0,0 +1,25 @@ +/* + vertical-align-spanner.hh -- declare Vertical_align_spanner + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef VERTICAL_ALIGN_SPANNER_HH +#define VERTICAL_ALIGN_SPANNER_HH + +#include "spanner.hh" +#include "align-element.hh" +#include "axis-group-spanner.hh" + +class Axis_align_spanner : public virtual Align_element, + public virtual Axis_group_spanner +{ +public: + VIRTUAL_COPY_CONS(Score_element); + Axis_align_spanner (); + virtual void do_print() const {} +}; +#endif // VERTICAL_ALIGN_SPANNER_HH diff --git a/lily/include/axis-group-element.hh b/lily/include/axis-group-element.hh index ed80677fae..d38c0d1960 100644 --- a/lily/include/axis-group-element.hh +++ b/lily/include/axis-group-element.hh @@ -18,15 +18,19 @@ This is a wrapper around Axis_group_administration */ class Axis_group_element : public virtual Score_element, - public Graphical_axis_group { + public virtual Graphical_axis_group { protected: virtual void do_print() const; virtual Link_array get_extra_dependencies() const; + virtual Interval do_height () const; + virtual Interval do_width () const; public: + virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual Link_array elem_l_arr() const; - Axis_group_element(Axis,Axis); - Axis_group_element(); + Axis_group_element (); + virtual void set_axes (Axis,Axis); + virtual Link_array get_children (); }; diff --git a/lily/include/axis-group-item.hh b/lily/include/axis-group-item.hh index 9d0852b64a..b3701a1534 100644 --- a/lily/include/axis-group-item.hh +++ b/lily/include/axis-group-item.hh @@ -17,11 +17,14 @@ A grouping item. Its special support is in do_breakable_col_processing(). */ -class Axis_group_item : public virtual Axis_group_element, public Item { +class Axis_group_item : public virtual Axis_group_element, + public virtual Item { protected: virtual void do_breakable_col_processing(); void OK() const; virtual void do_print() const; +public: + VIRTUAL_COPY_CONS(Score_element); }; #endif // AXIS_ITEM_HH diff --git a/lily/include/axis-group-spanner.hh b/lily/include/axis-group-spanner.hh index 138c58787a..40753a8a9a 100644 --- a/lily/include/axis-group-spanner.hh +++ b/lily/include/axis-group-spanner.hh @@ -15,15 +15,18 @@ /** An element which groups a line in a certain direction. The most useful example of this is the Vertical_group_spanner */ -class Axis_group_spanner : public Spanner, public virtual Axis_group_element +class Axis_group_spanner : public virtual Axis_group_element, + public virtual Spanner + { void do_break_processing_if_unbroken(); protected: virtual void do_break_processing(); virtual void do_print() const; + virtual Interval do_width () const; public: - + VIRTUAL_COPY_CONS(Score_element); }; #endif // SPAN_AXIS_GROUP_HH diff --git a/lily/include/bar-engraver.hh b/lily/include/bar-engraver.hh index 647a47e05d..bbb26c7c70 100644 --- a/lily/include/bar-engraver.hh +++ b/lily/include/bar-engraver.hh @@ -24,7 +24,6 @@ public: void request_bar (String type_str); protected: - virtual void acknowledge_element (Score_element_info i); virtual void do_creation_processing (); virtual void do_removal_processing (); virtual bool do_try_music (Music *req_l); diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 08e48d2f6e..3c43bc0dcd 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -14,9 +14,6 @@ class Bar:public Item { public: String type_str_; - bool at_line_start_b_; - - VIRTUAL_COPY_CONS(Score_element); Bar (); @@ -24,6 +21,7 @@ protected: virtual void do_pre_processing (); virtual Molecule* do_brew_molecule_p () const; virtual Real get_bar_size () const; + private: void do_print () const; }; diff --git a/lily/include/base-span-bar-engraver.hh b/lily/include/base-span-bar-engraver.hh index cf992c8fb9..47c274d758 100644 --- a/lily/include/base-span-bar-engraver.hh +++ b/lily/include/base-span-bar-engraver.hh @@ -11,7 +11,7 @@ #define SPAN_BAR_GRAV_HH #include "engraver.hh" - +class Axis_align_spanner; /** Make bars that span multiple "staffs". Catch bars, and span a @@ -22,7 +22,7 @@ class Base_span_bar_engraver : public Engraver { Span_bar * spanbar_p_; Array bar_l_arr_; - Vertical_align_spanner * valign_l_; + Axis_align_spanner * valign_l_; public: VIRTUAL_COPY_CONS(Translator); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 3b99b4e083..fcf477430e 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -51,13 +51,11 @@ public: /// maximum number of beams (for opening-up of beam-spacing) int multiple_i_; - /// vertical align distance between staffs - Drul_array vertical_align_drul_; - Array sinfo_; Beam(); void add_stem (Stem*); + Stem_info get_stem_info (Stem*); void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current); void set_stemlens (); diff --git a/lily/include/bow.hh b/lily/include/bow.hh index c6b946e87b..dd3426ce10 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -16,6 +16,11 @@ /** Base class for anything that looks like a slur. Anybody with a better name? + + UGH. Fixme. Should junk + + dy_f_drul_ , dx_f_drul_ + */ class Bow : public Directional_spanner { @@ -23,10 +28,6 @@ public: Bow (); Offset center () const; - int dash_i_; - Real interstaff_f_; - Drul_array vertical_align_drul_; - protected: virtual Molecule* do_brew_molecule_p () const; // virtual Interval do_width () const; diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh index d127e7879b..d2b98fa7ce 100644 --- a/lily/include/break-align-item.hh +++ b/lily/include/break-align-item.hh @@ -10,16 +10,16 @@ #ifndef BREAK_ALIGN_ITEM_HH #define BREAK_ALIGN_ITEM_HH -#include "horizontal-align-item.hh" +#include "axis-align-item.hh" /// align breakable items (clef, bar, etc.) -class Break_align_item : public Horizontal_align_item { +class Break_align_item : public Axis_align_item { protected: - virtual void do_pre_processing(); + virtual void do_pre_processing(); public: - - VIRTUAL_COPY_CONS(Score_element); + Break_align_item (); + VIRTUAL_COPY_CONS(Score_element); }; #endif // BREAK_ALIGN_ITEM_HH diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 832ac89704..42b14277cf 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -10,7 +10,7 @@ #ifndef COLLISION_HH #define COLLISION_HH #include "lily-proto.hh" -#include "horizontal-vertical-group-item.hh" +#include "axis-group-item.hh" /** Resolve conflicts between various Note_columns (chords). @@ -20,7 +20,7 @@ multistaff support (see Chlapik: equal noteheads should be on the same hpos.) */ -class Collision : public Horizontal_vertical_group_item { +class Collision : public Axis_group_item { protected: virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual void do_pre_processing(); diff --git a/lily/include/cons.cc b/lily/include/cons.cc deleted file mode 100644 index 39ed3095f6..0000000000 --- a/lily/include/cons.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* - cons.cc -- implement - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - -#include "cons.hh" diff --git a/lily/include/cons.hh b/lily/include/cons.hh deleted file mode 100644 index 7e2a995450..0000000000 --- a/lily/include/cons.hh +++ /dev/null @@ -1,111 +0,0 @@ -/* - cons.hh -- declare LISP like datatypes - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - -#ifndef CONS_HH -#define CONS_HH - - -template -class Cons -{ -public: - T * car_; - Cons * next_; - Cons () - { - car_=0; - next_ =0; - } - Cons (T*t, Cons*c) - { - car_ = t; - next_ = c; - } - virtual ~Cons () - { - delete next_; - } -}; - -template -class Killing_cons : public Cons -{ -public: - Killing_cons (T *t, Cons *p) - : Cons( t,p) - { - } - virtual ~Killing_cons (); -}; - - -/// 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 -{ -public: - Cons * head_; - Cons ** tail_; - Cons_list () { init_list (); } - void init_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 -void copy_killing_cons_list (Cons_list&, Cons *src); -template -void -clone_killing_cons_list (Cons_list&, Cons *src); - -template int cons_list_size_i (Cons *l) -{ - int i=0; - while (l) - { - l = l->next_; - i++; - } - return i; -} - - - - -#endif /* CONS_HH */ - diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 67a62429c2..374181e014 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -10,12 +10,12 @@ #ifndef DOT_COLUMN_HH #define DOT_COLUMN_HH -#include "horizontal-group-item.hh" +#include "axis-group-item.hh" /** Group dots. This is needed because, the dots have to be aligned per voice */ -class Dot_column : public Horizontal_group_item +class Dot_column : public Axis_group_item { Link_array head_l_arr_; Link_array dot_l_arr_; @@ -24,7 +24,7 @@ public: void add_head (Rhythmic_head*); void add_dots (Dots*); - + Dot_column (); protected: virtual void do_pre_processing (); virtual void do_substitute_element_pointer (Score_element *o, Score_element*n); diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 2ff6f06170..919da6fb8d 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -24,7 +24,6 @@ protected: public: int no_dots_i_; int position_i_; - Dots (); }; diff --git a/lily/include/g-staff-side.hh b/lily/include/g-staff-side.hh index 6334233f11..c463360e27 100644 --- a/lily/include/g-staff-side.hh +++ b/lily/include/g-staff-side.hh @@ -20,7 +20,6 @@ public: Score_element * to_position_l_; Direction dir_; Link_array support_l_arr_; - Real padding_f_; Axis axis_; G_staff_side_item (); diff --git a/lily/include/graphical-axis-group.hh b/lily/include/graphical-axis-group.hh index 73249862b6..c21995c39c 100644 --- a/lily/include/graphical-axis-group.hh +++ b/lily/include/graphical-axis-group.hh @@ -22,19 +22,21 @@ */ class Graphical_axis_group : public virtual Graphical_element { public: + // keep array in order. + bool ordered_b_; Link_array elem_l_arr_; Axis axes_[2]; Interval extent (Axis) const; virtual void do_print() const; Graphical_axis_group (Graphical_axis_group const&); - Graphical_axis_group (Axis,Axis); + Graphical_axis_group (); + virtual void set_axes (Axis,Axis); void remove_all (); bool contains_b (Graphical_element const *) const; void add_element (Graphical_element*); void remove_element (Graphical_element*); - }; #endif // Graphical_axis_group_HH diff --git a/lily/include/hara-kiri-vertical-group-spanner.hh b/lily/include/hara-kiri-vertical-group-spanner.hh index 3f5031ba48..7479e90b29 100644 --- a/lily/include/hara-kiri-vertical-group-spanner.hh +++ b/lily/include/hara-kiri-vertical-group-spanner.hh @@ -10,17 +10,17 @@ #ifndef HARA_KIRI_VERTICAL_GROUP_SPANNER_HH #define HARA_KIRI_VERTICAL_GROUP_SPANNER_HH -#include "vertical-group-spanner.hh" +#include "axis-group-spanner.hh" /** As Vertical_group_spanner, but keep track of interesting items. If we don't contain any interesting items after linebreaking, then gracefully commit suicide. Objective: don't disgrace Lily by typesetting empty lines in orchestral scores. */ -class Hara_kiri_vertical_group_spanner : public Vertical_group_spanner +class Hara_kiri_group_spanner : public Axis_group_spanner { public: - Hara_kiri_vertical_group_spanner (); + Hara_kiri_group_spanner (); virtual void do_post_processing (); void add_interesting_item (Item* n); protected: diff --git a/lily/include/horizontal-align-item.hh b/lily/include/horizontal-align-item.hh deleted file mode 100644 index ae2ff01640..0000000000 --- a/lily/include/horizontal-align-item.hh +++ /dev/null @@ -1,30 +0,0 @@ -/* - horizontal-align-item.hh -- declare Horizontal_align_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef HORIZONTAL_ALIGN_ITEM_HH -#define HORIZONTAL_ALIGN_ITEM_HH - -#include "item.hh" -#include "align-element.hh" - -/** - Order elems left to right. - - TODO: insert (order, elem) - */ -class Horizontal_align_item : public Item , public Align_element { -public: - - VIRTUAL_COPY_CONS(Score_element); - void add_item (Item*, int p); - Horizontal_align_item(); - virtual void do_print() const; - -}; -#endif // HORIZONTAL_ALIGN_ITEM_HH diff --git a/lily/include/horizontal-group-element.hh b/lily/include/horizontal-group-element.hh deleted file mode 100644 index ed2e393565..0000000000 --- a/lily/include/horizontal-group-element.hh +++ /dev/null @@ -1,30 +0,0 @@ -/* - horizontal-group-element.hh -- declare Horizontal_group_element - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys - - */ - -#ifndef HORIZONTAL_GROUP_ELEM_HH -#define HORIZONTAL_GROUP_ELEM_HH - -#include "axis-group-element.hh" - -/** - Treat a group of elements a unity in horizontal sense . - A column is a typical Vertical_group. - */ -class Horizontal_group_element : public virtual Axis_group_element { -protected: - virtual Interval do_width() const; - -public: - Horizontal_group_element (); - -}; - - -#endif /* HORIZONTAL_GROUP_ELEM_HH */ - diff --git a/lily/include/horizontal-group-item.hh b/lily/include/horizontal-group-item.hh deleted file mode 100644 index 0c96d29c95..0000000000 --- a/lily/include/horizontal-group-item.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - horizontal-group-item.hh -- declare Horizontal_group_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef HORIZONTAL_GROUP_ITEM_HH -#define HORIZONTAL_GROUP_ITEM_HH - -#include "horizontal-group-element.hh" -#include "axis-group-item.hh" - -/** - Group stuff in horizontal sense. Example: Paper_column - */ -class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element { -protected: - virtual void do_print() const; -public: - Horizontal_group_item (); - - VIRTUAL_COPY_CONS(Score_element); -}; - -#endif // HORIZONTAL_GROUP_ITEM_HH diff --git a/lily/include/horizontal-vertical-group-element.hh b/lily/include/horizontal-vertical-group-element.hh deleted file mode 100644 index 90043a7cce..0000000000 --- a/lily/include/horizontal-vertical-group-element.hh +++ /dev/null @@ -1,33 +0,0 @@ -/* - horizontal-vertical-group-element.hh -- declare Horizontal_vertical_group_element - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys - - */ - -#ifndef HORIZONTAL_VERTICAL_GROUP_ELEM_HH -#define HORIZONTAL_VERTICAL_GROUP_ELEM_HH - -#include "vertical-group-element.hh" -#include "horizontal-group-element.hh" - -/** A class to treat a group of elements as a single entity. The - dimensions are the unions of the dimensions of what it contains. - Translation means translating the contents. - */ -class Horizontal_vertical_group_element : public Vertical_group_element, - public Horizontal_group_element -{ -protected: -public: - Horizontal_vertical_group_element (); - - -}; - - -#endif /* HORIZONTAL_VERTICAL_GROUP_ELEM_HH */ - - diff --git a/lily/include/horizontal-vertical-group-item.hh b/lily/include/horizontal-vertical-group-item.hh deleted file mode 100644 index e5f7bbfe17..0000000000 --- a/lily/include/horizontal-vertical-group-item.hh +++ /dev/null @@ -1,30 +0,0 @@ -/* - horizontal-vertical-group-item.hh -- declare Horizontal_vertical_group_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef HORIZONTAL_VERTICAL_GROUP_ITEM_HH -#define HORIZONTAL_VERTICAL_GROUP_ITEM_HH - -#include "axis-group-item.hh" -#include "horizontal-vertical-group-element.hh" - - -/** - Treat a collection of items as a unity - */ -class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element { -protected: - virtual void do_print() const; - VIRTUAL_COPY_CONS(Score_element); -public: - Horizontal_vertical_group_item (); - - -}; - -#endif // HORIZONTAL_VERTICAL_GROUP_ITEM_HH diff --git a/lily/include/key-engraver.hh b/lily/include/key-engraver.hh index e93907886c..aef3f27faf 100644 --- a/lily/include/key-engraver.hh +++ b/lily/include/key-engraver.hh @@ -27,11 +27,11 @@ public: VIRTUAL_COPY_CONS(Translator); Key key_; Key_change_req * keyreq_l_; - Key_item * kit_p_; + Key_item * item_p_; Array accidental_idx_arr_; Array old_accidental_idx_arr_; - bool default_key_b_; - bool change_key_b_; + + protected: virtual bool do_try_music (Music *req_l); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 0833aca961..82f72cb871 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -13,19 +13,17 @@ /// An item which places accidentals at the start of the line class Key_item :public Item, public Staff_symbol_referencer { -public: - Array pitch_arr_; Array acc_arr_; Array old_pitch_arr_; Array old_acc_arr_; + int c0_position_; + + +public: + bool multi_octave_b_; - // ugh. Naming - int c_position; - // see above. - int c0_position; - bool default_b_; - bool multi_octave_b_; + int get_c_position () const; VIRTUAL_COPY_CONS(Score_element); @@ -37,7 +35,6 @@ public: int calculate_position(int p, int a) const; protected: - virtual void do_pre_processing(); virtual Molecule* do_brew_molecule_p() const; }; diff --git a/lily/include/killing-cons.tcc b/lily/include/killing-cons.tcc deleted file mode 100644 index f6fcff7bd1..0000000000 --- a/lily/include/killing-cons.tcc +++ /dev/null @@ -1,44 +0,0 @@ -/* - killing-cons.tcc -- declare Killing_cons - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - -#ifndef KILLING_CONS_TCC -#define KILLING_CONS_TCC - -#include "cons.hh" - -template -Killing_cons::~Killing_cons () -{ - delete car_; -} - -template -void -copy_killing_cons_list (Cons_list &dest, Cons *src) -{ - for (; src; src = src->next_) - { - T *t = new T(*src->car_); - dest.append ( new Killing_cons (t, 0)); - } -} - -template -void -clone_killing_cons_list (Cons_list & dest, Cons *src) -{ - for (; src; src = src->next_) - { - T *t = src->car_->clone (); - dest.append (new Killing_cons (t, 0)); - } -} - -#endif /* KILLING_CONS_TCC */ - diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 097a77af14..5620719042 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -24,7 +24,7 @@ SCM ly_eval (SCM a); SCM ly_func_o (char const* name); SCM ly_quote_scm (SCM s); void ly_display_scm (SCM s); - +String ly_scm2string (SCM s); #include "array.hh" #include "scalar.hh" diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 545ba25af6..367ff2febd 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -89,13 +89,9 @@ struct Graphical_element; struct Graphical_axis_group; struct Global_translator; struct Hara_kiri_line_group_engraver; -struct Hara_kiri_vertical_group_spanner; +struct Hara_kiri_group_spanner; struct Head_column; -struct Horizontal_align_item; -struct Horizontal_group_element; -struct Horizontal_group_item; -struct Horizontal_vertical_group; struct Idealspacing; struct Identifier; struct Input_file; @@ -257,10 +253,7 @@ struct Translator_group; struct Timing_req; struct Vertical_brace; struct Vertical_spanner; -struct Vertical_group_element; -struct Vertical_group_spanner; -struct Vertical_align_spanner; -struct Vertical_align_engraver; + struct Volta_spanner; struct Align_element; struct Sequential_music; diff --git a/lily/include/line-group-group-engraver.hh b/lily/include/line-group-group-engraver.hh index 24d1dd668c..93e917310b 100644 --- a/lily/include/line-group-group-engraver.hh +++ b/lily/include/line-group-group-engraver.hh @@ -18,7 +18,7 @@ */ class Line_group_engraver_group : public Engraver_group_engraver { protected: - Vertical_group_spanner *staffline_p_; + Axis_group_spanner *staffline_p_; virtual void create_line_spanner (); virtual void do_creation_processing(); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 9b988f4978..9290359b1e 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -23,13 +23,11 @@ public: Lookup (); Lookup (Lookup const&); - - - Molecule special_ball (int, String) const; Molecule simple_bar (String s, Real w) const; Molecule accidental (int, bool cautionary) const; Molecule afm_find (String, bool warn=true) const; - Molecule ball (int) const; + Molecule notehead (int, String) const; + Molecule bar (String, Real height) const; Molecule beam (Real, Real, Real) const; Molecule clef (String) const; diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh index 3dfe3025d4..1e2c85eecb 100644 --- a/lily/include/ly-symbols.hh +++ b/lily/include/ly-symbols.hh @@ -14,9 +14,11 @@ #define DECLARE_LY_SYMBOL(a) extern SCM a ## _scm_sym #endif +DECLARE_LY_SYMBOL(at_line_start); DECLARE_LY_SYMBOL(beam); DECLARE_LY_SYMBOL(beam_thickness); DECLARE_LY_SYMBOL(beam_dir); +DECLARE_LY_SYMBOL(beam_gap); DECLARE_LY_SYMBOL(bracket); DECLARE_LY_SYMBOL(break_helper_only); DECLARE_LY_SYMBOL(break_priority); @@ -25,6 +27,7 @@ DECLARE_LY_SYMBOL(char); DECLARE_LY_SYMBOL(change); DECLARE_LY_SYMBOL(damping); DECLARE_LY_SYMBOL(dashed); +DECLARE_LY_SYMBOL(extremal); DECLARE_LY_SYMBOL(dir_forced); DECLARE_LY_SYMBOL(extender_height); DECLARE_LY_SYMBOL(filledbox); @@ -39,11 +42,13 @@ DECLARE_LY_SYMBOL(notewidth); DECLARE_LY_SYMBOL(non_default); DECLARE_LY_SYMBOL(octave_dir); DECLARE_LY_SYMBOL(output); +DECLARE_LY_SYMBOL(padding); DECLARE_LY_SYMBOL(pianobrace); DECLARE_LY_SYMBOL(placebox); DECLARE_LY_SYMBOL(rulesym); DECLARE_LY_SYMBOL(rulethickness); DECLARE_LY_SYMBOL(staffheight); +DECLARE_LY_SYMBOL(style); DECLARE_LY_SYMBOL(text); DECLARE_LY_SYMBOL(transparent); DECLARE_LY_SYMBOL(tuplet); diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 8390326add..5727661321 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -48,5 +48,6 @@ public: Molecule (const Molecule&s); void print() const; void operator=(const Molecule&); + bool empty_b() const; }; #endif diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index a48792349d..e931ede0ea 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -17,20 +17,10 @@ class Note_head : public Rhythmic_head { public: - - String note_head_type_str_; - - /// position of top line (5 linestaff: 8) int position_i_; - /// -1 = lowest, 0 = inside, 1 = top - int extremal_i_; - - /// needed for the help-lines - int staff_size_i_; - Direction x_dir_; - Note_head (); + void flip_around_stem (Direction); static int compare (Note_head * const &a, Note_head *const &b) ; protected: virtual Interval do_width () const; diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 3f3f35e517..fd379a3347 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -10,7 +10,7 @@ #ifndef P_COL_HH #define P_COL_HH -#include "horizontal-group-item.hh" +#include "axis-group-item.hh" #include "rod.hh" @@ -27,7 +27,7 @@ \end{itemize} */ -class Paper_column : public Horizontal_group_item { +class Paper_column : public Axis_group_item { public: VIRTUAL_COPY_CONS(Score_element); Drul_array > minimal_dists_arr_drul_; diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 94d1e481e1..74ba090bad 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -10,23 +10,24 @@ #ifndef SCRIPT_COLUMN_HH #define SCRIPT_COLUMN_HH -#include "horizontal-vertical-group-item.hh" +#include "axis-group-item.hh" /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts) as a single entity. */ -class Script_column : public Horizontal_vertical_group_item { +class Script_column : public Axis_group_item { protected: - virtual void do_print() const; - virtual void do_substitute_element_pointer (Score_element*, Score_element*); - virtual void do_pre_processing() ; + virtual void do_print() const; + virtual void do_substitute_element_pointer (Score_element*, Score_element*); + virtual void do_pre_processing() ; public: - Link_array