diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 1998-11-02 16:25:15 +0100 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 1998-11-02 16:25:15 +0100 |
commit | 31653bf1d61a33ef8bc8c871d60c6b3452d04d28 (patch) | |
tree | afe8c07918d201a58eafb71f060b6622d1e91254 | |
parent | 4a8e84ba5dc1f8b71fda44b848b601349a80403a (diff) |
release: 1.1.1
183 files changed, 789 insertions, 738 deletions
diff --git a/Documentation/faq.yo b/Documentation/faq.yo index 327a83eb5c..059cc78381 100644 --- a/Documentation/faq.yo +++ b/Documentation/faq.yo @@ -381,7 +381,7 @@ wrong symbols and dvi-checksum errors!) We obviously mucked with the fonts in the upgrade. Remove em(all) previous fonts, including the file(.pk) and file(.tfm) fonts in file(/var/lib/texmf). A script automating this has been included, see -file(bin/clean-fonts.sh). +file(buildscripts/clean-fonts.sh). question(The beams and slurs are gone if use the XDvi magnifying glass!?) diff --git a/Documentation/ntweb/index.yo b/Documentation/ntweb/index.yo index 4460f700c8..1a3a8df1f1 100644 --- a/Documentation/ntweb/index.yo +++ b/Documentation/ntweb/index.yo @@ -4,11 +4,12 @@ sect(Windows NT Binary Distribution) subsect(Introduction) label(introduction) -This page is dedicated to the distribution of precompiled and preformatted -LilyPond binaries for Windows NT 4.0 . This package is covered under the -GNU General Public License and all of the source and documentation are +This page is dedicated to the distribution of precompiled and +preformatted LilyPond binaries for Windows NT 4.0 . This package is +covered under the GNU General Public License and all of the source is available on the official url(LilyPond Homepage)(http://www.cs.ruu.nl/people/hanwen/lilypond/index.html). +A full set of url(documentation)(http://www.cs.ruu.nl/people/hanwen/lilypond/Documentation/tex/out-www/index.html) in various formats is also available. includefile(../BLURB.in) @@ -69,8 +70,8 @@ itemize( In a batch file you can add the following entries: nl() bf(set LILYPONDPREFIX=em(LilyPond-dir)) nl() bf(set path=%path%;%LILYPONDPREFIX%\bin;em(MiKTeX-dir)\miktex\bin) nl() - bf(set TEXINPUTS=%LILYPONDPREFIX%\texmf\tex\lilypond;;) nl() - bf(set MFINPUTS=%LILYPONDPREFIX%\texmf\mf\public\lilypond;;) nl() + bf(set TEXINPUTS=%LILYPONDPREFIX%\share\lilypond\tex;;) nl() + bf(set MFINPUTS=%LILYPONDPREFIX%\share\lilypond\mf;;) nl() COMMENT( dit(Windows Environment) In the Windows environment you can select properties menu of the My Computer icon. Click on diff --git a/Documentation/tex/GNUmakefile b/Documentation/tex/GNUmakefile index 8b4a15a5d4..6102deb049 100644 --- a/Documentation/tex/GNUmakefile +++ b/Documentation/tex/GNUmakefile @@ -4,6 +4,7 @@ depth=../.. DATA_FILES = $(wildcard *.data) datafiles = $(addprefix $(outdir)/,$(DATA_FILES:.data=.html)) +TEX_FILES = $(wildcard *.tex) DOC_FILES = $(wildcard *.doc) DVI_FILES = $(addprefix $(outdir)/,$(DOC_FILES:.doc=.dvi) $(YO_FILES:.yo=.dvi)) OUT_BIB_FILES = $(addprefix $(outdir)/, $(BIB_FILES)) @@ -11,10 +12,11 @@ OUT_BIB_FILES = $(addprefix $(outdir)/, $(BIB_FILES)) # just include me YO_URG_FILES = $(wildcard *.yo-urg) +OUTTEX_FILES = $(addprefix $(outdir)/, $(TEX_FILES)) OUTDOC_FILES = $(addprefix $(outdir)/, $(DOC_FILES)) EL_FILES = $(wildcard *.el) BIB_FILES= $(wildcard *.bib) -EXTRA_DIST_FILES= $(BIB_FILES) $(DOC_FILES) $(DATA_FILES) $(EL_FILES) $(YO_URG_FILES) +EXTRA_DIST_FILES= $(BIB_FILES) $(DOC_FILES) $(DATA_FILES) $(EL_FILES) $(YO_URG_FILES) $(TEX_FILES) HTML_FILES = $(addprefix $(outdir)/, $(YO_FILES:.yo=.html)) PS_FILES = $(DVI_FILES:.dvi=.ps) @@ -54,9 +56,9 @@ $(outdir)/glossary.dvi: $(outdir)/glossary-table.tex $(outdir)/glossary.html: $(outdir)/glossary-table.html -local-WWW: $(HTML_FILES) $(OUTDOC_FILES:.doc=.ps.gz) $(OUTYO_FILES:.yo=.latex) $(OUTYO_FILES:.yo=.ps.gz) $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html)) $(datafiles) +local-WWW: $(HTML_FILES) $(OUTDOC_FILES:.doc=.ps.gz) $(OUTTEX_FILES:.tex=.ps.gz) $(OUTYO_FILES:.yo=.latex) $(OUTYO_FILES:.yo=.ps.gz) $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html)) $(datafiles) $(PYTHON) $(step-bindir)/ls-latex.py --package=$(topdir) --title 'LaTeX documents about LilyPond' \ - $(YO_FILES) $(OUTYO_FILES:.yo=.latex) $(BIB_FILES) $(DOC_FILES) \ + $(YO_FILES) $(OUTYO_FILES:.yo=.latex) $(BIB_FILES) $(DOC_FILES) $(TEX_FILES)\ | sed "s!$(outdir)/!!g" > $(outdir)/index.html $(PYTHON) $(step-bindir)/add-html-footer.py --package=$(topdir) $(outdir)/index.html diff --git a/Documentation/topdocs/INSTALL.yo b/Documentation/topdocs/INSTALL.yo index 9a72516764..54147f74e1 100644 --- a/Documentation/topdocs/INSTALL.yo +++ b/Documentation/topdocs/INSTALL.yo @@ -4,13 +4,13 @@ sect(ABSTRACT) You do something which looks remotely like verb( - configure # Check out the bin/set-lily.sh script + configure # Check out the buildscripts/set-lily.sh script make make install ) The detailed instructions follow here. The -file(bin/set-lily.sh) script sets some environment variables +file(buildscripts/set-lily.sh) script sets some environment variables and symlinks, which comes in handly when you have to compile LilyPond very often. It is aimed at people who run (or debug) LilyPond without installing. @@ -35,6 +35,8 @@ it() GNU C++ version 2.7 or newer (2.8 and egcs are also fine). it() Python 1.5 (Strictly speaking, you shouldn't need Python for compiling and installing, but you'll need it to regenerate the font tables, e.g.). + +it() GUILE 1.3 (no, GUILE 1.2 won't work) ) sect(RUNNING) @@ -60,8 +62,8 @@ export TEXINPUTS="/usr/local/share/lilypond/tex:" The empty path component represents TeX() and MetaFont's default search paths. Scripts with the proper paths for the bourne and C-shell respectively are generated in -file(bin/out/lilypond-profile) and -file(bin/out/lilypond-login) during compilation. +file(buildscripts/out/lilypond-profile) and +file(buildscripts/out/lilypond-login) during compilation. sect(RECOMMENDED) diff --git a/Documentation/topdocs/index.yo b/Documentation/topdocs/index.yo index fc1675b132..1307c60e3b 100644 --- a/Documentation/topdocs/index.yo +++ b/Documentation/topdocs/index.yo @@ -39,7 +39,6 @@ nsect(Sites) description( dit(lurl(http://www.cs.uu.nl/people/hanwen/lilypond/))Han-Wen's site. -dit(lurl(http://www.xs4all.nl/~jantien/lilypond/))Jan's site. dit(lurl(http://www.realtime.net/~daboys/lilypond/))Jeff's Windows NT Distribution site. ) @@ -1,27 +1,45 @@ ---- ../lilypond-1.1.0.uu2.jcn1/NEWS Fri Oct 30 17:01:27 1998 -++ b/NEWS Fri Oct 30 18:15:48 1998 -@@ -1,3 +1,8 @@ -pl 0.uu2.jcn2 +pl 0.uu5 + - fixed MIDI output. + +pl 0.jcn3 - dropped stepmake/aclocal.m4 - removed silly -lguile (BLA_LIBS, EXTRA_LIBS ??) - added debugging output format: -fscm - - pl 0.uu2.jcn1 - - ly2dvi.py -I fix - - too annoying buildscripts, scripts -> bin--- ../lilypond-1.1.0.uu2/NEWS Thu Oct 29 00:59:19 1998 -++ b/NEWS Fri Oct 30 17:01:27 1998 -@@ -1,3 +1,8 @@ -pl 0.uu2.jcn1 - ly2dvi.py -I fix - - too annoying buildscripts, scripts -> bin - Documentation/tex/feta.tex - doco fixes: PATCHES.yo, yodl-1.31.7 - - pl 0.uu2 - - undone type_info::before hack. (Ugh. RTFM).pl 0.jcn1 + +pl 0.uu4 + - Protected_scm to fixup GUILE gc + +pl 0.uu3 + - more RTTI cleaning. + +pl 0.uu2 + - undone type_info::before hack. (Ugh. RTFM). + +pl 0.uu1 + - more RTTI stuff: is_type_b -> type_info::before + +pl 0.jcn1 pl 17.jcn7 - added: set*text, timesig, beam - guile-1.3 is fine; my egcs-1.0.2's -O2 is broken +pl 17.jbr1 + - stepmake/stepmake/bin/package-zip32.sh: Updated configure statement + and modified win32 specific distribution file names to match + pl 16.hwn1 changes. + - scripts/ly2dvi.py: Modified search paths to match the new lilypond + installation tree. + - scripts/convert-mudela.py: Remove the an existing backup file + before renaming original. This is a WIN32 Python requirement. + - Documentation/ntweb/index.html: Updated documentation to match + new lilypond installation tree. + - lily/main.cc: Fixed LILYPONDPREFIX search paths. + + + +********** 1.1.0 diff --git a/PATCHES.txt b/PATCHES.txt index 2f32fb9487..f801d8ef5a 100644 --- a/PATCHES.txt +++ b/PATCHES.txt @@ -62,13 +62,17 @@ Then, from the top of Lily's source tree, type + make dist make diff -which leaves your patch as ./lilypond-0.1.73.jcn1.diff. +which rolls the tarball ../releases/lilypond-0.1.73.tar.gz +and leaves your patch as ./lilypond-0.1.73.jcn1.diff. [1] +We assume that there is a tarball lilypond-0.1.73.tar.gz in +the directory ../releases. If you didn't configure Lily using --srcdir, you can do: @@ -102,6 +106,10 @@ o GNU diff o Python (version 1.5 or newer). You can of course make a patch by hand, which would go something like: +----------- +[1] 'Make diff' generates a patch between two tar- +balls. For more info type 'make diff help=='. + make distclean cd .. @@ -9,8 +9,12 @@ grep for TODO and ugh/ugr/urg BUGS: + * disallow backslashes + + * \breathmark TeX macro + + * catch GUILE errors? - * add new glyphs to font.ly * formatting of input stuff. @@ -103,8 +107,6 @@ BUGS: * include MIDI list - * make GNU style webpages. - * midi_instrument -> midiInstrument * horizontal centering of dynamics @@ -350,7 +352,6 @@ PROJECTS - indentation - notenames? - fontlock: \melodic \melodic - * use properties for: - plet? @@ -372,9 +373,8 @@ PROJECTS * Spring_spacer: - write a faster Spring_spacer (without matrices if possible) - - use straight LP to find minimal "fitting force" - relate energybound to linelen unitspace fontsize etc. - - used fixed point fp + - used fixed point fp? * \header - output header info to MIDI too. @@ -458,7 +458,7 @@ PROJECTS * Documentation - Doc (C) stuff of sheet music - a better format? SGML? TeX? Info? - - a tutorial + - a better tutorial * more spanners (smallish) - Glissando @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=0 -MY_PATCH_LEVEL=uu2.jcn2 +PATCH_LEVEL=1 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/GNUmakefile b/buildscripts/GNUmakefile new file mode 100644 index 0000000000..3a24a75973 --- /dev/null +++ b/buildscripts/GNUmakefile @@ -0,0 +1,12 @@ +# bin/Makefile + +depth = .. +STEPMAKE_TEMPLATES=script + +include $(depth)/make/stepmake.make + + + + + + diff --git a/bin/clean-diaper.sh b/buildscripts/clean-diaper.sh index 47c2a069db..47c2a069db 100644..100755 --- a/bin/clean-diaper.sh +++ b/buildscripts/clean-diaper.sh diff --git a/bin/clean-fonts.sh b/buildscripts/clean-fonts.sh index 597efa9032..597efa9032 100644..100755 --- a/bin/clean-fonts.sh +++ b/buildscripts/clean-fonts.sh diff --git a/bin/docxx-lily.sh b/buildscripts/docxx-lily.sh index 82407ed1ff..82407ed1ff 100644 --- a/bin/docxx-lily.sh +++ b/buildscripts/docxx-lily.sh diff --git a/bin/find-typenames.pl b/buildscripts/find-typenames.pl index 890f9cabd0..890f9cabd0 100644 --- a/bin/find-typenames.pl +++ b/buildscripts/find-typenames.pl diff --git a/bin/gen-sitemap.sh b/buildscripts/gen-sitemap.sh index 7f9bcbc95e..7f9bcbc95e 100644 --- a/bin/gen-sitemap.sh +++ b/buildscripts/gen-sitemap.sh diff --git a/bin/genheader.py b/buildscripts/genheader.py index 4dbb07f358..4dbb07f358 100644 --- a/bin/genheader.py +++ b/buildscripts/genheader.py diff --git a/bin/html-accents.py b/buildscripts/html-accents.py index 228ed7485f..228ed7485f 100644 --- a/bin/html-accents.py +++ b/buildscripts/html-accents.py diff --git a/bin/lilypond-login.sh b/buildscripts/lilypond-login.sh index d4a482ebe6..d4a482ebe6 100644 --- a/bin/lilypond-login.sh +++ b/buildscripts/lilypond-login.sh diff --git a/bin/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 176f63629e..176f63629e 100644 --- a/bin/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh diff --git a/bin/localpackage.py b/buildscripts/localpackage.py index f37fc8267b..f37fc8267b 100644 --- a/bin/localpackage.py +++ b/buildscripts/localpackage.py diff --git a/bin/ltmain.sh b/buildscripts/ltmain.sh index e9350b3fab..e9350b3fab 100644 --- a/bin/ltmain.sh +++ b/buildscripts/ltmain.sh diff --git a/bin/mail-address.sh b/buildscripts/mail-address.sh index 37e1141751..37e1141751 100644 --- a/bin/mail-address.sh +++ b/buildscripts/mail-address.sh diff --git a/bin/mf-to-table.py b/buildscripts/mf-to-table.py index 4d4b505197..4d4b505197 100644 --- a/bin/mf-to-table.py +++ b/buildscripts/mf-to-table.py diff --git a/bin/mf-to-xpms.sh b/buildscripts/mf-to-xpms.sh index 03729893d9..03729893d9 100644 --- a/bin/mf-to-xpms.sh +++ b/buildscripts/mf-to-xpms.sh diff --git a/bin/mutopia-index.py b/buildscripts/mutopia-index.py index b72042cadf..b72042cadf 100644 --- a/bin/mutopia-index.py +++ b/buildscripts/mutopia-index.py diff --git a/bin/profile-conf.sh b/buildscripts/profile-conf.sh index 79dbd73463..79dbd73463 100644 --- a/bin/profile-conf.sh +++ b/buildscripts/profile-conf.sh diff --git a/bin/ps-to-gifs.sh b/buildscripts/ps-to-gifs.sh index 0f4afe0a5a..0f4afe0a5a 100644..100755 --- a/bin/ps-to-gifs.sh +++ b/buildscripts/ps-to-gifs.sh diff --git a/bin/ps-to-pngs.sh b/buildscripts/ps-to-pngs.sh index 2a3f3636b5..2a3f3636b5 100644..100755 --- a/bin/ps-to-pngs.sh +++ b/buildscripts/ps-to-pngs.sh diff --git a/bin/run-lilypond.sh b/buildscripts/run-lilypond.sh index 2a69e5a3e2..2a69e5a3e2 100644 --- a/bin/run-lilypond.sh +++ b/buildscripts/run-lilypond.sh diff --git a/bin/set-lily.sh b/buildscripts/set-lily.sh index c85a44b8e3..d44317dc8e 100644..100755 --- a/bin/set-lily.sh +++ b/buildscripts/set-lily.sh @@ -38,9 +38,9 @@ fi ln -sf $LILYPOND_SOURCEDIR/lily/out/lilypond $prefix/bin/lilypond ln -sf $LILYPOND_SOURCEDIR/mi2mu/out/mi2mu $prefix/bin/mi2mu -ln -sf $LILYPOND_SOURCEDIR/bin/ly2dvi.sh $prefix/bin/ly2dvi -chmod 755 $LILYPOND_SOURCEDIR/bin/ps-to-gifs.sh -ln -sf $LILYPOND_SOURCEDIR/bin/ps-to-gifs.sh $prefix/bin/ps-to-gifs +ln -sf $LILYPOND_SOURCEDIR/scripts/ly2dvi.sh $prefix/bin/ly2dvi +chmod 755 $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh +ln -sf $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh $prefix/bin/ps-to-gifs if [ -f ../.gdbinit ]; then diff --git a/bin/show-current.sh b/buildscripts/show-current.sh index 7ae9c3fb03..7ae9c3fb03 100644 --- a/bin/show-current.sh +++ b/buildscripts/show-current.sh diff --git a/bin/template.py b/buildscripts/template.py index f1a45e0509..f1a45e0509 100644 --- a/bin/template.py +++ b/buildscripts/template.py diff --git a/flower/axis.cc b/flower/axis.cc index 73b8a8ec1a..ab80403e02 100644 --- a/flower/axis.cc +++ b/flower/axis.cc @@ -1,7 +1,7 @@ /* axis.cc -- implement Axis - source file of the GNU LilyPond music typesetter + (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl> */ diff --git a/flower/include/array.hh b/flower/include/array.hh index c40e639817..c9c146e9f1 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -66,12 +66,23 @@ public: {setsize_} */ int size() const - { return size_; } + { + return size_; + } /// POST: size() == 0 - void clear() - { size_ = 0; } + void clear() + { + size_ = 0; + } + Array (T *tp, int n) + { + array_p_ = new T[n]; + max_ =size_ = n; + arrcpy (array_p_, tp, n); + } + Array() { array_p_ = 0; max_ =0; size_ =0; } diff --git a/flower/include/dictionary.hh b/flower/include/dictionary.hh index d3c9a7afb3..e1e840b8a1 100644 --- a/flower/include/dictionary.hh +++ b/flower/include/dictionary.hh @@ -183,7 +183,7 @@ public: V retval; if (!elem_b (k)) return retval ; - retval ((Dictionary<V> *) this)->elem (k); + return ((Dictionary<V> *) this)->elem (k); } V remove (String s) diff --git a/flower/include/vector.hh b/flower/include/vector.hh index 8b4d280cf5..b4eeb97597 100644 --- a/flower/include/vector.hh +++ b/flower/include/vector.hh @@ -78,6 +78,7 @@ public: return sqrt (norm_sq()); } operator Array<Real>() { return dat; } + Array<Real> const &to_array()const { return dat; } void print() const; /// set to j-th element of unit-base void set_unit (int j) ; diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index 39795ce115..909267165b 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -10,6 +10,7 @@ #ifndef VIRTUAL_METHODS_HH #define VIRTUAL_METHODS_HH +#include <typeinfo> #include "stdlib.h" // size_t /** Declare the classes name as a static and virtual function. @@ -17,49 +18,79 @@ s->name() != S::static_name (). Overlapping strings need not be merged in C++ */ #define DECLARE_MY_RUNTIME_TYPEINFO \ -static bool static_is_type_b (const char*s);\ -virtual bool is_type_b (const char *s) const { return static_is_type_b (s); } \ -virtual char const *name() const{ return static_name (); } \ -virtual size_t class_size () const { return static_class_size (); }\ -static size_t static_class_size (); \ +virtual char const *name() const{ return static_name (); }\ static char const *static_name() -#define IMPLEMENT_STATIC_NAME(c)\ - char const *c::static_name() { return #c; } \ - size_t c::static_class_size () { return sizeof (c); } +#if 0 + /* + oops. before() has nothing to do with inheritance + */ +inline bool operator > (type_info const &a1, type_info const &a2) +{ + return a2.before (a1); +} +inline bool operator < (type_info const &a1, type_info const &a2) +{ + return a1.before (a2); +} -#define VIRTUAL_COPY_CONS(T, R)\ - virtual R *clone() const { return new T(*this); } \ - int yet_another_stupid_function_to_allow_semicolon() +inline bool operator <= (type_info const &a1, type_info const &a2) +{ + return a1 == a2 || a1 < a2; +} + +inline bool operator >= (type_info const &a1, type_info const &a2) +{ + return a1 == a2 || a1 > a2; +} +#endif + +#define IMPLEMENT_STATIC_NAME(c)\ + char const *c::static_name() { return #c; } + + /* + size_t c::static_class_size () { return sizeof (c); } + */ +#define VIRTUAL_COPY_CONS(T, R)\ + virtual R *clone() const { return new T(*this); } #define DECLARE_VIRTUAL_COPY_CONS(T, R)\ virtual R *clone() const + #define IMPLEMENT_VIRTUAL_COPY_CONS(T, R)\ R *T::clone() const { return new T(*this); }\ #define IMPLEMENT_IS_TYPE_B(D)\ - IMPLEMENT_STATIC_NAME(D)\ + IMPLEMENT_STATIC_NAME(D) + +/* bool D::static_is_type_b (const char *s)\ {\ return s == static_name();\ -} +}*/ #define IMPLEMENT_IS_TYPE_B1(D, B)\ - IMPLEMENT_STATIC_NAME(D)\ + IMPLEMENT_STATIC_NAME(D) +/* bool D::static_is_type_b (const char *s)\ {\ return s == static_name() || B::static_is_type_b (s);\ } +*/ #define IMPLEMENT_IS_TYPE_B2(D, BA, BB)\ - IMPLEMENT_STATIC_NAME(D)\ + IMPLEMENT_STATIC_NAME(D) + +/* + bool D::static_is_type_b (const char *s)\ {\ return s == static_name() || BA::static_is_type_b (s) || BB::static_is_type_b (s);\ } +*/ #endif diff --git a/lily/GNUmakefile b/lily/GNUmakefile index cf4db4c84a..e04d9f6476 100644 --- a/lily/GNUmakefile +++ b/lily/GNUmakefile @@ -6,9 +6,15 @@ depth = .. NAME = lilypond SUBDIRS = include -MODULE_LIBS=$(depth)/lib $(depth)/flower +MODULE_LIBS=$(depth)/lib $(depth)/flower +MODULE_INCLUDES=$(depth)/lib/include $(depth)/flower/include -STEPMAKE_TEMPLATES= c++ executable +STEPMAKE_TEMPLATES= c++ executable + +MODULE_LIBES=-lguile + +# for the RedHat GUILE 1.3 RPM +MODULE_LIBES+= -lreadline -ldl include $(depth)/make/stepmake.make diff --git a/lily/abbrev.cc b/lily/abbrev.cc index eb87945cd7..841f063ca6 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -129,7 +129,7 @@ void Abbreviation::do_substitute_dependent (Score_element*o, Score_element*n) { if (stem_l_ == o) - stem_l_ = n ? dynamic_cast<Stem*> (n) : 0; + stem_l_ = dynamic_cast<Stem*> (n); } diff --git a/lily/abbreviation-beam-engraver.cc b/lily/abbreviation-beam-engraver.cc index be29437462..145ab50bcb 100644 --- a/lily/abbreviation-beam-engraver.cc +++ b/lily/abbreviation-beam-engraver.cc @@ -27,11 +27,7 @@ Abbreviation_beam_engraver::Abbreviation_beam_engraver () bool Abbreviation_beam_engraver::do_try_request (Request*r) { - Musical_req* mus_l = dynamic_cast <Musical_req *> (r); - if (!mus_l) - return false; - - Abbreviation_beam_req * b = dynamic_cast <Abbreviation_beam_req *> (mus_l); + Abbreviation_beam_req * b = dynamic_cast <Abbreviation_beam_req *> (r); if (!b) return false; @@ -40,7 +36,7 @@ Abbreviation_beam_engraver::do_try_request (Request*r) return false; Direction d = (!abeam_p_) ? LEFT : RIGHT; - if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l)) + if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (b)) return false; span_reqs_drul_[d] = b; @@ -82,11 +78,10 @@ Abbreviation_beam_engraver::do_removal_processing () void Abbreviation_beam_engraver::acknowledge_element (Score_element_info i) { - if (!abeam_p_ || !i.elem_l_->is_type_b (Stem::static_name ())) + Stem* s = dynamic_cast<Stem *> (i.elem_l_); + if (!abeam_p_ || !s) return; - Stem* s = (Stem*)dynamic_cast <Item *> (i.elem_l_); - int type_i = span_reqs_drul_[LEFT]->type_i_; s->flag_i_ = intlog2 (type_i) - 2; if (span_reqs_drul_[RIGHT]) diff --git a/lily/atom.cc b/lily/atom.cc index 2d8f11e78e..ae6092c165 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -6,7 +6,6 @@ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl> */ - #include "atom.hh" #include "interval.hh" #include "string.hh" @@ -66,6 +65,7 @@ Atom::extent () const } + Atom::Atom () : dim_ (Interval (0,0),Interval (0,0)) { @@ -76,15 +76,15 @@ Atom::Atom () But Atom is used as a simple type *everywhere*, and we don't have virtual contructors. */ - lambda_ = 0; str_ = "unknown\n"; + origin_l_ = 0; } Atom::Atom (String s, Box b) : dim_ (b) { - lambda_ = 0; str_ = s; + origin_l_ = 0; } @@ -101,8 +101,6 @@ Atom::offset () const return off_; } - - void Atom::translate_axis (Real r, Axis a) { diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 71757314a7..2ec7736a40 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -80,6 +80,7 @@ Audio_time_signature::midi_item_p() { return new Midi_time_signature (this); } + IMPLEMENT_IS_TYPE_B1(Audio_time_signature, Audio_item); Audio_text::Audio_text (Audio_text::Type type, String text_str) @@ -96,7 +97,6 @@ Audio_text::midi_item_p() } IMPLEMENT_IS_TYPE_B1(Audio_text, Audio_item); - IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element); void diff --git a/lily/auto-plet-engraver.cc b/lily/auto-plet-engraver.cc index 254f029f59..c97be06723 100644 --- a/lily/auto-plet-engraver.cc +++ b/lily/auto-plet-engraver.cc @@ -15,16 +15,12 @@ bool Tuplet_engraver::do_try_request (Request *r) { - Command_req * c = dynamic_cast <Command_req *> (r); - if (!(c && - dynamic_cast <Bracket_req *> (c))) + if (Bracket_req * b = dynamic_cast <Bracket_req *> (r)) { - return false; + bracket_req_arr_.push (b); + return true; } - - Bracket_req * b = dynamic_cast <Bracket_req *> (c); - bracket_req_arr_.push (b); - return true; + return false; } void @@ -59,9 +55,9 @@ Tuplet_engraver::do_process_requests () void Tuplet_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->is_type_b (Note_column::static_name ())) + if (Note_column *nc = dynamic_cast<Note_column *> (i.elem_l_)) { - Note_column *nc = (Note_column*)dynamic_cast <Item *> (i.elem_l_); + for (int j =0; j <started_span_p_arr_.size (); j++) // started_span_p_arr_[j]->add_column (nc); ; diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index 928f64de0c..a19d26c6c3 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -76,12 +76,5 @@ Axis_group_element::Axis_group_element () transparent_b_ = true; } -Axis_group_element* -Axis_group_element::access_Axis_group_element () -{ - return this; -} - - IMPLEMENT_IS_TYPE_B2(Axis_group_element, Score_element, Graphical_axis_group); diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc index 273116d1ea..6eabab3a58 100644 --- a/lily/axis-group-item.cc +++ b/lily/axis-group-item.cc @@ -40,7 +40,7 @@ Axis_group_item::do_breakable_col_processing() { Item *new_l = it_l->find_prebroken_piece (broken_to_drul_[j]->break_status_dir_); - ((Axis_group_item*)broken_to_drul_[j])->add_element (new_l); + (dynamic_cast<Axis_group_item*> (broken_to_drul_[j]))->add_element (new_l); } while (flip(&j)!=LEFT); } diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 70c70c297f..fdd2969b5e 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -65,39 +65,36 @@ 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 */ - if (dynamic_cast <Spanner *> (elt)) + Spanner * sp =dynamic_cast <Spanner *> (elt); + Item *it = dynamic_cast <Item *> (elt) ; + if (sp) { - Spanner * sp = dynamic_cast <Spanner *> (elt); - for (int j =0; j < broken_into_l_arr_.size(); j++) { Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)broken_into_l_arr_[j]; + = dynamic_cast<Axis_group_spanner*>(broken_into_l_arr_[j]); Spanner * broken_span_l - = sp->find_broken_piece ( - ((Score_element*)my_broken_l)->line_l()); + = sp->find_broken_piece (dynamic_cast<Score_element*>(my_broken_l)->line_l()); if (broken_span_l) my_broken_l->add_element (broken_span_l); } } - else if (dynamic_cast <Item *> (elt) - && dynamic_cast <Item *> (elt)->breakable_b_ - && dynamic_cast <Item *> (elt)->break_status_dir () == 0) + else if (it && it->breakable_b_ && it->break_status_dir () == 0) { // broken items Direction j=LEFT; do { - Item * my_item = dynamic_cast <Item *> (elt)->broken_to_drul_[j]; + Item * my_item = it->broken_to_drul_[j]; Line_of_score * item_line_l = my_item->line_l() ; if (! item_line_l) continue; Axis_group_spanner * v - = (Axis_group_spanner*)find_broken_piece (item_line_l); + = dynamic_cast<Axis_group_spanner*>(find_broken_piece (item_line_l)); if (v) v->add_element (my_item); else @@ -118,7 +115,7 @@ Axis_group_spanner::do_break_processing() Put it in appropriate piece of this spanner */ Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)find_broken_piece (elt->line_l()); + = dynamic_cast<Axis_group_spanner*> (find_broken_piece (elt->line_l())); my_broken_l->add_element (elt); } } diff --git a/lily/bar-column-engraver.cc b/lily/bar-column-engraver.cc index 0832448a2a..230a0f3ea2 100644 --- a/lily/bar-column-engraver.cc +++ b/lily/bar-column-engraver.cc @@ -12,6 +12,7 @@ #include "request.hh" #include "script.hh" #include "bar.hh" +#include <typeinfo> Bar_column_engraver::Bar_column_engraver() { @@ -55,22 +56,24 @@ Bar_column_engraver::acknowledge_element (Score_element_info info) Item * it = dynamic_cast <Item *> (info.elem_l_); if (!it) return; - - if (it->is_type_b (Script::static_name()) + Script *s = dynamic_cast<Script*> (it); + Bar *b = dynamic_cast<Bar*> (it); + if (s && it->breakable_b_ && info.origin_grav_l_arr_.size() == 1 && it->break_priority_i_ == break_priority_i_) { create_column (); - barcol_p_->add_script ((Script*)it); + barcol_p_->add_script (s); } else if (info.origin_grav_l_arr_.size() == 1 && it->break_priority_i_ == break_priority_i_ - && it->breakable_b_ - && it->is_type_b (Bar::static_name())) + && it->breakable_b_ + &&b) + { create_column (); - barcol_p_->set_bar ( (Bar*)it); + barcol_p_->set_bar (b); } } diff --git a/lily/bar-column.cc b/lily/bar-column.cc index 74ce5386af..5f1a40d93f 100644 --- a/lily/bar-column.cc +++ b/lily/bar-column.cc @@ -28,7 +28,7 @@ Bar_column::do_substitute_dependency (Score_element*o,Score_element*n) Script_column::do_substitute_dependency (o,n); if (o == bar_l_) { - bar_l_ = n ? (Bar*)dynamic_cast <Item *> (n) : 0; + bar_l_ = dynamic_cast<Bar *> (n); } } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 7a2a515cdc..456a13cf40 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -23,16 +23,18 @@ Bar_engraver::Bar_engraver() bool Bar_engraver::do_try_request (Request*r_l) { - Command_req* c_l = dynamic_cast <Command_req *> (r_l); - if (!c_l|| !dynamic_cast <Bar_req *> (c_l)) - return false; - Bar_req * b= dynamic_cast <Bar_req *> (c_l); - if (bar_req_l_ && bar_req_l_->equal_b (b)) - return false; + if (Bar_req * b= dynamic_cast <Bar_req *> (r_l)) + { + if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh? + return false; + + bar_req_l_ = b; + + return true; + } - bar_req_l_ = b; + return false; - return true; } void diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 380cb65145..455690e516 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -25,10 +25,8 @@ Bar_number_engraver::Bar_number_engraver() void Bar_number_engraver::acknowledge_element (Score_element_info i) { - - Item *it=dynamic_cast <Item *> (i.elem_l_); - if (script_p_ - || !it || !it->is_type_b (Bar::static_name())) + Bar *b =dynamic_cast <Bar *> (i.elem_l_); + if (script_p_ || !b) return; /* Only put numbers on bars that are at our own level (don't put @@ -58,7 +56,7 @@ Bar_number_engraver::acknowledge_element (Score_element_info i) script_p_->break_priority_i_ = int (pri); } else - script_p_->break_priority_i_ = it->break_priority_i_; + script_p_->break_priority_i_ = b->break_priority_i_; Scalar padding = get_property ("barScriptPadding"); if (padding.length_i() && padding.isnum_b ()) diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 4ef398b499..b8eb55903b 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -25,11 +25,7 @@ Beam_engraver::Beam_engraver() bool Beam_engraver::do_try_request(Request*r) { - Musical_req* mus_l = dynamic_cast <Musical_req *> (r); - if (!mus_l) - return false; - - Beam_req* b = dynamic_cast <Beam_req *> (mus_l); + Beam_req* b = dynamic_cast <Beam_req *> (r); if (!b) return false; @@ -37,7 +33,7 @@ Beam_engraver::do_try_request(Request*r) return false; Direction d = (!beam_p_) ? LEFT : RIGHT; - if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l)) + if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (b)) return false; span_reqs_drul_[d] = b; @@ -97,10 +93,10 @@ Beam_engraver::do_removal_processing() void Beam_engraver::acknowledge_element (Score_element_info i) { - if (!beam_p_ || !i.elem_l_->is_type_b (Stem::static_name ())) + Stem* s = dynamic_cast<Stem *> (i.elem_l_); + if (!beam_p_ || !s) return; - Stem* s = (Stem*)dynamic_cast <Item *> (i.elem_l_); if (!dynamic_cast <Rhythmic_req *> (i.req_l_)) { ::warning ( _("Stem must have Rhythmic structure.")); diff --git a/lily/beam.cc b/lily/beam.cc index a9dd24bda3..4982dd3937 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -125,8 +125,9 @@ Beam::do_post_processing () void Beam::do_substitute_dependent (Score_element*o,Score_element*n) { - if (o->is_type_b (Stem::static_name ())) - stems_.substitute ((Stem*)dynamic_cast <Item *> (o), n? (Stem*) dynamic_cast <Item *> (n):0); + if (Stem * os = dynamic_cast<Stem*> (o)) + stems_.substitute (os, + dynamic_cast<Stem *> (n)); } Interval diff --git a/lily/chord-iterator.cc b/lily/chord-iterator.cc index 34c91c586c..8b691619ee 100644 --- a/lily/chord-iterator.cc +++ b/lily/chord-iterator.cc @@ -24,7 +24,7 @@ Simultaneous_music_iterator::construct_children() if (mi->ok()) { if (simultaneous_music_l ()->translator_type_str_.empty_b ()) - set_translator (mi->report_to_l()->ancestor_l (simultaneous_music_l ()->multi_level_i_)); + set_translator (mi->report_to_l()->ancestor_l (0)); children_p_list_.bottom().add (mi); } else diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 462a9c1402..83e6eff1e6 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -14,8 +14,6 @@ #include "debug.hh" #include "command-request.hh" #include "time-description.hh" - - #include "note-head.hh" #include "key-item.hh" #include "local-key-item.hh" @@ -148,7 +146,7 @@ Clef_engraver::read_req (Clef_change_req*c_l) void Clef_engraver::acknowledge_element (Score_element_info info) { - if (info.elem_l_->is_type_b (Bar::static_name ()) + if (dynamic_cast<Bar*>(info.elem_l_) && clef_type_str_.length_i()) { create_clef(); @@ -158,24 +156,21 @@ Clef_engraver::acknowledge_element (Score_element_info info) /* ugh; should make Clef_referenced baseclass */ Item * it_l =dynamic_cast <Item *> (info.elem_l_); -if (it_l) - { - if (it_l->is_type_b (Note_head::static_name ())) + if (it_l) { - Note_head * h = (Note_head*)it_l; - h->position_i_ += c0_position_i_; - } - else if (it_l->is_type_b (Local_key_item::static_name ())) - { - Local_key_item *i = (Local_key_item*)it_l; - i->c0_position_i_ =c0_position_i_; - } - else if (it_l->is_type_b (Key_item::static_name ())) - { - Key_item *k = (Key_item*)it_l; - k-> set_c_position (c0_position_i_); - } - } + if (Note_head * h = dynamic_cast<Note_head*>(it_l)) + { + h->position_i_ += c0_position_i_; + } + else if (Local_key_item *i = dynamic_cast<Local_key_item*> (it_l)) + { + i->c0_position_i_ =c0_position_i_; + } + else if (Key_item *k = dynamic_cast<Key_item*>(it_l)) + { + k-> set_c_position (c0_position_i_); + } + } } void @@ -195,13 +190,15 @@ Clef_engraver::do_creation_processing() bool Clef_engraver::do_try_request (Request * r_l) { - Command_req* creq_l= dynamic_cast <Command_req *> (r_l); - if (!creq_l || !dynamic_cast <Clef_change_req *> (creq_l)) + if (Clef_change_req *cl = dynamic_cast <Clef_change_req *> (r_l)) + { + clef_req_l_ = cl; + read_req (clef_req_l_); + return true; + } + else return false; - clef_req_l_ = dynamic_cast <Clef_change_req *> (creq_l); - read_req (clef_req_l_); - return true; } void diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index d7c6a102ab..a0d5dc1006 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -28,9 +28,8 @@ Collision_engraver::process_acknowledged () void Collision_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->is_type_b (Note_column::static_name ())) + if (Note_column * c = dynamic_cast<Note_column *> (i.elem_l_)) { - Note_column * c = (Note_column*) dynamic_cast <Item *> (i.elem_l_); if (c->rest_b ()) return ; diff --git a/lily/collision.cc b/lily/collision.cc index 3a07ce18e1..a9971951b9 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -18,6 +18,7 @@ Collision::Collision() void Collision::add_column (Note_column* ncol_l) { + // ugh. Fixme. clash_l_arr_.push (ncol_l); add_element (ncol_l); add_dependency (ncol_l); @@ -165,6 +166,10 @@ IMPLEMENT_IS_TYPE_B1(Collision, Item); void Collision::do_substitute_dependency (Score_element*o_l,Score_element*n_l) { - clash_l_arr_.substitute ((Note_column*)dynamic_cast <Item *> (o_l), - (Note_column*)(n_l?dynamic_cast <Item *> (n_l):0)); + if (o_l) + { + clash_l_arr_.substitute (dynamic_cast<Note_column *> (o_l), + dynamic_cast <Note_column *> (n_l)); + + } } diff --git a/lily/command-request.cc b/lily/command-request.cc index e407f30661..5a67560e45 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -33,8 +33,7 @@ bool Cadenza_req::do_equal_b (Request*r) const { Cadenza_req*cad = dynamic_cast <Cadenza_req *> (r); - - return cad->on_b_ == on_b_; + return cad && cad->on_b_ == on_b_; } Cadenza_req::Cadenza_req (bool b) @@ -48,7 +47,7 @@ bool Bar_req::do_equal_b (Request*r) const { Bar_req * b = dynamic_cast <Bar_req *> (r); - return type_str_ == b->type_str_; + return b && type_str_ == b->type_str_; } @@ -83,7 +82,7 @@ Partial_measure_req::do_equal_b (Request* r) const { Partial_measure_req *p = dynamic_cast <Partial_measure_req *> (r); - return p->duration_ == duration_; + return p&& p->duration_ == duration_; } @@ -104,9 +103,10 @@ void Barcheck_req::do_print() const{} bool -Barcheck_req::do_equal_b (Request*) const +Barcheck_req::do_equal_b (Request*r) const { - return true; + Barcheck_req *b = dynamic_cast<Barcheck_req*> (r); + return r; } @@ -152,7 +152,7 @@ Time_signature_change_req::do_equal_b (Request * r) const { Time_signature_change_req * m = dynamic_cast <Time_signature_change_req *> (r); - return m->beats_i_ == beats_i_ + return m && m->beats_i_ == beats_i_ && one_beat_i_ == m->one_beat_i_; } @@ -181,7 +181,7 @@ Tempo_req::do_equal_b (Request *r) const { Tempo_req *t = dynamic_cast <Tempo_req *> (r); - return t->dur_.length()== dur_.length () && metronome_i_ == t->metronome_i_; + return t&& t->dur_.length()== dur_.length () && metronome_i_ == t->metronome_i_; } diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index ae6259ac4c..771963e348 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -30,13 +30,10 @@ Dot_column_engraver::do_pre_move_processing () void Dot_column_engraver::acknowledge_element (Score_element_info info) { - Item * i=dynamic_cast <Item *> (info.elem_l_); - - if (! (i && i->is_type_b (Rhythmic_head::static_name ()))) + Rhythmic_head * h = dynamic_cast<Rhythmic_head*>(info.elem_l_); + if (!h) return; - Rhythmic_head * h = (Rhythmic_head*)i; - if (!h->dots_l_) return; diff --git a/lily/dot-column.cc b/lily/dot-column.cc index cee8a3edec..284b746cc9 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -33,12 +33,13 @@ void Dot_column::do_substitute_dependency (Score_element*o,Score_element*n) { Item *oi =dynamic_cast <Item *> (o); - Item *ni = n?dynamic_cast <Item *> (n):0; - if (oi&&oi->is_type_b (Rhythmic_head::static_name ())) - head_l_arr_.substitute ((Rhythmic_head*)oi, (Rhythmic_head*)ni); - else if (oi && oi->is_type_b (Dots::static_name ())) - dot_l_arr_.substitute ((Dots*) oi, (Dots*) ni); + if (oi && dynamic_cast<Rhythmic_head *> (oi)) + head_l_arr_.substitute (dynamic_cast<Rhythmic_head*> (oi), + dynamic_cast<Rhythmic_head*>(n)); + else if (oi && dynamic_cast<Dots *> (oi)) + dot_l_arr_.substitute (dynamic_cast<Dots*> (oi), + dynamic_cast<Dots*> (n)); } void diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 2b38c4c08e..e0f2680748 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -34,24 +34,16 @@ Dynamic_engraver::do_post_move_processing() bool Dynamic_engraver::do_try_request (Request * r) { - Musical_req * m = dynamic_cast <Musical_req *> (r); - if (!m) - return false; - Dynamic_req * d = dynamic_cast <Dynamic_req *> (m); - if (!d) - return false; - -#if 0 - if (cresc_p_ && dynamic_cast <Span_dynamic_req *> (d) - && dynamic_cast <Span_dynamic_req *> (d)->spantype == Span_req::START) - return false; -#endif - for (int i=0; i < dynamic_req_l_arr_.size (); i++) - if (d->equal_b (dynamic_req_l_arr_[i])) + if(Dynamic_req * d = dynamic_cast <Dynamic_req *> (r)) + { + for (int i=0; i < dynamic_req_l_arr_.size (); i++) + if (d->equal_b (dynamic_req_l_arr_[i])) + return true; + + dynamic_req_l_arr_.push (d); return true; - - dynamic_req_l_arr_.push (dynamic_cast <Dynamic_req *> (m)); - return true; + } + return false; } void Dynamic_engraver::do_process_requests() @@ -60,7 +52,7 @@ Dynamic_engraver::do_process_requests() for (int i=0; i < dynamic_req_l_arr_.size(); i++) { Dynamic_req *dreq_l = dynamic_req_l_arr_[i]; - if (dynamic_cast <Absolute_dynamic_req *> (dreq_l)) + if (Absolute_dynamic_req *absd = dynamic_cast<Absolute_dynamic_req *> (dreq_l)) { if (dynamic_p_) @@ -71,8 +63,8 @@ Dynamic_engraver::do_process_requests() Text_def * td_p = new Text_def; td_p->align_dir_ = CENTER; - String loud = dynamic_cast <Absolute_dynamic_req *> (dreq_l)->loudness_str (); - td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; + String loud = absd->loudness_str (); + td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; // ugh td_p->style_str_ = "dynamic"; @@ -80,9 +72,8 @@ Dynamic_engraver::do_process_requests() dynamic_p_ = new Text_item (td_p); announce_element (Score_element_info (dynamic_p_, dreq_l)); } - else if (dynamic_cast <Span_dynamic_req *> (dreq_l)) + else if (Span_dynamic_req *span_l = dynamic_cast <Span_dynamic_req *> (dreq_l)) { - Span_dynamic_req* span_l = dynamic_cast <Span_dynamic_req *> (dreq_l); if (span_l->spantype == Span_req::STOP) { if (!cresc_p_) @@ -188,7 +179,7 @@ Dynamic_engraver::do_removal_processing () void Dynamic_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->is_type_b (Note_column::static_name ())) + if (dynamic_cast<Note_column *> (i.elem_l_)) { if (dynamic_p_) dynamic_p_->add_support (i.elem_l_); diff --git a/lily/engraver.cc b/lily/engraver.cc index 8a79b60346..8fccb6a84d 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -57,6 +57,6 @@ Engraver_group_engraver* Engraver::daddy_grav_l () const { return (daddy_trans_l_ ) - ? (Engraver_group_engraver*) dynamic_cast <Engraver *> (daddy_trans_l_) + ? dynamic_cast<Engraver_group_engraver *> (daddy_trans_l_) : 0; } diff --git a/lily/hara-kiri-line-group-engraver.cc b/lily/hara-kiri-line-group-engraver.cc index d85437a921..16619f83c8 100644 --- a/lily/hara-kiri-line-group-engraver.cc +++ b/lily/hara-kiri-line-group-engraver.cc @@ -24,10 +24,11 @@ Hara_kiri_line_group_engraver::create_line_spanner () void Hara_kiri_line_group_engraver::typeset_element(Score_element * e) { - if (e->is_type_b (Note_head::static_name ())) - ((Hara_kiri_vertical_group_spanner*)staffline_p_)->add_note - ((Note_head*)dynamic_cast <Item *> (e)); - + if (Note_head *h = dynamic_cast<Note_head *> (e)) + { + dynamic_cast<Hara_kiri_vertical_group_spanner*> (staffline_p_) + ->add_note (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 38468cf91c..9a31e52bca 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -43,9 +43,9 @@ Hara_kiri_vertical_group_spanner::do_post_processing () void Hara_kiri_vertical_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n) { - if (o->is_type_b (Note_head::static_name ())) - head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o), - (n)? (Note_head*)dynamic_cast <Item *> (n) : 0); + if (dynamic_cast<Note_head *> (o)) + head_l_arr_.substitute (dynamic_cast<Note_head *> (o), + (n)? dynamic_cast<Note_head *> (n) : 0); } diff --git a/lily/head-engraver.cc b/lily/head-engraver.cc index ce4e5dcdf3..4b0a3b06fd 100644 --- a/lily/head-engraver.cc +++ b/lily/head-engraver.cc @@ -23,11 +23,12 @@ Note_head_engraver::do_try_request (Request *req_l) if (note_req_l_) return false; - if (!(dynamic_cast <Note_req *> (req_l))) - return false; - - note_req_l_=dynamic_cast <Rhythmic_req *> (req_l); - return true; + if (Note_req * nr = dynamic_cast <Note_req *> (req_l)) + { + note_req_l_= nr; + return true; + } + return false; } void diff --git a/lily/heads-engraver.cc b/lily/heads-engraver.cc index a8e0aaa46b..1fc2627102 100644 --- a/lily/heads-engraver.cc +++ b/lily/heads-engraver.cc @@ -18,15 +18,12 @@ Note_heads_engraver::Note_heads_engraver() bool Note_heads_engraver::do_try_request (Request *req_l) { - if (!dynamic_cast <Musical_req *> (req_l)) - return false; - - Note_req * n =dynamic_cast <Note_req *> (req_l); - if (!n) - return false; - - note_req_l_arr_.push (n); - return true; + if (Note_req * n =dynamic_cast <Note_req *> (req_l)) + { + note_req_l_arr_.push (n); + return true; + } + return false; } void @@ -49,7 +46,7 @@ Note_heads_engraver::do_process_requests() dot_p_arr_.push (d); } - note_p->position_i_ = dynamic_cast <Note_req *> (note_req_l)->pitch_.steps (); + note_p->position_i_ = note_req_l->pitch_.steps (); Score_element_info itinf (note_p,note_req_l); diff --git a/lily/identifier.cc b/lily/identifier.cc index bdd40f69a4..d09749daed 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -77,7 +77,7 @@ Identifier::do_print () const #define DEFAULT_PRINT(Class) \ void \ Class ## _identifier::do_print () const { \ - Class *cl = ((Class ## _identifier *)this)->access_ ## Class(false);\ + Class *cl = ((Class ## _identifier *)this)->access_content_ ## Class(false);\ cl->print (); \ } @@ -143,14 +143,14 @@ DEFAULT_STR(String); #define DEFAULT_ACCESSOR(Class)\ Class*\ -Class ## _identifier::access_ ## Class (bool copy_b) const {\ +Class ## _identifier::access_content_ ## Class (bool copy_b) const {\ ((Class ## _identifier*)this)->accessed_b_ = true;\ return copy_b ? new Class (*data_p_) : data_p_;\ } #define VIRTUAL_ACCESSOR(Class)\ Class*\ -Class ## _identifier::access_ ## Class (bool copy_b) const{\ +Class ## _identifier::access_content_ ## Class (bool copy_b) const{\ ((Class ## _identifier*)this)->accessed_b_ = true;\ return copy_b ? (Class*)data_p_->clone() : data_p_;\ } @@ -166,7 +166,7 @@ Class ## _identifier::access_ ## Class (bool copy_b) const{\ Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \ : Identifier (s)\ {\ - data_p_ = s.access_ ## Class (true);\ + data_p_ = s.access_content_ ## Class (true);\ } diff --git a/lily/include/atom.hh b/lily/include/atom.hh index f9621382bc..1fd7ef262c 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -9,7 +9,7 @@ #ifndef ATOM_HH #define ATOM_HH -#include "lily-guile.hh" +#include "protected-scm.hh" #include "string.hh" #include "box.hh" #include "lily-proto.hh" @@ -17,11 +17,15 @@ /// a symbol which can be translated, and freely copied class Atom { Offset off_; + + public: + Protected_scm lambda_; + Score_element * origin_l_; + // urg, only used as a temp buffer String str_; String font_; - SCM lambda_; Box dim_; Offset offset () const; diff --git a/lily/include/axis-group-element.hh b/lily/include/axis-group-element.hh index f1389deebd..f753b9015f 100644 --- a/lily/include/axis-group-element.hh +++ b/lily/include/axis-group-element.hh @@ -24,7 +24,6 @@ protected: virtual Link_array<Score_element> get_extra_dependencies() const; virtual void do_unlink(); virtual void do_junk_links(); - virtual Axis_group_element * access_Axis_group_element (); public: virtual Link_array<Score_element> elem_l_arr() const; diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index a0afdc8f5e..96c010322b 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -21,18 +21,6 @@ class Command_req : public virtual Request { public: REQUESTMETHODS(Command_req); - DEFAULTACCESSOR(Measure_grouping_req) - DEFAULTACCESSOR(Clef_change_req) - DEFAULTACCESSOR(Key_change_req) - DEFAULTACCESSOR(Partial_measure_req) - DEFAULTACCESSOR(Time_signature_change_req) - DEFAULTACCESSOR(Bar_req) - DEFAULTACCESSOR(Cadenza_req) - DEFAULTACCESSOR(Timing_req) - DEFAULTACCESSOR(Command_script_req) - DEFAULTACCESSOR(Break_req) - DEFAULTACCESSOR(Mark_req) - DEFAULTACCESSOR(Bracket_req) }; @@ -64,7 +52,6 @@ public: class Timing_req : public Command_req { public: REQUESTMETHODS(Timing_req); - DEFAULTACCESSOR(Tempo_req) }; diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 9dc6594c8e..1b73406b84 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -71,7 +71,6 @@ public: Engraver () {} DECLARE_MY_RUNTIME_TYPEINFO; - virtual Engraver * access_Engraver () { return this; } }; diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh index 3a57588a7d..d6bd8babe6 100644 --- a/lily/include/graphical-element.hh +++ b/lily/include/graphical-element.hh @@ -32,8 +32,6 @@ class Graphical_element bool cached_valid_b_a_[NO_AXES]; public: - // suck me plenty - virtual Score_element* access_Score_element () { return 0; } void set_empty (bool); bool empty_b () const; diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index cb36305966..66644eeef3 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -32,8 +32,8 @@ class Duration_identifier; #define IDACCESSOR(Class)\ -virtual Class * access_ ## Class (bool=true) const { error (#Class + String ("_identifier")); return 0; }\ -virtual Class ## _identifier * access_ ## Class ## _identifier () { return 0; } +virtual Class * access_content_ ## Class (bool) const { error (#Class + String ("_identifier")); return 0; }\ + /** A declarable data structure in mudela. @@ -78,11 +78,7 @@ struct Class ## _identifier : Identifier {\ Class ## _identifier (Class ## _identifier const&);\ Class ## _identifier (Class*st, int code);\ VIRTUAL_COPY_CONS (Class ## _identifier, Identifier);\ - virtual Class ## _identifier * access_ ## Class ## _identifier ()\ - {\ - return this;\ - }\ - virtual Class* access_ ## Class (bool copy_b) const;\ + virtual Class* access_content_ ## Class (bool copy_b) const;\ ~Class ## _identifier();\ virtual void do_print () const; \ virtual String do_str () const; \ diff --git a/lily/include/item.hh b/lily/include/item.hh index bd38edcc0f..ec0e1ae098 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -40,7 +40,6 @@ public: Item * find_prebroken_piece (Direction) const; Item * find_prebroken_piece (Line_of_score*) const; - virtual Item *access_Item() ; Item(); Real hpos_f() const; DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 56ce820c7e..c4479cb567 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -40,4 +40,7 @@ SCM ly_quote (); SCM lambda_scm (String str, Array<Real> args_arr); SCM lambda_scm (String str, Array<Scalar> args_arr); + + + #endif // LILY_GUILE_HH diff --git a/lily/include/lyric-performer.hh b/lily/include/lyric-performer.hh index 29a5f92390..df77b0f028 100644 --- a/lily/include/lyric-performer.hh +++ b/lily/include/lyric-performer.hh @@ -17,17 +17,15 @@ class Lyric_performer : public Performer { public: TRANSLATOR_CLONE(Lyric_performer); - DECLARE_MY_RUNTIME_TYPEINFO; - Lyric_performer(); - ~Lyric_performer(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: - void do_print() const; - virtual bool do_try_request (Request* req_l); - virtual void do_process_requests(); + void do_print() const; + virtual bool do_try_request (Request* req_l); + virtual void do_process_requests(); private: - Array<Lyric_req*> lreq_arr_; + Array<Lyric_req*> lreq_arr_; }; #endif // LYRIC_PERFOMER_HH diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 6cdda3dc5b..477ab2465f 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -30,7 +30,6 @@ public: class Music_sequence : public Music { public: - int multi_level_i_; Music_list * music_p_list_p_; Music_sequence (Music_sequence const&); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 2f3c3f599c..d280d158ac 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -22,26 +22,7 @@ class Musical_req : public virtual Request { public: - DEFAULTACCESSOR(Lyric_req) - DEFAULTACCESSOR(Note_req ) - DEFAULTACCESSOR(Stem_req ) - DEFAULTACCESSOR(Melodic_req ) - DEFAULTACCESSOR(Slur_req ) - DEFAULTACCESSOR(Beam_req ) - DEFAULTACCESSOR(Abbreviation_beam_req) - DEFAULTACCESSOR(Rhythmic_req) - DEFAULTACCESSOR(Musical_script_req) - DEFAULTACCESSOR(Text_req) - DEFAULTACCESSOR(Rest_req ) - DEFAULTACCESSOR(Skip_req) - DEFAULTACCESSOR(Dynamic_req) - DEFAULTACCESSOR(Absolute_dynamic_req ) - DEFAULTACCESSOR(Tie_req) - DEFAULTACCESSOR(Musical_span_req) - DEFAULTACCESSOR(Plet_req) - DEFAULTACCESSOR(Span_dynamic_req ) - DEFAULTACCESSOR(Abbreviation_req) - DEFAULTACCESSOR(Multi_measure_rest_req) + REQUESTMETHODS(Musical_req); }; @@ -131,7 +112,6 @@ public: bool forceacc_b_; Note_req(); bool do_equal_b (Request*) const; - Rhythmic_req* access_Rhythmic_req () { return Rhythmic_req::access_Rhythmic_req (); } REQUESTMETHODS(Note_req); }; diff --git a/lily/include/performer.hh b/lily/include/performer.hh index 61fd1d2aba..75fbeccf7e 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -27,7 +27,6 @@ public: protected: virtual int get_tempo_i() const; virtual void play (Audio_element * elem_p ); - Performer * access_Performer () { return this; } }; diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh new file mode 100644 index 0000000000..e83593a537 --- /dev/null +++ b/lily/include/protected-scm.hh @@ -0,0 +1,30 @@ +/* + protected-scm.hh -- declare Protected_scm + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ + +#ifndef PROTECTED_SCM_HH +#define PROTECTED_SCM_HH + +#include "lily-guile.hh" + +/* + Mix GUILE GC with C++ ctors and dtors. + */ +class Protected_scm +{ + SCM object_; +public: + Protected_scm (); + Protected_scm (SCM); + Protected_scm (Protected_scm const &); + ~Protected_scm (); + Protected_scm &operator = (Protected_scm const &); + operator SCM (); +}; + +#endif /* PROTECTED_SCM_HH */ diff --git a/lily/include/request.hh b/lily/include/request.hh index 7d976a648e..4394fce306 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -17,8 +17,6 @@ #include "music.hh" #include "direction.hh" -#define DEFAULTACCESSOR(T) virtual T *access_ ## T () { return 0; } - /** An atom of musical information. This is an abstract class for any piece of music that does not contain other Music. @@ -35,17 +33,6 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Request,Music); - /* accessors for children - maybe checkout RTTI - */ - - DEFAULTACCESSOR(Barcheck_req) - DEFAULTACCESSOR(Script_req) - DEFAULTACCESSOR(Span_req) - DEFAULTACCESSOR(Spacing_req) - DEFAULTACCESSOR(Musical_req) - DEFAULTACCESSOR(Command_req) - bool equal_b (Request*) const; protected: virtual bool do_equal_b (Request*) const; @@ -54,7 +41,6 @@ protected: #define REQUESTMETHODS(T) \ -virtual T * access_ ## T() { return this;}\ DECLARE_MY_RUNTIME_TYPEINFO;\ VIRTUAL_COPY_CONS(T, Request);\ virtual void do_print() const diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index e9ea8aff99..4ad95c7371 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -52,16 +52,6 @@ public: */ void add_dependency (Score_element*); - /* - virtual accessors - */ - - virtual Spanner* access_Spanner () { return 0; } - virtual Span_bar* access_Span_bar () { return 0; } - virtual Axis_group_element * access_Axis_group_element () { return 0; } - virtual Score_element* access_Score_element () { return this; } - - virtual Item * access_Item () { return 0; } virtual Line_of_score * line_l () const; virtual bool linked_b () const; SCORE_ELEMENT_CLONE (Score_element); diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index 1aec571514..825d1d8cbe 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -20,7 +20,6 @@ public: Span_bar(); DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEMENT_CLONE(Span_bar); - virtual Span_bar* access_Span_bar (); void add_bar (Bar*); void set_align (Align_element *); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 1cad1d8ebb..255b21eaa8 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -38,7 +38,6 @@ public: void set_bounds (Direction d, Item*); DECLARE_MY_RUNTIME_TYPEINFO; - virtual Spanner* access_Spanner (); Spanner (); Spanner (Spanner const &); bool broken_b () const; diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index defcd15bc3..33390810ce 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -45,12 +45,11 @@ class Spring_spacer : public Line_spacer { friend class Durations_iter; - - + Pointer_list<Idealspacing *> ideal_p_list_; Array<Column_info> cols_; Array<Column_info> loose_col_arr_; - Array<Spacer_rod> rods_; + /// mark column #i# as being loose. void loosen_column (int i); diff --git a/lily/include/timing-engraver.hh b/lily/include/timing-engraver.hh index 18aa404ab5..cc52fa13c0 100644 --- a/lily/include/timing-engraver.hh +++ b/lily/include/timing-engraver.hh @@ -19,7 +19,6 @@ class Timing_engraver : public Timing_translator, public Engraver { protected: virtual void fill_staff_info (Staff_info&); - virtual Engraver * access_Engraver () { return Engraver::access_Engraver (); } public: TRANSLATOR_CLONE(Timing_engraver); DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 1b1f05f004..fb1c8e2d23 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -33,8 +33,6 @@ public: String id_str_; - - int iterator_count_; TRANSLATOR_CLONE(Translator_group); @@ -72,7 +70,6 @@ public: Translator_group*get_default_interpreter(); protected: virtual ~Translator_group (); - virtual Translator_group * access_Translator_group () { return this; } virtual void do_print () const; virtual void do_process_requests (); virtual void do_add_processing (); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 57d45e4d98..b0257a4448 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -66,9 +66,6 @@ public: Music_output_def *output_def_l () const; virtual Moment now_moment () const; - virtual Engraver *access_Engraver () { return 0; } - virtual Performer *access_Performer() { return 0; } - virtual Translator_group * access_Translator_group () { return 0; } protected: enum { diff --git a/lily/include/type-swallow-trans.hh b/lily/include/type-swallow-trans.hh index 53eb7ea04a..27bac3d661 100644 --- a/lily/include/type-swallow-trans.hh +++ b/lily/include/type-swallow-trans.hh @@ -11,11 +11,12 @@ #define TYPESWALLOW_GRAV_HH #include "translator.hh" + /// eat a certain type of request class Type_swallow_translator : public virtual Translator { protected: - const char * type_; + const type_info * type_; bool do_try_request (Request*); public: DECLARE_MY_RUNTIME_TYPEINFO; @@ -26,7 +27,7 @@ public: #define DECLARE_REQUEST_SWALLOWER(TYPE) \ struct TYPE ## _swallow_translator : public Type_swallow_translator {\ TYPE ## _swallow_translator() { \ - type_ = TYPE::static_name ();\ + type_ = &typeid (TYPE);\ }\ DECLARE_MY_RUNTIME_TYPEINFO;\ TRANSLATOR_CLONE(TYPE ## _swallow_translator);\ diff --git a/lily/item.cc b/lily/item.cc index e48d576cfd..ad00cb3685 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -129,10 +129,10 @@ Item::handle_prebroken_dependencies() int Item::left_right_compare(Item const *l, Item const *r) { - while (!l->is_type_b (Paper_column::static_name ())) - l = dynamic_cast<Item*> (l->axis_group_l_a_[X_AXIS]); - while (!r->is_type_b (Paper_column::static_name ())) - r = dynamic_cast<Item*> (r->axis_group_l_a_[X_AXIS]); + while (!(dynamic_cast<Paper_column const *> (l))) + l = dynamic_cast<Item const*> (l->axis_group_l_a_[X_AXIS]); + while (!(dynamic_cast<Paper_column const *> (r))) + r = dynamic_cast<Item const*> (r->axis_group_l_a_[X_AXIS]); Paper_column *p1 = (Paper_column*)l; Paper_column* p2 = (Paper_column*)r; @@ -190,8 +190,3 @@ Item::Item (Item const &s) break_priority_i_ = s.break_priority_i_; } -Item * -Item::access_Item () -{ - return this; -} diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index bb66802d86..77a29425f5 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -36,29 +36,27 @@ Key_engraver::create_key () bool Key_engraver::do_try_request (Request * req_l) { - Command_req* creq_l= dynamic_cast <Command_req *> (req_l); - if (!creq_l|| !dynamic_cast <Key_change_req *> (creq_l)) - return false; - - if (keyreq_l_) - return false; // TODO - keyreq_l_ = dynamic_cast <Key_change_req *> (creq_l); - read_req (keyreq_l_); - return true; + if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l)) + { + if (keyreq_l_) + warning ("Fixme: key change merge."); + keyreq_l_ = kc; + read_req (keyreq_l_); + return true; + } + return false; } void Key_engraver::acknowledge_element (Score_element_info info) { - Command_req * r_l = dynamic_cast <Command_req *> (info.req_l_) ; - - if (r_l && dynamic_cast <Clef_change_req *> (r_l)) + if (dynamic_cast <Clef_change_req *> (info.req_l_)) { int i= get_property ("createKeyOnClefChange").length_i (); if (i) create_key (); } - else if (info.elem_l_->is_type_b (Bar::static_name ()) + else if (dynamic_cast<Bar *> (info.elem_l_) && accidental_idx_arr_.size ()) { if (!keyreq_l_) diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 3ccac03e21..b163e4022f 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -29,7 +29,7 @@ Key_performer::do_print() const { #ifndef NPRINT if (key_req_l_) - key_req_l_->print(); + key_req_l_->print(); #endif } @@ -37,19 +37,19 @@ void Key_performer::do_process_requests() { if (key_req_l_) - play (new Audio_key (key_req_l_)); + play (new Audio_key (key_req_l_)); key_req_l_ = 0; } bool Key_performer::do_try_request (Request* req_l) { - if (key_req_l_) - return false; - - if (dynamic_cast <Key_change_req *> (req_l)) + if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l)) { - key_req_l_ = dynamic_cast <Key_change_req*> (req_l); + if (key_req_l_) + warning ("FIXME. Key change merge"); + + key_req_l_ = kc; return true; } diff --git a/lily/lexer.ll b/lily/lexer.ll index 43fffba484..b61c4c1975 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -89,7 +89,6 @@ HORIZONTALWHITE [ \t] BLACK [^ \n\t\f\r] RESTNAME [rs] NOTECOMMAND \\{A}+ -ANDREWLYRICS ([^ \n\t\f\\{}<>0-9";.|]|\\[^a-zA-Z\]\[<>])[^0-9 \t\n\f] LYRICS ({AA}|{TEX})[^0-9 \t\n\f]* ESCAPED [nt\\'"] PLET \\\[ @@ -159,10 +158,10 @@ TELP \\\] Identifier * id = lookup_identifier (s); if (id) { - String* s_p = id->access_String (); - DOUT << "#include `" << *s_p << "\'\n"; - new_input (*s_p, source_global_l); - delete s_p; + String* s_l = id->access_content_String (false); + DOUT << "#include `" << *s_l << "\'\n"; + new_input (*s_l, source_global_l); + yy_pop_state (); } else diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index daa7588554..375ff46359 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -97,3 +97,4 @@ lambda_scm (String str, Array<Real> args_arr) return scm; } + diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 54df397c45..9b0658b647 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -40,7 +40,7 @@ Local_key_engraver::do_creation_processing () } else { - key_C_ = &((Key_engraver*)dynamic_cast <Engraver *> (result))->key_; + key_C_ = &(dynamic_cast<Key_engraver *> (result))->key_; local_key_ = *key_C_; } } @@ -96,23 +96,20 @@ Local_key_engraver::do_pre_move_processing() void Local_key_engraver::acknowledge_element (Score_element_info info) { - Score_element * elem_l = info.elem_l_; - Item * item_l = dynamic_cast <Item *> (elem_l); - Note_req * note_l = dynamic_cast <Note_req *> (info.req_l_); - - if (note_l && item_l && item_l->is_type_b (Note_head::static_name ())) + Note_head * note_head = dynamic_cast<Note_head *> (info.elem_l_); + + if (note_l && note_head) { mel_l_arr_.push (note_l); - support_l_arr_.push (item_l); + support_l_arr_.push (note_head); } else if (dynamic_cast <Key_change_req*> (info.req_l_)) { local_key_ = *key_C_; } - else if (elem_l->is_type_b (Tie::static_name ())) + else if (Tie * tie_l = dynamic_cast<Tie *> (info.elem_l_)) { - Tie * tie_l = (Tie*)dynamic_cast <Spanner *> (elem_l); if (tie_l->same_pitch_b_) tied_l_arr_.push (tie_l-> head_l_drul_[RIGHT]); } diff --git a/lily/lookup.cc b/lily/lookup.cc index a8a4af3dd5..c763bb56e1 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -86,7 +86,7 @@ Lookup::afm_find (String s) const a.dim_[Y_AXIS] *= 1 / 1000.0; Array<Real> arr; arr.push (m.code ()); - a.lambda_ = lambda_scm ("char", arr); + a.lambda_ = (lambda_scm ("char", arr)); a.font_ = font_; return a; } @@ -106,7 +106,7 @@ Lookup::bar (String str, Real h) const Array<Real> arr; arr.push (h); Atom a = (*symtables_p_) ("bars")->lookup (str); - a.lambda_ = lambda_scm (a.str_, arr); + a.lambda_ = (lambda_scm (a.str_, arr)); a.dim_.y () = Interval (-h/2, h/2); a.font_ = font_; return a; @@ -125,7 +125,7 @@ Lookup::beam (Real slope, Real width, Real thick) const arr.push (thick); Atom a; - a.lambda_ = lambda_scm ("beam", arr); + a.lambda_ = (lambda_scm ("beam", arr)); a.dim_[X_AXIS] = Interval (0, width); a.dim_[Y_AXIS] = Interval (min_y, max_y); return a; @@ -151,7 +151,7 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const a.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy); // (lambda (o) (dashed-slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2)))) - a.lambda_ = + a.lambda_ = ( ly_append (ly_lambda_o (), ly_list1 (ly_append (ly_func_o ("dashed-slur"), gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash), @@ -160,7 +160,7 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())), gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())), gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), - SCM_EOL))))))))))); + SCM_EOL)))))))))))); return a; } @@ -216,7 +216,7 @@ Lookup::rule_symbol (Real height, Real width) const Array<Real> args; args.push (height); args.push (width); - bs.lambda_ = lambda_scm (bs.str_, args); + bs.lambda_ = (lambda_scm (bs.str_, args)); bs.dim_.x () = Interval (0, width); bs.dim_.y () = Interval (0, height); return bs; @@ -274,7 +274,7 @@ Lookup::stem (Real y1, Real y2) const a.push (y2); a.push (-y1); - s.lambda_ = lambda_scm ("stem", a); + s.lambda_ = (lambda_scm ("stem", a)); s.font_ = font_; return s; } @@ -295,7 +295,7 @@ Lookup::text (String style, String text) const a.push (text); Atom s = (*symtables_p_) ("style")->lookup (style); - s.lambda_ = lambda_scm (s.str_, a); + s.lambda_ = (lambda_scm (s.str_, a)); s.font_ = font_; return s; @@ -305,7 +305,7 @@ Atom Lookup::time_signature (Array<Real> a) const { Atom s ((*symtables_p_) ("param")->lookup ("time_signature")); - s.lambda_ = lambda_scm (s.str_, a); + s.lambda_ = (lambda_scm (s.str_, a)); return s; } @@ -340,7 +340,7 @@ Lookup::vbrace (Real &y) const Array<Real> a; a.push (idx); - brace.lambda_ = lambda_scm (brace.str_, a); + brace.lambda_ = (lambda_scm (brace.str_, a)); brace.dim_[Y_AXIS] = Interval (-y/2,y/2); brace.font_ = font_; @@ -395,7 +395,7 @@ Lookup::slur (Array<Offset> controls) const Atom a; // (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. ))) - a.lambda_ = + a.lambda_ = ( ly_append (ly_lambda_o (), ly_list1 (ly_append (ly_func_o ("slur"), ly_list1 (ly_list2 (ly_quote (), @@ -407,7 +407,7 @@ Lookup::slur (Array<Offset> controls) const gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())), gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())), gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())), - SCM_EOL))))))))))))); + SCM_EOL)))))))))))))); a.dim_[X_AXIS] = Interval (0, dx); a.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy); @@ -428,7 +428,7 @@ Lookup::vbracket (Real &y) const } Array<Real> arr; arr.push (y); - a.lambda_ = lambda_scm ("bracket", arr); + a.lambda_ = (lambda_scm ("bracket", arr)); a.dim_[Y_AXIS] = Interval (-y/2,y/2); a.dim_[X_AXIS] = Interval (0,4 PT); return a; diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index da7102b1f7..9555cad7eb 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -23,12 +23,12 @@ Lyric_engraver::Lyric_engraver() bool Lyric_engraver::do_try_request (Request*r) { - Musical_req * m =dynamic_cast <Musical_req *> (r); - if (!m || ! dynamic_cast <Lyric_req *> (m)) - return false; - lreq_l_ = dynamic_cast <Lyric_req *> (m); - - return true; + if (Lyric_req * lr = dynamic_cast <Lyric_req *> (r)) + { + lreq_l_ = lr; + return true; + } + return false; } void diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 43fe0f2634..e8c8892339 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -16,20 +16,12 @@ IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer); ADD_THIS_TRANSLATOR(Lyric_performer); -Lyric_performer::Lyric_performer() -{ -} - -Lyric_performer::~Lyric_performer() -{ -} - void Lyric_performer::do_print() const { #ifndef NPRINT if (lreq_arr_.size()) - lreq_arr_[ 0 ]->print(); + lreq_arr_[0]->print(); #endif } @@ -37,18 +29,18 @@ void Lyric_performer::do_process_requests() { if (lreq_arr_.size() && lreq_arr_[0]->text_str_.length_i()) - play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->text_str_)); + play (new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_)); lreq_arr_.clear(); } bool Lyric_performer::do_try_request (Request* req_l) { - Musical_req* m_l = dynamic_cast <Musical_req *> (req_l); - if (!m_l || ! dynamic_cast <Lyric_req *> (m_l)) - return false; - lreq_arr_.push (dynamic_cast <Lyric_req *> (m_l)); - - return true; + if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l)) + { + lreq_arr_.push (lr); + return true; + } + return false; } diff --git a/lily/main.cc b/lily/main.cc index d9a7a0afc0..9adf5a5941 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -224,15 +224,18 @@ setup_paths () if (!prefix_directory.empty_b()) { - global_path.add (prefix_directory + "/share/lilypond/init/"); - global_path.add (prefix_directory + "/share/lilypond"); + global_path.add (prefix_directory + "/share/lilypond/ly/"); + global_path.add (prefix_directory + "/share/lilypond/afm/"); + } + else + { + global_path.add (String (DIR_DATADIR) + "/ly/"); + global_path.add (String (DIR_DATADIR) + "/afm/"); } - - global_path.add (String (DIR_DATADIR) + "/ly/"); - global_path.add (String (DIR_DATADIR) + "/afm/"); } + void main_prog (int argc, char **argv) { @@ -341,6 +344,7 @@ main_prog (int argc, char **argv) default_outname_base_global = outname_str; do_one_file (i, default_outname_base_global); } + exit( exit_status_i_); } int @@ -355,12 +359,12 @@ main (int argc, char **argv) #endif } -/* - urg: make input file name: +/** + make input file name from command arg. - input: file name + @input file name - output: file name with added default extension. "" is stdin. + @output file name with added default extension. "" is stdin. in reference argument: the extension. ".ly" if none */ String @@ -375,6 +379,7 @@ distill_inname_str (String name_str, String& ext_r) split_path (str,a,b,c,ext_r); // add extension if not present. + // UGH. Should parametrise in list of default extensions. if (ext_r.empty_b ()) { ext_r = ".fly"; diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 71119e4eb6..3c25f1aeae 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -26,13 +26,12 @@ Mark_engraver::Mark_engraver () bool Mark_engraver::do_try_request (Request* r_l) { - Command_req* c_l = dynamic_cast <Command_req *> (r_l); - if (!c_l || !dynamic_cast <Mark_req *> (c_l) || mark_req_l_) - return false; - - mark_req_l_ = dynamic_cast <Mark_req *> (c_l); - - return true; + if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l)) + { + mark_req_l_ = mr; + return true; + } + return false; } void diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 362508ee64..7ae9551f7d 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -399,6 +399,7 @@ Midi_note::Midi_note (Audio_item* audio_item_l) : Midi_item (audio_item_l) { dynamic_byte_ = 0x7f; + assert (dynamic_cast<Audio_note*> (audio_item_l)); } Moment diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 81489c2ad0..90477a3009 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -48,10 +48,10 @@ Midi_walker::do_start_note (Midi_note* note_p) Moment stop_mom = note_p->duration() + ptr ()->audio_column_l_->at_mom (); for (int i=0; i < stop_note_queue.size(); i++) { - if (stop_note_queue[ i ].val->pitch_i() == note_p->pitch_i ()) + if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) { - if (stop_note_queue[ i ].key < stop_mom) - stop_note_queue[ i ].ignore_b_ = true; + if (stop_note_queue[i].key < stop_mom) + stop_note_queue[i].ignore_b_ = true; else { // skip the stopnote delete note_p; @@ -111,9 +111,9 @@ Midi_walker::process() return; p->channel_i_ = track_l_->number_i_; - if (p->name() != Midi_note::static_name ()) - output_event (ptr()->audio_column_l_->at_mom (), p); + if (Midi_item *mi = dynamic_cast<Midi_note*>(p)) + do_start_note (mi); else - do_start_note ((Midi_note*)p); + output_event (ptr()->audio_column_l_->at_mom (), p); } diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 03578a5815..d72da1d4f0 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -26,20 +26,20 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver () bool Multi_measure_rest_engraver::do_try_request (Request* req_l) { - if (!dynamic_cast<Multi_measure_rest_req *> (req_l)) - return false; - - if (multi_measure_req_l_) - if (!multi_measure_req_l_->equal_b (req_l) - || req_start_mom_ != now_moment ()) - return false; - - multi_measure_req_l_ = dynamic_cast<Multi_measure_rest_req *> (req_l); - req_start_mom_ = now_moment (); + if (Multi_measure_rest_req *mr = dynamic_cast<Multi_measure_rest_req *> (req_l)) + { + if (multi_measure_req_l_) + if (!multi_measure_req_l_->equal_b (req_l) + || req_start_mom_ != now_moment ()) + return false; - rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length (); - - return true; + multi_measure_req_l_ = mr; + req_start_mom_ = now_moment (); + + rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length (); + return true; + } + return false; } void diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 2b329815d6..5505c145a7 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -136,19 +136,19 @@ Music_iterator* Music_iterator::static_get_iterator_p (Music const *m, Translator_group *report_l) { Music_iterator * p =0; - if (m->is_type_b (Request_chord::static_name())) + if (dynamic_cast<Request_chord const *> (m)) p = new Request_chord_iterator; - else if (m->is_type_b (Simultaneous_music::static_name())) + else if (dynamic_cast<Simultaneous_music const *> (m)) p = new Simultaneous_music_iterator; - else if (m->is_type_b (Sequential_music::static_name())) + else if (dynamic_cast<Sequential_music const *> (m)) p = new Sequential_music_iterator; - else if (m->is_type_b (Translation_property::static_name ())) + else if (dynamic_cast<Translation_property const *> (m)) p = new Property_iterator; - else if (m->is_type_b (Change_translator::static_name ())) + else if (dynamic_cast<Change_translator const *> (m)) p = new Change_iterator; - else if (m->is_type_b (Compressed_music::static_name ())) + else if (dynamic_cast<Compressed_music const *> (m)) p = new Compressed_music_iterator; - else if (m->is_type_b (Music_wrapper::static_name ())) + else if (dynamic_cast<Music_wrapper const *> (m)) p = new Music_wrapper_iterator; p->music_l_ = m; diff --git a/lily/music-list.cc b/lily/music-list.cc index 7c47ded027..b712f3e255 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -109,7 +109,6 @@ IMPLEMENT_IS_TYPE_B1(Request_chord, Simultaneous_music); Request_chord::Request_chord() : Simultaneous_music (new Music_list) { - multi_level_i_ =0; } @@ -118,10 +117,9 @@ Request_chord::to_relative_octave (Musical_pitch last) { for (iter (music_p_list_p_->top(),i); i.ok (); i++) { - Musical_req *m = dynamic_cast<Musical_req*> (i.ptr ()); - if (m && dynamic_cast <Melodic_req *> (m)) + if (Melodic_req *m= dynamic_cast <Melodic_req *> (i.ptr ())) { - Musical_pitch &pit = dynamic_cast <Melodic_req *> (m)->pitch_; + Musical_pitch &pit = m->pitch_; pit.to_relative_octave (last); return pit; } diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 8e28cdf4bb..cdd7af56a8 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -40,7 +40,7 @@ Music_output_def::Music_output_def (Music_output_def const &s) for (Dictionary_iter<Identifier*> i (*translator_p_dict_p_); i.ok (); i++) { - Translator * t = i.val ()->access_Translator (false); + Translator * t = i.val ()->access_content_Translator (false); t-> output_def_l_ = this; } } @@ -60,7 +60,7 @@ Translator* Music_output_def::find_translator_l (String name) const { if (translator_p_dict_p_->elem_b (name)) - return (*translator_p_dict_p_)[name]->access_Translator (); + return (*translator_p_dict_p_)[name]->access_content_Translator (false); if (global_translator_dict_p->elem_b (name)) return (*global_translator_dict_p)[name]; @@ -76,7 +76,7 @@ Music_output_def::get_global_translator_p () if (!t) error (_("Can't find Score context")); t = t->clone (); - Global_translator *g = dynamic_cast <Translator_group *> (t)->global_l (); + Global_translator *g = dynamic_cast <Global_translator *> (t); t->add_processing (); return g; @@ -98,6 +98,6 @@ Music_output_def::get_default_output () const return ""; Identifier * id = (*scope_p_) ["output"]; - String *p = dynamic_cast <String *> (id); + String *p = id->access_content_String (false); return p ? *p : String (""); } diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index fd00a120e8..8d8299a510 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -13,7 +13,6 @@ Music_sequence::Music_sequence (Music_sequence const&s) : Music (s) { - multi_level_i_ = s.multi_level_i_; music_p_list_p_ = new Music_list (*s.music_p_list_p_); } @@ -21,7 +20,6 @@ IMPLEMENT_IS_TYPE_B1(Music_sequence, Music); Music_sequence::Music_sequence(Music_list *mlist_p) { - multi_level_i_ = 0; music_p_list_p_ = mlist_p; } diff --git a/lily/musical-request.cc b/lily/musical-request.cc index 6c72cb538a..c12cd16c29 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -105,7 +105,7 @@ bool Melodic_req::do_equal_b (Request*r) const { Melodic_req* m= dynamic_cast <Melodic_req *> (r); - return !compare (*m, *this); + return m&& !compare (*m, *this); } int @@ -131,7 +131,7 @@ Rhythmic_req::do_equal_b (Request*r) const { Rhythmic_req* rh = dynamic_cast <Rhythmic_req *> (r); - return !compare (*this, *rh); + return rh&& !compare (*this, *rh); } @@ -178,7 +178,8 @@ Lyric_req::do_print () const bool Note_req::do_equal_b (Request*r) const { - return Rhythmic_req::do_equal_b (r) && Melodic_req::do_equal_b (r); + Note_req *n = dynamic_cast<Note_req*> (r); + return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n); } @@ -270,7 +271,7 @@ bool Span_req:: do_equal_b (Request*r) const { Span_req * s = dynamic_cast <Span_req *> (r); - return spantype == s->spantype; + return s&& spantype == s->spantype; } Span_req::Span_req () @@ -294,7 +295,7 @@ Script_req::do_equal_b (Request*r) const { Script_req * s = dynamic_cast <Script_req *> (r); - return scriptdef_p_->equal_b (*s->scriptdef_p_); + return s&& scriptdef_p_->equal_b (*s->scriptdef_p_); } Script_req::Script_req () @@ -401,7 +402,7 @@ bool Absolute_dynamic_req::do_equal_b (Request *r) const { Absolute_dynamic_req *a = dynamic_cast <Absolute_dynamic_req *> (r); - return loudness_ == a->loudness_; + return a&& loudness_ == a->loudness_; } String @@ -451,7 +452,7 @@ Span_dynamic_req::do_equal_b (Request *req) const { Span_dynamic_req * s = dynamic_cast <Span_dynamic_req *> (req); - return Span_req::do_equal_b (req) && s->dynamic_dir_ == dynamic_dir_; + return s&& Span_req::do_equal_b (req) && s->dynamic_dir_ == dynamic_dir_; } Span_dynamic_req::Span_dynamic_req () diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 4c7d05a9a2..df3634bce5 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -109,7 +109,7 @@ My_lily_lexer::start_main_input () } void -My_lily_lexer::set_identifier (String name_str, Identifier* i, bool unique_b) +My_lily_lexer::set_identifier (String name_str, Identifier* i, bool ) { Identifier *old =0; if (scope_l_arr_.top ()->elem_b (name_str)) @@ -140,7 +140,7 @@ My_lily_lexer::~My_lily_lexer() } void -My_lily_lexer::print_declarations (bool init_b) const +My_lily_lexer::print_declarations (bool ) const { for (int i=scope_l_arr_.size (); i--; ) { diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index f3cdf87aba..a024f0dd68 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -177,6 +177,10 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p) return v; } + +/* + UGH. + */ Array<Request*>* My_lily_parser::get_parens_request (int t) { @@ -314,13 +318,13 @@ Paper_def* My_lily_parser::default_paper_p () { Identifier *id = lexer_p_->lookup_identifier ("$defaultpaper"); - return id ? id->access_Paper_def () : new Paper_def ; + return id ? id->access_content_Paper_def (true) : new Paper_def ; } Midi_def* My_lily_parser::default_midi_p () { Identifier *id = lexer_p_->lookup_identifier ("$defaultmidi"); - return id ? id->access_Midi_def () : new Midi_def ; + return id ? id->access_content_Midi_def (true) : new Midi_def ; } diff --git a/lily/note-column.cc b/lily/note-column.cc index b00cb5ea0a..ef0c81e380 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -102,30 +102,30 @@ Note_column::do_substitute_dependency (Score_element*o, Score_element*n) { if (stem_l_ == o) { - stem_l_ = n ? (Stem*)dynamic_cast <Item *> (n):0; + stem_l_ = n ? dynamic_cast<Stem *> (n):0; } - if (o->is_type_b (Note_head::static_name ())) + if (dynamic_cast<Note_head *> (o)) { - head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o), - (n)? (Note_head*)dynamic_cast <Item *> (n) : 0); + head_l_arr_.substitute (dynamic_cast<Note_head *> (o), + (n)? dynamic_cast<Note_head *> (n) : 0); } Script_column::do_substitute_dependency (o,n); - if (o->is_type_b (Rest::static_name ())) + if (dynamic_cast<Rest *> (o)) { - rest_l_arr_.substitute ((Rest*)dynamic_cast <Item *> (o), - (n)? (Rest*)dynamic_cast <Item *> (n) : 0); + rest_l_arr_.substitute (dynamic_cast<Rest *> (o), + (n)? dynamic_cast<Rest *> (n) : 0); } } void Note_column::add_head (Rhythmic_head *h) { - if (h->is_type_b (Rest::static_name ())) + if (dynamic_cast<Rest *> (h)) { rest_l_arr_.push ((Rest*)h); add_support (h); } - if (h->is_type_b (Note_head::static_name ())) + if (dynamic_cast<Note_head *> (h)) { head_l_arr_.push ((Note_head*) h); add_support (h); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 5f8923c284..d63b433a4f 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -24,27 +24,26 @@ Note_performer::do_print () const { #ifndef NPRINT if (note_req_l_) - note_req_l_->print (); + note_req_l_->print (); #endif } void Note_performer::do_process_requests () { - // this is _really_ braindead, but it generates some output - if (!note_req_l_ || !dynamic_cast <Melodic_req *> (note_req_l_) || !dynamic_cast <Rhythmic_req *> (note_req_l_)) - return; - - int transposing_i = 0; - //urg - Scalar prop = get_property ("transposing"); - if (!prop.empty_b () && prop.isnum_b ()) - transposing_i = prop; + if (note_req_l_) + { + int transposing_i = 0; + //urg + Scalar prop = get_property ("transposing"); + if (!prop.empty_b () && prop.isnum_b ()) + transposing_i = prop; - play (new Audio_note (note_req_l_, transposing_i)); + play (new Audio_note (note_req_l_, transposing_i)); - note_req_l_ = 0; + note_req_l_ = 0; + } } bool diff --git a/lily/p-score.cc b/lily/p-score.cc index be107cd929..6b68f7f0fd 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -25,9 +25,11 @@ #include "file-results.hh" #include "misc.hh" +#if 0 // has w32 advanced? // sucking Cygnus egcs - w32 #include "list.tcc" #include "cursor.tcc" +#endif Paper_score::Paper_score () { @@ -319,10 +321,11 @@ Paper_score::broken_col_range (Item const*l_item_l, Item const*r_item_l) const Item const*l=l_item_l; Item const*r=r_item_l; - while (! l->is_type_b(Paper_column::static_name ())) + // huh? see Item::left_right_compare () + while (! (dynamic_cast<Paper_column const *> (l))) l = dynamic_cast<Item*> (l->axis_group_l_a_[X_AXIS]); - while (! r->is_type_b(Paper_column::static_name ())) + while (! (dynamic_cast<Paper_column const *> (r))) r = dynamic_cast<Item*>(r->axis_group_l_a_[X_AXIS]); PCursor<Paper_column*> start (l ? find_col ((Paper_column*)l)+1 : col_p_list_.top ()); diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 5ce8b04cd9..85abdd931b 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -57,7 +57,7 @@ Paper_def::get_var (String s) const { if (!scope_p_->elem_b (s)) error (_f ("unknown paper variable: `%s\'", s)); - Real * p = scope_p_->elem (s)->access_Real (false); + Real * p = scope_p_->elem (s)->access_content_Real (false); if (!p) { error (_ ("not a real variable")); @@ -247,10 +247,10 @@ output_header (Paper_outputter* p, Scope *head) for (Dictionary_iter<Identifier*> i (*head); i.ok (); i++) { - if (!i.val ()->access_String_identifier ()) + if (!i.val ()->access_content_String (false)) continue; - String val = *i.val()->access_String_identifier ()->data_p_; + String val = *i.val()->access_content_String (false); output_def (p, i.key (), val); } } @@ -260,7 +260,7 @@ Paper_def::output_settings (Paper_outputter* p) const { for (Dictionary_iter<Identifier*> i (*scope_p_); i.ok (); i++) output_def (p, String ("mudelapaper") + i.key (), i.val ()->str ()); - p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_String ()); + p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false)); } Paper_outputter* diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index ade5ef13fc..033fbf3f06 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -85,8 +85,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) if (!i->lambda_) { // urg - i->lambda_ = - ly_append (ly_lambda_o (), + i->lambda_ = ly_append (ly_lambda_o (), ly_list1 (ly_func_o ("empty"))); } diff --git a/lily/parser.yy b/lily/parser.yy index ccca7e4942..bc0680a301 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -358,7 +358,7 @@ notenames_body: $$ = new Notename_table; } | NOTENAME_TABLE_IDENTIFIER { - $$ = $1-> access_Notename_table(true); + $$ = $1-> access_content_Notename_table(true); } | notenames_body STRING '=' explicit_musical_pitch { (*$$)[*$2] = *$4; @@ -461,12 +461,12 @@ translator_spec: translator_spec_body: TRANS_IDENTIFIER { - $$ = $1->access_Translator (true); + $$ = $1->access_content_Translator (true); $$-> set_spot (THIS->here_input ()); } | TYPE STRING ';' { Translator* t = get_translator_l (*$2); - Translator_group * tg = t->access_Translator_group (); + Translator_group * tg = dynamic_cast<Translator_group*> (t); if (!tg) THIS->parser_error (_("Need a translator group for a context")); @@ -478,14 +478,14 @@ translator_spec_body: } | translator_spec_body STRING '=' simple_identifier_init ';' { Identifier* id = $4; - String_identifier *s = id->access_String_identifier (); - Real_identifier *r= id->access_Real_identifier (); - int_identifier *i = id->access_int_identifier (); + String_identifier *s = dynamic_cast<String_identifier*> (id); + Real_identifier *r= dynamic_cast<Real_identifier*>(id); + int_identifier *i = dynamic_cast<int_identifier*> (id); String str; - if (s) str = *s->access_String (false); - if (i) str = to_str (*i->access_int (false)); - if (r) str = to_str (*r->access_Real (false)); + if (s) str = *s->access_content_String (false); + if (i) str = to_str (*i->access_content_int (false)); + if (r) str = to_str (*r->access_content_Real (false)); if (!s && !i && !r) THIS->parser_error (_("Wrong type for property value")); @@ -497,15 +497,15 @@ translator_spec_body: delete $3; } | translator_spec_body CONSISTS STRING ';' { - $$->access_Translator_group ()-> set_element (*$3, true); + dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true); delete $3; } | translator_spec_body ACCEPTS STRING ';' { - $$->access_Translator_group ()-> set_acceptor (*$3, true); + dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true); delete $3; } | translator_spec_body REMOVE STRING ';' { - $$->access_Translator_group ()-> set_element (*$3, false); + dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false); delete $3; } ; @@ -533,7 +533,7 @@ score_body: { $$ = new Score; } | SCORE_IDENTIFIER { - $$ = $1->access_Score (true); + $$ = $1->access_content_Score (true); } | score_body mudela_header { $$->header_p_ = $2; @@ -593,7 +593,7 @@ paper_def_body: $$ = p; } | PAPER_IDENTIFIER optional_semicolon { - Paper_def *p = $1->access_Paper_def (true); + Paper_def *p = $1->access_content_Paper_def (true); THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); $$ = p; } @@ -643,7 +643,7 @@ real_expression: } | dimension | REAL_IDENTIFIER { - $$= *$1->access_Real (false); + $$= *$1->access_content_Real (false); } | '-' real_expression %prec UNARY_MINUS { $$ = -$2; @@ -687,7 +687,7 @@ midi_body: /* empty */ { $$ = THIS->default_midi_p (); } | MIDI_IDENTIFIER { - $$ = $1-> access_Midi_def (true); + $$ = $1-> access_content_Midi_def (true); } | midi_body translator_spec { $$-> assign_translator ($2); @@ -738,7 +738,7 @@ Simultaneous_music: '<' Music_list '>' { Simple_music: request_chord { $$ = $1; } - | MUSIC_IDENTIFIER { $$ = $1->access_Music (true); } + | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); } | property_def | translator_change ; @@ -851,7 +851,7 @@ abbrev_command_req: $$ = new Barcheck_req; } | COMMAND_IDENTIFIER { - $$ = $1->access_Request (true); + $$ = $1->access_content_Request (true); } /* | '[' { @@ -958,7 +958,7 @@ structured_post_request: post_request: POST_REQUEST_IDENTIFIER { - $$ = (Request*)$1->access_Request (true); + $$ = (Request*)$1->access_content_Request (true); } | dynamic_req { $$ = $1; @@ -1226,10 +1226,10 @@ script_abbreviation: ; mudela_script: - SCRIPT_IDENTIFIER { $$ = $1->access_General_script_def (true); } + SCRIPT_IDENTIFIER { $$ = $1->access_content_General_script_def (true); } | script_definition { $$ = $1; } | script_abbreviation { - $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_General_script_def (true); + $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true); delete $1; } ; @@ -1299,7 +1299,7 @@ steno_duration: } } | DURATION_IDENTIFIER { - $$ = $1->access_Duration (true); + $$ = $1->access_content_Duration (true); } | steno_duration '.' { $$->dots_i_ ++; @@ -1396,7 +1396,7 @@ int: $$ = -$2; } | INT_IDENTIFIER { - $$ = *$1->access_int (false); + $$ = *$1->access_content_int (false); } ; @@ -1406,7 +1406,7 @@ string: $$ = $1; } | STRING_IDENTIFIER { - $$ = $1->access_String (true); + $$ = $1->access_content_String (true); } | string '+' string { *$$ += *$3; @@ -1428,7 +1428,7 @@ symtables_body: $$ = new Symtables; } | IDENTIFIER { - $$ = $1->access_Symtables (true); + $$ = $1->access_content_Symtables (true); } | symtables_body FONT STRING { $$->font_ = *$3; diff --git a/lily/performer.cc b/lily/performer.cc index 7c5e541f82..449caf22bb 100644 --- a/lily/performer.cc +++ b/lily/performer.cc @@ -30,6 +30,6 @@ Performer_group_performer* Performer::daddy_perf_l () const { return (daddy_trans_l_) - ?(Performer_group_performer*) dynamic_cast <Performer *> (daddy_trans_l_) + ?dynamic_cast<Performer_group_performer *> (daddy_trans_l_) : 0; } diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index 4851cee02c..8c3273cd7c 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -13,10 +13,9 @@ void Pitch_squash_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->is_type_b (Note_head::static_name ())) + if (Note_head *nh = dynamic_cast<Note_head *> (i.elem_l_)) { - Note_head * nl = (Note_head*)dynamic_cast <Item *> (i.elem_l_); - nl->position_i_ =0; + nh->position_i_ =0; } } diff --git a/lily/plet-engraver.cc b/lily/plet-engraver.cc index ed85c58bfd..172a491200 100644 --- a/lily/plet-engraver.cc +++ b/lily/plet-engraver.cc @@ -27,7 +27,9 @@ Plet_engraver::Plet_engraver () void Plet_engraver::acknowledge_element (Score_element_info i) { - if (!i.elem_l_->is_type_b (Stem::static_name ())) + + Stem * st = (dynamic_cast<Stem *> (i.elem_l_)); + if (!st) return; if (!plet_spanner_p_) return; @@ -35,10 +37,10 @@ Plet_engraver::acknowledge_element (Score_element_info i) return; if (!plet_spanner_p_->stem_l_drul_[LEFT]) - plet_spanner_p_->set_stem (LEFT, (Stem*)dynamic_cast <Item *> (i.elem_l_)); + plet_spanner_p_->set_stem (LEFT, st); else if (span_reqs_drul_[RIGHT] && !plet_spanner_p_->stem_l_drul_[RIGHT]) - plet_spanner_p_->set_stem (RIGHT, (Stem*)dynamic_cast <Item *> (i.elem_l_)); + plet_spanner_p_->set_stem (RIGHT, st); } bool diff --git a/lily/plet-spanner.cc b/lily/plet-spanner.cc index 4a032ffc72..57f6ca30cf 100644 --- a/lily/plet-spanner.cc +++ b/lily/plet-spanner.cc @@ -130,7 +130,7 @@ Plet_spanner::do_post_processing () void Plet_spanner::do_substitute_dependency (Score_element* o, Score_element* n) { - Stem* new_l = n ? (Stem*)dynamic_cast <Item *> (n) : 0; + Stem* new_l = n ? dynamic_cast<Stem *> (n) : 0; if (dynamic_cast <Item *> (o) == stem_l_drul_[LEFT]) stem_l_drul_[LEFT] = new_l; else if (dynamic_cast <Item *> (o) == stem_l_drul_[RIGHT]) diff --git a/lily/plet-swallow-engraver.cc b/lily/plet-swallow-engraver.cc index 47da034354..994a84003b 100644 --- a/lily/plet-swallow-engraver.cc +++ b/lily/plet-swallow-engraver.cc @@ -15,5 +15,5 @@ ADD_THIS_TRANSLATOR(Plet_swallow_engraver); bool Plet_swallow_engraver::do_try_request (Request* req_l) { - return dynamic_cast <Plet_req *> (req_l); + return dynamic_cast<Plet_req *> (req_l); } diff --git a/lily/priority-halign-engraver.cc b/lily/priority-halign-engraver.cc index 2aa56cb7cf..6a9d8d15dd 100644 --- a/lily/priority-halign-engraver.cc +++ b/lily/priority-halign-engraver.cc @@ -30,7 +30,7 @@ void Priority_horizontal_align_engraver::acknowledge_element (Score_element_info i) { Engraver* reg = i.origin_grav_l_arr_[0]; - if (reg->is_type_b (Score_priority_engraver::static_name())) + if (dynamic_cast<Score_priority_engraver *> (reg)) { if (!halign_p_) { diff --git a/lily/protected-scm.cc b/lily/protected-scm.cc new file mode 100644 index 0000000000..0304d91f91 --- /dev/null +++ b/lily/protected-scm.cc @@ -0,0 +1,52 @@ +/* + protected-scm.cc -- implement Protected_scm + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ +#include "protected-scm.hh" +extern "C" +{ +#include <libguile/gc.h> +}; + + +Protected_scm::Protected_scm () +{ + object_ = 0; +} + +Protected_scm::Protected_scm (SCM s) +{ + object_ = s ? scm_protect_object (s): 0; +} + +Protected_scm::Protected_scm (Protected_scm const &s) +{ + object_ = s.object_ ? scm_protect_object (s.object_) : 0; +} + +Protected_scm & +Protected_scm::operator =(Protected_scm const &s) +{ + if (this == &s) + return *this; + if (object_) + scm_unprotect_object(object_); + + object_ = (s.object_) ? scm_protect_object (s.object_): 0; + return *this; +} + +Protected_scm::~Protected_scm () +{ + if (object_) + scm_unprotect_object (object_); +} + +Protected_scm::operator SCM () +{ + return object_; +} diff --git a/lily/request-iterator.cc b/lily/request-iterator.cc index 56764298f5..5ed0f31155 100644 --- a/lily/request-iterator.cc +++ b/lily/request-iterator.cc @@ -65,11 +65,14 @@ Request_chord_iterator::do_process_and_next (Moment mom) { for (PCursor<Music*> i (elt_l ()->music_p_list_p_->top ()); i.ok(); i++) { - assert (i->is_type_b (Request::static_name())); - Request * req_l = (Request*)i.ptr(); - bool gotcha = report_to_l()->try_request (req_l); - if (!gotcha) - req_l->warning (_f ("junking request: `%s\'", req_l->name())); + if (Request * req_l = dynamic_cast<Request*> (i.ptr())) + { + bool gotcha = report_to_l()->try_request (req_l); + if (!gotcha) + req_l->warning (_f ("junking request: `%s\'", req_l->name())); + } + else + i.ptr ()->warning (_f ("Huh? Not a Request: `%s\'", i.ptr()->name ())); } first_b_ = false; } diff --git a/lily/request.cc b/lily/request.cc index 858d5c44d5..aadbe80aef 100644 --- a/lily/request.cc +++ b/lily/request.cc @@ -23,17 +23,12 @@ Request::do_print() const bool Request::equal_b (Request *r) const { - if (is_type_b (r->name())) - return r->do_equal_b ((Request*)this); - if (r->is_type_b (name())) - return do_equal_b (r); - - return false; + return r->do_equal_b (this) || this->do_equal_b (r) ; } bool Request::do_equal_b (Request*) const { - return false; + return true; } diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 2c52168807..89ac8e6531 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -36,8 +36,8 @@ Rest_collision_engraver::process_acknowledged () void Rest_collision_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->is_type_b (Note_column::static_name())) - note_column_l_arr_.push ((Note_column*)dynamic_cast <Item *> (i.elem_l_)); + if (dynamic_cast<Note_column *> (i.elem_l_)) + note_column_l_arr_.push (dynamic_cast<Note_column *> (i.elem_l_)); } void diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 54cfe814c1..095c6ac469 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -133,14 +133,11 @@ Rest_collision::do_print() const void Rest_collision::do_substitute_dependency (Score_element*o,Score_element*n) { - Item*o_l = dynamic_cast <Item *> (o); - - - if (o_l&&o_l->is_type_b (Note_column::static_name ())) + if (Note_column *onl = dynamic_cast<Note_column *> (o)) { - Note_column *n_l = n?(Note_column*)dynamic_cast <Item *> (n):0; - rest_l_arr_.substitute ((Note_column*)o_l, n_l); - ncol_l_arr_.substitute ((Note_column*)o_l, n_l); + Note_column *n_l = n?dynamic_cast<Note_column *> (n):0; + rest_l_arr_.substitute (onl, n_l); + ncol_l_arr_.substitute (onl, n_l); } } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index f4f2e6efbe..2170886e55 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -60,14 +60,14 @@ Rest_engraver::do_process_requests () } bool -Rest_engraver::do_try_request (Request *r) +Rest_engraver::do_try_request (Request *req) { - Musical_req *m = dynamic_cast <Musical_req *> (r); - if (!m || !dynamic_cast <Rest_req *> (m)) - return false; - - rest_req_l_ = dynamic_cast <Rest_req *> (m); // ugh - return true; + if (Rest_req *r = dynamic_cast <Rest_req *> (req)) + { + rest_req_l_ = r; + return true; + } + return false; } IMPLEMENT_IS_TYPE_B1(Rest_engraver, Engraver); diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 8c1cacfdf5..8bccc1eec6 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -70,21 +70,21 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i) Item * item = dynamic_cast <Item *> (i.elem_l_); if (!item) return; - if (item->is_type_b (Script::static_name ()) + if (dynamic_cast<Script *> (item) && i.req_l_ && dynamic_cast <Musical_req *> (i.req_l_)) { script_l_arr_.push ((Script*)item); } - else if (item->is_type_b (Stem::static_name())) + else if (dynamic_cast<Stem *> (item)) { stem_l_ = (Stem*) item; } - else if (item->is_type_b (Rhythmic_head::static_name ())) + else if (dynamic_cast<Rhythmic_head *> (item)) { rhead_l_arr_.push ((Rhythmic_head*)item); } - else if (item->is_type_b (Dot_column::static_name ())) + else if (dynamic_cast<Dot_column *> (item)) { dotcol_l_ = (Dot_column*) item; } diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index d4625e7c2b..b25b5ac950 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -52,7 +52,7 @@ void Rhythmic_head::do_substitute_dependent (Score_element*o,Score_element*n) { if (o == dots_l_) - dots_l_ = n ? (Dots*)dynamic_cast <Item *> (n) :0; + dots_l_ = n ? dynamic_cast<Dots *> (n) :0; } IMPLEMENT_IS_TYPE_B1(Rhythmic_head, Item); diff --git a/lily/score-element.cc b/lily/score-element.cc index cbaadfc4f4..a82e50adee 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -176,6 +176,11 @@ Score_element::do_brew_molecule () if (transparent_b_) return; Molecule *output= brew_molecule_p (); + for (PCursor<Atom*> i(output->atoms_); i.ok(); i++) + { + i->origin_l_ = this; + } + pscore_l_->outputter_l_->output_molecule (output, absolute_offset (), name()); delete output; } @@ -291,17 +296,16 @@ Score_element::handle_broken_dependencies() Score_element * elt = dependency (i); if (elt->line_l() != line) { - if (dynamic_cast <Spanner *> (elt)) + if (Spanner *sp = dynamic_cast<Spanner *> (elt)) { - Spanner * sp = dynamic_cast <Spanner *> (elt); Spanner * broken = sp->find_broken_piece (line); substitute_dependency (sp, broken); add_dependency (broken); } - else if (dynamic_cast <Item *> (elt)) + else if (Item *original = dynamic_cast <Item *> (elt)) { - Item * my_item = dynamic_cast <Item *> (elt)->find_prebroken_piece (line); + Item * my_item = original->find_prebroken_piece (line); substitute_dependency (elt, my_item); if (my_item) diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 30a38f5360..37a73b00c1 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -104,10 +104,9 @@ Score_engraver::do_announces() */ if (announce_info_arr_[i].req_l_) { - Musical_req *m =dynamic_cast <Musical_req *> ( announce_info_arr_[i].req_l_); - if (m && dynamic_cast <Rhythmic_req *> (m)) + if (Rhythmic_req *rq = dynamic_cast <Rhythmic_req *> (announce_info_arr_[i].req_l_)) { - musical_column_l_->add_duration (m->duration()); + musical_column_l_->add_duration (rq->duration()); } } Engraver_group_engraver::do_announces(); @@ -128,9 +127,8 @@ Score_engraver::typeset_all() for (int i =0; i < elem_p_arr_.size(); i++) { Score_element * elem_p = elem_p_arr_[i]; - if (dynamic_cast <Spanner *> (elem_p)) + if (Spanner *s = dynamic_cast <Spanner *> (elem_p)) { - Spanner *s = dynamic_cast <Spanner *> (elem_p); pscore_p_->typeset_unbroken_spanner (s); /* @@ -241,22 +239,21 @@ Score_engraver::do_try_request (Request*r) { bool gotcha = Engraver_group_engraver::do_try_request (r); - if (gotcha || !dynamic_cast <Command_req *> (r)) - return gotcha; - - Command_req * c = dynamic_cast <Command_req *> (r); - if (dynamic_cast <Break_req *> (c)) + if (!gotcha) { - Break_req* b = (Break_req*)dynamic_cast <Break_req *> (c); - if (b->penalty_i_ <= Break_req::DISALLOW) - break_penalty_i_ = b->penalty_i_; - else if (b->penalty_i_ >= Break_req::FORCE) + if (Break_req* b = dynamic_cast<Break_req *> (r)) { - command_column_l_->break_penalty_i_ = b->penalty_i_; - gotcha = true; + if (b->penalty_i_ <= Break_req::DISALLOW) + break_penalty_i_ = b->penalty_i_; + else if (b->penalty_i_ >= Break_req::FORCE) + { + command_column_l_->break_penalty_i_ = b->penalty_i_; + gotcha = true; + } } } - return gotcha; + return gotcha; + } IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver); @@ -266,7 +263,7 @@ void Score_engraver::do_add_processing () { Translator_group::do_add_processing (); - assert (output_def_l_->is_type_b (Paper_def::static_name ())); + assert (dynamic_cast<Paper_def *> (output_def_l_)); assert (!daddy_trans_l_); pscore_p_ = new Paper_score; pscore_p_->paper_l_ = (Paper_def*)output_def_l_; diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 9e91c14b24..48822afc4c 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -35,11 +35,11 @@ Score_performer::~Score_performer() void Score_performer::play (Audio_element * p) { - if (p->is_type_b (Audio_item::static_name())) + if (dynamic_cast<Audio_item *> (p)) { audio_column_l_->add_audio_item ((Audio_item*)p); } - else if (p->is_type_b (Audio_staff::static_name())) + else if (dynamic_cast<Audio_staff *> (p)) { performance_p_->add_staff ((Audio_staff*)p); } @@ -95,7 +95,7 @@ void Score_performer::do_add_processing () { Translator_group::do_add_processing (); - assert (output_def_l_->is_type_b (Midi_def::static_name ())); + assert (dynamic_cast<Midi_def *> (output_def_l_)); performance_p_ = new Performance; performance_p_->midi_l_ = (Midi_def*) output_def_l_; } diff --git a/lily/score-priority-engraver.cc b/lily/score-priority-engraver.cc index 3de5ea9f00..bb9f75513c 100644 --- a/lily/score-priority-engraver.cc +++ b/lily/score-priority-engraver.cc @@ -42,7 +42,7 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) Don't try to eat up our (probable) parent. */ if (inf.origin_grav_l_arr_.size () <= 1 && - item_l->is_type_b (Break_align_item::static_name ())) + dynamic_cast<Break_align_item *> (item_l)) return; diff --git a/lily/score.cc b/lily/score.cc index 8600a6a181..291616b882 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -129,7 +129,7 @@ Score::process() for (int i=0; i < def_p_arr_.size (); i++) { if (no_paper_global_b - && def_p_arr_[i]->is_type_b (Paper_def::static_name ())) + && dynamic_cast<Paper_def*>(def_p_arr_[i])) continue; run_translator (def_p_arr_[i]); } diff --git a/lily/script-column.cc b/lily/script-column.cc index d85e1a6e0b..e00f9f04a6 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -107,7 +107,9 @@ Script_column::do_substitute_dependency (Score_element*o,Score_element*n) { if (dynamic_cast <Item *> (o)) { - script_l_arr_.substitute ((Script*)dynamic_cast <Item *> (o),(Script*) (n?dynamic_cast <Item *> (n):0)); - support_l_arr_.substitute (dynamic_cast <Item *> (o), (n?dynamic_cast <Item *> (n):0)); + script_l_arr_.substitute (dynamic_cast<Script *> (o), + dynamic_cast <Script *> (n)); + support_l_arr_.substitute (dynamic_cast <Item *> (o), + dynamic_cast <Item *> (n)); } } diff --git a/lily/script-def.cc b/lily/script-def.cc index 05074c7107..daf721f041 100644 --- a/lily/script-def.cc +++ b/lily/script-def.cc @@ -46,8 +46,8 @@ Script_def::do_print() const bool Script_def::do_equal_b (General_script_def const *g) const { - Script_def const * c = (Script_def const*) g; - return (symidx_str_ == c->symidx_str_ && + Script_def const * c = dynamic_cast<Script_def const*> (g); + return c&& (symidx_str_ == c->symidx_str_ && rel_stem_dir_ == c->rel_stem_dir_&& staff_dir_ == c->staff_dir_&& invertsym_b_ == c->invertsym_b_); diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index f27577e44b..c68a165d11 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -61,7 +61,7 @@ Script_engraver::do_pre_move_processing() if (!script_p->specs_p_->inside_b()) script_p->add_support (s_l); - if (script_p->specs_p_->is_type_b (Text_def::static_name ())) + if (dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH { Text_def * td_l = (Text_def*)script_p->specs_p_; Scalar style = get_property ("textstyle"); diff --git a/lily/script.cc b/lily/script.cc index ee525907ae..c7e5d41770 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -27,7 +27,7 @@ Script::do_substitute_dependency (Score_element*o,Score_element*n) Staff_side::do_substitute_dependency (o,n); if (o == stem_l_) { - stem_l_ = n ? (Stem*)dynamic_cast <Item *> (n) : 0; + stem_l_ = dynamic_cast<Stem *> (n); } } diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 059afad994..2b31c9eee7 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -62,11 +62,10 @@ IMPLEMENT_IS_TYPE_B1(Separating_group_spanner, Spanner); void Separating_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n) { - if (o->is_type_b (Single_malt_grouping_item::static_name ())) + if (dynamic_cast<Single_malt_grouping_item *> (o)) { - Single_malt_grouping_item*ns = n ? - (Single_malt_grouping_item*)dynamic_cast <Item *> (n) : 0; - spacing_unit_l_arr_.substitute ((Single_malt_grouping_item*)dynamic_cast <Item *> (o), ns); + Single_malt_grouping_item*ns = dynamic_cast<Single_malt_grouping_item *> (n); + spacing_unit_l_arr_.substitute (dynamic_cast<Single_malt_grouping_item *> (o), ns); } } diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index f43b99a3c3..bf046b82ac 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -41,8 +41,8 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i) Item * it = dynamic_cast <Item *> (i.elem_l_); if (it && !it->axis_group_l_a_[X_AXIS]) { - Single_malt_grouping_item *&p_ref_ (it->breakable_b_ ? - break_malt_p_ : nobreak_malt_p_); + Single_malt_grouping_item *&p_ref_ (it->breakable_b_ + ? break_malt_p_ : nobreak_malt_p_); if (!p_ref_) { diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index 56541540f1..0b1af3f676 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -48,7 +48,8 @@ Single_malt_grouping_item::do_substitute_dependency (Score_element*o, Score_elem { if (dynamic_cast <Item *> (o)) { - item_l_arr_.unordered_substitute (dynamic_cast <Item *> (o), n ? dynamic_cast <Item *> (n) : 0); + item_l_arr_.unordered_substitute (dynamic_cast <Item *> (o), + dynamic_cast <Item *> (n)); } } diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index e7447b7432..33e2b24c23 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -16,19 +16,20 @@ bool Slur_engraver::do_try_request (Request *req_l) { Musical_req *mus_l = dynamic_cast <Musical_req *> (req_l); - if (!mus_l || !dynamic_cast <Slur_req *> (mus_l)) - return false; - - new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l)); - return true; + if (Slur_req *sl = dynamic_cast <Slur_req *> (mus_l)) + { + new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l)); + return true; + } + return false; } void Slur_engraver::acknowledge_element (Score_element_info info) { - if (info.elem_l_->is_type_b (Note_column::static_name ())) + if (dynamic_cast<Note_column *> (info.elem_l_)) { - Note_column *col_l =(Note_column*) dynamic_cast <Item *> (info.elem_l_) ;// ugh + Note_column *col_l =dynamic_cast<Note_column *> (info.elem_l_) ;// ugh for (int i = 0; i < slur_l_stack_.size(); i++) slur_l_stack_[i]->add_column (col_l); for (int i = 0; i < end_slur_l_arr_.size(); i++) diff --git a/lily/slur.cc b/lily/slur.cc index 41769d8e0c..73c8cb98fb 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -76,10 +76,10 @@ void Slur::do_substitute_dependency (Score_element*o, Score_element*n) { int i; - while ((i = encompass_arr_.find_i ((Note_column*)dynamic_cast <Item *> (o))) >=0) + while ((i = encompass_arr_.find_i (dynamic_cast<Note_column *> (o))) >=0) { if (n) - encompass_arr_[i] = (Note_column*)dynamic_cast <Item *> (n); + encompass_arr_[i] = dynamic_cast<Note_column *> (n); else encompass_arr_.del (i); } diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 4d3dc1f6f4..acf9c4fb06 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -38,9 +38,9 @@ Span_bar_engraver::acknowledge_element (Score_element_info i) { int depth = i.origin_grav_l_arr_.size(); if (depth > 1 - && i.elem_l_->is_type_b (Bar::static_name())) + && dynamic_cast<Bar *> (i.elem_l_)) { - bar_l_arr_.push ((Bar*)dynamic_cast <Item *> (i.elem_l_)); + bar_l_arr_.push (dynamic_cast<Bar *> (i.elem_l_)); if (bar_l_arr_.size() >= 2 && !spanbar_p_) /* @@ -62,10 +62,10 @@ Span_bar_engraver::acknowledge_element (Score_element_info i) spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_; } } - else if (i.elem_l_->is_type_b (Vertical_align_spanner::static_name()) + else if (dynamic_cast<Vertical_align_spanner *> (i.elem_l_) && i.origin_grav_l_arr_.size() <= 2) { - valign_l_ = (Vertical_align_spanner*)dynamic_cast <Spanner *> (i.elem_l_); + valign_l_ = dynamic_cast<Vertical_align_spanner *> (i.elem_l_); } } diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 331201d4d0..c44900e609 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -116,9 +116,3 @@ Span_bar::Span_bar () { type_str_ = ""; } - -Span_bar* -Span_bar::access_Span_bar () -{ - return this; -} diff --git a/lily/span-score-bar-engraver.cc b/lily/span-score-bar-engraver.cc index d3cff445e5..0aa5e9852a 100644 --- a/lily/span-score-bar-engraver.cc +++ b/lily/span-score-bar-engraver.cc @@ -48,7 +48,7 @@ void Staff_group_bar_engraver::acknowledge_element (Score_element_info i) { Span_bar_engraver::acknowledge_element (i); - if (i.elem_l_->is_type_b (Piano_brace::static_name ())) + if (dynamic_cast<Piano_brace *> (i.elem_l_)) { Span_bar* b = dynamic_cast <Span_bar *> (i.elem_l_); Piano_brace * piano_l = (Piano_brace*) b; diff --git a/lily/spanner.cc b/lily/spanner.cc index 83ad5f2091..25b9855f23 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -118,12 +118,6 @@ Spanner::do_break_processing() } } -Spanner* -Spanner::access_Spanner () -{ - return this; -} - Spanner::Spanner () { unbroken_original_l_ =0; diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 99939fcd6b..b10b0ba8bf 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -20,6 +20,7 @@ #include "score-column.hh" #include "paper-def.hh" #include "colhpos.hh" +#include "main.hh" Vector Spring_spacer::default_solution() const @@ -324,10 +325,10 @@ Spring_spacer::Spring_spacer () void Spring_spacer::solve (Column_x_positions*positions) const { - DOUT << "Spring_spacer::solve ()..."; - Vector solution_try; + Vector solution_try; + bool constraint_satisfaction = try_initial_solution_and_tell (solution_try); if (constraint_satisfaction) { @@ -335,9 +336,9 @@ Spring_spacer::solve (Column_x_positions*positions) const make_matrices (lp.quad_,lp.lin_, lp.const_term_); make_constraints (lp); set_fixed_cols (lp); - + Vector solution_vec (lp.solve (solution_try)); - + positions->satisfies_constraints_b_ = check_constraints (solution_vec); if (!positions->satisfies_constraints_b_) { @@ -352,6 +353,7 @@ Spring_spacer::solve (Column_x_positions*positions) const { positions->set_stupid_solution (solution_try); } + DOUT << "Finished Spring_spacer::solve ()..."; } diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc index a80d36bd0a..92c5cdd139 100644 --- a/lily/staff-margin-engraver.cc +++ b/lily/staff-margin-engraver.cc @@ -44,7 +44,7 @@ Staff_margin_engraver::acknowledge_element (Score_element_info i) if (!it || script_p_ - || !it->is_type_b (Bar::static_name()) + || !(dynamic_cast<Bar *> (it)) || (i.origin_grav_l_arr_.size() != 1)) return; diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index ac2cfa3aab..90f2c63ebc 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -97,7 +97,7 @@ Staff_performer::new_instrument_str () void Staff_performer::play (Audio_element* p) { - if (p->is_type_b (Audio_item::static_name ())) + if (dynamic_cast<Audio_item *> (p)) { audio_staff_p_->add_audio_item ( (Audio_item*)p); } diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index e21c8c9012..65351c29a7 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -36,9 +36,9 @@ Stem_engraver::do_creation_processing () void Stem_engraver::acknowledge_element(Score_element_info i) { - if (i.elem_l_->is_type_b (Rhythmic_head::static_name())) + if (dynamic_cast<Rhythmic_head *> (i.elem_l_)) { - Rhythmic_head *h = (Rhythmic_head*) dynamic_cast <Item *> (i.elem_l_); + Rhythmic_head *h = dynamic_cast<Rhythmic_head *> (i.elem_l_); if (!stem_p_) { Rhythmic_req * r = dynamic_cast <Rhythmic_req *> (i.req_l_); diff --git a/lily/stem.cc b/lily/stem.cc index 423b40b397..09193e0647 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -115,11 +115,11 @@ void Stem::add_head (Rhythmic_head *n) { n->add_dependency (this); // ? - if (n->is_type_b (Note_head::static_name ())) + if (dynamic_cast<Note_head *> (n)) { head_l_arr_.push ((Note_head*)n); } - else if (n->is_type_b (Rest::static_name ())) + else if (dynamic_cast<Rest *> (n)) { rest_l_arr_.push ((Rest*)n); } diff --git a/lily/symtable.cc b/lily/symtable.cc index cc3cecff23..dd9cb2f732 100644 --- a/lily/symtable.cc +++ b/lily/symtable.cc @@ -31,7 +31,7 @@ Symtables::Symtables (Symtables const &s) Symtables::~Symtables() { - for (Dictionary_iter< Symtable*> i (*this); i.ok(); i++) + for (Dictionary_iter<Symtable*> i (*this); i.ok(); i++) { delete i.val(); } @@ -60,12 +60,12 @@ Symtables::operator()(String s) { error (_f ("Symtable `%s\' unknown", s)); /* - We can 't return, because we'll dump core anyway. + We can 't return, because we would dump core anyway. */ return 0; } else - return Dictionary<Symtable*>::operator[](s); + return elem(s); } void Symtables::print() const diff --git a/lily/text-def.cc b/lily/text-def.cc index 3597f30e5e..06eccd3fe6 100644 --- a/lily/text-def.cc +++ b/lily/text-def.cc @@ -65,8 +65,8 @@ Text_def::Text_def() bool Text_def::do_equal_b (General_script_def const *gdef) const { - Text_def const *def= (Text_def*)gdef; - return align_dir_ == def->align_dir_ && text_str_ == def->text_str_ + Text_def const *def= dynamic_cast<Text_def const*>(gdef); + return def&& align_dir_ == def->align_dir_ && text_str_ == def->text_str_ && style_str_ == def->style_str_; } diff --git a/lily/text-item.cc b/lily/text-item.cc index c23b63c9a5..35dcbdb49f 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -38,9 +38,11 @@ Real Text_item::get_position_f () const { // uhuh, tdef/gdef? - if ( (tdef_p_->name () != Text_def::static_name ()) - || ( ( (Text_def*)tdef_p_)->style_str_ != "finger")) - return Staff_side::get_position_f (); + if (Text_def *tdl = dynamic_cast<Text_def*>(tdef_p_)) + { + if (tdl->style_str_ != "finger") // HUHH? + return Staff_side::get_position_f (); + } if (!dir_) { diff --git a/lily/tie.cc b/lily/tie.cc index 002c5e9694..1bf3a9640e 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -151,7 +151,7 @@ Tie::do_post_processing() void Tie::do_substitute_dependency (Score_element*o, Score_element*n) { - Note_head *new_l =n?(Note_head*)dynamic_cast <Item *> (n):0; + Note_head *new_l =n?dynamic_cast<Note_head *> (n):0; if (dynamic_cast <Item *> (o) == head_l_drul_[LEFT]) head_l_drul_[LEFT] = new_l; else if (dynamic_cast <Item *> (o) == head_l_drul_[RIGHT]) diff --git a/lily/ties-engraver.cc b/lily/ties-engraver.cc index f79dab5ac9..3f5a3c5d6d 100644 --- a/lily/ties-engraver.cc +++ b/lily/ties-engraver.cc @@ -28,10 +28,7 @@ Ties_engraver::do_post_move_processing() bool Ties_engraver::do_try_request (Request*req) { - if (! dynamic_cast <Musical_req *> (req)) - return false; - - if(Tie_req * r= dynamic_cast <Tie_req *> (req)) + if (Tie_req * r = dynamic_cast <Tie_req *> (req)) { req_l_ = r; return true; @@ -45,9 +42,8 @@ Ties_engraver::acknowledge_element (Score_element_info i) { if (!req_l_ && ! end_req_l_) return; - if (i.elem_l_->is_type_b (Note_head::static_name ())) + if (Note_head * h = dynamic_cast <Note_head *> (i.elem_l_)) { - Note_head * h = dynamic_cast <Note_head *> (i.elem_l_); Melodic_req *m = dynamic_cast <Melodic_req *> (i.req_l_); head_mel_tuple_arr_.push (Head_melodic_tuple (h, m)); diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 739bae6712..35743ad24f 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -21,7 +21,7 @@ void Time_signature_engraver::do_process_requests() { Translator * result = - daddy_grav_l()->get_simple_translator (Timing_engraver::static_name()); + daddy_grav_l()->get_simple_translator (Timing_engraver::static_name ()); // ugh if (!result) { @@ -30,7 +30,7 @@ Time_signature_engraver::do_process_requests() return ; } - Timing_engraver * timing_grav_l= (Timing_engraver*) dynamic_cast <Engraver *> (result); + Timing_engraver * timing_grav_l= dynamic_cast<Timing_engraver *> (result); Time_signature_change_req *req = timing_grav_l->time_signature_req_l(); if (req) diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 316f31d523..856525785b 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -20,24 +20,27 @@ Timing_translator::Timing_translator () bool Timing_translator::do_try_request(Request*r) { - Command_req * c = dynamic_cast <Command_req *> (r); - if (!(c && dynamic_cast <Timing_req *> (c))) - return false; - for (int i=0; i < timing_req_l_arr_.size (); i++) + if (Timing_req *t = dynamic_cast <Timing_req *> (r)) { - if (timing_req_l_arr_[i]->equal_b(r)) - return true; - if (timing_req_l_arr_[i]->name() == r->name()) + for (int i=0; i < timing_req_l_arr_.size (); i++) { - r->warning (_ ("conflicting timing request")); - return false; + if (timing_req_l_arr_[i]->equal_b(t)) + return true; + if (timing_req_l_arr_[i]->name() == r->name()) + { + r->warning (_ ("conflicting timing request")); + return false; + } } + + timing_req_l_arr_.push(t); + return true; } - - timing_req_l_arr_.push(dynamic_cast <Timing_req *> (c)); - return true; + return false; } +/*ugh. + */ Time_signature_change_req* Timing_translator::time_signature_req_l() const { @@ -55,8 +58,8 @@ Timing_translator::do_process_requests() for (int i=0; i < timing_req_l_arr_.size (); i++) { Timing_req * tr_l = timing_req_l_arr_[i]; - Time_signature_change_req *m_l = dynamic_cast <Time_signature_change_req *> (tr_l); - if (m_l) + + if (Time_signature_change_req *m_l = dynamic_cast <Time_signature_change_req *> (tr_l)) { int b_i= m_l->beats_i_; int o_i = m_l->one_beat_i_; @@ -69,9 +72,9 @@ Timing_translator::do_process_requests() Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i); } } - else if (dynamic_cast <Partial_measure_req *> (tr_l)) + else if (Partial_measure_req *pm = dynamic_cast <Partial_measure_req *> (tr_l)) { - Moment m = dynamic_cast <Partial_measure_req *> (tr_l)->duration_; + Moment m = pm->duration_; String error = time_.try_set_partial_str (m); if (error.length_i ()) { @@ -92,15 +95,15 @@ Timing_translator::do_process_requests() } } - else if (dynamic_cast <Cadenza_req *> (tr_l)) + else if (Cadenza_req *cr = dynamic_cast <Cadenza_req *> (tr_l)) { - time_.set_cadenza (dynamic_cast <Cadenza_req *> (tr_l)->on_b_); + time_.set_cadenza (cr->on_b_); } - else if (dynamic_cast <Measure_grouping_req *> (tr_l)) + else if (Measure_grouping_req *mg=dynamic_cast <Measure_grouping_req *> (tr_l)) { default_grouping_ = - parse_grouping (dynamic_cast <Measure_grouping_req *> (tr_l)->beat_i_arr_, - dynamic_cast <Measure_grouping_req *> (tr_l)->elt_length_arr_); + parse_grouping (mg->beat_i_arr_, + mg->elt_length_arr_); } } @@ -112,7 +115,7 @@ Timing_translator::do_pre_move_processing() { timing_req_l_arr_.set_size (0); Global_translator *global_l = - daddy_trans_l_->ancestor_l (100)->global_l (); // ugh 100. + dynamic_cast<Global_translator*> (daddy_trans_l_->ancestor_l (100)); // ugh 100. /* allbars == ! skipbars */ diff --git a/lily/type-swallow-trans.cc b/lily/type-swallow-trans.cc index 58dceb1b1d..3ef7567af5 100644 --- a/lily/type-swallow-trans.cc +++ b/lily/type-swallow-trans.cc @@ -17,9 +17,9 @@ Type_swallow_translator::Type_swallow_translator () bool Type_swallow_translator::do_try_request (Request*r) { - if (type_&&r->is_type_b (type_)) - return true; - return false; + // if (type_ && type_->before (typeid( *r))) // + // return true; + return false; // ugh. FIXME. } IMPLEMENT_IS_TYPE_B1(Type_swallow_translator, Translator); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 2f56e3b7b3..a270ad7a9f 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -48,7 +48,7 @@ void Vertical_align_engraver::acknowledge_element (Score_element_info i) { if (i.origin_grav_l_arr_.size() == 1 && - i.elem_l_->is_type_b (Vertical_group_spanner::static_name()) && + dynamic_cast<Vertical_group_spanner *> (i.elem_l_) && !i.elem_l_->axis_group_l_a_[Y_AXIS]) { assert (!valign_p_->contains_b (i.elem_l_)); diff --git a/make/generic-vars.make b/make/generic-vars.make index fcde1cfd52..a8cc0afc3a 100644 --- a/make/generic-vars.make +++ b/make/generic-vars.make @@ -8,9 +8,8 @@ # you do make dist # -# urg, ambiguous and thus error prone; hardcode all $(*scripts) to bin? -buildscripts = $(depth)/bin -scripts = $(depth)/bin +buildscripts = $(depth)/buildscripts + flower-dir = $(depth)/flower lib-dir = $(depth)/lib @@ -22,7 +21,7 @@ include-flower = $(depth)/flower/include -LILYPOND_INCLUDES = $(include-lib) $(depth)/lib/$(outdir) $(include-flower) $(depth)/flower/$(outdir) +LILYPOND_INCLUDES = -Istinho $(include-lib) $(depth)/lib/$(outdir) $(include-flower) $(depth)/flower/$(outdir) # should use to create .spec ? diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index a5f9487ed2..f912908583 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -1,5 +1,5 @@ -export PATH:=$(topdir)/lily/out:$(topdir)/$(buildscripts)/out:$(PATH) +export PATH:=$(topdir)/lily/out:$(topdir)/buildscripts/out:$(PATH) export MFINPUTS:=$(topdir)/mf/$(PATHSEP)$(MFINPUTS)$(PATHSEP)$(PATHSEP) export TEXINPUTS:=$(topdir)/tex/$(PATHSEP)$(TEXINPUTS)$(PATHSEP)$(PATHSEP) export LILYINCLUDE:=$(topdir)/init$(PATHSEP)$(topdir)/mf/out$(PATHSEP)$(LILYINCLUDE) diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index ed8060fcfa..244a80801f 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -31,8 +31,8 @@ strip lily/out/lilypond mi2mu/out/mi2mu make prefix="$RPM_BUILD_ROOT/usr" install mkdir -p $RPM_BUILD_ROOT/etc/profile.d -cp bin/out/lilypond-profile $RPM_BUILD_ROOT/etc/profile.d/lilypond.sh -cp bin/out/lilypond-login $RPM_BUILD_ROOT/etc/profile.d/lilypond.csh +cp buildscripts/out/lilypond-profile $RPM_BUILD_ROOT/etc/profile.d/lilypond.sh +cp buildscripts/out/lilypond-login $RPM_BUILD_ROOT/etc/profile.d/lilypond.csh %files diff --git a/make/mudela-rules.make b/make/mudela-rules.make index f2e39d714f..5a7d8ef670 100644 --- a/make/mudela-rules.make +++ b/make/mudela-rules.make @@ -7,5 +7,5 @@ $(outdir)/%.dvi: $(outdir)/%.mudtex mv $(notdir $@) $(outdir) $(outdir)/%.mudtex: %.doc - $(PYTHON) $(depth)/$(scripts)/mudela-book.py --outdir=$(outdir)/ --outname=$(notdir $@) $< + $(PYTHON) $(depth)/scripts/mudela-book.py --outdir=$(outdir)/ --outname=$(notdir $@) $< diff --git a/make/mutopia-rules.make b/make/mutopia-rules.make index 22d9e63c67..74072fb462 100644 --- a/make/mutopia-rules.make +++ b/make/mutopia-rules.make @@ -23,9 +23,9 @@ $(outdir)/%.fly.txt: %.fly .PRECIOUS: $(outdir)/%.dvi $(outdir)/%.dvi: %.ly - $(PYTHON) $(depth)/$(scripts)/ly2dvi.py -o $(outdir) $< + $(PYTHON) $(depth)/scripts/ly2dvi.py -o $(outdir) $< -mv $(basename $<).midi $(outdir) $(outdir)/%.dvi: %.fly - $(PYTHON) $(depth)/$(scripts)/ly2dvi.py -o $(outdir) $< + $(PYTHON) $(depth)/scripts/ly2dvi.py -o $(outdir) $< -mv $(basename $<).midi $(outdir) diff --git a/make/mutopia-targets.make b/make/mutopia-targets.make index be5aa37fde..11b4a35299 100644 --- a/make/mutopia-targets.make +++ b/make/mutopia-targets.make @@ -12,4 +12,4 @@ convert-mudela: local-convert-mudela $(LOOP) local-convert-mudela: - $(PYTHON) $(depth)/$(scripts)/convert-mudela.py -e *ly + $(PYTHON) $(depth)/scripts/convert-mudela.py -e *ly diff --git a/make/out/lelievijver.lsm b/make/out/lelievijver.lsm index 0979341e1a..c13526cc6c 100644 --- a/make/out/lelievijver.lsm +++ b/make/out/lelievijver.lsm @@ -1,15 +1,15 @@ Begin3 Titel: LilyPond -Versie: 1.1.0 -Inschrijf datum: 23OCT98 +Versie: 1.1.1 +Inschrijf datum: 02NOV98 Beschrijving: @FLAPTEKST@ Trefwoorden: muziek typezetten midi notatie Auteur: hanwen@stack.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys) Voornaamste plek: sunsite.unc.edu /pub/Linux/apps - 770k lilypond-1.1.0.tar.gz + 770k lilypond-1.1.1.tar.gz Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.0.tar.gz + 770k lilypond-1.1.1.tar.gz Copi-eer voorwaarden: GPL End diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 2d97b83a71..a569d897c2 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,7 +1,7 @@ Begin3 Title: LilyPond -Version: 1.1.0 -Entered-date: 23OCT98 +Version: 1.1.1 +Entered-date: 02NOV98 Description: LilyPond is the GNU Project music typesetter. This program can print beautiful sheet music from a music definition file. It can also play @@ -14,8 +14,8 @@ Author: hanwen@cs.ruu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 770k lilypond-1.1.0.tar.gz + 770k lilypond-1.1.1.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.0.tar.gz + 770k lilypond-1.1.1.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 34f9660243..2eff8ff87e 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.1.0 +Version: 1.1.1 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.0.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.1.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl> diff --git a/make/toplevel.make.in b/make/toplevel.make.in index e60960ffcb..ae6073e89c 100644 --- a/make/toplevel.make.in +++ b/make/toplevel.make.in @@ -8,9 +8,9 @@ depth = . # descent order into subdirectories: # -SUBDIRS = bin flower lib lily mf mi2mu po debian \ +SUBDIRS = scripts buildscripts flower lib lily mf mi2mu po debian \ Documentation init input tex make mutopia test intl stepmake\ - ps + ps # SCRIPTS = configure aclocal.m4 diff --git a/bin/GNUmakefile b/scripts/GNUmakefile index b954530259..b954530259 100644 --- a/bin/GNUmakefile +++ b/scripts/GNUmakefile diff --git a/bin/convert-mudela.py b/scripts/convert-mudela.py index ee6d05a229..f8b10a9080 100644 --- a/bin/convert-mudela.py +++ b/scripts/convert-mudela.py @@ -14,7 +14,7 @@ # - rewrite in python program_name = 'convert-mudela' -version = '0.3' +version = '0.4' import os @@ -319,6 +319,10 @@ def do_one_file (infile_name): outfile.close () if __main__.edit: + try: + os.remove(infile_name + '~') + except: + pass os.rename (infile_name, infile_name + '~') os.rename (infile_name + '.NEW', infile_name) diff --git a/bin/ly2dvi-old.sh b/scripts/ly2dvi-old.sh index b2e0330aaa..b2e0330aaa 100644 --- a/bin/ly2dvi-old.sh +++ b/scripts/ly2dvi-old.sh diff --git a/bin/ly2dvi.py b/scripts/ly2dvi.py index 943aef7bec..287fa5ad21 100644 --- a/bin/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -444,14 +444,14 @@ class Properties: t='' if os.environ.has_key ('TEXINPUTS'): t = os.pathsep + os.environ['TEXINPUTS'] - os.environ['TEXINPUTS'] = os.path.join(this.get('root'), 'texmf', - 'tex', 'lilypond' ) + t + os.environ['TEXINPUTS'] = os.path.join(this.get('root'), 'share', + 'lilypond', 'tex' ) + t t='' if os.environ.has_key ('MFINPUTS'): t = os.pathsep + os.environ['MFINPUTS'] - os.environ['MFINPUTS'] = os.path.join(this.get('root'), 'texmf', - 'mf', 'public', 'lilypond' ) + t + os.environ['MFINPUTS'] = os.path.join(this.get('root'), 'share', + 'lilypond', 'mf' ) + t if os.environ.has_key('TMP'): this.__set('tmp',os.environ['TMP'],'environment') @@ -505,8 +505,8 @@ class Properties: """ if os.name == 'nt': - path = os.path.join(this.get('root'), 'texmf', 'tex', - 'lilypond', var) + path = os.path.join(this.get('root'), 'share', 'lilypond', + 'tex', var) else: path ='' cmd =('kpsewhich tex %s %s' % (var,errorlog)) @@ -514,8 +514,8 @@ class Properties: path = pipe.readline ()[:-1] # chop off \n return_status = pipe.close() if return_status and not path: - path = os.path.join(this.get('root'), 'texmf', 'tex', - 'lilypond', var) + path = os.path.join(this.get('root'), 'share', 'lilypond', + 'tex', var) fd = open(path, 'r') return fd @@ -554,7 +554,7 @@ class Properties: else: # Windows apps like edit choke on .lilyrc dotFilename='_lilyrc' - for d in [os.path.join(this.get('root'),'share','lilypond'), \ + for d in [os.path.join(this.get('root'),'share','lilypond','ly'), \ os.environ['HOME'], os.curdir ]: file=os.path.join(d,dotFilename) try: @@ -876,8 +876,7 @@ class Properties: def getLilyopts(): inc = '' if len(Props.get('include')) > 0: - # inc = '-I ' + string.join(Props.get('include'), os.pathsep ()) - inc = '-I ' + string.join(Props.get('include'), " -I ") + inc = '-I ' + string.join(Props.get('include'),os.pathsep) else: if Props.get('dependencies'): @@ -903,7 +902,7 @@ def writeLilylog(contents): def getTeXFile(contents): texfiles=[] for line in string.split(contents,'\n'): - m = re.search('^TeX output to (.+)\.\.\.', line) + m = re.search('^Paper output to (.+)\.\.\.', line) if m: texfiles.append(m.group(1)) diff --git a/bin/mudela-book.py b/scripts/mudela-book.py index 3faa60d238..3faa60d238 100644 --- a/bin/mudela-book.py +++ b/scripts/mudela-book.py diff --git a/stepmake/NEWS b/stepmake/NEWS index 7e0a1e72bf..61039414f6 100644 --- a/stepmake/NEWS +++ b/stepmake/NEWS @@ -1,3 +1,6 @@ +pl 60 + - small fixes. + pl 59 - bf: package-diff (remove missing automatic) - install templates, (urg) INSTALL*1,2 INSTALL_OUT*1,2 diff --git a/stepmake/bin/package-zip32.sh b/stepmake/bin/package-zip32.sh index e299418333..45574a1824 100644 --- a/stepmake/bin/package-zip32.sh +++ b/stepmake/bin/package-zip32.sh @@ -40,10 +40,7 @@ distdir=/tmp/${name} rm -f ${srcdir}/config.cache PYTHON=${PYTHON:-python} ${srcdir}/configure --prefix=${distdir} \ - --srcdir=${srcdir} \ - --enable-tex-prefix=${distdir}/texmf \ - --enable-tex-dir=${distdir}/texmf/tex \ - --enable-mf-dir=${distdir}/texmf/mf + --srcdir=${srcdir} if ! make ; then echo "make failed" @@ -80,7 +77,7 @@ cp $CYGWIN_LIB $distdir/bin # # Rename python files to <filename>.py # -mv $distdir/bin/ly2dvi32 $distdir/bin/ly2dvi.py +mv $distdir/bin/ly2dvi $distdir/bin/ly2dvi.py mv $distdir/bin/convert-mudela $distdir/bin/convert-mudela.py mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py @@ -89,7 +86,7 @@ mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py # mkdir $distdir/doc cp Documentation/man/out/*.txt $distdir/doc -mv $distdir/doc/ly2dvi32.txt $distdir/doc/ly2dvi_py.txt +mv $distdir/doc/ly2dvi32.txt $distdir/doc/ly2dvi.txt cd $distdir/.. $ZIP_CMD $ZIP_FILE $name echo "Wrote $ZIP_FILE" diff --git a/stepmake/stepmake/c++-vars.make b/stepmake/stepmake/c++-vars.make index d4b8c470d9..70b59f7e5b 100644 --- a/stepmake/stepmake/c++-vars.make +++ b/stepmake/stepmake/c++-vars.make @@ -19,8 +19,8 @@ INL_FILES := $(wildcard *.icc) YY_FILES := $(wildcard *.yy) LL_FILES := $(wildcard *.ll) -SOURCE_FILES+=$(YY_FILES) $(CC_FILES) $(INL_FILES) $(TCC_FILES) $(HH_FILES) $(LL_FILES) -O_FILES+=$(addprefix $(outdir)/, $(YY_FILES:.yy=.o) $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o)) +SOURCE_FILES+= $(CC_FILES) $(YY_FILES) $(INL_FILES) $(TCC_FILES) $(HH_FILES) $(LL_FILES) +O_FILES+=$(addprefix $(outdir)/, $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o) $(YY_FILES:.yy=.o)) TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES) diff --git a/stepmake/stepmake/executable-vars.make b/stepmake/stepmake/executable-vars.make index 0448ee8fc6..1c1209d3a5 100644 --- a/stepmake/stepmake/executable-vars.make +++ b/stepmake/stepmake/executable-vars.make @@ -1,5 +1,5 @@ # empty LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) $($(PACKAGE)_LDFLAGS) -MODULE_LIBES=$(addsuffix /$(outdir)/library.a, $(MODULE_LIBS)) +MODULE_LIBES := $(addsuffix /$(outdir)/library.a, $(MODULE_LIBS)) $(MODULE_LIBES) LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES) diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make index 811dd0d3a2..5f8b78d86e 100644 --- a/stepmake/stepmake/generic-vars.make +++ b/stepmake/stepmake/generic-vars.make @@ -84,7 +84,7 @@ date := $(shell date +%x) #duplicated? # ARFLAGS = ru -INCLUDES = include $(outdir) $($(PACKAGE)_INCLUDES) +INCLUDES = include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES) # urg: for windows ? # LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES) -lstdc++ diff --git a/stepmake/stepmake/metafont-targets.make b/stepmake/stepmake/metafont-targets.make index bb2cad423c..5f142738b9 100644 --- a/stepmake/stepmake/metafont-targets.make +++ b/stepmake/stepmake/metafont-targets.make @@ -7,4 +7,4 @@ dvi: $(DVI_FILES) pks: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.$(XPM_RESOLUTION)pk)) xpms: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.afm)) pks - $(SHELL) $(depth)/$(buildscripts)/mf-to-xpms.sh $(XPM_FONTS) + $(SHELL) $(depth)/buildscripts/mf-to-xpms.sh $(XPM_FONTS) diff --git a/stepmake/stepmake/metapost-rules.make b/stepmake/stepmake/metapost-rules.make index f72cb62963..a33b8cdd52 100644 --- a/stepmake/stepmake/metapost-rules.make +++ b/stepmake/stepmake/metapost-rules.make @@ -6,7 +6,7 @@ $(outdir)/%.pfa: %.mf # to the metapost mfplain guru, really does 200dpi, iso 600dpi (minimun) -$(METAPOST) "&mfplain \mode=lowres; \mag=100.0; batchmode; input $<" # -$(METAPOST) "&mfmp \mode=ljfour; \mag=100.0; batchmode; input $<" - $(PYTHON) $(depth)/$(buildscripts)/ps-to-pfa.py $< + $(PYTHON) $(depth)/buildscripts/ps-to-pfa.py $< rm -f $(basename $(@F)).[0-9]* rm -f $(basename $<).log $(basename $<).tfm |