From 31653bf1d61a33ef8bc8c871d60c6b3452d04d28 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 2 Nov 1998 16:25:15 +0100 Subject: [PATCH] release: 1.1.1 --- Documentation/faq.yo | 2 +- Documentation/ntweb/index.yo | 11 ++-- Documentation/tex/GNUmakefile | 8 +-- Documentation/topdocs/INSTALL.yo | 10 ++-- Documentation/topdocs/index.yo | 1 - NEWS | 48 ++++++++++++------ PATCHES.txt | 10 +++- TODO | 14 +++--- VERSION | 4 +- buildscripts/GNUmakefile | 12 +++++ {bin => buildscripts}/clean-diaper.sh | 0 {bin => buildscripts}/clean-fonts.sh | 0 {bin => buildscripts}/docxx-lily.sh | 0 {bin => buildscripts}/find-typenames.pl | 0 {bin => buildscripts}/gen-sitemap.sh | 0 {bin => buildscripts}/genheader.py | 0 {bin => buildscripts}/html-accents.py | 0 {bin => buildscripts}/lilypond-login.sh | 0 {bin => buildscripts}/lilypond-profile.sh | 0 {bin => buildscripts}/localpackage.py | 0 {bin => buildscripts}/ltmain.sh | 0 {bin => buildscripts}/mail-address.sh | 0 {bin => buildscripts}/mf-to-table.py | 0 {bin => buildscripts}/mf-to-xpms.sh | 0 {bin => buildscripts}/mutopia-index.py | 0 {bin => buildscripts}/profile-conf.sh | 0 {bin => buildscripts}/ps-to-gifs.sh | 0 {bin => buildscripts}/ps-to-pngs.sh | 0 {bin => buildscripts}/run-lilypond.sh | 0 {bin => buildscripts}/set-lily.sh | 6 +-- {bin => buildscripts}/show-current.sh | 0 {bin => buildscripts}/template.py | 0 flower/axis.cc | 2 +- flower/include/array.hh | 17 +++++-- flower/include/dictionary.hh | 2 +- flower/include/vector.hh | 1 + flower/include/virtual-methods.hh | 61 +++++++++++++++++------ lily/GNUmakefile | 10 +++- lily/abbrev.cc | 2 +- lily/abbreviation-beam-engraver.cc | 13 ++--- lily/atom.cc | 8 ++- lily/audio-item.cc | 2 +- lily/auto-plet-engraver.cc | 16 +++--- lily/axis-group-element.cc | 7 --- lily/axis-group-item.cc | 2 +- lily/axis-group-spanner.cc | 21 ++++---- lily/bar-column-engraver.cc | 15 +++--- lily/bar-column.cc | 2 +- lily/bar-engraver.cc | 18 ++++--- lily/bar-number-engraver.cc | 8 ++- lily/beam-engraver.cc | 12 ++--- lily/beam.cc | 5 +- lily/chord-iterator.cc | 2 +- lily/clef-engraver.cc | 47 ++++++++--------- lily/collision-engraver.cc | 3 +- lily/collision.cc | 9 +++- lily/command-request.cc | 16 +++--- lily/dot-column-engraver.cc | 7 +-- lily/dot-column.cc | 11 ++-- lily/dynamic-engraver.cc | 37 ++++++-------- lily/engraver.cc | 2 +- lily/hara-kiri-line-group-engraver.cc | 9 ++-- lily/hara-kiri-vertical-group-spanner.cc | 6 +-- lily/head-engraver.cc | 11 ++-- lily/heads-engraver.cc | 17 +++---- lily/identifier.cc | 8 +-- lily/include/atom.hh | 8 ++- lily/include/axis-group-element.hh | 1 - lily/include/command-request.hh | 13 ----- lily/include/engraver.hh | 1 - lily/include/graphical-element.hh | 2 - lily/include/identifier.hh | 10 ++-- lily/include/item.hh | 1 - lily/include/lily-guile.hh | 3 ++ lily/include/lyric-performer.hh | 12 ++--- lily/include/music-list.hh | 1 - lily/include/musical-request.hh | 22 +------- lily/include/performer.hh | 1 - lily/include/protected-scm.hh | 30 +++++++++++ lily/include/request.hh | 14 ------ lily/include/score-element.hh | 10 ---- lily/include/span-bar.hh | 1 - lily/include/spanner.hh | 1 - lily/include/spring-spacer.hh | 5 +- lily/include/timing-engraver.hh | 1 - lily/include/translator-group.hh | 3 -- lily/include/translator.hh | 3 -- lily/include/type-swallow-trans.hh | 5 +- lily/item.cc | 13 ++--- lily/key-engraver.cc | 24 ++++----- lily/key-performer.cc | 14 +++--- lily/lexer.ll | 9 ++-- lily/lily-guile.cc | 1 + lily/local-key-engraver.cc | 15 +++--- lily/lookup.cc | 26 +++++----- lily/lyric-engraver.cc | 12 ++--- lily/lyric-performer.cc | 24 +++------ lily/main.cc | 23 +++++---- lily/mark-engraver.cc | 13 +++-- lily/midi-item.cc | 1 + lily/midi-walker.cc | 12 ++--- lily/multi-measure-rest-engraver.cc | 26 +++++----- lily/music-iterator.cc | 14 +++--- lily/music-list.cc | 6 +-- lily/music-output-def.cc | 8 +-- lily/music-sequence.cc | 2 - lily/musical-request.cc | 15 +++--- lily/my-lily-lexer.cc | 4 +- lily/my-lily-parser.cc | 8 ++- lily/note-column.cc | 18 +++---- lily/note-performer.cc | 23 ++++----- lily/p-score.cc | 7 ++- lily/paper-def.cc | 8 +-- lily/paper-outputter.cc | 3 +- lily/parser.yy | 50 +++++++++---------- lily/performer.cc | 2 +- lily/pitch-squash-engraver.cc | 5 +- lily/plet-engraver.cc | 8 +-- lily/plet-spanner.cc | 2 +- lily/plet-swallow-engraver.cc | 2 +- lily/priority-halign-engraver.cc | 2 +- lily/protected-scm.cc | 52 +++++++++++++++++++ lily/request-iterator.cc | 13 +++-- lily/request.cc | 9 +--- lily/rest-collision-engraver.cc | 4 +- lily/rest-collision.cc | 11 ++-- lily/rest-engraver.cc | 14 +++--- lily/rhythmic-column-engraver.cc | 8 +-- lily/rhythmic-head.cc | 2 +- lily/score-element.cc | 12 +++-- lily/score-engraver.cc | 33 ++++++------ lily/score-performer.cc | 6 +-- lily/score-priority-engraver.cc | 2 +- lily/score.cc | 2 +- lily/script-column.cc | 6 ++- lily/script-def.cc | 4 +- lily/script-engraver.cc | 2 +- lily/script.cc | 2 +- lily/separating-group-spanner.cc | 7 ++- lily/separating-line-group-engraver.cc | 4 +- lily/single-malt-grouping-item.cc | 3 +- lily/slur-engraver.cc | 15 +++--- lily/slur.cc | 4 +- lily/span-bar-engraver.cc | 8 +-- lily/span-bar.cc | 6 --- lily/span-score-bar-engraver.cc | 2 +- lily/spanner.cc | 6 --- lily/spring-spacer.cc | 10 ++-- lily/staff-margin-engraver.cc | 2 +- lily/staff-performer.cc | 2 +- lily/stem-engraver.cc | 4 +- lily/stem.cc | 4 +- lily/symtable.cc | 6 +-- lily/text-def.cc | 4 +- lily/text-item.cc | 8 +-- lily/tie.cc | 2 +- lily/ties-engraver.cc | 8 +-- lily/time-signature-engraver.cc | 4 +- lily/timing-translator.cc | 47 +++++++++-------- lily/type-swallow-trans.cc | 6 +-- lily/vertical-align-engraver.cc | 2 +- make/generic-vars.make | 7 ++- make/lilypond-vars.make | 2 +- make/lilypond.spec.in | 4 +- make/mudela-rules.make | 2 +- make/mutopia-rules.make | 4 +- make/mutopia-targets.make | 2 +- make/out/lelievijver.lsm | 8 +-- make/out/lilypond.lsm | 8 +-- make/out/lilypond.spec | 4 +- make/toplevel.make.in | 4 +- {bin => scripts}/GNUmakefile | 0 {bin => scripts}/convert-mudela.py | 6 ++- {bin => scripts}/ly2dvi-old.sh | 0 {bin => scripts}/ly2dvi.py | 23 ++++----- {bin => scripts}/mudela-book.py | 0 stepmake/NEWS | 3 ++ stepmake/bin/package-zip32.sh | 9 ++-- stepmake/stepmake/c++-vars.make | 4 +- stepmake/stepmake/executable-vars.make | 2 +- stepmake/stepmake/generic-vars.make | 2 +- stepmake/stepmake/metafont-targets.make | 2 +- stepmake/stepmake/metapost-rules.make | 2 +- 183 files changed, 789 insertions(+), 738 deletions(-) create mode 100644 buildscripts/GNUmakefile rename {bin => buildscripts}/clean-diaper.sh (100%) mode change 100644 => 100755 rename {bin => buildscripts}/clean-fonts.sh (100%) mode change 100644 => 100755 rename {bin => buildscripts}/docxx-lily.sh (100%) rename {bin => buildscripts}/find-typenames.pl (100%) rename {bin => buildscripts}/gen-sitemap.sh (100%) rename {bin => buildscripts}/genheader.py (100%) rename {bin => buildscripts}/html-accents.py (100%) rename {bin => buildscripts}/lilypond-login.sh (100%) rename {bin => buildscripts}/lilypond-profile.sh (100%) rename {bin => buildscripts}/localpackage.py (100%) rename {bin => buildscripts}/ltmain.sh (100%) rename {bin => buildscripts}/mail-address.sh (100%) rename {bin => buildscripts}/mf-to-table.py (100%) rename {bin => buildscripts}/mf-to-xpms.sh (100%) rename {bin => buildscripts}/mutopia-index.py (100%) rename {bin => buildscripts}/profile-conf.sh (100%) rename {bin => buildscripts}/ps-to-gifs.sh (100%) mode change 100644 => 100755 rename {bin => buildscripts}/ps-to-pngs.sh (100%) mode change 100644 => 100755 rename {bin => buildscripts}/run-lilypond.sh (100%) rename {bin => buildscripts}/set-lily.sh (87%) mode change 100644 => 100755 rename {bin => buildscripts}/show-current.sh (100%) rename {bin => buildscripts}/template.py (100%) create mode 100644 lily/include/protected-scm.hh create mode 100644 lily/protected-scm.cc rename {bin => scripts}/GNUmakefile (100%) rename {bin => scripts}/convert-mudela.py (99%) rename {bin => scripts}/ly2dvi-old.sh (100%) rename {bin => scripts}/ly2dvi.py (98%) rename {bin => scripts}/mudela-book.py (100%) 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. ) diff --git a/NEWS b/NEWS index 577495b195..c11ce8fd55 100644 --- a/NEWS +++ b/NEWS @@ -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 .. diff --git a/TODO b/TODO index e22c3f60e8..b22fe9a244 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/VERSION b/VERSION index ea9afb6b71..deeabc172b 100644 --- a/VERSION +++ b/VERSION @@ -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 old mode 100644 new mode 100755 similarity index 100% rename from bin/clean-diaper.sh rename to buildscripts/clean-diaper.sh diff --git a/bin/clean-fonts.sh b/buildscripts/clean-fonts.sh old mode 100644 new mode 100755 similarity index 100% rename from bin/clean-fonts.sh rename to buildscripts/clean-fonts.sh diff --git a/bin/docxx-lily.sh b/buildscripts/docxx-lily.sh similarity index 100% rename from bin/docxx-lily.sh rename to buildscripts/docxx-lily.sh diff --git a/bin/find-typenames.pl b/buildscripts/find-typenames.pl similarity index 100% rename from bin/find-typenames.pl rename to buildscripts/find-typenames.pl diff --git a/bin/gen-sitemap.sh b/buildscripts/gen-sitemap.sh similarity index 100% rename from bin/gen-sitemap.sh rename to buildscripts/gen-sitemap.sh diff --git a/bin/genheader.py b/buildscripts/genheader.py similarity index 100% rename from bin/genheader.py rename to buildscripts/genheader.py diff --git a/bin/html-accents.py b/buildscripts/html-accents.py similarity index 100% rename from bin/html-accents.py rename to buildscripts/html-accents.py diff --git a/bin/lilypond-login.sh b/buildscripts/lilypond-login.sh similarity index 100% rename from bin/lilypond-login.sh rename to buildscripts/lilypond-login.sh diff --git a/bin/lilypond-profile.sh b/buildscripts/lilypond-profile.sh similarity index 100% rename from bin/lilypond-profile.sh rename to buildscripts/lilypond-profile.sh diff --git a/bin/localpackage.py b/buildscripts/localpackage.py similarity index 100% rename from bin/localpackage.py rename to buildscripts/localpackage.py diff --git a/bin/ltmain.sh b/buildscripts/ltmain.sh similarity index 100% rename from bin/ltmain.sh rename to buildscripts/ltmain.sh diff --git a/bin/mail-address.sh b/buildscripts/mail-address.sh similarity index 100% rename from bin/mail-address.sh rename to buildscripts/mail-address.sh diff --git a/bin/mf-to-table.py b/buildscripts/mf-to-table.py similarity index 100% rename from bin/mf-to-table.py rename to buildscripts/mf-to-table.py diff --git a/bin/mf-to-xpms.sh b/buildscripts/mf-to-xpms.sh similarity index 100% rename from bin/mf-to-xpms.sh rename to buildscripts/mf-to-xpms.sh diff --git a/bin/mutopia-index.py b/buildscripts/mutopia-index.py similarity index 100% rename from bin/mutopia-index.py rename to buildscripts/mutopia-index.py diff --git a/bin/profile-conf.sh b/buildscripts/profile-conf.sh similarity index 100% rename from bin/profile-conf.sh rename to buildscripts/profile-conf.sh diff --git a/bin/ps-to-gifs.sh b/buildscripts/ps-to-gifs.sh old mode 100644 new mode 100755 similarity index 100% rename from bin/ps-to-gifs.sh rename to buildscripts/ps-to-gifs.sh diff --git a/bin/ps-to-pngs.sh b/buildscripts/ps-to-pngs.sh old mode 100644 new mode 100755 similarity index 100% rename from bin/ps-to-pngs.sh rename to buildscripts/ps-to-pngs.sh diff --git a/bin/run-lilypond.sh b/buildscripts/run-lilypond.sh similarity index 100% rename from bin/run-lilypond.sh rename to buildscripts/run-lilypond.sh diff --git a/bin/set-lily.sh b/buildscripts/set-lily.sh old mode 100644 new mode 100755 similarity index 87% rename from bin/set-lily.sh rename to buildscripts/set-lily.sh index c85a44b8e3..d44317dc8e --- 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 similarity index 100% rename from bin/show-current.sh rename to buildscripts/show-current.sh diff --git a/bin/template.py b/buildscripts/template.py similarity index 100% rename from bin/template.py rename to 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 */ 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 *) this)->elem (k); + return ((Dictionary *) 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() { return dat; } + Array 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 #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 (n) : 0; + stem_l_ = dynamic_cast (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 (r); - if (!mus_l) - return false; - - Abbreviation_beam_req * b = dynamic_cast (mus_l); + Abbreviation_beam_req * b = dynamic_cast (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 (i.elem_l_); + if (!abeam_p_ || !s) return; - Stem* s = (Stem*)dynamic_cast (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 */ - #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 (r); - if (!(c && - dynamic_cast (c))) + if (Bracket_req * b = dynamic_cast (r)) { - return false; + bracket_req_arr_.push (b); + return true; } - - Bracket_req * b = dynamic_cast (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 (i.elem_l_)) { - Note_column *nc = (Note_column*)dynamic_cast (i.elem_l_); + for (int j =0; 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 (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 (elt)) + Spanner * sp =dynamic_cast (elt); + Item *it = dynamic_cast (elt) ; + if (sp) { - Spanner * sp = dynamic_cast (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(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(my_broken_l)->line_l()); if (broken_span_l) my_broken_l->add_element (broken_span_l); } } - else if (dynamic_cast (elt) - && dynamic_cast (elt)->breakable_b_ - && dynamic_cast (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 (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(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 (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 Bar_column_engraver::Bar_column_engraver() { @@ -55,22 +56,24 @@ Bar_column_engraver::acknowledge_element (Score_element_info info) Item * it = dynamic_cast (info.elem_l_); if (!it) return; - - if (it->is_type_b (Script::static_name()) + Script *s = dynamic_cast (it); + Bar *b = dynamic_cast (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 (n) : 0; + bar_l_ = dynamic_cast (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 (r_l); - if (!c_l|| !dynamic_cast (c_l)) - return false; - Bar_req * b= dynamic_cast (c_l); - if (bar_req_l_ && bar_req_l_->equal_b (b)) - return false; + if (Bar_req * b= dynamic_cast (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 (i.elem_l_); - if (script_p_ - || !it || !it->is_type_b (Bar::static_name())) + Bar *b =dynamic_cast (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 (r); - if (!mus_l) - return false; - - Beam_req* b = dynamic_cast (mus_l); + Beam_req* b = dynamic_cast (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 (i.elem_l_); + if (!beam_p_ || !s) return; - Stem* s = (Stem*)dynamic_cast (i.elem_l_); if (!dynamic_cast (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 (o), n? (Stem*) dynamic_cast (n):0); + if (Stem * os = dynamic_cast (o)) + stems_.substitute (os, + dynamic_cast (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(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 (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(it_l)) + { + h->position_i_ += c0_position_i_; + } + else if (Local_key_item *i = dynamic_cast (it_l)) + { + i->c0_position_i_ =c0_position_i_; + } + else if (Key_item *k = dynamic_cast(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 (r_l); - if (!creq_l || !dynamic_cast (creq_l)) + if (Clef_change_req *cl = dynamic_cast (r_l)) + { + clef_req_l_ = cl; + read_req (clef_req_l_); + return true; + } + else return false; - clef_req_l_ = dynamic_cast (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 (i.elem_l_)) { - Note_column * c = (Note_column*) dynamic_cast (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 (o_l), - (Note_column*)(n_l?dynamic_cast (n_l):0)); + if (o_l) + { + clash_l_arr_.substitute (dynamic_cast (o_l), + dynamic_cast (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 (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 (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 (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 (r); + return r; } @@ -152,7 +152,7 @@ Time_signature_change_req::do_equal_b (Request * r) const { Time_signature_change_req * m = dynamic_cast (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 (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 (info.elem_l_); - - if (! (i && i->is_type_b (Rhythmic_head::static_name ()))) + Rhythmic_head * h = dynamic_cast(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 (o); - Item *ni = n?dynamic_cast (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 (oi)) + head_l_arr_.substitute (dynamic_cast (oi), + dynamic_cast(n)); + else if (oi && dynamic_cast (oi)) + dot_l_arr_.substitute (dynamic_cast (oi), + dynamic_cast (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 (r); - if (!m) - return false; - Dynamic_req * d = dynamic_cast (m); - if (!d) - return false; - -#if 0 - if (cresc_p_ && dynamic_cast (d) - && dynamic_cast (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 (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 (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 (dreq_l)) + if (Absolute_dynamic_req *absd = dynamic_cast (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 (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 (dreq_l)) + else if (Span_dynamic_req *span_l = dynamic_cast (dreq_l)) { - Span_dynamic_req* span_l = dynamic_cast (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 (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 (daddy_trans_l_) + ? dynamic_cast (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 (e)); - + if (Note_head *h = dynamic_cast (e)) + { + dynamic_cast (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 (o), - (n)? (Note_head*)dynamic_cast (n) : 0); + if (dynamic_cast (o)) + head_l_arr_.substitute (dynamic_cast (o), + (n)? dynamic_cast (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 (req_l))) - return false; - - note_req_l_=dynamic_cast (req_l); - return true; + if (Note_req * nr = dynamic_cast (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 (req_l)) - return false; - - Note_req * n =dynamic_cast (req_l); - if (!n) - return false; - - note_req_l_arr_.push (n); - return true; + if (Note_req * n =dynamic_cast (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_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 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 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 args_arr); SCM lambda_scm (String str, Array 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 lreq_arr_; + Array 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 + + */ + +#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 ideal_p_list_; Array cols_; Array loose_col_arr_; - Array 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 (l->axis_group_l_a_[X_AXIS]); - while (!r->is_type_b (Paper_column::static_name ())) - r = dynamic_cast (r->axis_group_l_a_[X_AXIS]); + while (!(dynamic_cast (l))) + l = dynamic_cast (l->axis_group_l_a_[X_AXIS]); + while (!(dynamic_cast (r))) + r = dynamic_cast (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 (req_l); - if (!creq_l|| !dynamic_cast (creq_l)) - return false; - - if (keyreq_l_) - return false; // TODO - keyreq_l_ = dynamic_cast (creq_l); - read_req (keyreq_l_); - return true; + if (Key_change_req *kc = dynamic_cast (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 (info.req_l_) ; - - if (r_l && dynamic_cast (r_l)) + if (dynamic_cast (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 (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 (req_l)) + if (Key_change_req *kc = dynamic_cast (req_l)) { - key_req_l_ = dynamic_cast (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 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 (result))->key_; + key_C_ = &(dynamic_cast (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 (elem_l); - Note_req * note_l = dynamic_cast (info.req_l_); - - if (note_l && item_l && item_l->is_type_b (Note_head::static_name ())) + Note_head * note_head = dynamic_cast (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 (info.req_l_)) { local_key_ = *key_C_; } - else if (elem_l->is_type_b (Tie::static_name ())) + else if (Tie * tie_l = dynamic_cast (info.elem_l_)) { - Tie * tie_l = (Tie*)dynamic_cast (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 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 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 controls, Real thick, Real dash) const a.dim_[Y_AXIS] = Interval (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 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 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 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 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 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 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); @@ -428,7 +428,7 @@ Lookup::vbracket (Real &y) const } Array 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 (r); - if (!m || ! dynamic_cast (m)) - return false; - lreq_l_ = dynamic_cast (m); - - return true; + if (Lyric_req * lr = dynamic_cast (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 (req_l); - if (!m_l || ! dynamic_cast (m_l)) - return false; - lreq_arr_.push (dynamic_cast (m_l)); - - return true; + if (Lyric_req *lr = dynamic_cast (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 (r_l); - if (!c_l || !dynamic_cast (c_l) || mark_req_l_) - return false; - - mark_req_l_ = dynamic_cast (c_l); - - return true; + if (Mark_req *mr = dynamic_cast (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_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(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 (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 (req_l); - req_start_mom_ = now_moment (); + if (Multi_measure_rest_req *mr = dynamic_cast (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 (m)) p = new Request_chord_iterator; - else if (m->is_type_b (Simultaneous_music::static_name())) + else if (dynamic_cast (m)) p = new Simultaneous_music_iterator; - else if (m->is_type_b (Sequential_music::static_name())) + else if (dynamic_cast (m)) p = new Sequential_music_iterator; - else if (m->is_type_b (Translation_property::static_name ())) + else if (dynamic_cast (m)) p = new Property_iterator; - else if (m->is_type_b (Change_translator::static_name ())) + else if (dynamic_cast (m)) p = new Change_iterator; - else if (m->is_type_b (Compressed_music::static_name ())) + else if (dynamic_cast (m)) p = new Compressed_music_iterator; - else if (m->is_type_b (Music_wrapper::static_name ())) + else if (dynamic_cast (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 (i.ptr ()); - if (m && dynamic_cast (m)) + if (Melodic_req *m= dynamic_cast (i.ptr ())) { - Musical_pitch &pit = dynamic_cast (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 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 (t)->global_l (); + Global_translator *g = dynamic_cast (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 (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 (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 (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 (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 (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 (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 (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 (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* 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 (n):0; + stem_l_ = n ? dynamic_cast (n):0; } - if (o->is_type_b (Note_head::static_name ())) + if (dynamic_cast (o)) { - head_l_arr_.substitute ((Note_head*)dynamic_cast (o), - (n)? (Note_head*)dynamic_cast (n) : 0); + head_l_arr_.substitute (dynamic_cast (o), + (n)? dynamic_cast (n) : 0); } Script_column::do_substitute_dependency (o,n); - if (o->is_type_b (Rest::static_name ())) + if (dynamic_cast (o)) { - rest_l_arr_.substitute ((Rest*)dynamic_cast (o), - (n)? (Rest*)dynamic_cast (n) : 0); + rest_l_arr_.substitute (dynamic_cast (o), + (n)? dynamic_cast (n) : 0); } } void Note_column::add_head (Rhythmic_head *h) { - if (h->is_type_b (Rest::static_name ())) + if (dynamic_cast (h)) { rest_l_arr_.push ((Rest*)h); add_support (h); } - if (h->is_type_b (Note_head::static_name ())) + if (dynamic_cast (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 (note_req_l_) || !dynamic_cast (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 (l))) l = dynamic_cast (l->axis_group_l_a_[X_AXIS]); - while (! r->is_type_b(Paper_column::static_name ())) + while (! (dynamic_cast (r))) r = dynamic_cast(r->axis_group_l_a_[X_AXIS]); PCursor 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 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 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 (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 (id); + Real_identifier *r= dynamic_cast(id); + int_identifier *i = dynamic_cast (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 ($$)-> set_element (*$3, true); delete $3; } | translator_spec_body ACCEPTS STRING ';' { - $$->access_Translator_group ()-> set_acceptor (*$3, true); + dynamic_cast ($$)-> set_acceptor (*$3, true); delete $3; } | translator_spec_body REMOVE STRING ';' { - $$->access_Translator_group ()-> set_element (*$3, false); + dynamic_cast ($$)-> 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 (daddy_trans_l_) + ?dynamic_cast (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 (i.elem_l_)) { - Note_head * nl = (Note_head*)dynamic_cast (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 (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 (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 (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 (n) : 0; + Stem* new_l = n ? dynamic_cast (n) : 0; if (dynamic_cast (o) == stem_l_drul_[LEFT]) stem_l_drul_[LEFT] = new_l; else if (dynamic_cast (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 (req_l); + return dynamic_cast (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 (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 + + */ +#include "protected-scm.hh" +extern "C" +{ +#include +}; + + +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 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 (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 (i.elem_l_)); + if (dynamic_cast (i.elem_l_)) + note_column_l_arr_.push (dynamic_cast (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 (o); - - - if (o_l&&o_l->is_type_b (Note_column::static_name ())) + if (Note_column *onl = dynamic_cast (o)) { - Note_column *n_l = n?(Note_column*)dynamic_cast (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 (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 (r); - if (!m || !dynamic_cast (m)) - return false; - - rest_req_l_ = dynamic_cast (m); // ugh - return true; + if (Rest_req *r = dynamic_cast (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 (i.elem_l_); if (!item) return; - if (item->is_type_b (Script::static_name ()) + if (dynamic_cast