]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.1.11 release/0.1.11
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 31 Aug 1997 23:22:51 +0000 (01:22 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 31 Aug 1997 23:22:51 +0000 (01:22 +0200)
329 files changed:
.dstreamrc
AUTHORS.text
DEDICATION
Documentation/AUTHORS.pod
Documentation/Makefile
Documentation/Rules.make
Documentation/Vocab-British [deleted file]
Documentation/Vocab-French [deleted file]
Documentation/Vocab-German [deleted file]
Documentation/gnu-music.pod
Documentation/index.pod
Documentation/links.pod
Documentation/mudela-course.doc
Documentation/vocabulary-data [new file with mode: 0644]
Documentation/vocabulary-forms.el [new file with mode: 0644]
INSTALL.text
NEWS
README
TODO
VERSION
bin/make-website.in
flower/VERSION
flower/choleski.cc
flower/diagonal-storage.cc
flower/directed-graph.cc
flower/full-storage.cc
flower/include/assoc-iter.hh
flower/include/choleski.hh
flower/include/cursor.hh
flower/include/cursor.icc
flower/include/diagonal-storage.hh
flower/include/directed-graph.hh
flower/include/full-storage.hh
flower/include/full-storage.icc
flower/include/interval.hh
flower/include/interval.tcc
flower/include/lgetopt.hh
flower/include/list.icc
flower/include/list.tcc
flower/include/matrix-storage.hh
flower/include/matrix.hh
flower/include/parray.hh
flower/include/path.hh
flower/include/plist.icc
flower/include/plist.tcc
flower/include/pointer.tcc
flower/include/string-data.hh
flower/include/string-data.icc
flower/include/string-handle.hh
flower/include/virtual-methods.hh
flower/lgetopt.cc
flower/matrix-storage.cc
flower/matrix.cc
flower/path.cc
init/engraver.ly
input/fugue1.ly [new file with mode: 0644]
input/prelude1.ly [new file with mode: 0644]
input/rhythm.ly
input/standchen-16.ly [deleted file]
input/standchen-16.tex
input/standchen-20.ly [deleted file]
input/standchen-20.tex
input/standchen-part.ly [deleted file]
input/standchen.ly [new file with mode: 0644]
input/wohltemperirt.ly
lib/binary-source-file.cc
lib/duration-convert.cc
lib/duration.cc
lib/file-storage.cc [deleted file]
lib/includable-lexer.cc
lib/include/duration.hh
lib/include/file-storage.hh
lib/include/includable-lexer.hh
lib/include/input.hh
lib/include/plet.hh
lib/include/source-file.hh
lib/input.cc
lib/mapped-file-storage.cc [new file with mode: 0644]
lib/plet.cc
lib/simple-file-storage.cc
lib/source-file.cc
lib/source.cc
lib/template.cc
lib/windhoos-suck-suck-suck-thank-you-cygnus.cc
lily/VERSION
lily/audio-item.cc
lily/audio-score.cc
lily/audio-staff.cc
lily/axis-group-item.cc
lily/axis-group-spanner.cc
lily/axis-group.cc
lily/bar-column-grav.cc
lily/bar-column.cc
lily/bar-grav.cc
lily/bar-number-grav.cc
lily/bar.cc
lily/beam-grav.cc [new file with mode: 0644]
lily/beam.cc
lily/bow.cc
lily/break.cc
lily/chord-iterator.cc [new file with mode: 0644]
lily/clef-grav.cc
lily/clef-item.cc
lily/col-info.cc
lily/colhpos.cc
lily/collision.cc
lily/command-request.cc
lily/crescendo.cc
lily/dimen.cc
lily/directional-spanner.cc
lily/dynamic-grav.cc
lily/elem-group-item.cc
lily/elem-group.cc
lily/engraver-group.cc
lily/engraver.cc
lily/general-script-def.cc
lily/global-translator.cc
lily/gourlay-breaking.cc
lily/grouping.cc
lily/head-column.cc
lily/horizontal-align-item.cc
lily/identifier.cc
lily/include/audio-score.hh
lily/include/axis-group-item.hh
lily/include/axis-group-spanner.hh
lily/include/axis-group.hh
lily/include/bar-number-grav.hh
lily/include/bar.hh
lily/include/beam-grav.hh [new file with mode: 0644]
lily/include/beam.hh
lily/include/bow.hh
lily/include/boxes.hh
lily/include/break-caching.hh
lily/include/break.hh
lily/include/chord-iterator.hh [new file with mode: 0644]
lily/include/clef-item.hh
lily/include/col-info.hh
lily/include/colhpos.hh
lily/include/command-request.hh
lily/include/crescendo.hh
lily/include/direction.hh [new file with mode: 0644]
lily/include/directional-spanner.hh
lily/include/drul-array.hh [new file with mode: 0644]
lily/include/dynamic-grav.hh
lily/include/elem-group-item.hh
lily/include/elem-group.hh
lily/include/engraver-group.hh
lily/include/engraver.hh
lily/include/general-script-def.hh
lily/include/global-translator.hh
lily/include/gourlay-breaking.hh
lily/include/grouping.hh
lily/include/head-column.hh
lily/include/header.hh
lily/include/horizontal-align-item.hh
lily/include/horizontal-group-item.hh
lily/include/idealspacing.hh
lily/include/identifier.hh
lily/include/ineq-constrained-qp.hh
lily/include/item.hh
lily/include/key-item.hh
lily/include/key.hh
lily/include/lily-proto.hh
lily/include/line-spacer.hh
lily/include/linespace.hh
lily/include/local-key-item.hh
lily/include/lookup.hh
lily/include/meter-grav.hh
lily/include/midi-def.hh
lily/include/music-iterator.hh
lily/include/music-list.hh
lily/include/music-output-def.hh [new file with mode: 0644]
lily/include/music-output.hh [new file with mode: 0644]
lily/include/music.hh
lily/include/musical-request.hh
lily/include/my-lily-parser.hh
lily/include/note-column-grav.hh
lily/include/note-column.hh
lily/include/note-head.hh
lily/include/offset.hh
lily/include/p-col.hh
lily/include/p-score.hh
lily/include/paper-def.hh
lily/include/performer-group-performer.hh
lily/include/qlpsolve.hh
lily/include/request-iterator.hh [new file with mode: 0644]
lily/include/request.hh
lily/include/score-column.hh
lily/include/score-elem.hh
lily/include/score-grav.hh
lily/include/score-performer.hh
lily/include/score.hh
lily/include/scoreline.hh
lily/include/script-def.hh
lily/include/script.hh
lily/include/slur-grav.hh
lily/include/span-bar-grav.hh
lily/include/span-bar.hh
lily/include/span-score-bar-grav.hh
lily/include/span-score-bar.hh
lily/include/spanner-elem-group.hh [deleted file]
lily/include/spanner.hh
lily/include/spring-spacer.hh
lily/include/staff-info.hh
lily/include/staff-side.hh
lily/include/staff-sym.hh
lily/include/stem-beam-grav.hh [deleted file]
lily/include/stem-grav.hh [new file with mode: 0644]
lily/include/stem.hh
lily/include/super-elem.hh
lily/include/symbol.hh
lily/include/symtable.hh
lily/include/text-def.hh
lily/include/text-grav.hh
lily/include/text-item.hh
lily/include/text-spanner.hh
lily/include/tie-grav.hh
lily/include/tie.hh
lily/include/time-description.hh
lily/include/timing-grav.hh
lily/include/translator.hh
lily/include/vertical-align-elem.hh
lily/include/vertical-group-spanner.hh
lily/include/voice-group-gravs.hh
lily/include/voice-iterator.hh [new file with mode: 0644]
lily/include/word-wrap.hh
lily/ineq-constrained-qp.cc
lily/input-translator.cc
lily/item.cc
lily/key-grav.cc
lily/key-item.cc
lily/key-performer.cc
lily/keyword.cc
lily/lexer.l
lily/line-group-grav.cc
lily/line-spacer.cc
lily/local-key-grav.cc
lily/local-key-item.cc
lily/lookup.cc
lily/lyric-grav.cc
lily/lyric-performer.cc
lily/main.cc
lily/meter-grav.cc
lily/meter-performer.cc
lily/meter.cc
lily/midi-def.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/midi-walker.cc
lily/music-iterator.cc
lily/music-list.cc
lily/music-output-def.cc [new file with mode: 0644]
lily/music.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-column-grav.cc
lily/note-column.cc
lily/note-performer.cc
lily/note.cc
lily/notehead.cc
lily/p-col.cc
lily/p-score.cc
lily/paper-def.cc
lily/parser.y
lily/performer-group-performer.cc
lily/performer.cc
lily/request-iterator.cc [new file with mode: 0644]
lily/request.cc
lily/rest-collision-grav.cc
lily/rest-collision.cc
lily/score-align-grav.cc
lily/score-column.cc
lily/score-elem.cc
lily/score-grav.cc
lily/score-performer.cc
lily/score.cc
lily/scoreline.cc
lily/scores.cc
lily/script-column.cc
lily/script-def.cc
lily/script-grav.cc
lily/script.cc
lily/slur-grav.cc
lily/slur.cc
lily/span-bar-grav.cc
lily/span-bar.cc
lily/span-score-bar.cc
lily/spanner-elem-group.cc [deleted file]
lily/spanner.cc
lily/spring-spacer.cc
lily/staff-info.cc
lily/staff-performer.cc
lily/staff-side.cc
lily/staff-sym-grav.cc
lily/staff-sym.cc
lily/stem-beam-grav.cc [deleted file]
lily/stem-grav.cc [new file with mode: 0644]
lily/stem.cc
lily/super-elem.cc
lily/symbol.cc
lily/symtable.cc
lily/template1.cc
lily/template2.cc
lily/template3.cc
lily/template6.cc
lily/template7.cc
lily/template8.cc
lily/tex-beam.cc
lily/tex-slur.cc
lily/tex.cc
lily/text-def.cc
lily/text-grav.cc [deleted file]
lily/text-item.cc
lily/text-spanner.cc
lily/tie-grav.cc
lily/tie.cc
lily/time-description.cc
lily/timing-grav.cc
lily/translator.cc
lily/vertical-align-elem.cc
lily/vertical-align-grav.cc
lily/voice-group-gravs.cc
lily/voice-iterator.cc [new file with mode: 0644]
lily/word-wrap.cc
make/lilypond.lsm
make/lilypond.spec
mi2mu/mudela-score.cc
mi2mu/template.cc

index 211edb54f50f5fb4f9ff9086466ce3d75c1c42f3..6e401c89cf084cb81610858feccbd9419f9aa08d 100644 (file)
@@ -22,14 +22,14 @@ Bar                 0
 Beam                   0
 Change_iterator                0
 Chord                  0
 Beam                   0
 Change_iterator                0
 Chord                  0
-Chord_iterator         1
+Chord_iterator         0
 Clef_item              0
 Col_configuration      0
 Colinfo                        0
 Colinfo                        0
 Collision              0
 Clef_item              0
 Col_configuration      0
 Colinfo                        0
 Colinfo                        0
 Collision              0
-Engraver               1
-Engraver_group_engraver 1
+Engraver               0
+Engraver_group_engraver 0
 Group_change_req       0
 Head_column            0
 Idealspacing           0
 Group_change_req       0
 Head_column            0
 Idealspacing           0
@@ -43,7 +43,7 @@ Melodic_req           0
 Midi_def               0
 Mixed_qp               0
 Music                  0
 Midi_def               0
 Mixed_qp               0
 Music                  0
-Music_iterator         1
+Music_iterator         0
 My_lily_lexer          1
 Note_head              0
 Note_performer         0
 My_lily_lexer          1
 Note_head              0
 Note_performer         0
index 74174c30738b76da05b18415423d3d2f6363a161..ce11d2466346891d66ab006ecc15d31d2ac06d91 100644 (file)
@@ -23,9 +23,9 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
            lily/midi-*, mi2mu/*, parts flower/string*.cc,
            make/*.make, */Makefile parts of
            Documentation/mudela.pod, lib/*source-file*,
            lily/midi-*, mi2mu/*, parts flower/string*.cc,
            make/*.make, */Makefile parts of
            Documentation/mudela.pod, lib/*source-file*,
-           lib/duration.cc, lib/source, flower/*{list,cursor}*,
+           lib/duration.cc, lib/source*, flower/*{list,cursor}*,
            lily/rest-collision*, conflily, cygnus w32 stuff,
            lily/rest-collision*, conflily, cygnus w32 stuff,
-           lily/*perf*
+           lily/*perf*, some input files
 
            and corresponding header files.
 
 
            and corresponding header files.
 
@@ -42,10 +42,15 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS
        +\bo   Anthony Fok <foka@gpu.srv.ualberta.ca>, debian
            package: make/debian/*
 
        +\bo   Anthony Fok <foka@gpu.srv.ualberta.ca>, debian
            package: make/debian/*
 
+       +\bo   Franc,ois Pinard <pinard@iro.umontreal.ca>, Neil
+           Jerram <nj104@cus.cam.ac.uk>. Documentation/Vocab*
+
        Your name could be here! If you want to help, then take a
        look at the SMALLISH PROJECTS section of in the file _\bT_\bO_\bD_\bO.
        Some do not involve coding C++
 
        Your name could be here! If you want to help, then take a
        look at the SMALLISH PROJECTS section of in the file _\bT_\bO_\bD_\bO.
        Some do not involve coding C++
 
+       [And of course, J.S.Bach,  F.Schubert, T. Merula and
+       W.A.Mozart]
 
 
 
 
 
 
@@ -56,11 +61,6 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS
 
 
 
 
 
 
-
-
-
-
-
-12/Aug/97                LilyPond 0.1.10                        1
+30/Aug/97                LilyPond 0.1.11                        1
 
 
 
 
index c96c364dfae0d1520c42c41175893a261a23cb78..36414b54e8bdb862c496445ca28d248ed71d230c 100644 (file)
@@ -15,7 +15,7 @@ Janneke!
        That's a nice thought, Wendy.  I've got a few too, to spread
 the credits a bit (Again, no particular order) Michelle, Illushka, 
 Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, 
        That's a nice thought, Wendy.  I've got a few too, to spread
 the credits a bit (Again, no particular order) Michelle, Illushka, 
 Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, 
-Eva, Roos, Judith, and, of course, Wendy!
+Eva, Roos, Judith, Tim, and, of course, Wendy!
 
        JCN
  
 
        JCN
  
index f6366d5e00c719463f30f9a0ab807e1601057d8e..2d40fefc7f7613300815a3ceb075ec4fe588b921 100644 (file)
@@ -22,8 +22,8 @@ Jan Nieuwenhuizen <jan@digicash.com>, http://www.digicash.com/~jan
 
 lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile
 parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc,
 
 lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile
 parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc,
-lib/source, flower/*{list,cursor}*,  lily/rest-collision*, conflily,
-cygnus w32 stuff, lily/*perf*
+lib/source*, flower/*{list,cursor}*,  lily/rest-collision*, conflily,
+cygnus w32 stuff, lily/*perf*, some input files
 
 and corresponding header files.
 
 
 and corresponding header files.
 
@@ -51,8 +51,15 @@ Alexandre Oliva <oliva@dcc.unicamp.br>, testing
 
 Anthony Fok <foka@gpu.srv.ualberta.ca>, debian package: make/debian/*
 
 
 Anthony Fok <foka@gpu.srv.ualberta.ca>, debian package: make/debian/*
 
+=item *
+
+Franc,ois Pinard <pinard@iro.umontreal.ca>, Neil Jerram
+<nj104@cus.cam.ac.uk>. Documentation/Vocab*
+
 =back
 
 Your name could be here! If you want to help, then take a look at the
 SMALLISH PROJECTS section of in the file F<TODO>. Some do not involve
 coding C++
 =back
 
 Your name could be here! If you want to help, then take a look at the
 SMALLISH PROJECTS section of in the file F<TODO>. Some do not involve
 coding C++
+
+[And of course, J.S.Bach,  F.Schubert, T. Merula and W.A.Mozart]
index 521caa1bb63c7d26b71c4a76521b92dfb05f2ba6..4da45d58b02c1682923e0857be468a3e0adebc59 100644 (file)
@@ -39,7 +39,7 @@ giffiles=$(XPMS:.xpm=.gif)
 gifs: $(addprefix $(outdir)/, $(giffiles))
 
 
 gifs: $(addprefix $(outdir)/, $(giffiles))
 
 
-EXTRA_DISTFILES = $(XPMS)  $(DOCFILES)  $(wildcard Vocab*)
+EXTRA_DISTFILES = $(XPMS)  $(DOCFILES)  vocabulary-data vocabulary-forms.el 
 
 # don't do DVI files. They can only be made if lily is installed
 do-doc: $(TEXTFILES)
 
 # don't do DVI files. They can only be made if lily is installed
 do-doc: $(TEXTFILES)
index 5ac09affd2a07ff6754ea53b9351100c6f07da75..7e87d4ff6bf100d8c39d09f748563328f01390f2 100644 (file)
@@ -43,7 +43,7 @@ $(outdir)/%.gz: $(outdir)/%
        gzip -c9 $< > $@
 
 name-stem= $(notdir $(basename $<))
        gzip -c9 $< > $@
 
 name-stem= $(notdir $(basename $<))
-$(outdir)/%.dvi: $(depth)/input/%.ly 
+$(outdir)/%.dvi: $(depth)/input/%.ly $(depth)/VERSION
        (cd $(outdir); \
        lilypond -o  $(name-stem)  ../$< )
        (cd $(outdir); \
        (cd $(outdir); \
        lilypond -o  $(name-stem)  ../$< )
        (cd $(outdir); \
diff --git a/Documentation/Vocab-British b/Documentation/Vocab-British
deleted file mode 100644 (file)
index d2b666a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# Musical vocabulary, correspondance from British.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Neil Jerram <nj104@cus.cam.ac.uk>, 1993.
-
-British                                American
-
-breve                          double whole note
-crotchet                       quarter note
-crotchet rest                  quarter rest
-demisemiquaver                 thirty-second note
-demisemiquaver rest            thirty-second rest
-hemidemisemiquaver             sixty-fourth note
-hemidemisemiquaver rest                sixty-fourth rest
-minim                          half note
-minim rest                     half rest
-quaver                         eighth note
-quaver rest                    eighth rest
-semibreve                      whole note
-semibreve rest                 whole rest
-semiquaver                     sixteenth note
-semiquaver rest                        sixteenth rest
diff --git a/Documentation/Vocab-French b/Documentation/Vocab-French
deleted file mode 100644 (file)
index 74e4622..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-# Musical vocabulary, correspondance from French.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Francois Pinard <pinard@iro.umontreal.ca>, 1993.
-
-# Thanks to Neil Jerram <nj104@cus.cam.ac.uk>.
-
-French                         American        
-
-accentuation                   accentuation
-accolade                       brace
-accord                         chord
-accord de neuvième dominante   chord of the dominant ninth
-accord de septième dominante   chord of the dominant seventh
-accord parfait majeur          perfect major chord
-accord parfait mineur          perfect minor chord
-alto                           alto
-altération accidentelle                accident; accidental alteration
-altération essentielle         essential alteration
-appogiature                    appoggiatura
-appogiature brève              short appoggiatura
-appogiature double             double appoggiatura
-appogiature longue             long appoggiatura
-appogiature simple             simple appoggiatura
-armature [de la clé]           key signature
-armure [de la clé]             key signature
-arpège                         arpeggio
-augmenté (intervalle)          augmented (interval)
-bariton                                baritone
-barre de mesure                        bar line
-barre de reprise               repeat
-basse                          bass
-blanche                                half note
-bâton de pause                 (arbitrary number of bars' rest)
-bâton de pause                 four-bar rest
-bâton de pause                 two-bar rest
-bécarre                                natural sign
-bémol                          flat
-cadence                                cadence
-cadence harmonique             harmonic cadence
-cadence mélodique              melodic cadence
-caractère                      character
-chaîne de trilles              chain of trills
-chevron                                chevron
-chiffrage                      time signature
-chiffre inférieur              lower number
-chiffre supérieur              upper number
-chiffres indicateurs           time signature
-clé                            clef
-clé d'octave                   octave line
-clé d'ut                       middle C clef
-clé de fa                      bass clef
-clé de sol                     treble clef
-comma                          comma
-comma enharmonique
-comma pythagoricien
-comma syntonique
-consonance                     consonant interval; consonance
-contralto                      contralto
-contre-temps                   contro-time
-contre-temps irrégulier                irregular contro-time
-contre-temps régulier          regular contro-time
-coulé                          slur
-courbe rythmique               rythmic curve
-cresendo                       opening angular bracket
-croche                         eighth note
-decrescendo                    closing angular bracket
-degré [de la gamme]            degree [of the scale]
-demi-pause                     half rest
-demi-soupir                    eighth rest
-demi-ton                       semitone
-demi-ton chromatique           chromatic semitone
-demi-ton diatonique            diatonic semitone
-diapason                       pitch pipe; tuning fork
-diminué (intervalle)           diminished (interval)
-dissonance                     dissonant interval; dissonance
-dièse                          sharp
-do                             C
-do central                     middle C
-doigté
-doigté de pédale
-dominante                      dominant
-double barre                   double bar line
-double bémol                   double flat
-double croche                  sixteenth note
-double dièse                   double sharp
-double triolet                 double triplet
-duolet                         duplet
-durée                          duration
-échelle d'octave               octave line
-échelle musicale               Musical Ladder
-enharmonie                     enharmony
-espace                         space
-extension d'intervalle         extension of interval
-fa                             F
-figure de note                 kind of note
-figure de silence              kind of rest
-fioriture                      cadenza
-forme du mode mineur ancien    ancient form (diatonic minor scale)
-forme harmonique               harmonic form (diatonic minor scale)
-forme mélodique                        melodic form (diatonic minor scale)
-gamme                          scale
-gamme chromatique              chromatic scale
-gamme diatonique majeure       diatonic major scale
-gamme diatonique mineure       diatonic minor scale
-gammes enharmoniques           enharmonic scales
-gammes relatives               relative scales
-genre chromatique              chromatic type
-genre diatonique               diatonic type
-genre enharmonique             enharmonic type
-groupe irrégulier              irregular group
-grupetto                       turn; gruppetto
-hauteur                                pitch
-huitième de soupir             thirty-second rest
-incise                         motive
-indication de pédale
-indication métronomique                metronomic indication
-intervalle                     interval
-intervalle ascendant           ascending interval
-intervalle composé             compound interval
-intervalle descendant          descending interval
-intervalle harmonique          harmonic interval
-intervalle simple              simple interval
-intervalles enharmoniques      enharmonic intervals
-juste (intervalle)             perfect (interval)
-la                             A
-liaison                                tie
-liaison rythmique              legato curve
-ligne                          line
-ligne supplémentaire           ledger line
-majeur (intervalle)            major (interval)
-membre de phrase               phrase member
-mesure                         bar; measure
-mesure artificielle            artificial measure
-mesure composée                        compound measure
-mesure incomplète              incomplete measure
-mesure irrégulière             irregular measure
-mesure simple                  simple measure
-mezzo-soprano                  mezzo-soprano
-mi                             E
-mineur (intervalle)            minor (interval)
-mode                           mode
-mode ecclésiastique
-mode majeur                    major mode
-mode mineur                    minor mode
-modulation                     modulation
-mordant                                mordent
-mouvement                      tempo; movement
-mouvement conjoint             conjunct movement
-mouvement disjoint             disjunct movement
-mouvement lent                 slow tempo
-mouvement modéré               moderate tempo
-mouvement rapide               fast tempo
-médiante                       mediant
-métronome                      metronome
-noire                          quarter note
-note                           note
-note doublement pointée                double dotted note
-note modale                    modal note
-note pointée                   dotted note
-note tonale                    tonal note
-notes enharmoniques            enharmonic notes
-nuance                         shading
-octave                         octave
-ornement                       embellishment; accessory
-partition                      score
-pause                          whole rest
-phrase                         phrase
-phrasé                         phrasing
-pizzicato                      dash over/below
-point                          dot
-point d'orgue                  pause
-point et liaison combinés      dot and curved line combined
-pointillés
-portamento                     underline over/below
-portée                         staff
-portées                                staves
-quadruple croche               sixty-fourth note
-quart de soupir                        sixteenth rest
-quarte                         fourth
-quartolet                      quadruplet
-quinte                         fifth
-registre                       register
-renversement d'intervalle      inversion of interval
-renvoi                         return sign
-respiration                    artificial rest
-ronde                          whole note
-rythme                         rythm
-ré                             D
-seconde                                second
-seizième de soupir             sixty-fourth rest
-sensible                       leading note
-septième                       seventh
-sextolet                       sextuplet
-si                             B
-signes indicateurs de nuance   shading signs
-silence                                rest
-sixain                         sextuplet
-sixte                          sixth
-sol                            G
-soprano                                soprano
-soupir                         quarter rest
-sous-dominante                 subdominant
-sous-tonique                   subtonic
-staccato                       dot over/below
-sus-dominante                  superdominant
-sus-tonique                    supertonic
-syncope                                syncopation; upbeat
-syncope irrégulière            irregular syncopation
-syncope régulière              regular syncopation
-temps                          beat
-temps binaire                  binary beat
-temps faible                   weak beat
-temps fort                     strong beat
-temps ternaire                 ternary beat
-tempérament mésotonique                meantone tuning
-tempérament Ã©gal               tempered tuning
-tierce                         third
-ton                            tone
-tonalité                       tonality
-tonique                                tonic
-tons relatifs                  relative scales
-tons voisins                   adjacent keys
-transposition                  transposition
-transposition chromatique      chromatic transposition
-transposition enharmonique     enharmonic transposition
-trille                         trill; shake
-trille double                  double trill
-triolet                                triplet
-triple croche                  thirty-second note
-triton                         tritone
-ténor                          tenor
-tétracorde                     tetrachord
-unisson                                unison
-unité de mesure                        unit of measure
-unité de temps                 unit of beat
-ut                             C
-voix                           voice
diff --git a/Documentation/Vocab-German b/Documentation/Vocab-German
deleted file mode 100644 (file)
index 488c4f0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Musical vocabulary, correspondance from German.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Francois Pinard <pinard@iro.umontreal.ca>, 1993.
-
-German                         American
-
-B                              B flat
-H                              B
index 2a2ee0009a98872745693ebeaf1aff62a97f6b77..3398e283bcbb7baab2503442099754e85112bc33 100644 (file)
@@ -4,63 +4,7 @@ GNU Music project - manifesto
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-Random ranting about the GNU Music project. 
-
-=head2 History of the GNU Music Project
-
-Please note that this all happened when I wasn't around yet.  If you
-think that I am a biased, unfair, predisposed hypocrite, then don't
-bother flaming me;  I already know that.
-
-The GNU Music project is a project which aims to create free software
-for music printing and composing.  It was started in november '92 by a
-core team of four members (Bryan Ford <baford@cs.utah.edu>, David Linn
-<drl@vuse.vanderbilt.edu>, Francois Pinard <pinard@iro.umontreal.ca>,
-Neil Jerram <nj104@cus.cam.ac.uk> and in January '93 Robert Strandh
-<Robert.Strandh@labri.u-bordeaux.fr> joined.
-
-After serious disputes with Robert Strandh
-<Robert.Strandh@labri.u-bordeaux.fr> and the FSF staff in '94, the
-project core team got divided. The development efforts of GMP stopped.
-
-Independently, I (HWN) started LilyPond. When I showed it to
-RMS, he was very enthousiastic about having LilyPond in the GNU
-project. I subsequently learned about the GNU Music project, and
-contacted them.  
-
-What was left of the GMP (Robert Strandh) and us, LilyPond people,
-agreed that cooperation would be desirable. Although merging of both
-efforts was and is technically infeasible, we did decide that LilyPond
-should also be part of the GNU Music project.
-
-Only later did I discover the previous quarrels about the GMP-"take
-1". To show that I am aware of the history, and to make sure nobody
-gets me wrong or is angry at me because I stole a project or a
-project's name, I wrote this note.
-
-In summary, LilyPond is now the only substantial embodiment of the GNU Music
-Project, and it is part of the GNU project. 
-
-For completeness' sake, I will mention the other efforts  here:
-
-=over 4
-
-=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
-
-An alpha version notation editor for X in Scheme. Source available on
-request.
-
-=item GNU music, 
-
-An alpha version of a music editing system with Musictex
-output. Pretest versions of GNU Music (v0.3) can still be obtained from
-Francois Pinard.
-
-=back
-
-This history note is probably biased in some way, because I wrote it.
-The rest of this document is also entirely mine, and is not meant to
-reflect anyone else's opinion.
+Random ranting about the GNU Music project.  
 
 =head1 GOAL
 
 
 =head1 GOAL
 
@@ -264,3 +208,62 @@ support would be desirable.
 
 =back
 
 
 =back
 
+
+
+=head1 HISTORY 
+
+
+Please note that this all happened when I wasn't around yet.  If you
+think that I am a biased, unfair, predisposed hypocrite, then don't
+bother flaming me;  I already know that.
+
+The GNU Music project is a project which aims to create free software
+for music printing and composing.  It was started in november '92 by a
+core team of four members (Bryan Ford <baford@cs.utah.edu>, David Linn
+<drl@vuse.vanderbilt.edu>, Francois Pinard <pinard@iro.umontreal.ca>,
+Neil Jerram <nj104@cus.cam.ac.uk> and in January '93 Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> joined.
+
+After serious disputes with Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> and the FSF staff in '94, the
+project core team got divided. The development efforts of GMP stopped.
+
+Independently, I (HWN) started LilyPond. When I showed it to
+RMS, he was very enthousiastic about having LilyPond in the GNU
+project. I subsequently learned about the GNU Music project, and
+contacted them.  
+
+What was left of the GMP (Robert Strandh) and us, LilyPond people,
+agreed that cooperation would be desirable. Although merging of both
+efforts was and is technically infeasible, we did decide that LilyPond
+should also be part of the GNU Music project.
+
+Only later did I discover the previous quarrels about the GMP-"take
+1". To show that I am aware of the history, and to make sure nobody
+gets me wrong or is angry at me because I stole a project or a
+project's name, I wrote this note.
+
+In summary, LilyPond is now the only substantial embodiment of the GNU Music
+Project, and it is part of the GNU project. 
+
+For completeness' sake, I will mention the other efforts  here:
+
+=over 4
+
+=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+
+An alpha version notation editor for X in Scheme. Source available on
+request.
+
+=item GNU music, 
+
+An alpha version of a music editing system with Musictex
+output. Pretest versions of GNU Music (v0.3) can still be obtained from
+Francois Pinard.
+
+=back
+
+This history note is probably biased in some way, because I wrote it.
+The rest of this document is also entirely mine, and is not meant to
+reflect anyone else's opinion.
+
index 6701961f3f60c69db533cf8c876d024ad1bac24e..29ec80b6a3ef29902dd3b553cf1ee0733b4e8636 100644 (file)
@@ -52,6 +52,7 @@ The installation instructions.
 </a
 >
 
 </a
 >
 
+=back
 
 =head2 Why: Background Information 
 
 
 =head2 Why: Background Information 
 
index 2402e2e533f40ed3aa36267ac02806faab94e5a9..955f9f3ec6f77931a7c0a4ef10c8d85bc36f0f5a 100644 (file)
@@ -114,7 +114,7 @@ gnu-music-discuss.
 
 =item http://www.ssc.com/linux/
 
 
 =item http://www.ssc.com/linux/
 
-The Number One Free OS-Kernel: Linux 
+The Number One Free Operating System Kernel: Linux 
 
 =item http://www.bright.net/~dlphilp/linux_soundapps.html
 
 
 =item http://www.bright.net/~dlphilp/linux_soundapps.html
 
@@ -126,7 +126,7 @@ More software for (early) music.
 
 =item http://www.emry.net/webwatcher/
 
 
 =item http://www.emry.net/webwatcher/
 
-The Linux webwatcher.
+The Linux webwatcher: this site logs changes in important Linux sites.
 
 =item http://www.pbm.com/~lindahl/ravenscroft/modern
 
 
 =item http://www.pbm.com/~lindahl/ravenscroft/modern
 
index 369cfc745cacd605a4b8af0e87ce701d3e253c15..da2be2526b09129be4f479ce5e1356c0aed2ed2e 100644 (file)
@@ -19,8 +19,9 @@
 
 
 \section{Overview}
 
 
 \section{Overview}
+
 Mudela is a language for specifying music. LilyPond is a
 Mudela is a language for specifying music. LilyPond is a
-program which converts such a specification into formatted  sheet
+program which converts such a specification into formatted sheet
 music, or MIDI output.
 
 Please note that some examples not only demonstrate features but also
 music, or MIDI output.
 
 Please note that some examples not only demonstrate features but also
@@ -100,12 +101,13 @@ etc.
 \end{mudela}
 
 
 \end{mudela}
 
 
-LilyPond is designed to handle complicated stuff
-automatically. Expertise should be in the program, not in the user.
+LilyPond is designed to handle complicated stuff automatically.
+Expertise should be in the program, not in the user.
 
 
-The following example shows how multiple voice  on the same staff are
+The following example shows how multiple voices on the same staff are
 handled graciously (well, somewhat). If the noteheads of different
 handled graciously (well, somewhat). If the noteheads of different
-voices collide, they are moved horizontally. The same goes for the rests. 
+voices collide, they are moved horizontally. Rests are moved
+vertically.
 
 \begin[verbatim]{mudela}
 two_voice = \melodic 
 
 \begin[verbatim]{mudela}
 two_voice = \melodic 
diff --git a/Documentation/vocabulary-data b/Documentation/vocabulary-data
new file mode 100644 (file)
index 0000000..c2ed3f0
--- /dev/null
@@ -0,0 +1,244 @@
+Francais:US English:Deutsch:UK English:Nederlands:Italiaans
+accentuation:accentuation:::accent:
+accolade:brace::::
+accord:chord:::akkoord:
+accord de neuvième dominante:chord of the dominant ninth:::dominant akkoord:
+accord de septième dominante:chord of the dominant seventh:::septiem akkoord:
+accord parfait majeur:perfect major chord::::
+accord parfait mineur:perfect minor chord::::
+alto:alto:::alt:
+altération accidentelle:accident; accidental alteration:::toevallig teken:
+altération essentielle:essential alteration::::
+appogiature:appoggiatura::::
+appogiature brève:short appoggiatura::::
+appogiature double:double appoggiatura::::
+appogiature longue:long appoggiatura::::
+appogiature simple:simple appoggiatura::::
+armature [de la clé]:key signature:::toonsoort (voortekens):
+armure [de la clé]:key signature::::
+arpège:arpeggio::::
+augmenté (intervalle):augmented (interval)::::
+bariton:baritone::::
+barre de mesure:bar line::::
+barre de reprise:repeat::::
+basse:bass::::
+blanche:half note::::
+bâton de pause:(arbitrary number of bars' rest)::::
+bâton de pause:four-bar rest::::
+bâton de pause:two-bar rest::::
+bécarre:natural sign:::herstellingsteken:
+bémol:flat:::mol:
+cadence:cadence::::
+cadence harmonique:harmonic cadence::::
+cadence mélodique:melodic cadence::::
+caractère:character::::
+chaîne de trilles:chain of trills::::
+chevron:chevron::::
+chiffrage (chiffres indicateurs):time signature:::maatsoort:
+chiffre inférieur:lower number::::
+chiffre supérieur:upper number::::
+clé:clef:::sleutel:
+clé d'octave:octave line::::
+clé d'ut:middle C clef:::C sleutel:
+clé de fa:bass clef::::
+clé de sol:treble clef::::
+comma:comma::::
+comma enharmonique::::
+comma pythagoricien::::
+comma syntonique::::
+consonance:consonant interval; consonance:::consonant:
+contralto:contralto::::
+contre-temps:contro-time::::
+contre-temps irrégulier:irregular contro-time::::
+contre-temps régulier:regular contro-time::::
+coulé:slur:::binding, bindingsboog:
+courbe rythmique:rythmic curve::::
+cresendo:opening angular bracket::::
+croche:eighth note::::
+decrescendo:closing angular bracket::::
+degré [de la gamme]:degree [of the scale]::::
+demi-pause:half rest::::
+demi-soupir:eighth rest::::
+demi-ton:semitone::::
+demi-ton chromatique:chromatic semitone::::
+demi-ton diatonique:diatonic semitone::::
+diapason:pitch pipe; tuning fork::::
+diminué (intervalle):diminished (interval)::::
+dissonance:dissonant interval; dissonance::::
+dièse:sharp::::
+do:C::::
+do central:middle C:::::
+doigté:::::
+doigté de pédale:::::
+dominante:dominant::::
+double barre:double bar line::::
+double bémol:double flat::::
+double croche:sixteenth note::::
+double dièse:double sharp::::
+double triolet:double triplet::::
+duolet:duplet::::
+durée:duration::::
+échelle d'octave:octave line::::
+échelle musicale:Musical Ladder::::
+enharmonie:enharmony::::
+espace:space::::
+extension d'intervalle:extension of interval::::
+fa:F::::
+figure de note:kind of note::::
+figure de silence:kind of rest::::
+fioriture:cadenza::::
+forme du mode mineur ancien:ancient form (diatonic minor scale)::::
+forme harmonique:harmonic form (diatonic minor scale)::::
+forme mélodique:melodic form (diatonic minor scale)::::
+gamme:scale::::
+gamme chromatique:chromatic scale::::
+gamme diatonique majeure:diatonic major scale::::
+gamme diatonique mineure:diatonic minor scale::::
+gammes enharmoniques:enharmonic scales::::
+gammes relatives:relative scales::::
+genre chromatique:chromatic type::::
+genre diatonique:diatonic type::::
+genre enharmonique:enharmonic type::::
+groupe irrégulier:irregular group::::
+grupetto:turn; gruppetto::::
+hauteur:pitch::::
+huitième de soupir:thirty-second rest::::
+incise:motive::::
+indication de pédale::::
+indication métronomique:metronomic indication::::
+intervalle:interval::::
+intervalle ascendant:ascending interval::::
+intervalle composé:compound interval::::
+intervalle descendant:descending interval::::
+intervalle harmonique:harmonic interval::::
+intervalle simple:simple interval::::
+intervalles enharmoniques:enharmonic intervals::::
+juste (intervalle):perfect (interval)::::
+la:A::::
+liaison:tie::::
+liaison rythmique:legato curve::::
+ligne:line::::
+ligne supplémentaire:ledger line::::
+majeur (intervalle):major (interval)::::
+membre de phrase:phrase member::::
+mesure:bar; measure:::maat, maatstreep:
+mesure artificielle:artificial measure::::
+mesure composée:compound measure::::
+mesure incomplète:incomplete measure::::
+mesure irrégulière:irregular measure::::
+mesure simple:simple measure::::
+mezzo-soprano:mezzo-soprano::::
+mi:E::::
+mineur (intervalle):minor (interval)::::
+mode:mode::::
+mode ecclésiastique::::
+mode majeur:major mode::::
+mode mineur:minor mode::::
+modulation:modulation::::
+mordant:mordent::::
+mouvement:tempo; movement::::
+mouvement conjoint:conjunct movement::::
+mouvement disjoint:disjunct movement::::
+mouvement lent:slow tempo::::
+mouvement modéré:moderate tempo::::
+mouvement rapide:fast tempo::::
+médiante:mediant::::
+métronome:metronome::::
+noire:quarter note::::
+note:note::::
+note doublement pointée:double dotted note::::
+note modale:modal note::::
+note pointée:dotted note::::
+note tonale:tonal note::::
+notes enharmoniques:enharmonic notes::::
+nuance:shading::::
+octave:octave::::
+ornement:embellishment; accessory::::
+partition:score::::
+pause:whole rest::::
+phrase:phrase::::
+phrasé:phrasing::::
+pizzicato:dash over/below::::
+point:dot::::
+point d'orgue:pause::::
+point et liaison combinés:dot and curved line combined::::
+pointillés::::
+portamento:underline over/below::::
+portée:staff::::
+portées:staves::::
+quadruple croche:sixty-fourth note::::
+quart de soupir:sixteenth rest::::
+quarte:fourth::::
+quartolet:quadruplet::::
+quinte:fifth::::
+registre:register::::
+renversement d'intervalle:inversion of interval::::
+renvoi:return sign::::
+respiration:artificial rest::::
+:double whole note::breve:brevis:breve
+ronde:whole note::::
+rythme:rythm::::
+ré:D::::
+seconde:second::::
+seizième de soupir:sixty-fourth rest::::
+sensible:leading note::::
+septième:seventh::::
+sextolet:sextuplet::::
+si:B::::
+signes indicateurs de nuance:shading signs::::
+silence:rest::::
+sixain:sextuplet::::
+sixte:sixth::::
+sol:G::::
+soprano:soprano::::
+soupir:quarter rest::::
+sous-dominante:subdominant::::
+sous-tonique:subtonic::::
+staccato:dot over/below::::
+sus-dominante:superdominant::::
+sus-tonique:supertonic::::
+syncope:syncopation; upbeat::::
+syncope irrégulière:irregular syncopation::::
+syncope régulière:regular syncopation::::
+temps:beat::::
+temps binaire:binary beat::::
+temps faible:weak beat::::
+temps fort:strong beat::::
+temps ternaire:ternary beat::::
+tempérament mésotonique:meantone tuning::::
+tempérament Ã©gal:tempered tuning::::
+tierce:third::::
+ton:tone::::
+tonalité:tonality::::
+tonique:tonic::::
+tons relatifs:relative scales::::
+tons voisins:adjacent keys::::
+transposition:transposition::::
+transposition chromatique:chromatic transposition::::
+transposition enharmonique:enharmonic transposition::::
+trille:trill; shake::::
+trille double:double trill::::
+triolet:triplet::::
+triple croche:thirty-second note::::
+triton:tritone::::
+ténor:tenor::::
+tétracorde:tetrachord::::
+unisson:unison::::
+unité de mesure:unit of measure::::
+unité de temps:unit of beat::::
+ut:C::::
+voix:voice::::
+:quarter note::crotchet::
+:quarter rest::crotchet rest::
+:thirty-second note::demisemiquaver::
+:thirty-second rest::demisemiquaver rest::
+:sixty-fourth note::hemidemisemiquaver::
+:sixty-fourth rest::hemidemisemiquaver rest::
+:half note::minim::
+:half rest::minim rest::
+:eighth note::quaver::
+:eighth rest::quaver rest::
+:whole note::semibreve::
+:whole rest::semibreve rest::
+:sixteenth note::semiquaver::
+:sixteenth rest::semiquaver rest:: 
diff --git a/Documentation/vocabulary-forms.el b/Documentation/vocabulary-forms.el
new file mode 100644 (file)
index 0000000..87893d2
--- /dev/null
@@ -0,0 +1,21 @@
+; Musical vocabularies are Copyright (C) 1993 Free Software Foundation, Inc.
+; Francois Pinard <pinard@iro.umontreal.ca>,
+; Neil Jerram <nj104@cus.cam.ac.uk>.
+; Forms by Han-Wen Nienhuys
+
+(setq forms-file "vocabulary-data")
+(setq forms-number-of-fields 6)
+(setq forms-read-only nil)                 ; to make sure
+(setq forms-field-sep ":")
+(setq forms-multi-line nil)
+
+(setq forms-format-list
+      (list
+       "*** Musical vocabulary ***\n"
+       "\nItalian:          " 6
+       "\nFrench:           " 1
+       "\nUS English:       " 2
+       "\nGerman:           " 3
+       "\nBritish English:  " 4
+       "\nDutch:            " 5
+       ))
index 0720e8bead81596d3094ec3c1ff5fb0c01a7dabd..5329182265b491586fc94980f0ad6fbbbb259a80 100644 (file)
@@ -61,7 +61,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        1
+8/Aug/97                 LilyPond 0.1.11                        1
 
 
 
 
 
 
@@ -127,7 +127,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        2
+8/Aug/97                 LilyPond 0.1.11                        2
 
 
 
 
 
 
@@ -193,7 +193,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        3
+8/Aug/97                 LilyPond 0.1.11                        3
 
 
 
 
 
 
@@ -259,7 +259,7 @@ I\bI\bI\bIN\bN\bN\bNS\bS\bS\bST\bT\bT\bTA\bA\bA\bAL\bL\bL\bLL\bL\bL\bLI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        4
+8/Aug/97                 LilyPond 0.1.11                        4
 
 
 
 
 
 
@@ -325,7 +325,7 @@ R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        5
+8/Aug/97                 LilyPond 0.1.11                        5
 
 
 
 
 
 
@@ -391,6 +391,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
 
 
 
-8/Aug/97                 LilyPond 0.1.10                        6
+8/Aug/97                 LilyPond 0.1.11                        6
 
 
 
 
diff --git a/NEWS b/NEWS
index 980752826cd62300f079053d48f2d277679d92c0..b7e1b5bba14bb0e5c7aa24a41b9ee992fd55b70f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,31 @@
+
+pl 11
+       - forms for Musical vocabulary 
+       - ignore \r for windows
+       - Now paper{score,def} & midi{def,score} derived of class
+Music_output[_def]. Score is almost empty.
+       - Engraver hacking:
+         * junk Text_engraver
+         * Timing_engraver
+         * barnumber now really counts the number of bars
+         * Separated Stem_engraver and Beam_engraver
+         * junk Stem_beam_engraver
+         * no need for Stem_reqs
+       - use Direction = {LEFT, RIGHT, UP, DOWN} iso. -1, 1 throughout source
+       - ties and slurs with Drul_array
+       - junked Spanner_elem_group
+       - bf: w32 fixes
+       - Spanner now spans items.
+       - more GNITting ( bla ) -> (bla), indentation
+       - Drul_array
+       - Paper_column now is derived of Horizontal_group_item. Items
+are no longer hardwired into a Paper_column
+       - bf: stdin input
+       - PCol -> Paper_column
+       - Wtk-i, fugue1, prelude1 (SR)
+
+*******
+aug 21
 pl 10
        - bf: init pending_indent_i_
        - output header to TeX file. Who wants to write TeX to make it work?
 pl 10
        - bf: init pending_indent_i_
        - output header to TeX file. Who wants to write TeX to make it work?
diff --git a/README b/README
index 5b975730b59447ec4c2e3ee9a9a2214d25059092..d6881435f339a6780a612ee7ca3943f67cbbd072 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This is the toplevel README to LilyPond
+This is the toplevel README to LilyPond                -*-Text-*-
 
 
 GNU LilyPond which converts music definition files into visual or
 
 
 GNU LilyPond which converts music definition files into visual or
@@ -81,4 +81,29 @@ might help (Without -O2 optimisation, my execs run fine on Solaris;
 without -O2, but with purify, it dumps core)
 
 
 without -O2, but with purify, it dumps core)
 
 
+Linux (intel)
 
 
+LilyPond occasionally crashes while parsing the initialisation files.
+This is a very obscure bug, and usually entering the commandline
+differently "fixes" it.
+
+       lilypond input.ly 
+
+and
+
+       lilypond -I. ./input.ly 
+
+makes a difference
+
+Typical stacktrace:
+
+       SIGSEGV
+       __libc_malloc (bytes=16384)
+       ?? ()
+       yyFlexLexer::yy_create_buffer ()
+       Includable_lexer::new_input (this=0x8209a00, s={strh_ = {
+               :
+
+
+I get bitten by this every once in a while, and I am very interested
+in hints what might be wrong.
diff --git a/TODO b/TODO
index 26517e4b483d8e4d66c7b4e50083f3f32c1268d3..ff14045e1e4a85bf89aa85bb4769988d1ab54f6b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,6 +6,10 @@ done, or is an idea that I want to think about
 Most of the items are marked in the code as well, with full explanation. 
 grep for TODO and ugh/ugr
 
 Most of the items are marked in the code as well, with full explanation. 
 grep for TODO and ugh/ugr
 
+       * check out egcs
+       
+       * give Items/Spanners access to unbroken originals      
+
 3RD PARTY BUGS:
 
        * ICE: spring-spacer::calcideal()
 3RD PARTY BUGS:
 
        * ICE: spring-spacer::calcideal()
@@ -38,17 +42,19 @@ PROJECTS
        - have make dist produce tarball in out/ directory.
        - Use Automake
        - shared lib on Solaris too.
        - have make dist produce tarball in out/ directory.
        - Use Automake
        - shared lib on Solaris too.
-       - check libtool, automake
+       - check libtool
        - generate stuff in out/default, out/sun5-irix etc iso out/ 
        and out-sun5/
 
        - generate stuff in out/default, out/sun5-irix etc iso out/ 
        and out-sun5/
 
+       * Add mudela-output to Rosegarden.
 
 
-       * Add mudela to Rosegarden.
-
-       * a musical dictionary. See Documentation/Vocab*
-       - other languages
-       - emacs forms mode for editing it.
-       
+       * a musical dictionary. See Documentation/vocabulary-*, other
+languages:
+       - italian
+       - german
+       - dutch
+       - swedish
+        .. ?
 
        * chords
        - guitar chords
 
        * chords
        - guitar chords
@@ -58,7 +64,7 @@ PROJECTS
        - MIDI output?
        - typesetting
 
        - MIDI output?
        - typesetting
 
-       * integrate midi-elts from mi2mu and lily
+       * integrate midi-elts from mi2mu and lily?
 
        * Debug logs:
        - derive lily_stream, Dstream, texstream from ostream?
 
        * Debug logs:
        - derive lily_stream, Dstream, texstream from ostream?
@@ -80,8 +86,7 @@ PROJECTS
        - adapt for multiple font sizes.
        - make separate class for Grace_*_engravers 
        (which is at Voice_gravs level)
        - adapt for multiple font sizes.
        - make separate class for Grace_*_engravers 
        (which is at Voice_gravs level)
-       - move stem, beam, slur into baseclass to adapt for (fixed
-       size) grace notes.
+       - make encapsulated spacing problems.
 
        * accidentals per Voice_group
 
 
        * accidentals per Voice_group
 
@@ -111,7 +116,7 @@ PROJECTS
        - NIFF ?
        - Common Music Notation
        - PostScript output (esp. Beams, Slurs, etc)
        - NIFF ?
        - Common Music Notation
        - PostScript output (esp. Beams, Slurs, etc)
-       - Move PScore, Items, Spanners etc. into libmutype.a
+       - Move all Score_elems, into libmutype.a
 
  
        * Documentation
 
  
        * Documentation
@@ -148,7 +153,6 @@ PROJECTS
        - rewrite : make a metafont iso font
 
        * Font support:
        - rewrite : make a metafont iso font
 
        * Font support:
-       - update 20 pt table
        - mixed fontsizes
 
        * lines:
        - mixed fontsizes
 
        * lines:
@@ -175,7 +179,6 @@ PROJECTS
        - redo Notehead to allow digits as heads
        - add a \tablature {} lexer mode for easy entering
 
        - redo Notehead to allow digits as heads
        - add a \tablature {} lexer mode for easy entering
 
-
        * should adjust stemlength for flag number.
 
        * breaking:
        * should adjust stemlength for flag number.
 
        * breaking:
@@ -188,6 +191,8 @@ PROJECTS
 
        * Rhythmic staff.
 
 
        * Rhythmic staff.
 
+       * Baroque superstaff
+
 SEVERELY LACKING:
 
        * SPEED!
 SEVERELY LACKING:
 
        * SPEED!
@@ -240,9 +245,6 @@ SMALLISH PROJECTS
 
        * lyric in staff  (sharpsharp in staff, text below)
 
 
        * lyric in staff  (sharpsharp in staff, text below)
 
-       * replace Score_elem member access by get()/set() methods, to enable
-       future embedded code.
-
        * write Dynamic_line (to group dynamics horizontally)
 
        * write Rest_collision
        * write Dynamic_line (to group dynamics horizontally)
 
        * write Rest_collision
@@ -275,7 +277,6 @@ SMALLISH PROJECTS
        - String hash
        - Pointer hash
 
        - String hash
        - Pointer hash
 
-
        * binsearch/hash for identifiers
 
        * stafftypes: voice names/ instrument names.
        * binsearch/hash for identifiers
 
        * stafftypes: voice names/ instrument names.
@@ -290,10 +291,9 @@ SMALLISH PROJECTS
 
        * textspanner: center position
 
 
        * textspanner: center position
 
-
        * Brackets
        
        * Brackets
        
-       * Scricts:
+       * Scripts:
        - stack scripts in chords:
          % fingering:        footing:
            < a-4 c-2 g-1 >   < c-\ltoe e-\lheel >
        - stack scripts in chords:
          % fingering:        footing:
            < a-4 c-2 g-1 >   < c-\ltoe e-\lheel >
@@ -309,13 +309,6 @@ SMALLISH PROJECTS
            %  --|---         --|---
           (where "to" is a tiny bow)
 
            %  --|---         --|---
           (where "to" is a tiny bow)
 
-DOC
-       * all errors
-       
-       * hacking-HOWTO
-
-FUTURE
-
        * auxilliary file for caching info.
 
        * Text_crescendo
        * auxilliary file for caching info.
 
        * Text_crescendo
@@ -326,6 +319,11 @@ FUTURE
 
        * volta
 
 
        * volta
 
+DOC
+       * all errors
+       
+       * hacking-HOWTO
+
 IDEAS
 
        * scoping in Lexer: do general id- assignments in mudela.
 IDEAS
 
        * scoping in Lexer: do general id- assignments in mudela.
@@ -357,7 +355,9 @@ IDEAS
 
        * move towards incremental algorithms.
 
 
        * move towards incremental algorithms.
 
-       * design meta-language like TeX and Metafont
+       * far fetched language ideas
+       - design meta-language like TeX and Metafont
+       - programming/macros input
 
        * Global type registration.
 
 
        * Global type registration.
 
@@ -366,11 +366,6 @@ IDEAS
                if ( t <= get_type( q ))
                        ..
 
                if ( t <= get_type( q ))
                        ..
 
-       
-       * virtualise PCols to make encapsulated spacing problems
-
-       * don't count bars which are not on first beat.
-
        * naming of Voice_group/Voice
 
        * benchmark band_matrices.
        * naming of Voice_group/Voice
 
        * benchmark band_matrices.
@@ -391,8 +386,11 @@ IDEAS
 
        * lyrics in chords still fuck up.
 
 
        * lyrics in chords still fuck up.
 
-       * rewire acknowledge_element() logic with a process_acknowledged()
-       
+       *
+       - rewire acknowledge_element() logic with a process_acknowledged()
+       - construct Stem upon receiving Notehead. Junk Stem_req
+
+
        * pushgroup/popgroup
 
        * whole head on ledger line
        * pushgroup/popgroup
 
        * whole head on ledger line
diff --git a/VERSION b/VERSION
index d3a300ce9618727314edbe70ae377d495cde20e2..3747f21228c658688daeb3b1523e6e55c19c71b0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 1
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 10
+TOPLEVEL_PATCH_LEVEL = 11
 
 # use to send patches, always empty for released version:
 
 # use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
+TOPLEVEL_MY_PATCH_LEVEL = 
index be9563399211fb1f040723dd9f810b189f0f62e9..75fba55de0e342728df760069814b0c261d3d876 100644 (file)
@@ -77,9 +77,13 @@ sub my_system
 
 local $base="lilypond/";
 
 
 local $base="lilypond/";
 
-local @examples=("twinkle-pop", "twinkle", "multi", "wohltemperirt"
-                ,"standchen-16", "standchen-20", "toccata-fuga-E", "scsii-menuetto",
-                "cadenza", "scales", "rhythm", "gallina");
+local @examples=("twinkle-pop", "twinkle", "multi", "wohltemperirt",
+                #"standchen-16", 
+                #"standchen-20", 
+                "toccata-fuga-E", "scsii-menuetto",
+                "cadenza", "scales", 
+               #"rhythm", 
+                "gallina");
 
 # rhythm, scales, 
 
 
 # rhythm, scales, 
 
index 7aec79ceb059dae6f4b399eff01d92aa69f825d9..2d9d483b196d927d556979f9106ad4f26434dc89 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 26
+PATCH_LEVEL = 27
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index 4a98301af3ec39e63d61ebee2590e5a2dce6b22a..5932f10f973818de7fe60fc122c54a3664b5760d 100644 (file)
@@ -13,7 +13,7 @@ const Real EPS = 1e-7;                // so sue me. Hard coded
 //#define PARANOID
 
 void
 //#define PARANOID
 
 void
-Choleski_decomposition::full_matrix_solve (Vector &out, Vector const &rhs)const
+Choleski_decomposition::full_matrix_solve (Vector &out, Vector const &rhs) const
 {
   int n= rhs.dim();
   assert (n == L.dim());
 {
   int n= rhs.dim();
   assert (n == L.dim());
@@ -45,7 +45,7 @@ Choleski_decomposition::full_matrix_solve (Vector &out, Vector const &rhs)const
 }
 
 void
 }
 
 void
-Choleski_decomposition::band_matrix_solve (Vector &out, Vector const &rhs)const
+Choleski_decomposition::band_matrix_solve (Vector &out, Vector const &rhs) const
 {
   int n= rhs.dim();
   int b = L.band_i();
 {
   int n= rhs.dim();
   int b = L.band_i();
@@ -79,7 +79,7 @@ Choleski_decomposition::band_matrix_solve (Vector &out, Vector const &rhs)const
 }
 
 void
 }
 
 void
-Choleski_decomposition::solve (Vector &x, Vector const &rhs)const
+Choleski_decomposition::solve (Vector &x, Vector const &rhs) const
 {
   if (L.band_b()) 
     {
 {
   if (L.band_b()) 
     {
@@ -90,7 +90,7 @@ Choleski_decomposition::solve (Vector &x, Vector const &rhs)const
 }
 
 Vector
 }
 
 Vector
-Choleski_decomposition::solve (Vector rhs)const
+Choleski_decomposition::solve (Vector rhs) const
 {
   Vector r;
   solve (r, rhs);
 {
   Vector r;
   solve (r, rhs);
index 17699384cd14152cbef24d2401c2359c780b1a00..695819171acbdb4beec61bb270a1a65e5e2bcb83 100644 (file)
@@ -19,7 +19,7 @@
 #include "full-storage.icc"
 
 int
 #include "full-storage.icc"
 
 int
-Diagonal_storage::dim()const
+Diagonal_storage::dim() const
 {
   return band_.rows();
 }
 {
   return band_.rows();
 }
@@ -41,7 +41,7 @@ Diagonal_storage::cols() const
 }
 
 int
 }
 
 int
-Diagonal_storage::band_size_i()const
+Diagonal_storage::band_size_i() const
 {
   return (band_.cols()-1)/2;
 }
 {
   return (band_.cols()-1)/2;
 }
@@ -104,13 +104,13 @@ Diagonal_storage::~Diagonal_storage()
 
 
 bool
 
 
 bool
-Diagonal_storage::band_elt_b (int i,int j)const
+Diagonal_storage::band_elt_b (int i,int j) const
 {
   return abs (i-j) <= band_size_i();
 }
 
 void
 {
   return abs (i-j) <= band_size_i();
 }
 
 void
-Diagonal_storage::assert_valid (int i,int j)const
+Diagonal_storage::assert_valid (int i,int j) const
 {
   assert (band_elt_b (i,j));
   assert (i >=0 && j >=0 && i < dim() && j < dim ());
 {
   assert (band_elt_b (i,j));
   assert (i >=0 && j >=0 && i < dim() && j < dim ());
@@ -133,13 +133,13 @@ Diagonal_storage::resize_dim (int d)
 
 
 bool
 
 
 bool
-Diagonal_storage::mult_ok (int i,int)const
+Diagonal_storage::mult_ok (int i,int) const
 {
   return i < dim();
 }
 
 void
 {
   return i < dim();
 }
 
 void
-Diagonal_storage::mult_next (int &i, int &j)const
+Diagonal_storage::mult_next (int &i, int &j) const
 {
   j++;
   if ( j < i - band_size_i()) 
 {
   j++;
   if ( j < i - band_size_i()) 
@@ -152,13 +152,13 @@ Diagonal_storage::mult_next (int &i, int &j)const
 }
 
 bool
 }
 
 bool
-Diagonal_storage::trans_ok (int ,int j)const
+Diagonal_storage::trans_ok (int ,int j) const
 {
   return j < dim();
 }
 
 void
 {
   return j < dim();
 }
 
 void
-Diagonal_storage::trans_next (int &i, int& j)const
+Diagonal_storage::trans_next (int &i, int& j) const
 {
   i++;
   if ( i < j - band_size_i())
 {
   i++;
   if ( i < j - band_size_i())
@@ -174,7 +174,7 @@ Diagonal_storage::trans_next (int &i, int& j)const
 static Real nul_entry=0.0;
 
 Real 
 static Real nul_entry=0.0;
 
 Real 
-Diagonal_storage::elem (int i, int j)const
+Diagonal_storage::elem (int i, int j) const
 {
   if (abs ( i-j) > band_size_i())
        return 0;
 {
   if (abs ( i-j) > band_size_i())
        return 0;
@@ -202,7 +202,7 @@ Diagonal_storage::elem (int i, int j)
 
 bool
 Diagonal_storage::try_right_multiply (Matrix_storage*dest,
 
 bool
 Diagonal_storage::try_right_multiply (Matrix_storage*dest,
-                                    const Matrix_storage*right)const
+                                    const Matrix_storage*right) const
 {
   if ( right->name() != Diagonal_storage::static_name ()) 
        return false;
 {
   if ( right->name() != Diagonal_storage::static_name ()) 
        return false;
index 46511b4c319bfe0c4d41eb2a9b60eac6a508cee3..9a07629dab71644c7d6d78372f1b8ffd5372acf3 100644 (file)
@@ -22,7 +22,7 @@ Directed_graph_node::get_in_edge_arr() const
 }
 
 Link_array<Directed_graph_node> const &
 }
 
 Link_array<Directed_graph_node> const &
-Directed_graph_node::get_out_edge_arr()const
+Directed_graph_node::get_out_edge_arr() const
 {
   return edge_out_l_arr_;
 }
 {
   return edge_out_l_arr_;
 }
@@ -56,7 +56,7 @@ Directed_graph_node::OK() const
 }
 
 bool
 }
 
 bool
-Directed_graph_node::contains_b (const Directed_graph_node *d)const
+Directed_graph_node::contains_b (const Directed_graph_node *d) const
 {
   return edge_out_l_arr_.find_l ((Directed_graph_node*)d);
 }
 {
   return edge_out_l_arr_.find_l ((Directed_graph_node*)d);
 }
@@ -95,7 +95,7 @@ Directed_graph_node::remove_edge_out (Directed_graph_node *d_l)
   PARANOID_OK();
 }
 bool
   PARANOID_OK();
 }
 bool
-Directed_graph_node::linked_b()const
+Directed_graph_node::linked_b() const
 {
   return edge_out_l_arr_.size() || edge_in_l_arr_.size ();
 }
 {
   return edge_out_l_arr_.size() || edge_in_l_arr_.size ();
 }
index ee59ea23ed968cc9f6b553eea7731fdce5bd1254..71aa74c10c6f0aa1cb7b582fb20c8d296dbe3ed4 100644 (file)
@@ -129,7 +129,7 @@ Full_storage::insert_row (int k)
 }
 
 bool
 }
 
 bool
-Full_storage::try_right_multiply (Matrix_storage * dest, Matrix_storage const * right)const
+Full_storage::try_right_multiply (Matrix_storage * dest, Matrix_storage const * right) const
 {
   if (dest->name() != Full_storage::static_name () ||
        right->name() != Full_storage::static_name ())
 {
   if (dest->name() != Full_storage::static_name () ||
        right->name() != Full_storage::static_name ())
index 9157ad0ab74e25152e497f73a79e66532a9ede51..f1ba2f89b25de5bd47cf0456341b180f3eb9efe9 100644 (file)
@@ -28,7 +28,7 @@ struct Assoc_iter {
     bool ok() const {
        return i < assoc_.arr.size();
     }
     bool ok() const {
        return i < assoc_.arr.size();
     }
-    void OK()const {
+    void OK() const {
        assert (!ok() || !assoc_.arr[i].free);
     }
     void operator++(int) { i++; i = next (i); }
        assert (!ok() || !assoc_.arr[i].free);
     }
     void operator++(int) { i++; i = next (i); }
index dd21237550c8a2a96f463c43171043bad8e864c2..a1c3a8c47e172b718d0bb9053e9a6cdf8ac1e9ad 100644 (file)
@@ -30,7 +30,7 @@ struct Choleski_decomposition {
     solve Px = rhs
     */
     Vector solve (Vector rhs) const;
     solve Px = rhs
     */
     Vector solve (Vector rhs) const;
-    void solve (Vector &dest, Vector const &rhs)const;
+    void solve (Vector &dest, Vector const &rhs) const;
     Vector operator * (Vector rhs) const { return solve (rhs); }
   /**
     return the inverse of the matrix P.
     Vector operator * (Vector rhs) const { return solve (rhs); }
   /**
     return the inverse of the matrix P.
@@ -41,8 +41,8 @@ struct Choleski_decomposition {
     */
     Matrix original() const;
 private:
     */
     Matrix original() const;
 private:
-    void full_matrix_solve (Vector &,Vector const&)const;
-    void band_matrix_solve (Vector &, Vector const&)const;
+    void full_matrix_solve (Vector &,Vector const&) const;
+    void band_matrix_solve (Vector &, Vector const&) const;
     void full_matrix_decompose (Matrix const & P);
     void band_matrix_decompose (Matrix const &P);
         
     void full_matrix_decompose (Matrix const & P);
     void band_matrix_decompose (Matrix const &P);
         
index 2e205ba33063c85b2a0cfd7b224594a1ce83b764..4abefd3dea5f5eac5654846f8f2a8636cc6b48ba 100644 (file)
@@ -53,13 +53,13 @@ class Cursor
     Cursor<T> operator --( int); 
 
     /// point to link?
     Cursor<T> operator --( int); 
 
     /// point to link?
-    bool ok()const;
+    bool ok() const;
 
     /// ++ items left?
 
     /// ++ items left?
-    bool forward()const;               
+    bool forward() const;              
 
     /// -- items left?
 
     /// -- items left?
-    bool backward()const;
+    bool backward() const;
 
     /**  put (copy) after me in List. 
       analogously to editor. ok() interpreted as at end
 
     /**  put (copy) after me in List. 
       analogously to editor. ok() interpreted as at end
index 4fce0b19537a0976bd4e129142a2425c8cffcbd2..b1004b600aa5028f79e6efd4f2e5f63f8f17ac9e 100644 (file)
@@ -90,21 +90,21 @@ Cursor<T>::pointer()
 
 template<class T>
 inline bool
 
 template<class T>
 inline bool
-Cursor<T>::backward()const
+Cursor<T>::backward() const
 {
   return ( pointer_ != 0);
 }
 
 template<class T>
 inline bool
 {
   return ( pointer_ != 0);
 }
 
 template<class T>
 inline bool
-Cursor<T>::forward()const
+Cursor<T>::forward() const
 {
   return ( pointer_ != 0);
 }
 
 template<class T>
 inline bool
 {
   return ( pointer_ != 0);
 }
 
 template<class T>
 inline bool
-Cursor<T>::ok()const
+Cursor<T>::ok() const
 {
   return ( pointer_ != 0);
 }
 {
   return ( pointer_ != 0);
 }
index 9ac2be679d93e93ceb2e7e253841d329ced02027..f000cf23878fa6c6d65d313fa22cd198bfd9d8c0 100644 (file)
@@ -26,10 +26,10 @@ class Diagonal_storage : public Matrix_storage {
 
 public:
      void set_band_size (int b);
 
 public:
      void set_band_size (int b);
-   int band_size_i()const;
+   int band_size_i() const;
     
     void assert_valid (int i, int j) const;
     
     void assert_valid (int i, int j) const;
-    bool band_elt_b (int,int)const;
+    bool band_elt_b (int,int) const;
     void resize_dim (int);
     
     virtual void resize_rows (int d) { resize_dim (d); }
     void resize_dim (int);
     
     virtual void resize_rows (int d) { resize_dim (d); }
@@ -54,12 +54,12 @@ public:
     virtual void delete_column (int k);
     
     ~Diagonal_storage();
     virtual void delete_column (int k);
     
     ~Diagonal_storage();
-    virtual bool mult_ok (int i, int j)const;
+    virtual bool mult_ok (int i, int j) const;
     virtual void mult_next (int &i, int &j) const ;
     virtual bool trans_ok (int i, int j) const;
     virtual void trans_next (int &i, int &j) const;
     DECLARE_VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage);
     DECLARE_MY_RUNTIME_TYPEINFO;
     virtual void mult_next (int &i, int &j) const ;
     virtual bool trans_ok (int i, int j) const;
     virtual void trans_next (int &i, int &j) const;
     DECLARE_VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage);
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual bool try_right_multiply (Matrix_storage * dest, Matrix_storage const *)const;
+    virtual bool try_right_multiply (Matrix_storage * dest, Matrix_storage const *) const;
 };
 #endif // DIAGONAL_STORAGE_HH
 };
 #endif // DIAGONAL_STORAGE_HH
index caa065abecea23346e7cd3ccb326b47594eeb5c4..f82222158580c06e72301ac727b85d4e9aacbf85 100644 (file)
@@ -35,7 +35,7 @@ public:
     bool contains_b (Directed_graph_node const*) const;
 
     Directed_graph_node (Directed_graph_node const &);
     bool contains_b (Directed_graph_node const*) const;
 
     Directed_graph_node (Directed_graph_node const &);
-    void OK()const;
+    void OK() const;
     Directed_graph_node();
 
     ~Directed_graph_node();
     Directed_graph_node();
 
     ~Directed_graph_node();
index 0d17df412ff1cfba180b81cd37b35ea551e5b2a8..50eb0e0109979b9c0e6678d4e2ae991ec53d69b1 100644 (file)
@@ -41,8 +41,8 @@ public:
     virtual void resize (int i, int j);
     virtual void resize (int i);
     virtual Real& elem (int i,int j);
     virtual void resize (int i, int j);
     virtual void resize (int i);
     virtual Real& elem (int i,int j);
-    virtual Real elem (int i, int j)const ;
-    int dim()const;
+    virtual Real elem (int i, int j) const ;
+    int dim() const;
     Full_storage (Matrix_storage*);
     Full_storage();
     Full_storage (int i, int j);
     Full_storage (Matrix_storage*);
     Full_storage();
     Full_storage (int i, int j);
@@ -56,13 +56,13 @@ public:
     virtual void delete_column (int k);
     
     ~Full_storage();
     virtual void delete_column (int k);
     
     ~Full_storage();
-    virtual bool mult_ok (int i, int j)const;
+    virtual bool mult_ok (int i, int j) const;
     virtual void mult_next (int &i, int &j) const ;
     virtual bool trans_ok (int i, int j) const;
     virtual void trans_next (int &i, int &j) const;
     DECLARE_VIRTUAL_COPY_CONS(Full_storage,Matrix_storage);
     DECLARE_MY_RUNTIME_TYPEINFO;
     virtual void mult_next (int &i, int &j) const ;
     virtual bool trans_ok (int i, int j) const;
     virtual void trans_next (int &i, int &j) const;
     DECLARE_VIRTUAL_COPY_CONS(Full_storage,Matrix_storage);
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual bool try_right_multiply (Matrix_storage * dest, Matrix_storage const *)const;
+    virtual bool try_right_multiply (Matrix_storage * dest, Matrix_storage const *) const;
 };
 
 #endif // FULL_STORAGE_HH
 };
 
 #endif // FULL_STORAGE_HH
index 0e45f15b247468b6365a54c46a1c4ef475722e5d..c919bf1ac904abe1b75f2b40f6bb43c6ac135136 100644 (file)
@@ -18,7 +18,7 @@ Full_storage::init()
   height_i_=width_i_=max_height_i_=max_width_i_=0;
 }
 INLINE bool
   height_i_=width_i_=max_height_i_=max_width_i_=0;
 }
 INLINE bool
-Full_storage::valid (int i, int j)const
+Full_storage::valid (int i, int j) const
 {
   return (i>=0 && i < height_i_)
        && (j < width_i_ && j >=0);
 {
   return (i>=0 && i < height_i_)
        && (j < width_i_ && j >=0);
@@ -62,7 +62,7 @@ Full_storage::cols() const
   return width_i_;
 }
 INLINE int
   return width_i_;
 }
 INLINE int
-Full_storage::dim()const
+Full_storage::dim() const
 {
   assert (rows()==cols ());
   return rows();
 {
   assert (rows()==cols ());
   return rows();
index 19d50611146e3c628888a6a92191d1cc5d3fff47..865a7915749049af429f0b535ef1e1e9bb4e35f7 100644 (file)
@@ -46,8 +46,8 @@ struct Interval_t {
        return ((Interval_t<T> *)this)->idx (j);
     }
     T &max() { return right;}
        return ((Interval_t<T> *)this)->idx (j);
     }
     T &max() { return right;}
-    T max()const { return right;}
-    T min()const{ return left; }
+    T max() const { return right;}
+    T min() const{ return left; }
     T &min(){ return left; }
     /**
       PRE
     T &min(){ return left; }
     /**
       PRE
index 50864b78943b40e3d10f1e19964c01a550f55a1b..1a483b5f188a58a8f527a3429767e283b0b310ba 100644 (file)
@@ -34,7 +34,7 @@ _Interval__compare (const Interval_t<T>&a,Interval_t<T> const&b)
 
 template<class T>
 bool 
 
 template<class T>
 bool 
-Interval_t<T>::contains_b (Interval_t<T> const& a)const
+Interval_t<T>::contains_b (Interval_t<T> const& a) const
 {
   int c_i= _Interval__compare (*this, a);
   if (c_i == -2)
 {
   int c_i= _Interval__compare (*this, a);
   if (c_i == -2)
@@ -62,9 +62,12 @@ Interval_t<T>::set_empty()
 
 template<class T>
 T
 
 template<class T>
 T
-Interval_t<T>::length() const {
-  assert (right >= left);
-  return right-left;
+Interval_t<T>::length() const 
+{
+  if (right < left) 
+    return 0;
+  else 
+    return right-left;
 }
 
 template<class T>
 }
 
 template<class T>
index b8a2e19049a1b02f5118b2e2b076000c43c9d26a..9341d1dcaf528dddc64c8702f28c44a9b221f5a0 100644 (file)
@@ -14,7 +14,7 @@ struct Long_option_init {
     char const * longname;
     char        shortname;
 
     char const * longname;
     char        shortname;
 
-    void printon (ostream &errorout)const ;
+    void printon (ostream &errorout) const ;
 };
 
 
 };
 
 
@@ -68,7 +68,7 @@ public:
     void next();
     const Long_option_init *parselong();
     const Long_option_init *parseshort();
     void next();
     const Long_option_init *parselong();
     const Long_option_init *parseshort();
-    void OK()const;
+    void OK() const;
     bool ok() const;
 
     /// report an error and abort
     bool ok() const;
 
     /// report an error and abort
index 80d12f56ba2323ea6e2bb5a4556a603b045c296b..f77a2018361d3f407aa3a4877c4d9bf16bba494d 100644 (file)
@@ -40,7 +40,7 @@ List<T>::size() const
 
 template<class T>
 inline Cursor<T>
 
 template<class T>
 inline Cursor<T>
-List<T>::top()const
+List<T>::top() const
 {
   return Cursor<T>( *this, top_);
 }
 {
   return Cursor<T>( *this, top_);
 }
@@ -48,7 +48,7 @@ List<T>::top()const
 
 template<class T>
 inline Cursor<T>
 
 template<class T>
 inline Cursor<T>
-List<T>::bottom()const
+List<T>::bottom() const
 {
   return Cursor<T>( *this, bottom_);
 }
 {
   return Cursor<T>( *this, bottom_);
 }
index 1233c4821d6613b6a6d1b467eeaff60a39f6522c..06aa312bc30a4517f59b0ff28d7fde2dfb275438 100644 (file)
@@ -10,7 +10,7 @@
 
 
 // instantiate a template:  explicit instantiation.
 
 
 // instantiate a template:  explicit instantiation.
-#define L_INSTANTIATE(a)   class List<a>; template class Cursor<a>; \
+#define LIST_INSTANTIATE(a)   class List<a>; template class Cursor<a>; \
   template class Link<a>
 
 #include "list.hh"
   template class Link<a>
 
 #include "list.hh"
index 662cdddc895bf1068e5be133cd741e9187f0e560..5027b6f5558afa94d13ef9dfc00511d6017790cd 100644 (file)
@@ -109,7 +109,7 @@ public:
     virtual void delete_row (int k)=0;
         virtual void delete_column (int k)=0;
     virtual ~Matrix_storage() { }
     virtual void delete_row (int k)=0;
         virtual void delete_column (int k)=0;
     virtual ~Matrix_storage() { }
-    virtual Matrix_storage *clone()const=0;
+    virtual Matrix_storage *clone() const=0;
 
 
     
 
 
     
@@ -153,7 +153,7 @@ public:
     static void set_band (Matrix_storage*&, int band);
     static void set_full (Matrix_storage*&);
     virtual bool try_right_multiply (Matrix_storage *dest, 
     static void set_band (Matrix_storage*&, int band);
     static void set_full (Matrix_storage*&);
     virtual bool try_right_multiply (Matrix_storage *dest, 
-                                   const Matrix_storage *fact)const ;
+                                   const Matrix_storage *fact) const ;
     /**
       RTTI.
      */
     /**
       RTTI.
      */
index c2545a072dd6aa99353a0166a4365b72ef3ed967..c87613c454bf35ce0be69d194b9febf77b358569 100644 (file)
@@ -48,9 +48,9 @@ public:
       0 <= band_i() <= dim
       */
     int band_i() const;
       0 <= band_i() <= dim
       */
     int band_i() const;
-    bool band_b()const;
-    void set_full()const;
-    void try_set_band()const;
+    bool band_b() const;
+    void set_full() const;
+    void try_set_band() const;
     ~Matrix() { delete dat; }
 
     /// set entries to r 
     ~Matrix() { delete dat; }
 
     /// set entries to r 
index 054288b809a81d5a6bf70dc33ed509eef5ffda61..e1e597202030e8c61c118b6479fb7e0658bc05a1 100644 (file)
@@ -67,7 +67,7 @@ public:
                return i;
        return -1;
     }
                return i;
        return -1;
     }
-    T *find_l (T const *t)const
+    T *find_l (T const *t) const
     {
        int i = find_i (t);
        if (i >= 0)
     {
        int i = find_i (t);
        if (i >= 0)
index 81a8cb1038902a0d18ec8a495a866fe16d43b181..1f3a5eb97ad80b0885c5a82a672f8dea1e848466 100644 (file)
@@ -27,7 +27,7 @@ class File_path : private Array<String>
 {
 public:
     /// locate a file in the search path
 {
 public:
     /// locate a file in the search path
-    String find (String nm)const;
+    String find (String nm) const;
 
     /// add to end of path.
     Array<String>::push;
 
     /// add to end of path.
     Array<String>::push;
index 7fda7abb2c5cbc9302045fe1bf867e2e68905b9a..d81b322e48dac5e58461e86c6bffdcbf39dfeb7e 100644 (file)
@@ -8,7 +8,7 @@
 #define PLIST_INL
 
 template<class T>
 #define PLIST_INL
 
 template<class T>
-void
+inline void
 PL_copy (Pointer_list<T*> &to, Pointer_list<T*> const&src)
 {
   for (PCursor<T*> pc (src); pc.ok(); pc++) 
 PL_copy (Pointer_list<T*> &to, Pointer_list<T*> const&src)
 {
   for (PCursor<T*> pc (src); pc.ok(); pc++) 
@@ -19,4 +19,15 @@ PL_copy (Pointer_list<T*> &to, Pointer_list<T*> const&src)
     }
 }
 
     }
 }
 
+
+template<class T>
+inline PCursor<T> 
+Link_list<T>::find (T what) const
+{
+  PCursor<T> i (*this);
+  for (; i.ok(); i++)
+       if (i.ptr() == what)
+          break;
+  return i;    
+}
 #endif
 #endif
index 07c1a0118f77ae6d0b67afbe3f36d2b05bac88d0..5ce6c2446c29b6921036d14e442eaa4b5dccc3db 100644 (file)
@@ -1,9 +1,19 @@
+/*
+  plist.tcc -- implement Pointer_list
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef PLIST_TCC
+#define PLIST_TCC
+
 #include "plist.hh"
 
 #include "plist.hh"
 
-#define PL_INSTANTIATE(a) class Link_list<a*>; \
+#define POINTERLIST_INSTANTIATE(a) class Pointer_list<a*>;\
        template class PCursor<a*>;
        template class PCursor<a*>;
-#define IPL_INSTANTIATE(a) PL_INSTANTIATE(a); \
-       template class Pointer_list<a*>
        
 template<class T>
 void
        
 template<class T>
 void
@@ -16,13 +26,4 @@ Pointer_list<T>::junk()
     }
 }
 
     }
 }
 
-template<class T>
-PCursor<T> 
-Link_list<T>::find (T what) const
-{
-  PCursor<T> i (*this);
-  for (; i.ok(); i++)
-       if (i.ptr() == what)
-          break;
-  return i;    
-}
+#endif // PLIST_TCC
index 5eed1f4ef68af155ac11401ccfd59dec4e78d5ea..4ce1302189594ef71b71a3d3d0b09db7d8de9e42 100644 (file)
@@ -13,7 +13,7 @@
 template<class T>
 inline
 T *
 template<class T>
 inline
 T *
-P<T>::copy_p()const
+P<T>::copy_p() const
 {
   return t_p? new T(*t_p) : 0;
 }
 {
   return t_p? new T(*t_p) : 0;
 }
index d4440b1c26277249658caaa544cbafd9ccfad168..4dfe5544b95371f5e6dbd599044219bf2192d16a 100644 (file)
@@ -78,7 +78,7 @@ friend class String_handle;
       #String_data# knowing it.  */
     Byte &operator [](int j);
     Byte operator [](int j) const;
       #String_data# knowing it.  */
     Byte &operator [](int j);
     Byte operator [](int j) const;
-    bool is_binary_bo()const;
+    bool is_binary_bo() const;
 };
 
 
 };
 
 
index 6a88eef8c94cf3014b138703c77a993b8aa91a8d..c2225782d7b9fa5217115425b4af4634f926862b 100644 (file)
@@ -186,7 +186,7 @@ String_data::trunc (int j)
 }
 
 INLINE bool
 }
 
 INLINE bool
-String_data::is_binary_bo()const
+String_data::is_binary_bo() const
 {
 //    return !memchr (data_byte_p_, length_i_, 0);
   return ( (int)strlen ((char const*)data_byte_p_) != length_i_ );
 {
 //    return !memchr (data_byte_p_, length_i_, 0);
   return ( (int)strlen ((char const*)data_byte_p_) != length_i_ );
index c6e73ada103bb000eacfe76e6f1847daf7c80a70..ccd149b9cf7e6ec84d1d8e6f89e94194580e9058 100644 (file)
@@ -42,7 +42,7 @@ public:
     char const* ch_C() const;
     Byte* byte_l();
     char* ch_l();    
     char const* ch_C() const;
     Byte* byte_l();
     char* ch_l();    
-    bool is_binary_bo()const;
+    bool is_binary_bo() const;
     void operator =(String_handle const &src);
     void operator += (char const *s);
     Byte operator[](int j) const;
     void operator =(String_handle const &src);
     void operator += (char const *s);
     Byte operator[](int j) const;
index e56496605d199bf526f0b037d53e9f87a920ac49..278ed57190d2aef1dd23cc030cc96d6304e3ca79 100644 (file)
@@ -17,7 +17,7 @@
 #define DECLARE_MY_RUNTIME_TYPEINFO    \
 static char const *static_name();\
 static bool static_is_type_b (const char*s);\
 #define DECLARE_MY_RUNTIME_TYPEINFO    \
 static char const *static_name();\
 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 bool is_type_b (const char *s) const { return static_is_type_b (s); } \
 virtual char const *name() const{ return static_name (); } \
 int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
 
 virtual char const *name() const{ return static_name (); } \
 int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
 
index a73334fe008ee59f767388a5af82631677efe06d..f0a49ab3602c4bd5af1a52a3199b857ae2bcf581 100644 (file)
@@ -74,7 +74,7 @@ Getopt_long::parselong()
 
 
 void
 
 
 void
-Long_option_init::printon (ostream &errorout)const
+Long_option_init::printon (ostream &errorout) const
 {
   if (shortname)       
        errorout <<"-" << shortname;
 {
   if (shortname)       
        errorout <<"-" << shortname;
@@ -219,7 +219,7 @@ Getopt_long::Getopt_long (int c, char  **v, Long_option_init *lo)
 }
 
 bool
 }
 
 bool
-Getopt_long::ok()const
+Getopt_long::ok() const
 {
   return  array_index_i_ < argument_count_i_;
 }
 {
   return  array_index_i_ < argument_count_i_;
 }
index 698f673b25e9fe33a403d486d9b79a3d41938a92..7556a2cdd5c3b3a0acf899169b8c43155faf36bf 100644 (file)
@@ -92,7 +92,7 @@ Matrix_storage::get_full (int n, int m)
 
  bool
 Matrix_storage::try_right_multiply (Matrix_storage *, 
 
  bool
 Matrix_storage::try_right_multiply (Matrix_storage *, 
-                                  const Matrix_storage *)const
+                                  const Matrix_storage *) const
 {
   return false;
 }
 {
   return false;
 }
index 3f9b28f835b5b165c274d5c26328f863dc7a1c3f..0641d8032f649582810780340fb2cf344b9dda47 100644 (file)
@@ -11,7 +11,7 @@
 #include "diagonal-storage.hh"
 
 bool
 #include "diagonal-storage.hh"
 
 bool
-Matrix::band_b()const
+Matrix::band_b() const
 {
   return dat->is_type_b (Diagonal_storage::static_name());
 }
 {
   return dat->is_type_b (Diagonal_storage::static_name());
 }
@@ -26,7 +26,7 @@ Matrix::set_full() const
 }
 
 void
 }
 
 void
-Matrix::try_set_band()const
+Matrix::try_set_band() const
 {
   if (band_b())
        return;
 {
   if (band_b())
        return;
@@ -107,7 +107,7 @@ Matrix::operator=(Matrix const &m)
 }
 
 int
 }
 
 int
-Matrix::band_i()const
+Matrix::band_i() const
 {
   if ( band_b()) 
     {
 {
   if ( band_b()) 
     {
index e880b200ae163c2c83da2ddbc7b8a8245f93a9e4..bdfaf80b633a4deebc824d65e1be3c8ee1fc7a0d 100644 (file)
@@ -54,7 +54,7 @@ split_path (String path,
   in any other added path, in this order.
   */
 String
   in any other added path, in this order.
   */
 String
-File_path::find (String nm)const
+File_path::find (String nm) const
 
 {
   fdebug << "looking for " << nm << ": ";
 
 {
   fdebug << "looking for " << nm << ": ";
index c80d39e6fe268eca69321b16123b29dde09f883d..359667459f40a3737f1608fe1fb478b972e35443 100644 (file)
@@ -19,7 +19,8 @@ staff_engraver = \requesttranslator {
                          Engraver  "Voice_group_engravers"
                          \alias "Voice_group";
                          \consists "Dynamic_engraver";
                          Engraver  "Voice_group_engravers"
                          \alias "Voice_group";
                          \consists "Dynamic_engraver";
-                         \consists "Stem_beam_engraver";
+                         \consists "Stem_engraver";
+                       \consists "Beam_engraver";
                          \consists "Script_engraver";
                          \consists "Note_column_engraver";
                          \consists "Slur_engraver";
                          \consists "Script_engraver";
                          \consists "Note_column_engraver";
                          \consists "Slur_engraver";
@@ -72,6 +73,7 @@ orchestral_score_translator = \requesttranslator {
        Engraver Score_engraver
        \alias "Score";
 
        Engraver Score_engraver
        \alias "Score";
 
+       \consists "Timing_engraver";
        \consists "Bar_column_engraver";
        \consists "Bar_number_grav";
 
        \consists "Bar_column_engraver";
        \consists "Bar_number_grav";
 
@@ -89,5 +91,10 @@ orchestral_score_translator = \requesttranslator {
        \contains \requesttranslator { \piano_staff_engraver }
 }
 
        \contains \requesttranslator { \piano_staff_engraver }
 }
 
+stupid_engraver = \requesttranslator {
+       Engraver Score_engraver
+       \consists "Staff_sym_engraver";
+}
+
 
 
 
 
diff --git a/input/fugue1.ly b/input/fugue1.ly
new file mode 100644 (file)
index 0000000..f3d8fb0
--- /dev/null
@@ -0,0 +1,208 @@
+\header{
+filename               fugue1.ly
+title          Fuga a 4
+description            Das Wohltemperierte Clavier I, Fuga I (c-major)
+opus           BWV 846
+composer               Johann Sebastian Bach (1685-1750)
+enteredby              Shay Rojansky
+copyright              Public Domain
+}
+
+%{
+       
+%}
+\version "0.1.1";
+
+
+global = 
+    \melodic {
+         \meter 4/4;                % should be \meter C
+    }
+  
+tenor =
+    \melodic {
+        \clef "violin";
+        \octave c';
+
+        \stem \down;
+        r8 [c8 d e] [f. g32 f] [e8 a] |
+        [d g] ~ [g16 a g f] [e f e d] [c d c 'b] |
+        ['a8 fis] g4 ~ [g8 fis16 e] [f8 d] |
+        [g f! e d] c r r g ~ |
+%% 5
+        [g f16 e] f4 ~ [f16 f e8] d4 |
+        [c8 f] r16 [g f e] [f8 d] g4 ~ |
+       g4 r4 r2 |
+       r1 |
+       r8 [g8 a b] [c'. d'32 c'] [b8 e']
+%% 10
+       [a d'] ~ [d'16 e' d' c'] b8 r8 r d |
+       [e fis] [g. a32 g] [fis8 b e a] ~ |
+       [a16 b a gis] [fis8 f!] [e d] ~ [d16 e fis gis] |
+       [a gis a b] [gis fis gis a] b8 r8 r4 |
+       r8 [c8 d e] \stem 1; [f. g32 f] [e8 a] |
+%% 15
+       [d g] ~ [g16 a g f] e8 \stem -1; [e fis g] ~ |
+       [g8 fis] [gis8 a] ~ [a g! a b] |
+       \stem 0;
+       [c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
+       [b8 g' cis' d'] [e' cis' d' e' ] |
+       \stem -1; a8 r8 r e [fis g] \stem 0; [a. b32 a] |
+%% 20
+       [g8 c' fis b] ~ [b16 c' b a] \stem -1; [g fis e d] \stem 0; |
+       e4 \stem -1; d ~ [d16 a g f!] [e g f! a] |
+       g4 ~ [g16 a bes8] c'4 [d'8 g] |
+       \stem 0; g4. f8 ~ [f e] d4 |
+       \stem -1; e8 a4 g8 ~ [g8 f g a] |
+%% 25
+       [bes8. c'32 b] [a8 d'] [g c'] ~ [c'16 d' c' bes] |
+       [a bes a g] [f g f e] d4 ~ [d8. g16] |
+       a4 r16 [f'16 d'8] e'2 |
+    }
+
+
+soprane =
+    \melodic {
+        \octave c';
+        \stem \up;
+        r1 |
+        r2 r8 [g8 a b] |
+        [c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
+        [b g a b] [c' b c' d'] [e' d' e' fis'] [g'8 b] |
+%% 5
+       [c' a] [d'16 c' b a] [g8. g16] [f e f g] |
+       [a g a b] c'2 b4 |
+       \octave c'';
+       r8 [c8 d e] [f. g32 f] [e8 a] |
+       [d g] ~ [g16 a g f] [e8 a] ~ [a16 b a g] |
+       f2 [e8. fis16] g4 ~
+%% 10
+       g4 fis [g16 f! e d] [c d c 'b] |
+       ['a16 c 'b 'a] 'g8 r8 r16 [c16 'b 'a] ['gis8 e] |
+       [d c16 'b16] ['a 'gis 'a 'b] [c 'fis 'a 'gis] ['b8 'a16 'b]
+       [c8 f e d] ~ [d c16 'b] ['b8. 'a16] |
+       'a4 r4 r2 |
+%% 15
+       r2 r8 ['g8 'a 'b] |
+       [c8. d32 c] ['b8 c] [d e] [f!. g32 f!] |
+       [e8 a d g] ~ [g16 a g f] [e8 a] |
+       [d8 bes] [a g16 f] [g f g e] [f g g f32 g] |
+       [a16 cis d g] [e8. d16] d8 r8 r4 |
+%% 20
+       r2 r4 r8 'g |
+       ['a 'b] [c. d32 c] ['b8 e 'a d] ~ |
+       [e16 e d c] ['b c d e] [f g a g] [f e d c] |
+       'b4 [c8 d] 'g c4 'b8 |
+       c4 ['b8 'bes8] 'a d4 c8 |
+%% 25
+       [d8 e] f4 ~ [f16 a g f] [e f e d] |
+       c2 r16 ['g32 'a 'b!16 c] [d e f8] ~ |
+       [f32 c d e f16 g] [a8. b16] <g2 c'2> |
+    }
+
+alt =
+    \melodic {
+        \clef "bass";
+        \octave c;
+       
+       \stem 1;
+       r1 |
+       r |
+       r |
+       r8 [g8 a b] [c'. d'32 c'] [b8 e'] |
+%% 5
+       [a d'] ~ [d'16 e' d' c'] [b8 c' ~ c' bes8] |
+       [a d' g c'] r16 [a16 b c'] d'4 |
+       g4 r8 g8 [a b] [c'. d'32 c'] |
+       [b8 e' a d'] ~ [d'16 e' d' c'!] [b!8 e'] ~ |
+       e'4 d'4 [c'16 b c' a] [e' d' c' b] |
+%% 10
+       [c'16 a b c'] [d' c' b a] g4 r4 |
+       r1 |
+       r8 [e8 fis gis] [a. b32 a] [gis8 c'] |
+       [fis b] ~ [b16 c' b a] gis8 a4 gis8 |
+       a4 r8 g8 [a b] c'. [d'32 c'] |
+%% 15
+       [b8 e' a d'] ~ [d' g] d'4 |
+       [c'8 a] e'4 d'8 r8 r4 |
+       r8 [a8 b cis'] [d'. e'32 d'] [c'!8 f'] |
+       [b8 e'] ~ [e'16 f' e' d'] cis'8 r8 r4 |
+       r8 [a8 b cis'] [d'. e'32 d'] [c'!8 fis'] |
+%% 20
+       [b e'] ~ [e'16 fis' e' d'] c'2 ~ |
+       [c'16 d' c' b] [a g a fis] [g8 b c' d'] |
+       [e'. f'32 e'] [d'8 g'] [c' f'] ~ [f'16 g' f' e'] |
+       d'4 [e'8 d'] ~ [d' g] g4 ~
+       [g8 c d e] [f. g32 f] [e8 a] |
+%% 25
+       [d g] ~ [g16 a g f] [e d e f] [g a bes g] |
+       [a e f g] [a b c' a] b2 |
+       c'1 |
+    }
+
+bass =
+    \melodic {
+        \clef "bass";
+        \octave c;
+
+       \stem -1;
+        r1 |
+       r |
+       r |
+       r |
+%% 5
+       r2 r8 [c8 d e] |
+       [f. g32 f] [e8 a] [d g] ~ [g16 a g f] |
+       [e f e d] [c d c 'b] ['a8 d a fis] |
+       [g16 a bes g] [cis8 d] a4 e4 |
+       [a16 b c' d'] [c' b a g] c'8 r8 r4 |
+%% 10
+       r2 r8 ['g8 'a 'b] |
+       [c. d32 c] ['b8 e] ['a d] ~ [d16 e d c] |
+       'b8 e4 d8 c f!4 e8 ~ |
+       e d4 e8 [f! e16 d] e4 |
+       'a4 r4 r2 |
+%% 15
+       r8 ['g8 'a 'b] [c. d32 c] ['b8 e] |
+       ['a8 d] ~ [d16 e d c] ['b8 'bes 'a g'] |
+       ['a8 fis g e] d4 [e8 f!] |
+       [g8. a32 g] [f8 bes] [e a] ~ [a16 bes a g] |
+       [f e f d] [g8 a] d2 ~ |
+%% 20
+       [d16 e d c] ['b 'a 'g 'fis] ['e8 e fis g] ~ |
+       [g a16 g16] [fis8 d] g2 ~ |
+       g2 a4 [b8 c'] |
+       [f16 a g f] [e d c 'b] [c d e f] [g8 'g] |
+       c1 ~ |
+%% 25
+       c1 ~ |
+       c1 ~ |
+       c1 |
+    }
+
+        
+\score {
+    \melodic < \id "Piano" ""; 
+              \multi 1;
+                 < \multi 2;
+                       \global 
+                       \soprane
+                       \tenor
+                 >
+                 < \multi 2;
+                       \global
+                       \alt
+                      \bass
+                 >
+             >
+
+    \paper{
+       gourlay_maxmeasures =5.;
+%      castingalgorithme = \Wordwrap
+    }
+    \midi {
+        \tempo 4 = 84;
+    }
+}
+
+% EOF
diff --git a/input/prelude1.ly b/input/prelude1.ly
new file mode 100644 (file)
index 0000000..da66d87
--- /dev/null
@@ -0,0 +1,190 @@
+\header{
+filename               prelude1.ly
+title          Preludium
+description            Das Wohltemperierte Clavier I, Prelude I (c-major)
+opus           BWV 846
+source
+composer               Johann Sebastian Bach (1685-1750)
+enteredby              Shay Rojansky
+copyright              Public Domain"
+}
+
+\version "0.1.1";
+
+                                    % should add \need{dutch.ini} for
+                                    % correct parsing of note names
+
+global = 
+    \melodic {
+        \meter 4/4;                % should be \meter C
+    }
+  
+
+% should do programmable input.
+
+soprane =
+    \melodic {
+        \clef "violin";
+        \octave c';
+
+       <\multi 2;
+       % Real soprane
+       {\stem 1;
+       r8 [g16 c'] [e' g c' e'] r8 [g16 c'] [e' g c' e'] |
+       r8 [a16 d'] [f' a d' f'] r8 [a16 d'] [f' a d' f'] |
+       r8 [g16 d'] [f' g d' f'] r8 [g16 d'] [f' g d' f'] |
+       r8 [g16 c'] [e' g c' e'] r8 [g16 c'] [e' g c' e'] |
+       r8 [a16 e'] [a' a e' a'] r8 [a16 e'] [a' a e' a'] |
+       r8 [fis16 a] [d' fis a d'] r8 [fis16 a] [d' fis a d'] |
+       r8 [g16 d'] [g' g d' g'] r8 [g16 d'] [g' g d' g'] |
+       r8 [e16 g] [c' e g c'] r8 [e16 g] [c' e g c'] |
+       r8 [e16 g] [c' e g c'] r8 [e16 g] [c' e g c'] |}
+       % Tenor
+       {\stem -1;
+       r16 e8. ~ e4 r16 e8. ~ e4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 e8. ~ e4 r16 e8. ~ e4 |
+       r16 e8. ~ e4 r16 e8. ~ e4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 c8. ~ c4 r16 c8. ~ c4 |
+       r16 c8. ~ c4 r16 c8. ~ c4 |}>
+%% 10  
+       r8 [d16 fis] [c' d fis c'] r8 [d16 fis] [c' d fis c'] |
+       r8 [d16 g] [b d g b] r8 [d16 g] [b d g b] |
+       r8 [e16 g] [cis' e g cis'] r8 [e16 g] [cis' e g cis'] |
+       r8 [d16 a] [d' d a d'] r8 [d16 a] [d' d a d'] |
+       r8 [d16 f] [b d f b] r8 [d16 f] [b d f b] |
+       r8 [c16 g] [c' c g c'] r8 [c16 g] [c' c g c'] |
+       r8 ['a16 c] [f 'a c f] r8 ['a16 c] [f 'a c f] |
+       r8 ['a16 c] [f 'a c f] r8 ['a16 c] [f 'a c f] |
+       r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+       r8 ['g16 c] [e 'g c e] r8 ['g16 c] [e 'g c e] |
+%% 20
+       r8 ['bes16 c] [e 'bes c e] r8 ['bes16 c] [e 'bes c e] |
+       r8 ['a16 c] [e 'a c e] r8 ['a16 c] [e 'a c e] |
+       r8 ['a16 c] [ees 'a c ees] r8 ['a16 c] [ees 'a c ees] |
+       r8 ['b16 c] [d 'b c d] r8 ['b16 c] [d 'b c d] |
+       r8 ['g16 'b] [d 'g 'b d] r8 ['g16 'b] [d 'g 'b d] |
+       r8 ['g16 c] [e 'g c e] r8 ['g16 c] [e 'g c e] |
+       r8 ['g16 c] [f 'g c f] r8 ['g16 c] [f 'g c f] |
+       r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+       r8 ['a16 c] [fis 'a c fis] r8 ['a16 c] [fis 'a c fis] |
+       r8 ['g16 c] [g 'g c g] r8 ['g16 c] [g 'g c g] |
+%% 30
+       r8 ['g16 c] [f 'g c f] r8 ['g16 c] [f 'g c f] |
+       r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+       r8 ['g16 'bes] [e 'g 'bes e] r8 ['g16 'bes] [e 'g 'bes e] |
+
+       r8 ['f16 'a] [c f c 'a] [c 'a 'f 'a] ['f 'd 'f 'd] |
+       r8 [g16 b] [d' f' d' b] [d' b g b] [d f e d] |
+       <e1 g c'> ||
+    }
+
+bass =
+    \melodic {
+        \clef "bass";
+        \octave c;
+
+       \stem -1;
+       c'2 c' |
+       c' c' |
+       b b |
+       c' c' |
+       c' c' |
+       c' c' |
+       b b |
+       b b |
+       a a |   
+%% 10
+       <\multi 2;
+       % Alt
+       {\stem 1;
+       r16 a8. ~ a4 r16 a8. ~ a4 |
+       r16 b8. ~ b4 r16 b8. ~ b4 |
+       r16 bes8. ~ bes4 r16 bes8. ~ bes4 |
+       r16 a8. ~ a4 r16 a8. ~ a4 |
+       r16 aes8. ~ aes4 r16 aes8. ~ aes4 |
+       r16 g8. ~ g4 r16 g8. ~ g4 |
+       r16 f8. ~ f4 r16 f8. ~ f4 |
+       r16 f8. ~ f4 r16 f8. ~ f4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 e8. ~ e4 r16 e8. ~ e4 |
+%% 20
+       r16 g8. ~ g4 r16 g8. ~ g4 |
+       r16 f8. ~ f4 r16 f8. ~ f4 |
+       r16 c8. ~ c4 r16 c8. ~ c4 |
+       r16 f8. ~ f4 r16 f8. ~ f4 |
+       r16 f8. ~ f4 r16 f8. ~ f4 |
+       r16 e8. ~ e4 r16 e8. ~ e4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 ees8. ~ ees4 r16 ees8. ~ ees4 |
+       r16 e!8. ~ e4 r16 e8. ~ e4 |
+%% 30
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 d8. ~ d4 r16 d8. ~ d4 |
+       r16 c8. ~ c4 r16 c8. ~ c4 |
+
+       r16 c8. ~ c4 ~ c2 |
+       r16 'b8. ~ 'b4 ~ 'b2 |
+       c1 ||}
+
+       % Bass
+       {\stem -1;
+       d2 d |
+       g g |
+       g g |
+       f f |
+       f f |
+       e e |
+       e e |
+       d d |
+       'g 'g |
+       c c |
+%% 20
+       c c |
+       'f 'f |
+       'fis 'fis |
+       'aes 'aes |
+       'g 'g |
+       'g 'g |
+       'g 'g |
+       'g 'g |
+       'g 'g |
+       'g 'g |
+%% 30
+       'g 'g |
+       'g 'g |
+       'c 'c |
+       
+       'c 'c |
+       'c 'c |
+       'c1 }>
+    }
+
+        
+\score {
+    \melodic < \id "Piano" ""; 
+              \multi 1;
+                 < \multi 2;
+                       \global 
+                       \soprane
+                 >
+                 < \multi 2;
+                       \global
+                      \bass
+                 >
+             >
+
+    \paper{
+       gourlay_maxmeasures =5.;
+       
+    }
+    \midi {
+        \tempo 4 = 84;
+    }
+}
+
+% EOF
index 14454306a25a76d648040b04fca7ea39d8441bac..8f897af1263cf8dfcf8f76288bcb5d34f636cd8d 100644 (file)
@@ -1,15 +1,13 @@
-%{MudelaHeader
 
 
- filename:rhythm.ly
- title:
- description: 
- composers:
- entered-by:HWN
- copyright:public domain
-
- Tested Features: multiple meters, beaming
+\header{
+ filename      rhythm.ly
+ entered-by    HWN
+ copyright     public domain
+ Tested Features        multiple meters, beaming
        unsynced bars
        unsynced bars
-EndMudelaHeader
+}
+%{
+has to be revised for 0.1.12
 %}
 
 
 %}
 
 
diff --git a/input/standchen-16.ly b/input/standchen-16.ly
deleted file mode 100644 (file)
index 191760b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-%{
-16-point version of "leise flehen meine lieder"
-%}
-
-\include "standchen-part.ly"
-
-\score{
-       \themusic
-       \paper{
-               % 16pt mustn't use whole page width
-               linewidth= 160.\mm;
-               % we want gourlay, don't set geometric
-               % geometric= 1.4;
-               gourlay_maxmeasures = 9.;
-               \output "standchen.out";
-       }
-       \midi{
-               \tempo 4 = 54;
-       }
-}
index 2818ebc4ac71f185c76f8425e3221381b6f46daf..ae3ccc33baad12ebef7fd18af0448ceac35eff72 100644 (file)
@@ -16,6 +16,6 @@
 \instrument{M\"a\ss ig} % heu
 %#%\tempo{M\"a\ss ig}
 \maketit
 \instrument{M\"a\ss ig} % heu
 %#%\tempo{M\"a\ss ig}
 \maketit
-\input standchen.out
+\input{standchen-16.out}
 %\input lelie.tex
 \end{document}
 %\input lelie.tex
 \end{document}
diff --git a/input/standchen-20.ly b/input/standchen-20.ly
deleted file mode 100644 (file)
index 5a9eb1b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-%{
-20-point version of "leise flehen meine lieder"
-%}
-
-\include "standchen-part.ly"
-
-\score{
-       \themusic
-       \paper{
-               \paper_twenty
-               % 20pt music uses whole pagewidth
-               linewidth= 195.\mm;
-
-               % we want gourlay, don't set geometric
-               % geometric= 1.4;
-               gourlay_maxmeasures = 9.;
-               \output "standchen.out";
-       }
-       \midi{
-               \tempo 4 = 54;
-       }
-}
index 2818ebc4ac71f185c76f8425e3221381b6f46daf..9870b620ead60373634ac19d2e1eaaec1c5acc14 100644 (file)
@@ -16,6 +16,6 @@
 \instrument{M\"a\ss ig} % heu
 %#%\tempo{M\"a\ss ig}
 \maketit
 \instrument{M\"a\ss ig} % heu
 %#%\tempo{M\"a\ss ig}
 \maketit
-\input standchen.out
+\input{standchen-20.out}
 %\input lelie.tex
 \end{document}
 %\input lelie.tex
 \end{document}
diff --git a/input/standchen-part.ly b/input/standchen-part.ly
deleted file mode 100644 (file)
index e1e8624..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-\header{
-filename       standchen-part.ly
-title          St\"andchen (Serenade) "Leise flehen meine Lieder"
-opus           D. 957 No. 4
-composers      Franz Schubert (1797-1828)
-               Text by Ludwig Rellstab (1799-1860)
-enteredby      JCN
-copyright      public domain
-} 
-%{
- Tested Features: multivoice, accents, lyrics, chords, piano music
-%}
-
-\version "0.1.1";
-
-commands = \melodic{
-       \skip 2.*4;
-       \bar "|:";
-       \skip 2.*24;
-%      volta1
-       \skip 2.*8;
-%      volta2
-       \bar ":|";
-       \skip 2.*22;
-       \bar "|."; 
-       }
-
-melodie = \melodic{ 
-       \meter 3/4;
-       \clef "violin";
-       \key bes;
-       \octave c';
-       \duration 8;
-       r \pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > |
-%%2
-       r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > |
-%%3
-       \textstyle "italic";
-       r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] >|
-       \textstyle "roman";
-       
-%%4
-       r < [ 'a cis > e < 'a cis > e < 'a cis ] > |
-%%5
-       [2/3 a~ bes a ]1/1 d'4. a |
-%%6
-       [2/3 g~ a g ]1/1 d'4 g r |
-
-%%7
-       a4.^> g [2/3 g~ f e ]1/1 |
-%%8
-       f2 r4 |
-%%9
-
-       < { a'4.~  g' [2/3 g'( f' )e' ]1/1 }
-       { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > |
-%%10
-       < f'2. d'2. > |
-%%11
-       [2/3 a ~  bes a ]1/1 f'4. a |
-%%12
-       [2/3 g~   a g ]1/1 e'4. d' |
-%%13
-       c'4. bes [2/3 bes~   a g ]1/1 |
-%%14
-       a2 r 
-       < { d'~  c'4. g [2/3 bes a g ]1/1 }
-       { f \p ~  e4._"dolce" bes 
-               \plet 2/3; g
-               \plet 1/1; 
-       } > |
-%%16
-       < a2. f2. > |
-%%17
-       \textstyle "italic";
-       [ a8._"cresc." cis'16 ] f'4. e'
-       \textstyle "roman";|
-%%18
-       [ d'8. a16 ] f4. d |
-%%19
-%#%    c'\grace\stemup
-       [2/3 bes ~   a bes ]1/1 d'4. bes |
-%%20
-       a2. |
-%%21
-%#%    a\grace
-       [2/3 g~  fis g ]1/1 bes4.^> g |
-%%22
-       f!2. |
-%%23
-       [ a8. \mf cis'16 ] f'4. e' |
-%%24
-       [ d'8. a16 ] fis4. d |
-%%25
-       [2/3 b \mf~   ais b ]1/1 d'4. b |
-%%26
-       < a2. fis2. > |
-%%27
-       [2/3 e' \f~  dis' e' ]1/1 g'4. cis' |
-%%28
-       < d'2. fis2. > |
-%#%\volta1
-%%29
-       < { bes2( [ d'8.~ )bes16 ] }
-       { g2 \mf [ bes8. g16 ] } > |
-%%30
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-. ] } > |
-%%31 
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%32
-       < a2 fis2 \pp > < a4 fis4 > |
-%%33
-       < { b2( [ d'8.~ )b16 ] }
-       { g2 [ b8. g16 ] } > |
-%%34
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-. ] } > |
-%%35
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%36
-       < a2. fis2. > |
-%#%\volta2
-%%37
-       [ a8. a16 ] [ cis'8. cis'16 ] [ e'8. e'16 ] |
-%%38
-       d'4~  cis'4 r4 |
-%%39
-%#%    > a4. [ cis' e'8. >! d'16 ] |
-       a4. \> [ cis' e'8. \! d'16 ] |
-%%40
-       cis'2 r4 |
-%%41
-       < fis'4. \> cis'4. \f > e' [2/3 e'~  d' \! cis' ]1/1 |
-%%42
-       [ b8. cis'16 ] d'4^> b r |
-%%43
-
-       [ b8. \f cis'16 ] d'4^> b r |
-%%44
-       [ b8. \> cis'16 ] d'4^> b \! r |
-%%45
-       [2/3 b \p ~  ais b ]1/1 d'4. b |
-%%46
-       <a!2. fis2. > |
-%%47
-       [2/3 e' \f~  dis' e' ]1/1 g'4.^> cis' |
-%%48
-       \textstyle "italic";
-       < 
-       { fis2.~
-       %\group "+1"; 
-               \stem \down; f2. }
-       { d'2. ~ \stem \up;
-               d'4 r4_"decresc." d'4 } 
-       >
-       \textstyle "roman"; |
-%%50
-       < bes2. e2. > |
-%%51
-       < a2. cis2. > |
-%%52
-       < fis2 d2 > < a4 fis4 \pp > |
-%%53
-
-       < bes2 g2 > < [ d'8.^> bes8. > < bes16 g16 ] > |
-%%54
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-.] } > |
-%%55
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%56
-       \textstyle "italic";
-       < a2. fis2._"dim." >
-       \textstyle "roman"; |
-%%57
-       < a2. fis2. > |
-%%58
-       < a2.^\fermata fis2. > |
-%#%\tighten
-}
-
-begeleiding = \melodic{ 
-       \meter 3/4;
-       \clef"bass";
-       \key bes;
-       \octave c';
-       \duration 2;
-       'd r4 |
-%%2
-       ''bes r4 |
-
-%%3
-       ''g r4 |
-
-%%4
-       ''a r4 |
-%%5
-\duration 8;
-       < \multi 2; { \stem \up;        
-               [ 'f 'a d 'a d 'a ] 
-               [ 'd 'e 'g 'e 'g 'e ] 
-               [ 'cis 'e 'g 'e 'g 'e ]
-               [ 'd 'a d 'a d 'a ]
-               }
-       { \stem \down; 
-               'd2 r4 
-                ''bes2 r4 
-                ''a2 r4
-               'd2 r4
-       } >
-%%9
-       \stem 0;
-       [ 'a e g e g e ] |
-%%10
-       [ 'd 'a d 'a d 'a ] |
-%%11
-       < \multi 2;     
-       { \stem \up;
-               [ 'f 'a d 'a d 'a ]
-               [ 'd 'e 'g 'e 'g 'e ] 
-               [ 'e 'g 'bes 'g 'bes 'g ] 
-               [ 'a c f c f c ]
-       } { \stem \down; 
-               'd2 r4 
-                ''bes2 r4
-                'c2 r4 
-                'f2 r4 } 
-       >
-%%15
-       \stem 0;
-       [ 'c 'g 'bes 'g 'bes 'g ] |
-%%16
-       [ ''f 'c 'f 'c 'f 'c ] |
-       < \multi 2;
-       { \stem \up; 
-               [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
-               [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
-       { \stem \down; 
-               ''a2 r4
-               'd2 r4 
-               ''bes2 r4 
-               ''f2 r4 
-       } > 
-%%21
-       \stem 0;
-       < [ 'e 'c > 'g c 'g c 'g ] |
-%%22
-       [ 'f 'a c 'a 'f 'c ] |
-       < \multi 2; {
-               \stem \up;
-               [ ''a 'e 'g 'e 'g 'e ] 
-               [ 'd 'fis 'a 'fis 'a 'fis ] 
-               [ ''g 'd 'b 'd 'b 'd ] 
-               [ 'd 'a d 'a d 'a ] 
-       }
-       {\stem \down;
-               ''a2 r4 
-               'd2 r4 
-               ''g2 r4 
-               'd2 r4 
-       }
-       >
-       \stem 0;
-       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
-%%28
-       [ 'd 'a d 'a d 'a ] |
-%%29
-       [ 'd 'g 'bes 'g 'bes 'g ] |
-%#%\volta1
-%%30 
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%31
-       [ ''a 'e 'a 'e 'a 'e ] |
-%%32
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%33
-       [ 'd 'g 'b 'g 'b 'g ] |
-%%34
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%35
-       [ ''a 'e 'a 'e 'a 'e ] |
-%%36
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%#%\volta2
-%%37
-       [ ''a 'e 'g 'e ''bes^> 'e ] |
-%%38
-       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
-%%39
-       [ ''a 'e 'g 'e ''bes^> 'e ] |
-%%40
-       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
-%%41
-       [ ''ais 'e 'fis 'e 'fis 'e ] |
-%%42
-       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
-%%43
-       < [ 'e ''b > 'g 'b 'g 'b 'g ] |
-%%44
-       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
-%%45
-       < \multi 2; { \stem \up; 
-               [ ''g 'd 'b 'd 'b 'd ] 
-               [ 'd 'a d 'a d 'a ] 
-       } {
-               \stem \down;
-               ''g2 r4
-               'd2 r4 
-       } >
-
-%%47
-       \stem 0;
-       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
-%%48
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%49
-       [ 'd 'a d 'a d 'a ] |
-%%50
-       [ ''g 'e 'g 'e 'g 'e ] |
-%%51
-       [ ''a 'e 'g 'e 'g 'e ] |
-%%52
-       [ ''d 'd 'fis 'd 'fis 'd ] |
-%%53
-       [ 'd 'g 'bes 'g 'bes 'g ] |
-%%54
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%55
-       [ ''a 'e 'g 'e 'g 'e ] |
-%%56
-       [ ''d ''a 'd ''a 'd ''a ] |
-%%57
-       [ ''d ''a 'd ''a 'd ''a ]
-%%58
-       < 'd2.^\fermata ''d2. > |
- }
-
-
-tekstI = \lyric{
-       \meter 3/4;
-       \duration 4;
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
-% 5
-       [2/3 Lei- se8 ]1/1 fleh-4. en8 
-       [2/3 mei- ne8 ]1/1 Lie- der8 _8
-       Durch4. die8 [2/3 Nacht zu8 ]1/1 
-       dir;2 _    
-       _ _ _ 
-       _ _ _
-% 11
-       [2/3 In den8 ]1/1 stil-4. len8 
-       [2/3 Hain her-8 ]1/1 nie-4. der,8
-       Lieb4. chen,8 [2/3 komm zu8 ]1/1 
-       mir!2 _
-       _ _ _ 
-       _ _ _
-
-% 17
-       Fl\"us-8. ternd16 schlan-4. ke8 
-       Wip-8. fel16 rau-4. schen8
-       [2/3 In des8 ]1/1 Mon-4. des8 
-       Licht;2.
-       _ _ _ 
-       _ _ _
-
-% 23
-       Des8. Ver-16 r\"a-4. ters8 
-       feind-8. lich16 Lau-4. schen8
-       [2/3 F\"urch- te,8 ]1/1 Hol-4. de,8 
-       nicht.2.
-       _ _ _ 
-       _ _ _
-
-% volta 1
-% 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-
-% volta 2
-% 37
-       La\ss8. auch16 dir8. die16 Brust8. be-16
-       we- gen, _
-       Lieb-4. chen,8 h\"o-8. re16 
-       mich!2 _
-       Be-8. bend16 harr' ich8 _8
-       dir8. ent-16 ge- gen!8 _8
-       [2/3 Komm, be-8 ]1/1 gl\"u4. cke8 
-       mich!2.
-       _ _ _ _ _ _
-% 47
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-% 57
-       _ _ _ _ _ _ 
-       
-}
-
-tekstII = \lyric{
-    \meter 3/4;
-       \duration 4;
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
-% 5
-       [2/3 H\"orst die8 ]1/1 Nach-4. ti-8 
-       [2/3 gal- len8 ]1/1 schla- gen?8 _8
-       Ach!4. sie8 [2/3 fleh- en8 ]1/1 
-       dich,2 _
-       _ _ _ 
-       _ _ _
-
-% 11
-       [2/3 Mit der8 ]1/1 T\"o-4. ne8
-       [2/3 s\"u\ss- en8 ]1/1 Kla-4. gen8
-       Fleh-4. en8 [2/3 sie f\"ur8 ]1/1
-       mich.2 _
-       _ _ _ 
-       _ _ _
-
-% 17
-       Sie-8. ver-16 stehn4. des8
-       Bus-8. ens16 Seh-4. nen,8
-       [2/3 Ken- nen8 ]1/1 Lieb-4. es-8 
-       schmerz,2.
-       _ _ _ 
-       _ _ _
-
-% 23
-       R\"uh-8. ren16 mit4. den8 
-       Sil-8. ber-16 t\"o-4. nen8
-       [2/3 Jed- es8 ]1/1 wei-4. che8 
-       Herz.2.
-       _ _ _ 
-       _ _ _
-% volta 1
-% 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-
-% volta 2
-% 37
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _ 
-       _ _ _ _ _ _
-% 47
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-% 57
-       _ _ _ _ _ _ 
-       
-}
-themusic = 
-       <       
-               <       \id "Lyric" "1";
-                       \tekstI
-                        \tekstII
-               >
-               < \id "Piano" "";
-                       \multi 2;
-                       \melodic < \melodie \commands >
-                       \melodic < \begeleiding \commands >
-               >
-       >
diff --git a/input/standchen.ly b/input/standchen.ly
new file mode 100644 (file)
index 0000000..23bac1d
--- /dev/null
@@ -0,0 +1,512 @@
+\header{
+filename       standchen.ly
+title          St\"andchen (Serenade) "Leise flehen meine Lieder"
+opus           D. 957 No. 4
+composers      Franz Schubert (1797-1828)
+               Text by Ludwig Rellstab (1799-1860)
+enteredby      JCN
+copyright      public domain
+} 
+
+%{
+ Tested Features: multivoice, accents, lyrics, chords, piano music,
+multiple \paper{}s in one \score 
+%}
+
+\version "0.1.1";
+
+commands = \melodic{
+       \skip 2.*4;
+       \bar "|:";
+       \skip 2.*24;
+%      volta1
+       \skip 2.*8;
+%      volta2
+       \bar ":|";
+       \skip 2.*22;
+       \bar "|."; 
+       }
+
+melodie = \melodic{ 
+       \meter 3/4;
+       \clef "violin";
+       \key bes;
+       \octave c';
+       \duration 8;
+       r \pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > |
+%%2
+       r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > |
+%%3
+       \textstyle "italic";
+       r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] >|
+       \textstyle "roman";
+       
+%%4
+       r < [ 'a cis > e < 'a cis > e < 'a cis ] > |
+%%5
+       [2/3 a~ bes a ]1/1 d'4. a |
+%%6
+       [2/3 g~ a g ]1/1 d'4 g r |
+
+%%7
+       a4.^> g [2/3 g~ f e ]1/1 |
+%%8
+       f2 r4 |
+%%9
+
+       < { a'4.~  g' [2/3 g'( f' )e' ]1/1 }
+       { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > |
+%%10
+       < f'2. d'2. > |
+%%11
+       [2/3 a ~  bes a ]1/1 f'4. a |
+%%12
+       [2/3 g~   a g ]1/1 e'4. d' |
+%%13
+       c'4. bes [2/3 bes~   a g ]1/1 |
+%%14
+       a2 r 
+       < { d'~  c'4. g [2/3 bes a g ]1/1 }
+       { f \p ~  e4._"dolce" bes 
+               \plet 2/3; g
+               \plet 1/1; 
+       } > |
+%%16
+       < a2. f2. > |
+%%17
+       \textstyle "italic";
+       [ a8._"cresc." cis'16 ] f'4. e'
+       \textstyle "roman";|
+%%18
+       [ d'8. a16 ] f4. d |
+%%19
+%#%    c'\grace\stemup
+       [2/3 bes ~   a bes ]1/1 d'4. bes |
+%%20
+       a2. |
+%%21
+%#%    a\grace
+       [2/3 g~  fis g ]1/1 bes4.^> g |
+%%22
+       f!2. |
+%%23
+       [ a8. \mf cis'16 ] f'4. e' |
+%%24
+       [ d'8. a16 ] fis4. d |
+%%25
+       [2/3 b \mf~   ais b ]1/1 d'4. b |
+%%26
+       < a2. fis2. > |
+%%27
+       [2/3 e' \f~  dis' e' ]1/1 g'4. cis' |
+%%28
+       < d'2. fis2. > |
+%#%\volta1
+%%29
+       < { bes2( [ d'8.~ )bes16 ] }
+       { g2 \mf [ bes8. g16 ] } > |
+%%30
+       < { a4. [ a-. a-. a-. ] }
+       { fis4. [ fis-.( fis-. )fis-. ] } > |
+%%31 
+       < { a4. [ a-. a-. a-. ] }
+       { g4. [ cis-.( e-. )g-. ] } > |
+%%32
+       < a2 fis2 \pp > < a4 fis4 > |
+%%33
+       < { b2( [ d'8.~ )b16 ] }
+       { g2 [ b8. g16 ] } > |
+%%34
+       < { a4. [ a-. a-. a-. ] }
+       { fis4. [ fis-.( fis-. )fis-. ] } > |
+%%35
+       < { a4. [ a-. a-. a-. ] }
+       { g4. [ cis-.( e-. )g-. ] } > |
+%%36
+       < a2. fis2. > |
+%#%\volta2
+%%37
+       [ a8. a16 ] [ cis'8. cis'16 ] [ e'8. e'16 ] |
+%%38
+       d'4~  cis'4 r4 |
+%%39
+%#%    > a4. [ cis' e'8. >! d'16 ] |
+       a4. \> [ cis' e'8. \! d'16 ] |
+%%40
+       cis'2 r4 |
+%%41
+       < fis'4. \> cis'4. \f > e' [2/3 e'~  d' \! cis' ]1/1 |
+%%42
+       [ b8. cis'16 ] d'4^> b r |
+%%43
+
+       [ b8. \f cis'16 ] d'4^> b r |
+%%44
+       [ b8. \> cis'16 ] d'4^> b \! r |
+%%45
+       [2/3 b \p ~  ais b ]1/1 d'4. b |
+%%46
+       <a!2. fis2. > |
+%%47
+       [2/3 e' \f~  dis' e' ]1/1 g'4.^> cis' |
+%%48
+       \textstyle "italic";
+       < 
+       { fis2.~
+       %\group "+1"; 
+               \stem \down; f2. }
+       { d'2. ~ \stem \up;
+               d'4 r4_"decresc." d'4 } 
+       >
+       \textstyle "roman"; |
+%%50
+       < bes2. e2. > |
+%%51
+       < a2. cis2. > |
+%%52
+       < fis2 d2 > < a4 fis4 \pp > |
+%%53
+
+       < bes2 g2 > < [ d'8.^> bes8. > < bes16 g16 ] > |
+%%54
+       < { a4. [ a-. a-. a-. ] }
+       { fis4. [ fis-.( fis-. )fis-.] } > |
+%%55
+       < { a4. [ a-. a-. a-. ] }
+       { g4. [ cis-.( e-. )g-. ] } > |
+%%56
+       \textstyle "italic";
+       < a2. fis2._"dim." >
+       \textstyle "roman"; |
+%%57
+       < a2. fis2. > |
+%%58
+       < a2.^\fermata fis2. > |
+%#%\tighten
+}
+
+begeleiding = \melodic{ 
+       \meter 3/4;
+       \clef"bass";
+       \key bes;
+       \octave c';
+       \duration 2;
+       'd r4 |
+%%2
+       ''bes r4 |
+
+%%3
+       ''g r4 |
+
+%%4
+       ''a r4 |
+%%5
+\duration 8;
+       < \multi 2; { \stem \up;        
+               [ 'f 'a d 'a d 'a ] 
+               [ 'd 'e 'g 'e 'g 'e ] 
+               [ 'cis 'e 'g 'e 'g 'e ]
+               [ 'd 'a d 'a d 'a ]
+               }
+       { \stem \down; 
+               'd2 r4 
+                ''bes2 r4 
+                ''a2 r4
+               'd2 r4
+       } >
+%%9
+       \stem 0;
+       [ 'a e g e g e ] |
+%%10
+       [ 'd 'a d 'a d 'a ] |
+%%11
+       < \multi 2;     
+       { \stem \up;
+               [ 'f 'a d 'a d 'a ]
+               [ 'd 'e 'g 'e 'g 'e ] 
+               [ 'e 'g 'bes 'g 'bes 'g ] 
+               [ 'a c f c f c ]
+       } { \stem \down; 
+               'd2 r4 
+                ''bes2 r4
+                'c2 r4 
+                'f2 r4 } 
+       >
+%%15
+       \stem 0;
+       [ 'c 'g 'bes 'g 'bes 'g ] |
+%%16
+       [ ''f 'c 'f 'c 'f 'c ] |
+       < \multi 2;
+       { \stem \up; 
+               [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
+               [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
+       { \stem \down; 
+               ''a2 r4
+               'd2 r4 
+               ''bes2 r4 
+               ''f2 r4 
+       } > 
+%%21
+       \stem 0;
+       < [ 'e 'c > 'g c 'g c 'g ] |
+%%22
+       [ 'f 'a c 'a 'f 'c ] |
+       < \multi 2; {
+               \stem \up;
+               [ ''a 'e 'g 'e 'g 'e ] 
+               [ 'd 'fis 'a 'fis 'a 'fis ] 
+               [ ''g 'd 'b 'd 'b 'd ] 
+               [ 'd 'a d 'a d 'a ] 
+       }
+       {\stem \down;
+               ''a2 r4 
+               'd2 r4 
+               ''g2 r4 
+               'd2 r4 
+       }
+       >
+       \stem 0;
+       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
+%%28
+       [ 'd 'a d 'a d 'a ] |
+%%29
+       [ 'd 'g 'bes 'g 'bes 'g ] |
+%#%\volta1
+%%30 
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%%31
+       [ ''a 'e 'a 'e 'a 'e ] |
+%%32
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%%33
+       [ 'd 'g 'b 'g 'b 'g ] |
+%%34
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%%35
+       [ ''a 'e 'a 'e 'a 'e ] |
+%%36
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%#%\volta2
+%%37
+       [ ''a 'e 'g 'e ''bes^> 'e ] |
+%%38
+       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
+%%39
+       [ ''a 'e 'g 'e ''bes^> 'e ] |
+%%40
+       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
+%%41
+       [ ''ais 'e 'fis 'e 'fis 'e ] |
+%%42
+       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
+%%43
+       < [ 'e ''b > 'g 'b 'g 'b 'g ] |
+%%44
+       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
+%%45
+       < \multi 2; { \stem \up; 
+               [ ''g 'd 'b 'd 'b 'd ] 
+               [ 'd 'a d 'a d 'a ] 
+       } {
+               \stem \down;
+               ''g2 r4
+               'd2 r4 
+       } >
+
+%%47
+       \stem 0;
+       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
+%%48
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%%49
+       [ 'd 'a d 'a d 'a ] |
+%%50
+       [ ''g 'e 'g 'e 'g 'e ] |
+%%51
+       [ ''a 'e 'g 'e 'g 'e ] |
+%%52
+       [ ''d 'd 'fis 'd 'fis 'd ] |
+%%53
+       [ 'd 'g 'bes 'g 'bes 'g ] |
+%%54
+       [ 'd 'fis 'a 'fis 'a 'fis ] |
+%%55
+       [ ''a 'e 'g 'e 'g 'e ] |
+%%56
+       [ ''d ''a 'd ''a 'd ''a ] |
+%%57
+       [ ''d ''a 'd ''a 'd ''a ]
+%%58
+       < 'd2.^\fermata ''d2. > |
+ }
+
+
+tekstI = \lyric{
+       \meter 3/4;
+       \duration 4;
+       _ _ _
+       _ _ _
+       _ _ _
+       _ _ _
+% 5
+       [2/3 Lei- se8 ]1/1 fleh-4. en8 
+       [2/3 mei- ne8 ]1/1 Lie- der8 _8
+       Durch4. die8 [2/3 Nacht zu8 ]1/1 
+       dir;2 _    
+       _ _ _ 
+       _ _ _
+% 11
+       [2/3 In den8 ]1/1 stil-4. len8 
+       [2/3 Hain her-8 ]1/1 nie-4. der,8
+       Lieb4. chen,8 [2/3 komm zu8 ]1/1 
+       mir!2 _
+       _ _ _ 
+       _ _ _
+
+% 17
+       Fl\"us-8. ternd16 schlan-4. ke8 
+       Wip-8. fel16 rau-4. schen8
+       [2/3 In des8 ]1/1 Mon-4. des8 
+       Licht;2.
+       _ _ _ 
+       _ _ _
+
+% 23
+       Des8. Ver-16 r\"a-4. ters8 
+       feind-8. lich16 Lau-4. schen8
+       [2/3 F\"urch- te,8 ]1/1 Hol-4. de,8 
+       nicht.2.
+       _ _ _ 
+       _ _ _
+
+% volta 1
+% 29
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+
+% volta 2
+% 37
+       La\ss8. auch16 dir8. die16 Brust8. be-16
+       we- gen, _
+       Lieb-4. chen,8 h\"o-8. re16 
+       mich!2 _
+       Be-8. bend16 harr' ich8 _8
+       dir8. ent-16 ge- gen!8 _8
+       [2/3 Komm, be-8 ]1/1 gl\"u4. cke8 
+       mich!2.
+       _ _ _ _ _ _
+% 47
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+% 57
+       _ _ _ _ _ _ 
+       
+}
+
+tekstII = \lyric{
+    \meter 3/4;
+       \duration 4;
+       _ _ _
+       _ _ _
+       _ _ _
+       _ _ _
+% 5
+       [2/3 H\"orst die8 ]1/1 Nach-4. ti-8 
+       [2/3 gal- len8 ]1/1 schla- gen?8 _8
+       Ach!4. sie8 [2/3 fleh- en8 ]1/1 
+       dich,2 _
+       _ _ _ 
+       _ _ _
+
+% 11
+       [2/3 Mit der8 ]1/1 T\"o-4. ne8
+       [2/3 s\"u\ss- en8 ]1/1 Kla-4. gen8
+       Fleh-4. en8 [2/3 sie f\"ur8 ]1/1
+       mich.2 _
+       _ _ _ 
+       _ _ _
+
+% 17
+       Sie-8. ver-16 stehn4. des8
+       Bus-8. ens16 Seh-4. nen,8
+       [2/3 Ken- nen8 ]1/1 Lieb-4. es-8 
+       schmerz,2.
+       _ _ _ 
+       _ _ _
+
+% 23
+       R\"uh-8. ren16 mit4. den8 
+       Sil-8. ber-16 t\"o-4. nen8
+       [2/3 Jed- es8 ]1/1 wei-4. che8 
+       Herz.2.
+       _ _ _ 
+       _ _ _
+% volta 1
+% 29
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+
+% volta 2
+% 37
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _ 
+       _ _ _ _ _ _
+% 47
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+% 57
+       _ _ _ _ _ _ 
+       
+}
+themusic = 
+       <       
+               <       \id "Lyric" "1";
+                       \tekstI
+                        \tekstII
+               >
+               < \id "Piano" "";
+                       \multi 2;
+                       \melodic < \melodie \commands >
+                       \melodic < \begeleiding \commands >
+               >
+       >
+
+
+\score{
+       \themusic
+       \paper{
+               \paper_twenty
+               % 20pt music uses whole pagewidth
+               linewidth= 195.\mm;
+
+               % we want gourlay, don't set geometric
+               % geometric= 1.4;
+               gourlay_maxmeasures = 9.;
+               \output "standchen-20.out";
+       }
+       \paper{
+               % 16pt mustn't use whole page width
+               linewidth= 160.\mm;
+               % we want gourlay, don't set geometric
+               % geometric= 1.4;
+               gourlay_maxmeasures = 9.;
+               \output "standchen-16.out";
+       }
+       \midi{
+               \tempo 4 = 54;
+       }
+}
index 97429e7d88d079d2a9a0185d702e7829badfaa40..b3443e8a655188e5050b4470b6abd8dc7cc17d54 100644 (file)
@@ -1,12 +1,12 @@
 \header{
 filename               wohltemperirt.ly
 title          Fuga a 3
 \header{
 filename               wohltemperirt.ly
 title          Fuga a 3
-description            Das Wohltemperirte Clavier I, Fuga II (c-minor)
-opus           BWV ?
+description            Das Wohltemperierte Clavier I, Fuga II (c-minor)
+opus           BWV 847-Fuga
 source         Henle's Urtext
 composer               Johann Sebastian Bach (1685-1750)
 enteredby              HWN and Werner Lemberg
 source         Henle's Urtext
 composer               Johann Sebastian Bach (1685-1750)
 enteredby              HWN and Werner Lemberg
-copyright              Public Domain"
+copyright              Public Domain
 }
 %{
  Tested Features: stem direction, multivoice, forced accidentals.
 }
 %{
  Tested Features: stem direction, multivoice, forced accidentals.
index 8c4aac44741aeb2cf7716848fab5b1830ca4fcfb..306ca9785547dd62495d86e6c10c1e734fc257d2 100644 (file)
@@ -17,8 +17,8 @@
 #include "binary-source-file.hh"
 #include "string-convert.hh"
 
 #include "binary-source-file.hh"
 #include "string-convert.hh"
 
-Binary_source_file::Binary_source_file( String& filename_str )
-       : Source_file( filename_str )
+Binary_source_file::Binary_source_file(String& filename_str)
+       : Source_file(filename_str)
 {
 }
 
 {
 }
 
@@ -27,35 +27,35 @@ Binary_source_file::~Binary_source_file()
 }
 
 String
 }
 
 String
-Binary_source_file::error_str( char const* pos_ch_c_l ) const
+Binary_source_file::error_str(char const* pos_ch_c_l) const
 {
 {
-    assert( this );
-    if ( !in_b( pos_ch_c_l ) )
+    assert(this);
+    if (!in_b(pos_ch_c_l))
        return "";
 
     char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_C();
     char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_i();
 
        return "";
 
     char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_C();
     char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_i();
 
-    String pre_str( (Byte const*)begin_ch_c_l, pos_ch_c_l - begin_ch_c_l );
-    pre_str = String_convert::bin2hex_str( pre_str );
-    for ( int i = 2; i < pre_str.length_i(); i += 3 )
-       pre_str = pre_str.left_str( i ) + " " + pre_str.mid_str( i, INT_MAX );
-    String post_str( (Byte const*)pos_ch_c_l, end_ch_c_l - pos_ch_c_l );
-    post_str = String_convert::bin2hex_str( post_str );
-    for ( int i = 2; i < post_str.length_i(); i += 3 )
-       post_str = post_str.left_str( i ) + " " + post_str.mid_str( i, INT_MAX );
+    String pre_str((Byte const*)begin_ch_c_l, pos_ch_c_l - begin_ch_c_l);
+    pre_str = String_convert::bin2hex_str(pre_str);
+    for (int i = 2; i < pre_str.length_i(); i += 3)
+       pre_str = pre_str.left_str(i) + " " + pre_str.mid_str(i, INT_MAX);
+    String post_str((Byte const*)pos_ch_c_l, end_ch_c_l - pos_ch_c_l);
+    post_str = String_convert::bin2hex_str(post_str);
+    for (int i = 2; i < post_str.length_i(); i += 3)
+       post_str = post_str.left_str(i) + " " + post_str.mid_str(i, INT_MAX);
 
     String str = pre_str
 
     String str = pre_str
-       + String( '\n' )
-       + String( ' ', pre_str.length_i() + 1 
+       + String('\n')
+       + String(' ', pre_str.length_i() + 1
        + post_str;
     return str;
 }
 
 int
        + post_str;
     return str;
 }
 
 int
-Binary_source_file::line_i( char const* pos_ch_c_l ) const
+Binary_source_file::line_i(char const* pos_ch_c_l) const
 {
 {
-    if ( !in_b( pos_ch_c_l ) )
+    if (!in_b(pos_ch_c_l))
        return 0;
 
     return pos_ch_c_l - ch_C();
        return 0;
 
     return pos_ch_c_l - ch_C();
index e64ca663eaa674fe4e8dce9c5309ec9cec318216..9969e76341bc5804230bfba31196989b732e0798 100644 (file)
@@ -19,322 +19,322 @@ int Duration_convert::no_smaller_than_i_s = 0;
 Array<Duration> Duration_convert::dur_array_s;
        
 String 
 Array<Duration> Duration_convert::dur_array_s;
        
 String 
-Duration_convert::dur2_str( Duration dur )
+Duration_convert::dur2_str(Duration dur)
 {
 {
-       if ( dur.ticks_i_ )
-               return String( "["  ) + String( dur.ticks_i_ ) + "]";
+  if (dur.ticks_i_)
+    return String("[") + String(dur.ticks_i_) + "]";
        
        
-       String str;
-       if (dur.durlog_i_ <= 0)
-           str="\\breve";
-       else
-           str= String( type2_i(dur.durlog_i_) );
-       str += String( '.', dur.dots_i_ );
-       if ( dur.plet_b())
-               str += String( "*" ) + String( dur.plet_.iso_i_ )
-                       + String( "/" ) + String( dur.plet_.type_i_ );
-       return str;
+  String str;
+  if (dur.durlog_i_ <= 0)
+    str="\\breve";
+  else
+    str= String(type2_i(dur.durlog_i_));
+  str += String('.', dur.dots_i_);
+  if (dur.plet_b())
+    str += String("*") + String(dur.plet_.iso_i_)
+      + String("/") + String(dur.plet_.type_i_);
+  return str;
 }
 
 #if 0
 int
 }
 
 #if 0
 int
-Duration_convert::dur2_i( Duration dur, int division_1_i )
+Duration_convert::dur2_i(Duration dur, int division_1_i)
 {
 {
-       return dur2_mom( dur ) * Moment( division_1_i );
+  return dur2_mom(dur) * Moment(division_1_i);
 }
 #endif
 
 int
 }
 #endif
 
 int
-Duration_convert::dur2ticks_i( Duration dur )
+Duration_convert::dur2ticks_i(Duration dur)
 {
 {
-       if ( dur.ticks_i_ )
-               return dur.ticks_i_;
-       return dur2_mom( dur ) * Moment( Duration::division_1_i_s );
+  if (dur.ticks_i_)
+    return dur.ticks_i_;
+  return dur2_mom(dur) * Moment(Duration::division_1_i_s);
 }
 
 
 int
 Duration_convert::i2_type(int i)
 {
 }
 
 
 int
 Duration_convert::i2_type(int i)
 {
-    int t=0;
-    while (!(i & 1)) {
-       i >>= 1;
-       t++;
-           }
-    return t;
+  int t=0;
+  while (!(i & 1)) {
+    i >>= 1;
+    t++;
+  }
+  return t;
 }
 
 int
 Duration_convert::type2_i(int type)
 {
 }
 
 int
 Duration_convert::type2_i(int type)
 {
-    if (type<0)
-       return 0; 
-    else
-       return 1 << type;
+  if (type<0)
+    return 0; 
+  else
+    return 1 << type;
 }
 
 Moment
 }
 
 Moment
-Duration_convert::dur2_mom( Duration dur )
+Duration_convert::dur2_mom(Duration dur)
 {
 {
-       if ( dur.ticks_i_ )
-               return Moment( dur.ticks_i_, Duration::division_1_i_s );        
-
-       // or simply assert?
-       if ( dur.durlog_i_<-10 )
-               return Moment( 0 );
-       Moment mom;
-       if (dur.durlog_i_<0)
-           mom = Moment( type2_i( -dur.durlog_i_ ), 1 );
-       else
-           mom = Moment( 1 , type2_i( dur.durlog_i_ ) );
-
-       Moment delta = mom;
-       while ( dur.dots_i_-- 
-         {
-               delta /= 2.0;
-               mom += delta;
-         }
-
-       return mom * plet_factor_mom( dur );    
+  if (dur.ticks_i_)
+    return Moment(dur.ticks_i_, Duration::division_1_i_s);     
+
+  // or simply assert?
+  if (dur.durlog_i_<-10)
+    return Moment(0);
+  Moment mom;
+  if (dur.durlog_i_<0)
+    mom = Moment(type2_i(-dur.durlog_i_), 1);
+  else
+    mom = Moment(1 , type2_i(dur.durlog_i_));
+
+  Moment delta = mom;
+  while (dur.dots_i_--
+    {
+      delta /= 2.0;
+      mom += delta;
+    }
+
+  return mom * plet_factor_mom(dur);    
 }
 
 #if 0
 Moment
 }
 
 #if 0
 Moment
-Duration_convert::i2_mom( int time_i, int division_1_i )
+Duration_convert::i2_mom(int time_i, int division_1_i)
 {
 {
-       if ( !time_i )
-               return Moment( 0 );
+  if (!time_i)
+    return Moment(0);
 
 
-       if ( division_1_i > 0 )
-               return Moment( time_i, division_1_i );
-       else 
-               return Moment( -division_1_i, time_i );
+  if (division_1_i > 0)
+    return Moment(time_i, division_1_i);
+  else 
+    return Moment(-division_1_i, time_i);
 }
 #endif
 
 Duration
 }
 #endif
 
 Duration
-Duration_convert::mom2_dur( Moment mom )
+Duration_convert::mom2_dur(Moment mom)
 {
 {
-    if (!mom) 
-      {
-       Duration dur;
-       dur.set_plet(0,1);
-       return dur;
-      }
+  if (!mom) 
+    {
+      Duration dur;
+      dur.set_plet(0,1);
+      return dur;
+    }
        
 
        
 
-       Duration dur = mom2standardised_dur( mom );
-//     if ( !dur.mom() || ( dur.mom() == mom ) )
-       if ( !dur.length() || ( dur.length() == mom ) )
-               return dur;
-       assert( midi_as_plet_b_s );
-
-//     dur.set_plet( type_mom, Duration::division_1_i_s / 4 ); 
-
-//     Moment as_plet_mom = mom / dur.mom();
-       Moment as_plet_mom = mom / dur.length();
-       as_plet_mom *= dur.plet_.mom();
-       long num = as_plet_mom.numerator().as_long();
-       long den = as_plet_mom.denominator().as_long();
-       dur.set_plet( num, den );
-       return dur;
+  Duration dur = mom2standardised_dur(mom);
+  //   if (!dur.mom() || (dur.mom() == mom))
+  if (!dur.length() || (dur.length() == mom))
+    return dur;
+  assert(midi_as_plet_b_s);
+
+  //   dur.set_plet(type_mom, Duration::division_1_i_s / 4); 
+
+  //   Moment as_plet_mom = mom / dur.mom();
+  Moment as_plet_mom = mom / dur.length();
+  as_plet_mom *= dur.plet_.mom();
+  long num = as_plet_mom.numerator().as_long();
+  long den = as_plet_mom.denominator().as_long();
+  dur.set_plet(num, den);
+  return dur;
 }
 
 Duration
 }
 
 Duration
-Duration_convert::mom2standardised_dur( Moment mom )
+Duration_convert::mom2standardised_dur(Moment mom)
 {
 {
-//     if ( !dur_array_s.length_i() )
-       if ( !dur_array_s.size() )
-               set_array();
-       assert( dur_array_s.size() );
-       for ( int i = 0; i < dur_array_s.size() - 1; i++ 
-         {
-               Moment lower_mom = dur2_mom( dur_array_s[ i ] );
-               if ( mom <= lower_mom 
-                 {
-                       // all arbitrary, but 3/4 will get rid of the noise...
-                       // kinda ok
-                       if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
-                               return dur_array_s[ i ];
-                       else 
-                         {
-                           Duration d;
-                           d.durlog_i_ = -100;
-                           return d;
-                         }
-                 }
-               Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] );
-               if ( ( mom < upper_mom )
-                        && ( ( mom - lower_mom ) / lower_mom
-                               < ( upper_mom - mom ) / upper_mom ) )
-                       return dur_array_s[ i ];
-         }
-       return dur_array_s[ dur_array_s.size() - 1 ];
+  //   if (!dur_array_s.length_i())
+  if (!dur_array_s.size())
+    set_array();
+  assert(dur_array_s.size());
+  for (int i = 0; i < dur_array_s.size() - 1; i++
+    {
+      Moment lower_mom = dur2_mom(dur_array_s[ i ]);
+      if (mom <= lower_mom
+       {
+         // all arbitrary, but 3/4 will get rid of the noise...
+         // kinda ok
+         if (i || (mom / lower_mom > Moment(3, 4)))
+           return dur_array_s[ i ];
+         else 
+           {
+             Duration d;
+             d.durlog_i_ = -100;
+             return d;
+           }
+       }
+      Moment upper_mom = dur2_mom(dur_array_s[ i + 1 ]);
+      if ((mom < upper_mom)
+         && ((mom - lower_mom) / lower_mom
+             < (upper_mom - mom) / upper_mom))
+       return dur_array_s[ i ];
+    }
+  return dur_array_s[ dur_array_s.size() - 1 ];
 }
 
 void
 Duration_convert::set_array()
 {
 }
 
 void
 Duration_convert::set_array()
 {
-       dur_array_s.clear();
+  dur_array_s.clear();
 
 
-       Duration_iterator iter_dur;
-       assert( iter_dur );
-       while ( iter_dur )
-               dur_array_s.push( iter_dur++ );
+  Duration_iterator iter_dur;
+  assert(iter_dur);
+  while (iter_dur)
+    dur_array_s.push(iter_dur++);
 }
 
 
 Moment
 }
 
 
 Moment
-Duration_convert::plet_factor_mom( Duration dur )
+Duration_convert::plet_factor_mom(Duration dur)
 {
 {
-       return dur.plet_.mom();
+  return dur.plet_.mom();
 }
 
 Real
 }
 
 Real
-Duration_convert::sync_f( Duration dur, Moment mom )
+Duration_convert::sync_f(Duration dur, Moment mom)
 {
 {
-       return mom / dur2_mom( dur );
+  return mom / dur2_mom(dur);
 }
 
 Duration
 }
 
 Duration
-Duration_convert::ticks2_dur( int ticks_i )
+Duration_convert::ticks2_dur(int ticks_i)
 {
 {
-//             Duration dur( 4, 0 );
-//             dur.set_plet( ticks_i, Duration::division_1_i_s / 4 ); 
+  //           Duration dur(4, 0);
+  //           dur.set_plet(ticks_i, Duration::division_1_i_s / 4); 
 
 
-       Moment mom( ticks_i, Duration::division_1_i_s );
-       if ( midi_as_plet_b_s )
-               return mom2_dur( mom );
+  Moment mom(ticks_i, Duration::division_1_i_s);
+  if (midi_as_plet_b_s)
+    return mom2_dur(mom);
 
 
-       Duration dur = mom2standardised_dur( mom );
+  Duration dur = mom2standardised_dur(mom);
 
 
-//     if ( dur.mom() == mom )
-       if ( dur.length() == mom )
-               return dur;
+  //   if (dur.mom() == mom)
+  if (dur.length() == mom)
+    return dur;
                
 // huh?
 #if 0
                
 // huh?
 #if 0
-       dur.durlog_i_ = -100;
-       dur.dots_i_ = 0;
-       dur.set_ticks( ticks_i );
-       return dur;
+  dur.durlog_i_ = -100;
+  dur.dots_i_ = 0;
+  dur.set_ticks(ticks_i);
+  return dur;
 #else
 #else
-       return mom2_dur( mom );
+  return mom2_dur(mom);
 #endif
 }
 
 Duration
 #endif
 }
 
 Duration
-Duration_convert::ticks2standardised_dur( int ticks_i )
+Duration_convert::ticks2standardised_dur(int ticks_i)
 {
 {
-       Moment mom( ticks_i, Duration::division_1_i_s );
-       Duration dur = mom2standardised_dur( mom );
-       return dur;
+  Moment mom(ticks_i, Duration::division_1_i_s);
+  Duration dur = mom2standardised_dur(mom);
+  return dur;
 }
 
 Duration_iterator::Duration_iterator()
 {
 }
 
 Duration_iterator::Duration_iterator()
 {
-       cursor_dur_.durlog_i_ = 7;
-       if ( Duration_convert::no_smaller_than_i_s )
-               cursor_dur_.durlog_i_ = Duration_convert::no_smaller_than_i_s;
-//     cursor_dur_.set_plet( 1, 1 );
+  cursor_dur_.durlog_i_ = 7;
+  if (Duration_convert::no_smaller_than_i_s)
+    cursor_dur_.durlog_i_ = Duration_convert::no_smaller_than_i_s;
+  //   cursor_dur_.set_plet(1, 1);
 }
 
 Duration 
 Duration_iterator::operator ++(int)
 {
 }
 
 Duration 
 Duration_iterator::operator ++(int)
 {
-       return forward_dur();
+  return forward_dur();
 }
 
 Duration
 Duration_iterator::operator ()()
 {
 }
 
 Duration
 Duration_iterator::operator ()()
 {
-       return dur();
+  return dur();
 }
 
 Duration_iterator::operator bool()
 {
 }
 
 Duration_iterator::operator bool()
 {
-       return ok();
+  return ok();
 }
 
 Duration
 Duration_iterator::dur()
 {
 }
 
 Duration
 Duration_iterator::dur()
 {
-       return cursor_dur_;
+  return cursor_dur_;
 }
 
 Duration
 Duration_iterator::forward_dur()
 {
 }
 
 Duration
 Duration_iterator::forward_dur()
 {
-       /* should do smart table? guessing: 
-               duration wholes
-               16      0.0625
-               32..    0.0703
-               8:2/3   0.0833
-               16.     0.0938
-               8       0.1250
-               16..    0.1406
-       4:2/3   0.1667
-               8.      0.1875
+  /* should do smart table? guessing: 
+     duration wholes
+     16        0.0625
+     32..      0.0703
+     8:2/3     0.0833
+     16.       0.0938
+     8 0.1250
+     16..      0.1406
+     4:2/3     0.1667
+     8.        0.1875
                
                
-       */
-       assert( ok() );
-
-       Duration dur = cursor_dur_;
-
-       if ( !cursor_dur_.dots_i_ && !cursor_dur_.plet_b() 
-         {
-               cursor_dur_.durlog_i_ += 1;
-               cursor_dur_.dots_i_ = 2;
-         }
-       else if ( cursor_dur_.dots_i_ == 2 
-         {
-               assert( !cursor_dur_.plet_b() );
-               cursor_dur_.dots_i_ = 0;
-               cursor_dur_.durlog_i_ -=2;
-               cursor_dur_.set_plet( 2, 3 );
-         }
-       else if ( cursor_dur_.plet_b() 
-               && ( cursor_dur_.plet_.iso_i_ == 2 )
-               && ( cursor_dur_.plet_.type_i_ == 3 ) 
-                 {
-               assert( !cursor_dur_.dots_i_ );
-               cursor_dur_.set_plet( 1, 1 );
-               cursor_dur_.durlog_i_ += 1;
-               cursor_dur_.dots_i_ = 1;
-         }
-       else if ( cursor_dur_.dots_i_ == 1 
-         {
-               assert( !cursor_dur_.plet_b() );
-               cursor_dur_.dots_i_ = 0;
-               cursor_dur_.durlog_i_ -= 1;
-         }
+     */
+  assert(ok());
+
+  Duration dur = cursor_dur_;
+
+  if (!cursor_dur_.dots_i_ && !cursor_dur_.plet_b()
+    {
+      cursor_dur_.durlog_i_ += 1;
+      cursor_dur_.dots_i_ = 2;
+    }
+  else if (cursor_dur_.dots_i_ == 2
+    {
+      assert(!cursor_dur_.plet_b());
+      cursor_dur_.dots_i_ = 0;
+      cursor_dur_.durlog_i_ -=2;
+      cursor_dur_.set_plet(2, 3);
+    }
+  else if (cursor_dur_.plet_b() 
+          && (cursor_dur_.plet_.iso_i_ == 2)
+          && (cursor_dur_.plet_.type_i_ == 3)
+    {
+      assert(!cursor_dur_.dots_i_);
+      cursor_dur_.set_plet(1, 1);
+      cursor_dur_.durlog_i_ += 1;
+      cursor_dur_.dots_i_ = 1;
+    }
+  else if (cursor_dur_.dots_i_ == 1
+    {
+      assert(!cursor_dur_.plet_b());
+      cursor_dur_.dots_i_ = 0;
+      cursor_dur_.durlog_i_ -= 1;
+    }
                
                
-       if ( Duration_convert::no_triplets_b_s
-            && cursor_dur_.plet_b() && ok() )
-           forward_dur();
-       if ( Duration_convert::no_double_dots_b_s 
-            && ( cursor_dur_.dots_i_ == 2 ) && ok() )
-               forward_dur();
-       if ( Duration_convert::no_smaller_than_i_s
-            && ( cursor_dur_.durlog_i_ > Duration_convert::no_smaller_than_i_s ) && ok() )
-               forward_dur();
-       if ( Duration_convert::no_smaller_than_i_s
-            && cursor_dur_.dots_i_
-            && ( cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s )
-            && ok() )
-               forward_dur();
-       if ( Duration_convert::no_smaller_than_i_s
-            && ( cursor_dur_.dots_i_ == 2 )
-            && ( cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s / 2 )
-            && ok() )
-               forward_dur();
-
-       return dur;
+  if (Duration_convert::no_triplets_b_s
+      && cursor_dur_.plet_b() && ok())
+    forward_dur();
+  if (Duration_convert::no_double_dots_b_s 
+      && (cursor_dur_.dots_i_ == 2) && ok())
+    forward_dur();
+  if (Duration_convert::no_smaller_than_i_s
+      && (cursor_dur_.durlog_i_ > Duration_convert::no_smaller_than_i_s) && ok())
+    forward_dur();
+  if (Duration_convert::no_smaller_than_i_s
+      && cursor_dur_.dots_i_
+      && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s)
+      && ok())
+    forward_dur();
+  if (Duration_convert::no_smaller_than_i_s
+      && (cursor_dur_.dots_i_ == 2)
+      && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s / 2)
+      && ok())
+    forward_dur();
+
+  return dur;
 }
 
 bool
 Duration_iterator::ok()
 {
 }
 
 bool
 Duration_iterator::ok()
 {
-       return ( cursor_dur_.durlog_i_ 
-               && !( ( cursor_dur_.durlog_i_ == 0 ) && ( cursor_dur_.dots_i_ > 2 ) ) );
+  return (cursor_dur_.durlog_i_ 
+         && !((cursor_dur_.durlog_i_ == 0) && (cursor_dur_.dots_i_ > 2)));
 }
 }
index 24ae6b5da69ad6f38275c649db1dad4a3d3b7212..f04c5e42c05b6a4744d91f805aa5f55b9df4fd03 100644 (file)
@@ -34,7 +34,7 @@ Duration::duration_type_b(int t)
   /*
     ugh. Assuming behavior of conversion funcs on broken input.
    */
   /*
     ugh. Assuming behavior of conversion funcs on broken input.
    */
-  return t == Duration_convert::type2_i( Duration_convert::i2_type(t));
+  return t == Duration_convert::type2_i(Duration_convert::i2_type(t));
 }
 
 // ugh, what's this?
 }
 
 // ugh, what's this?
@@ -60,15 +60,15 @@ Duration::set_plet(Duration d)
 }
 
 void
 }
 
 void
-Duration::set_ticks( int ticks_i )
+Duration::set_ticks(int ticks_i)
 {
 {
-  assert( durlog_i_ <10 );
-  assert( !dots_i_ );
+  assert(durlog_i_ <10);
+  assert(!dots_i_);
   ticks_i_ = ticks_i;
 }
 
 String
   ticks_i_ = ticks_i;
 }
 
 String
-Duration::str()const
+Duration::str() const
 {
   return Duration_convert::dur2_str(*this);
 }
 {
   return Duration_convert::dur2_str(*this);
 }
diff --git a/lib/file-storage.cc b/lib/file-storage.cc
deleted file mode 100644 (file)
index 849c27c..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  file-storage.cc -- implement Mapped_file_storage
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-  Jan Nieuwenhuizen <jan@digicash.com>
-*/
-#include <sys/types.h>         // open, mmap
-#include <sys/stat.h>          // open
-#include <sys/mman.h>          // mmap
-#include <limits.h>            // INT_MAX
-#include <fcntl.h>             // open 
-#include <unistd.h>            // close, stat
-#include <stdio.h>             // fdopen
-#include <string.h>            // strerror
-#include <errno.h>             // errno
-
-
-
-#include "string.hh"
-#include "proto.hh"
-#include "warn.hh"
-#include "file-storage.hh"
-
-Mapped_file_storage::Mapped_file_storage(String s)
-{
-    data_caddr_ = 0;
-    fildes_i_ = 0;
-    size_off_ = 0;
-    open(s);
-}
-
-char const*
-Mapped_file_storage::ch_C()const
-{
-    return (char const*)data_caddr_;
-}
-
-void
-Mapped_file_storage::map()
-{
-    if ( fildes_i_ == -1 )
-       return;
-
-    data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
-
-    if ( (int)data_caddr_ == -1 )
-       warning( String( "can't map: error no: " ) + strerror( errno ));
-}
-
-
-void
-Mapped_file_storage::open(String name_str)
-{
-    fildes_i_ = ::open( name_str, O_RDONLY );  
-           
-    if ( fildes_i_ == -1 ) 
-      {
-       warning( String( "can't open: " ) + name_str + String( ": " ) + strerror( errno )); 
-        return;
-      }
-
-    struct stat file_stat;
-    fstat( fildes_i_, &file_stat );
-    size_off_ = file_stat.st_size;
-    map();
-}
-
-void
-Mapped_file_storage::unmap()
-{
-    if ( data_caddr_ ) 
-      {
-       munmap( data_caddr_, size_off_ );
-       data_caddr_ = 0;
-       size_off_ = 0;
-      }
-}
-
-void
-Mapped_file_storage::close()
-{
-    unmap();
-    if ( fildes_i_ ) 
-      {
-       ::close( fildes_i_ );
-       fildes_i_ = 0;
-      }
-}
-
-int
-Mapped_file_storage::length_i()const
-{
-    return size_off_;
-}
-
-Mapped_file_storage::~Mapped_file_storage()
-{
-    close();
-}
index 73d00498a80fa00b7333ff5b5580e41ac792648e..4e154051642ee04402bc123bc7c97f42bc4291e7 100644 (file)
@@ -15,7 +15,7 @@
 
 Includable_lexer::Includable_lexer()
 {
 
 Includable_lexer::Includable_lexer()
 {
-    yy_current_buffer = 0;
+  yy_current_buffer = 0;
 }
 
 /** set the  new input to s, remember old file.
 }
 
 /** set the  new input to s, remember old file.
@@ -23,31 +23,28 @@ Includable_lexer::Includable_lexer()
 void
 Includable_lexer::new_input(String s, Sources  * global_sources)
 {
 void
 Includable_lexer::new_input(String s, Sources  * global_sources)
 {
-    Source_file * sl = global_sources->get_file_l(s);
-    if (!sl) 
-      {
-       LexerError("Can't find file `" + s+ "'");
-       return; 
-      }
+  Source_file * sl = global_sources->get_file_l(s);
+  if (!sl) 
+    {
+      LexerError("Can't find file `" + s+ "'");
+      return; 
+    }
 
     
 
     
-    char_count_stack_.push(0);
-    if (yy_current_buffer) 
-       state_stack_.push(yy_current_buffer);
-    cout << "[" << s<<flush;
-    include_stack_.push(sl);    
+  char_count_stack_.push(0);
+  if (yy_current_buffer) 
+    state_stack_.push(yy_current_buffer);
+  cout << "[" << s<<flush;
+  include_stack_.push(sl);    
     
     
-    /*
-      ugh. We'd want to create a buffer from the bytes directly.
+  /*
+    ugh. We'd want to create a buffer from the bytes directly.
 
 
-      Whoops. The size argument to yy_create_buffer is not the
-      filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up.
+    Whoops. The size argument to yy_create_buffer is not the
+    filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up.
       
       
-      Maybe this is also the reason why LilyPond sometimes crashed
-      mysteriously in yy_create_buffer() with a libc-malloc error
-
-      */
-    yy_switch_to_buffer(yy_create_buffer( sl->istream_l(), YY_BUF_SIZE )); 
+    */
+  yy_switch_to_buffer(yy_create_buffer(sl->istream_l(), YY_BUF_SIZE)); 
 }
 
 /** pop the inputstack.  conceptually this is a destructor, but it
 }
 
 /** pop the inputstack.  conceptually this is a destructor, but it
@@ -55,14 +52,14 @@ Includable_lexer::new_input(String s, Sources  * global_sources)
 bool
 Includable_lexer::close_input()
 {
 bool
 Includable_lexer::close_input()
 {
-    include_stack_.pop();
-    char_count_stack_.pop();
-    cout << "]"<<flush;
-    yy_delete_buffer(yy_current_buffer );
-    yy_current_buffer = 0;
-    if (state_stack_.empty()) 
-      {
-       return false;
+  include_stack_.pop();
+  char_count_stack_.pop();
+  cout << "]"<<flush;
+  yy_delete_buffer(yy_current_buffer);
+  yy_current_buffer = 0;
+  if (state_stack_.empty()) 
+    {
+      return false;
     }else 
       {
        yy_switch_to_buffer(state_stack_.pop());
     }else 
       {
        yy_switch_to_buffer(state_stack_.pop());
@@ -73,17 +70,17 @@ Includable_lexer::close_input()
 char const*
 Includable_lexer::here_ch_C()
 {
 char const*
 Includable_lexer::here_ch_C()
 {
-    if (include_stack_.empty())
-       return 0;
-    return include_stack_.top()->ch_C() + char_count_stack_.top();
+  if (include_stack_.empty())
+    return 0;
+  return include_stack_.top()->ch_C() + char_count_stack_.top();
 }
 
 Includable_lexer::~Includable_lexer()
 {
 }
 
 Includable_lexer::~Includable_lexer()
 {
-    while (!include_stack_.empty()) 
-      {
-       close_input();
-    };
+  while (!include_stack_.empty()) 
+    {
+      close_input();
+    }
 }
 /** 
   Since we don't create the buffer state from the bytes directly, we
 }
 /** 
   Since we don't create the buffer state from the bytes directly, we
@@ -92,14 +89,14 @@ Includable_lexer::~Includable_lexer()
 void
 Includable_lexer::add_lexed_char(int count)
 {
 void
 Includable_lexer::add_lexed_char(int count)
 {
-    char_count_stack_.top() += count;
+  char_count_stack_.top() += count;
 }
 
 Source_file*
 }
 
 Source_file*
-Includable_lexer::source_file_l()const
+Includable_lexer::source_file_l() const
 {
 {
-    if (include_stack_.empty())
-       return 0;
-    else
-       return include_stack_.top();
+  if (include_stack_.empty())
+    return 0;
+  else
+    return include_stack_.top();
 }
 }
index 0ae66d572ecf67db37d55fb720f30c2ceafe0f25..293c9681fdc672a16cefee892cc79c2c0edc97ac 100644 (file)
@@ -31,7 +31,7 @@ struct Duration {
   Duration();
   /// is the "plet factor" of this note != 1 ?
   bool plet_b();
   Duration();
   /// is the "plet factor" of this note != 1 ?
   bool plet_b();
-  String str()const;
+  String str() const;
   void set_plet(int,int );
   void set_plet(Duration );
   static bool duration_type_b(int t);
   void set_plet(int,int );
   void set_plet(Duration );
   static bool duration_type_b(int t);
index 850046236c1bd99c14640ea50be6e938b9fc2304..23da07e19f37d46038de8c81b53ff91f218f5080 100644 (file)
@@ -18,8 +18,8 @@
 class File_storage
 {
 public:
 class File_storage
 {
 public:
-    virtual char const* ch_C()const=0;
-    virtual int length_i()const=0;
+    virtual char const* ch_C() const=0;
+    virtual int length_i() const=0;
     virtual ~File_storage(){}
 };
 
     virtual ~File_storage(){}
 };
 
@@ -31,8 +31,8 @@ class Mapped_file_storage:public File_storage
 public:
     Mapped_file_storage(String);    
 protected:
 public:
     Mapped_file_storage(String);    
 protected:
-    virtual char const* ch_C()const;
-    virtual int length_i()const;
+    virtual char const* ch_C() const;
+    virtual int length_i() const;
     virtual ~Mapped_file_storage();
 private:
     void open(String name);
     virtual ~Mapped_file_storage();
 private:
     void open(String name);
@@ -53,8 +53,8 @@ class Simple_file_storage  : public File_storage
     char * data_p_;
     int len_i_;
 protected:    
     char * data_p_;
     int len_i_;
 protected:    
-    virtual char const*ch_C()const;
-    virtual int length_i()const;
+    virtual char const*ch_C() const;
+    virtual int length_i() const;
     virtual ~Simple_file_storage();
 public:
     Simple_file_storage(String);
     virtual ~Simple_file_storage();
 public:
     Simple_file_storage(String);
index a84f736c4858ee7e11ec634da51c243c639475d8..fb1a96d0bc6684391ca8327051a34c86a3461119 100644 (file)
@@ -31,7 +31,7 @@ protected:
     Array<int> char_count_stack_;
 public:
 
     Array<int> char_count_stack_;
 public:
 
-    Source_file* source_file_l()const;
+    Source_file* source_file_l() const;
     void new_input(String s,Sources*);
     Includable_lexer();
     ~Includable_lexer();
     void new_input(String s,Sources*);
     Includable_lexer();
     ~Includable_lexer();
index e68940257c9cda1151063a8a49ac7c719703a161..2fdb97615a069204a31506a3d3a2a9647aa65c0f 100644 (file)
@@ -20,12 +20,12 @@ class Input {
     Source_file * source_file_l_;
 public:
     
     Source_file * source_file_l_;
 public:
     
-    void warning(String)const; // should use member func?
-    void error(String)const;
-    void message(String)const;
+    void warning(String) const; // should use member func?
+    void error(String) const;
+    void message(String) const;
     void set_spot(Input const &);
     
     void set_spot(Input const &);
     
-    String location_str()const;
+    String location_str() const;
     Input(Source_file*, char const*);
     Input();
     Input( Input const& );
     Input(Source_file*, char const*);
     Input();
     Input( Input const& );
index 1f1033f87bf38eef452fd7e7c52fccfafb62cf49..2326416716a4611e160d71bae2c18cedd7100982 100644 (file)
@@ -18,8 +18,8 @@
  */
 struct Plet {
   Plet();
  */
 struct Plet {
   Plet();
-  Moment mom()const;
-  bool unit_b()const;
+  Moment mom() const;
+  bool unit_b() const;
   int iso_i_;  // 2/3; 2 is not duration, maar of count!
   int type_i_; 
 };
   int iso_i_;  // 2/3; 2 is not duration, maar of count!
   int type_i_; 
 };
index 39cd533e410cdc6b7a011c78ca259ae8f464f51d..5991a2e8040f5ce167412c1ca131747d25071bd7 100644 (file)
@@ -21,14 +21,14 @@ public:
     Source_file( String filename_str_r );
     virtual ~Source_file();
 
     Source_file( String filename_str_r );
     virtual ~Source_file();
 
-    char const* ch_C()const;
-    virtual String error_str( char const* pos_ch_c_l )const;
+    char const* ch_C() const;
+    virtual String error_str( char const* pos_ch_c_l ) const;
     istream * istream_l();
     istream * istream_l();
-    bool in_b( char const* pos_ch_c_l )const;
-    int length_i()const;
-    virtual int line_i( char const* pos_ch_c_l )const;
-    String name_str()const;
-    String file_line_no_str( char const* ch_c_l )const;
+    bool in_b( char const* pos_ch_c_l ) const;
+    int length_i() const;
+    virtual int line_i( char const* pos_ch_c_l ) const;
+    String name_str() const;
+    String file_line_no_str( char const* ch_c_l ) const;
 
 private:
     String name_str_;
 
 private:
     String name_str_;
index 6f05290422b128aae18787e0f00495395e091121..3ef073cb39620a3fadeb018d4c5b1803379c818d 100644 (file)
@@ -36,37 +36,37 @@ Input::set_spot(Input const &i)
 }
 
 void
 }
 
 void
-Input::message(String message_str)const
+Input::message(String message_str) const
 {
     String str = "";
     
 {
     String str = "";
     
-    if ( source_file_l_ 
+    if (source_file_l_
       {
        str += location_str() + String(": ");
       }
     
     str += message_str;
       {
        str += location_str() + String(": ");
       }
     
     str += message_str;
-    if ( source_file_l_ 
+    if (source_file_l_
       {
        str += ":\n";
       {
        str += ":\n";
-       str += source_file_l_->error_str( defined_ch_C_);
+       str += source_file_l_->error_str(defined_ch_C_);
       }
     cerr << str << endl;
 }
 
 void
       }
     cerr << str << endl;
 }
 
 void
-Input::warning( String message_str)const
+Input::warning(String message_str) const
 {
 {
-    message( "warning: " + message_str);
+    message("warning: " + message_str);
 }
 void
 }
 void
-Input::error(String s)const
+Input::error(String s) const
 {
     message("error: "+ s);
 }
 
 String
 {
     message("error: "+ s);
 }
 
 String
-Input::location_str()const
+Input::location_str() const
 {
     if (source_file_l_) 
        return source_file_l_->file_line_no_str(defined_ch_C_);
 {
     if (source_file_l_) 
        return source_file_l_->file_line_no_str(defined_ch_C_);
diff --git a/lib/mapped-file-storage.cc b/lib/mapped-file-storage.cc
new file mode 100644 (file)
index 0000000..2267164
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+  file-storage.cc -- implement Mapped_file_storage
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  Jan Nieuwenhuizen <jan@digicash.com>
+*/
+#include <sys/types.h>         // open, mmap
+#include <sys/stat.h>          // open
+#include <sys/mman.h>          // mmap
+#include <limits.h>            // INT_MAX
+#include <fcntl.h>             // open 
+#include <unistd.h>            // close, stat
+#include <stdio.h>             // fdopen
+#include <string.h>            // strerror
+#include <errno.h>             // errno
+
+
+
+#include "string.hh"
+#include "proto.hh"
+#include "warn.hh"
+#include "file-storage.hh"
+
+Mapped_file_storage::Mapped_file_storage(String s)
+{
+  data_caddr_ = 0;
+  fildes_i_ = 0;
+  size_off_ = 0;
+  open(s);
+}
+
+char const*
+Mapped_file_storage::ch_C() const
+{
+  return (char const*)data_caddr_;
+}
+
+void
+Mapped_file_storage::map()
+{
+  if (fildes_i_ == -1)
+    return;
+
+  data_caddr_ = (caddr_t)mmap((void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0);
+
+  if ((int)data_caddr_ == -1)
+    warning(String("can't map: error no: ") + strerror(errno));
+}
+
+
+void
+Mapped_file_storage::open(String name_str)
+{
+  fildes_i_ = ::open(name_str, O_RDONLY);      
+           
+  if (fildes_i_ == -1) 
+    {
+      warning(String("can't open: ") + name_str + String(": ") + strerror(errno)); 
+      return;
+    }
+
+  struct stat file_stat;
+  fstat(fildes_i_, &file_stat);
+  size_off_ = file_stat.st_size;
+  map();
+}
+
+void
+Mapped_file_storage::unmap()
+{
+  if (data_caddr_) 
+    {
+      munmap(data_caddr_, size_off_);
+      data_caddr_ = 0;
+      size_off_ = 0;
+    }
+}
+
+void
+Mapped_file_storage::close()
+{
+  unmap();
+  if (fildes_i_) 
+    {
+      ::close(fildes_i_);
+      fildes_i_ = 0;
+    }
+}
+
+int
+Mapped_file_storage::length_i() const
+{
+  return size_off_;
+}
+
+Mapped_file_storage::~Mapped_file_storage()
+{
+  close();
+}
index 73df524f7d76e0a2ec69f219980ed72038920720..686909382a19cb3119a8fa4a2d094332c1460720 100644 (file)
@@ -16,13 +16,13 @@ Plet::Plet()
 }
 
 Moment
 }
 
 Moment
-Plet::mom()const
+Plet::mom() const
 {
 {
-  return  Moment( iso_i_, type_i_ );
+  return  Moment(iso_i_, type_i_);
 }
 
 bool
 }
 
 bool
-Plet::unit_b()const
+Plet::unit_b() const
 {
   return type_i_ == 1 && iso_i_ == 1;
 }
 {
   return type_i_ == 1 && iso_i_ == 1;
 }
index 2f72a4efc05c5b7d831e6dbb8be19ead73ff367e..ed1784ba63963abdafee6ef40746eb0ac7eba55e 100644 (file)
   Stupid but foolproof way of opening files.
 
   TODO 
   Stupid but foolproof way of opening files.
 
   TODO 
-  Should use obstack. Should check IO status
+  Should check IO status
 
   This is of course a build it yourself version of mmap, so we should
   have been using that... (see Mapped_file_storage) But we noticed
   some problems with this (unexplained lexer crashes)
   
 
   This is of course a build it yourself version of mmap, so we should
   have been using that... (see Mapped_file_storage) But we noticed
   some problems with this (unexplained lexer crashes)
   
-  */
+  [Some versions later] The crashes aren't caused by the mmap
+  code. But no reason to take it out, is there?  */
 
 Simple_file_storage::Simple_file_storage(String s)
 {
 
 Simple_file_storage::Simple_file_storage(String s)
 {
-    data_p_ =0;
-    FILE * f = fopen ( s.ch_C(), "r");
-    if ( !f ) 
-      {
-       warning("can't open file\n");
-       return ;
-      }
+  data_p_ =0;
+  /*
+    let's hope that "b" opens anything binary, and does not apply 
+    CR/LF translation
+    */
+  FILE * f = fopen (s.ch_C(), "rb");
+  if (!f) 
+    {
+      warning("can't open file\n");
+      return ;
+    }
 
 
-    int ret = fseek( f, 0, SEEK_END);
-    len_i_ = ftell(f);
-    rewind(f);
-    data_p_ = new char[len_i_+1];
-    data_p_[len_i_] = 0;
-    ret = fread(data_p_, sizeof(char), len_i_, f);
-#ifndef __CYGWIN32__ // ugh, \r\n -> \n translation
-    assert (ret==len_i_);
+  int ret = fseek(f, 0, SEEK_END);
+  len_i_ = ftell(f);
+  rewind(f);
+  data_p_ = new char[len_i_+1];
+  data_p_[len_i_] = 0;
+  ret = fread(data_p_, sizeof(char), len_i_, f);
+
+     
+#if 1 // ugh, \r\n -> \n translation
+  assert (ret==len_i_);
 #endif
 #endif
-    fclose(f);
+  fclose(f);
 }
 
 char const*
 Simple_file_storage::ch_C() const
 {
 }
 
 char const*
 Simple_file_storage::ch_C() const
 {
-    return data_p_;
+  return data_p_;
 }
 
 int
 }
 
 int
-Simple_file_storage::length_i()const
+Simple_file_storage::length_i() const
 {
 {
-    return len_i_;
+  return len_i_;
 }
     
 
 Simple_file_storage::~Simple_file_storage()
 {
 }
     
 
 Simple_file_storage::~Simple_file_storage()
 {
-    delete []data_p_;
+  delete []data_p_;
 }
 }
index 4ac7017f051eb67ca1a774ba31e6fc1458b88e4b..7d912edd6367a05890acabbaaeef50a100b11c1d 100644 (file)
@@ -19,7 +19,7 @@
 #include "source-file.hh"
 #include "file-storage.hh"
 
 #include "source-file.hh"
 #include "file-storage.hh"
 
-Source_file::Source_file( String filename_str )
+Source_file::Source_file(String filename_str)
 {
     name_str_ = filename_str;
     istream_p_ = 0;
 {
     name_str_ = filename_str;
     istream_p_ = 0;
@@ -29,16 +29,16 @@ Source_file::Source_file( String filename_str )
 istream*
 Source_file::istream_l()
 {
 istream*
 Source_file::istream_l()
 {
-    if ( !name_str_.length_i())
+    if (!name_str_.length_i())
        return &cin;
     
        return &cin;
     
-    if ( !istream_p_ 
+    if (!istream_p_
       {
       {
-       if ( length_i() ) // can-t this be done without such a hack?
-           istream_p_ = new istrstream( ch_C(), length_i() );
+       if (length_i()) // can-t this be done without such a hack?
+           istream_p_ = new istrstream(ch_C(), length_i());
         else 
           {
         else 
           {
-           istream_p_ = new istrstream( "", 0 );
+           istream_p_ = new istrstream("", 0);
            istream_p_->set(ios::eofbit);
          }
       }
            istream_p_->set(ios::eofbit);
          }
       }
@@ -46,14 +46,17 @@ Source_file::istream_l()
 }
 
 String
 }
 
 String
-Source_file::file_line_no_str(char const *ch_C )const
+Source_file::file_line_no_str(char const *context_ch_C) const
 {
 {
+  if  (!ch_C())
+    return "(unknown)";
+  else
     return name_str() + ": "
     return name_str() + ": "
-       + String( line_i( ch_C ) );
+       + String(line_i(context_ch_C));
 }
 
 String
 }
 
 String
-Source_file::name_str()const
+Source_file::name_str() const
 {
     return name_str_;
 }
 {
     return name_str_;
 }
@@ -66,79 +69,82 @@ Source_file::~Source_file()
 }
 
 String
 }
 
 String
-Source_file::error_str( char const* pos_ch_C )const
+Source_file::error_str(char const* pos_ch_C) const
 {
     char const* data_ch_C = ch_C();
     char const * eof_C_ = data_ch_C + length_i();
 {
     char const* data_ch_C = ch_C();
     char const * eof_C_ = data_ch_C + length_i();
-    if ( !in_b( pos_ch_C ) )
+    if (!in_b(pos_ch_C))
        return "(position unknown)";
 
     
        return "(position unknown)";
 
     
-    if ( pos_ch_C == eof_C_)
+    if (pos_ch_C == eof_C_)
        pos_ch_C --;
     char const* begin_ch_C = pos_ch_C;
        pos_ch_C --;
     char const* begin_ch_C = pos_ch_C;
-    while ( begin_ch_C > data_ch_C )
-        if ( *--begin_ch_C == '\n' 
+    while (begin_ch_C > data_ch_C)
+        if (*--begin_ch_C == '\n'
           {
            begin_ch_C++;
            break;
          }
 
     char const* end_ch_C = pos_ch_C;
           {
            begin_ch_C++;
            break;
          }
 
     char const* end_ch_C = pos_ch_C;
-    while ( end_ch_C < eof_C_ )
-        if ( *end_ch_C++ == '\n' 
+    while (end_ch_C < eof_C_)
+        if (*end_ch_C++ == '\n'
           {
          end_ch_C--;
          break;
          }
   
           {
          end_ch_C--;
          break;
          }
   
-       //    String( char const* p, int length ) is missing!?
-    String line_str( (Byte const*)begin_ch_C, end_ch_C - begin_ch_C );
+       //    String(char const* p, int length) is missing!?
+    String line_str((Byte const*)begin_ch_C, end_ch_C - begin_ch_C);
 
     int error_col_i = 0;
     char const* scan_ch_C = begin_ch_C;
 
     int error_col_i = 0;
     char const* scan_ch_C = begin_ch_C;
-    while ( scan_ch_C < pos_ch_C )
-       if ( *scan_ch_C++ == '\t' )
-           error_col_i = ( error_col_i / 8 + 1 ) * 8;
+    while (scan_ch_C < pos_ch_C)
+       if (*scan_ch_C++ == '\t')
+           error_col_i = (error_col_i / 8 + 1) * 8;
        else
            error_col_i++;
 
        else
            error_col_i++;
 
-    String str = line_str.left_str( pos_ch_C - begin_ch_C 
-       + String( '\n' )
-       + String( ' ', error_col_i 
-       + line_str.mid_str( pos_ch_C - begin_ch_C, INT_MAX ); // String::mid should take 0 arg..
+    String str = line_str.left_str(pos_ch_C - begin_ch_C
+       + String('\n')
+       + String(' ', error_col_i
+       + line_str.mid_str(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg..
     return str;
 }
 
 bool
     return str;
 }
 
 bool
-Source_file::in_b( char const* pos_ch_C )const
+Source_file::in_b(char const* pos_ch_C) const
 {
 {
-    return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + length_i() ) );
+    return (pos_ch_C && (pos_ch_C >= ch_C()) && (pos_ch_C <= ch_C() + length_i()));
 }
 
 
 int
 }
 
 
 int
-Source_file::line_i( char const* pos_ch_C )const
+Source_file::line_i(char const* pos_ch_C) const
 {
 {
-    if ( !in_b( pos_ch_C ) )
+    if (!in_b(pos_ch_C))
        return 0;
 
     int i = 1;
     char const* scan_ch_C = ch_C();
        return 0;
 
     int i = 1;
     char const* scan_ch_C = ch_C();
-    while ( scan_ch_C < pos_ch_C )
-       if ( *scan_ch_C++ == '\n' )
+    if (!scan_ch_C)
+      return 0;
+    
+    while (scan_ch_C < pos_ch_C)
+       if (*scan_ch_C++ == '\n')
                i++;
     return i;
 }
 
 int
                i++;
     return i;
 }
 
 int
-Source_file::length_i()const
+Source_file::length_i() const
 {
     return storage_p_->length_i();
 }
 
 char const *
 {
     return storage_p_->length_i();
 }
 
 char const *
-Source_file::ch_C()const
+Source_file::ch_C() const
 {
     return storage_p_->ch_C();
 }
 {
     return storage_p_->ch_C();
 }
index dd1c5f27d60f440088ef0ad26ce89d6c9692bd3a..3f2daf6a2356d8c27423b925a6cc1e917f8357c9 100644 (file)
 
 Sources::Sources()
 {
 
 Sources::Sources()
 {
-    path_C_= 0;
-    binary_b_ = false;
+  path_C_= 0;
+  binary_b_ = false;
 }
 
 void
 Sources::set_binary(bool bo)
 {
 }
 
 void
 Sources::set_binary(bool bo)
 {
-       binary_b_ = bo;
+  binary_b_ = bo;
 }
 
 void
 Sources::set_path(File_path *f_C)
 {
 }
 
 void
 Sources::set_path(File_path *f_C)
 {
-    path_C_ = f_C;
+  path_C_ = f_C;
 }
 
 /**
 }
 
 /**
@@ -44,25 +44,25 @@ Sources::set_path(File_path *f_C)
   @return 0 if no file found
   */
 Source_file*
   @return 0 if no file found
   */
 Source_file*
-Sources::get_file_l(String &file_str ) //UGH
+Sources::get_file_l(String &file_str) //UGH
 {
 {
-    if (path_C_)
-      {
-       String file_str_o = path_C_->find(file_str); 
-       if ( ( file_str_o == "" ) && ( file_str != "" ) )
-           return 0;
-       file_str = file_str_o;
-      }
-    Source_file * f_p= (!binary_b_) ?
-       new Source_file(file_str) : new Binary_source_file(file_str);
-    add(f_p);
-    return f_p;
+  if (path_C_)
+    {
+      String file_str_o = path_C_->find(file_str); 
+      if ((file_str_o == "") && (file_str != ""))
+       return 0;
+      file_str = file_str_o;
+    }
+  Source_file * f_p= (!binary_b_) ?
+    new Source_file(file_str) : new Binary_source_file(file_str);
+  add(f_p);
+  return f_p;
 }
 
 void
 }
 
 void
-Sources::add( Source_file* sourcefile_p )
+Sources::add(Source_file* sourcefile_p)
 {
 {
-    sourcefile_p_list_.bottom().add( sourcefile_p );
+  sourcefile_p_list_.bottom().add(sourcefile_p);
 }
 
 /**
 }
 
 /**
@@ -71,12 +71,12 @@ Sources::add( Source_file* sourcefile_p )
   @return 0 if not found.
   */
 Source_file*
   @return 0 if not found.
   */
 Source_file*
-Sources::sourcefile_l( char const* ch_C )
+Sources::sourcefile_l(char const* ch_C)
 {
 {
-    PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_list_.top() );
-    for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ )
-       if ( sourcefile_l_pcur->in_b( ch_C ) )  
-           return *sourcefile_l_pcur;
-    return 0;
+  PCursor<Source_file*> sourcefile_l_pcur(sourcefile_p_list_.top());
+  for (; sourcefile_l_pcur.ok(); sourcefile_l_pcur++)
+    if (sourcefile_l_pcur->in_b(ch_C)) 
+      return *sourcefile_l_pcur;
+  return 0;
 }
 
 }
 
index 4fefc0b56373e82f6be40da224544e7d7c131c28..90f9818d857ade7dd00d590d73e57f270065d135 100644 (file)
@@ -12,5 +12,5 @@
 #include "cursor.tcc"
 #include "list.tcc"
 
 #include "cursor.tcc"
 #include "list.tcc"
 
-template L_INSTANTIATE(void *);
-template IPL_INSTANTIATE(Source_file);
+template LIST_INSTANTIATE(void *);
+template POINTERLIST_INSTANTIATE(Source_file);
index b2681e482635fa094fc6f5d0b9a2d20954c7d757..8a7fe9f8b25b9e169be5a6aa0fb9e4caea68296f 100644 (file)
@@ -18,7 +18,7 @@ HANDLE CreateFileMapping(
     DWORD dwMaximumSizeHigh,   // high-order 32 bits of object size  
     DWORD dwMaximumSizeLow,    // low-order 32 bits of object size  
     LPCTSTR lpName     // name of file-mapping object 
     DWORD dwMaximumSizeHigh,   // high-order 32 bits of object size  
     DWORD dwMaximumSizeLow,    // low-order 32 bits of object size  
     LPCTSTR lpName     // name of file-mapping object 
-   );  
+);     
  
 
 LPVOID MapViewOfFile(
  
 
 LPVOID MapViewOfFile(
@@ -27,11 +27,11 @@ LPVOID MapViewOfFile(
     DWORD dwFileOffsetHigh,    // high-order 32 bits of file offset 
     DWORD dwFileOffsetLow,     // low-order 32 bits of file offset 
     DWORD dwNumberOfBytesToMap         // number of bytes to map 
     DWORD dwFileOffsetHigh,    // high-order 32 bits of file offset 
     DWORD dwFileOffsetLow,     // low-order 32 bits of file offset 
     DWORD dwNumberOfBytesToMap         // number of bytes to map 
-   );  
+);     
  
 
 io.h:
  
 
 io.h:
-long _get_osfhandle( int filehandle );
+long _get_osfhandle(int filehandle);
 */
 
 // cygnus's gnu-win32-b17.1 does not have _get_osfhandle
 */
 
 // cygnus's gnu-win32-b17.1 does not have _get_osfhandle
@@ -46,9 +46,9 @@ static const int OSF_FACTOR_i = 8;
 
 // #define HAVE_GET_OSFHANDLE  // no we still cannot; works only with cl.exe
 long
 
 // #define HAVE_GET_OSFHANDLE  // no we still cannot; works only with cl.exe
 long
-_get_osfhandle( int filedes_i )
+_get_osfhandle(int filedes_i)
 {
 {
-    return (long)( OSF_OFFSET_i + ( filedes_i + OSF_BASE_i ) * OSF_FACTOR_i );
+    return (long)(OSF_OFFSET_i + (filedes_i + OSF_BASE_i) * OSF_FACTOR_i);
 }
 
 #ifdef HAVE_GET_OSFHANDLE
 }
 
 #ifdef HAVE_GET_OSFHANDLE
@@ -61,10 +61,10 @@ mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
     (void)flags;
     (void)prot;
     (void)addr;
     (void)flags;
     (void)prot;
     (void)addr;
-    HANDLE osf = (HANDLE)_get_osfhandle( fd );
-    HANDLE file_handle = CreateFileMapping( osf, (void*)0, PAGE_READONLY,
-       0, len, 0 ); 
-    return (caddr_t)MapViewOfFile( file_handle, FILE_MAP_READ, 0, offset, len );
+    HANDLE osf = (HANDLE)_get_osfhandle(fd);
+    HANDLE file_handle = CreateFileMapping(osf, (void*)0, PAGE_READONLY,
+       0, len, 0); 
+    return (caddr_t)MapViewOfFile(file_handle, FILE_MAP_READ, 0, offset, len);
 }
 
 
 }
 
 
@@ -72,7 +72,7 @@ int
 munmap(caddr_t addr, size_t len)
 {
     (void)len;
 munmap(caddr_t addr, size_t len)
 {
     (void)len;
-    return UnmapViewOfFile( addr );
+    return UnmapViewOfFile(addr);
 }
 
 #else // ! HAVE_GET_OSFHANDLE //
 }
 
 #else // ! HAVE_GET_OSFHANDLE //
@@ -85,8 +85,8 @@ mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
     (void)addr;
     (void)offset;
     char* ch_p = new char[ len ];
     (void)addr;
     (void)offset;
     char* ch_p = new char[ len ];
-    if ( ch_p )
-        read( fd, (void*)ch_p, len );
+    if (ch_p)
+        read(fd, (void*)ch_p, len);
     return ch_p;
 }
 
     return ch_p;
 }
 
index 2302cb4717c48b271f8e05887a3c20020f50186c..7ce3b25fba45817016afc781083b8857de531bcd 100644 (file)
@@ -1,7 +1,7 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 1
 MAJOR_VERSION = 0
 MINOR_VERSION = 1
-PATCH_LEVEL = 10
+PATCH_LEVEL = 11
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-MY_PATCH_LEVEL =.jcn1
+MY_PATCH_LEVEL =
index eaa895049a2651cbc4eb9a85708266b0afdc1c4c..55367026fa56545c46452d976e8f27e465a80d51 100644 (file)
@@ -18,7 +18,7 @@ Audio_instrument::Audio_instrument (String instrument_str)
 Midi_item*
 Audio_instrument::midi_item_p()
 {
 Midi_item*
 Audio_instrument::midi_item_p()
 {
-  return str_.length_i() ? new Midi_instrument( 0, str_ ) : 0;
+  return str_.length_i() ? new Midi_instrument(0, str_) : 0;
 }
                                     
 Audio_item::Audio_item (Request* req_l)
 }
                                     
 Audio_item::Audio_item (Request* req_l)
@@ -83,7 +83,7 @@ Audio_text::Audio_text (Audio_text::Type type, String text_str)
 Midi_item*
 Audio_text::midi_item_p()
 {
 Midi_item*
 Audio_text::midi_item_p()
 {
-  return text_str_.length_i() ? new Midi_text( this ) : 0;
+  return text_str_.length_i() ? new Midi_text(this) : 0;
 }
 
 
 }
 
 
index 1c406c5b7f7b6bdb0f66edd9b7230aa4753fa319..37125f6fc3222fcc9fbff71af0886646f1f56f5b 100644 (file)
@@ -19,9 +19,9 @@
 #include "audio-score.hh"
 #include "score.hh"
 
 #include "audio-score.hh"
 #include "score.hh"
 
-Audio_score::Audio_score (Score* l)
+Audio_score::Audio_score ()
 {
 {
-  score_l_ = l;
+  midi_l_ =0;
 }
 
 void
 }
 
 void
@@ -40,7 +40,7 @@ Audio_score::output (Midi_stream& midi_stream_r)
   midi_stream_r << Midi_header (1, tracks_i, clocks_per_4_i);
   output_header_track (midi_stream_r);
   int n = 1;
   midi_stream_r << Midi_header (1, tracks_i, clocks_per_4_i);
   output_header_track (midi_stream_r);
   int n = 1;
-  for ( PCursor<Audio_staff*> i (audio_staff_l_list_); i.ok(); i++ )
+  for (PCursor<Audio_staff*> i (audio_staff_l_list_); i.ok(); i++)
        i->output (midi_stream_r, n++);
 }
 
        i->output (midi_stream_r, n++);
 }
 
@@ -55,26 +55,26 @@ Audio_score::output_header_track (Midi_stream& midi_stream_r)
   String str = String ("Creator: ") + get_version_str() + "\n";
 
   Midi_text creator (Midi_text::TEXT, str);
   String str = String ("Creator: ") + get_version_str() + "\n";
 
   Midi_text creator (Midi_text::TEXT, str);
-  midi_track.add (Moment (0), &creator );
+  midi_track.add (Moment (0), &creator);
 
   str = "Automatically generated at ";
   str += ctime (&t);
   str = str.left_str (str.length_i() - 1);
   str += "\n";
   Midi_text generate (Midi_text::TEXT, str);
 
   str = "Automatically generated at ";
   str += ctime (&t);
   str = str.left_str (str.length_i() - 1);
   str += "\n";
   Midi_text generate (Midi_text::TEXT, str);
-  midi_track.add (Moment (0), &generate );
+  midi_track.add (Moment (0), &generate);
 
   str = "from musical definition: ";
 
 
   str = "from musical definition: ";
 
-  str += score_l_->location_str();
+  str += origin_str_;
   Midi_text from (Midi_text::TEXT, str);
   Midi_text from (Midi_text::TEXT, str);
-  midi_track.add (Moment (0), &from );
+  midi_track.add (Moment (0), &from);
 
   Midi_text track_name (Midi_text::TRACK_NAME, "Track " 
 
   Midi_text track_name (Midi_text::TRACK_NAME, "Track " 
-                         + String_convert::i2dec_str (0, 0, '0') );
-  midi_track.add (Moment (0), &track_name );
+                         + String_convert::i2dec_str (0, 0, '0'));
+  midi_track.add (Moment (0), &track_name);
 
 
-  Midi_tempo tempo (score_l_->midi_p_->get_tempo_i (Moment (1, 4) ) );
+  Midi_tempo tempo (midi_l_->get_tempo_i (Moment (1, 4)));
   midi_track.add (Moment (0), &tempo);
 
   midi_stream_r  << midi_track;
   midi_track.add (Moment (0), &tempo);
 
   midi_stream_r  << midi_track;
@@ -97,9 +97,8 @@ Audio_score::print() const
 {    
 #ifndef NPRINT
   DOUT << "Audio_score { ";
 {    
 #ifndef NPRINT
   DOUT << "Audio_score { ";
-  score_l_->midi_p_->print();
   DOUT << "\ncolumns: ";
   DOUT << "\ncolumns: ";
-  for ( PCursor<Audio_column*> i (audio_column_p_list_); i.ok(); i++ )
+  for (PCursor<Audio_column*> i (audio_column_p_list_); i.ok(); i++)
        i->print();
   DOUT << "}\n";
 #endif 
        i->print();
   DOUT << "}\n";
 #endif 
@@ -108,5 +107,13 @@ Audio_score::print() const
 void
 Audio_score::process()
 {
 void
 Audio_score::process()
 {
-}
+  String out=midi_l_->outfile_str_;
+  if (out == "")
+    out = default_out_str_ + ".midi";
+
+  Midi_stream midi_stream (out);
+  *mlog << "MIDI output to " << out<< " ..." << endl;    
 
 
+  output (midi_stream);
+  *mlog << endl;
+}
index 21de1e0c9e40d9e2a25335e383f1e4ddf045d578..199657677c0d4943ec061d15f0b618d4d5b2a23c 100644 (file)
@@ -23,7 +23,7 @@ Audio_staff::output (Midi_stream& midi_stream_r, int track_i)
 {
   Midi_track midi_track;
   midi_track.number_i_ =  track_i;
 {
   Midi_track midi_track;
   midi_track.number_i_ =  track_i;
-  for ( Midi_walker i (this, &midi_track); i.ok(); i++ )
+  for (Midi_walker i (this, &midi_track); i.ok(); i++)
        i.process();
   midi_stream_r << midi_track;
 }
        i.process();
   midi_stream_r << midi_track;
 }
index 325c2a029723f93f5352fb357b030ba1f605a24e..d033d9757166add91c8e565dda288b1cb3741856 100644 (file)
@@ -16,19 +16,17 @@ Axis_group_item::OK() const
   Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
   for (int i=0; i < elems.size(); i++) 
     {
   Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
   for (int i=0; i < elems.size(); i++) 
     {
-       Item * it_l = elems[i]->item();
-       assert (it_l);
-  
-       // somebody probably broke it in pieces
-       assert (it_l->pcol_l_ == pcol_l_);
+      Item * it_l = elems[i]->item();
+      assert (it_l);
     }
 }
 
 void
 Axis_group_item::do_breakable_col_processing()
 {
     }
 }
 
 void
 Axis_group_item::do_breakable_col_processing()
 {
-  if (!pcol_l_->breakable_b())
-       return;
+  if (!breakable_b_)
+    return;
+  
   OK();
   copy_breakable_items();
   
   OK();
   copy_breakable_items();
   
@@ -36,12 +34,15 @@ Axis_group_item::do_breakable_col_processing()
   Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
   for (int i=0; i < elems.size(); i++) 
     {
   Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
   for (int i=0; i < elems.size(); i++) 
     {
-       Item* it_l = elems[i]->item();
-       for ( int j=0; j < 2; j++) 
-         {
-           Item *new_l = it_l->find_prebroken_piece (broken_to_a_[j]->pcol_l_);
-           ((Axis_group_item*)broken_to_a_[j])->add_element (new_l);
-         }
+      Item* it_l = elems[i]->item();
+      Direction  j=LEFT;
+      do 
+       {
+         Item *new_l = 
+           it_l->find_prebroken_piece (broken_to_drul_[j]->break_status_i_);
+         ((Axis_group_item*)broken_to_drul_[j])->add_element (new_l);
+       }
+      while ((j*=-1)!=LEFT);
     }
   Item::do_breakable_col_processing();
 }
     }
   Item::do_breakable_col_processing();
 }
index 1d45de3ae0e3bd003c7ff457ec5daf88ab859bcd..033a55b33a25be97a84e0af417556f87249d7bc6 100644 (file)
@@ -21,97 +21,95 @@ Axis_group_spanner::do_break_processing_if_unbroken()
   Line_of_score *my_line = line_l();
   for (int i=0; i < elems.size(); i++) 
     {
   Line_of_score *my_line = line_l();
   for (int i=0; i < elems.size(); i++) 
     {
-       if (!elems[i]->line_l()) 
-         {
-           Item * item_l = elems[i]->item();
-           if  (item_l
-                && item_l->breakable_b_ 
-                && item_l->break_status_i() == 0) 
-                  {
-               // last two checks are paranoia
-               Item * broken_item_l = 
-                   item_l->find_prebroken_piece (my_line);
-               add_element (broken_item_l);
-             }
-           remove_element (elems[i]);  
-         }
+      if (!elems[i]->line_l()) 
+       {
+         Item * item_l = elems[i]->item();
+         if  (item_l
+              && item_l->breakable_b_ 
+              && item_l->break_status_i() == 0) 
+           {
+             // last two checks are paranoia
+             Item * broken_item_l = 
+               item_l->find_prebroken_piece (my_line);
+             add_element (broken_item_l);
+           }
+         remove_element (elems[i]);  
+       }
     }
     }
-  
 }
 void
 Axis_group_spanner::do_break_processing()
 {
 }
 void
 Axis_group_spanner::do_break_processing()
 {
-  set_my_columns();
   bool breaking_self_b = ! Spanner::line_l();
   if (!breaking_self_b)  
     {
   bool breaking_self_b = ! Spanner::line_l();
   if (!breaking_self_b)  
     {
-       do_break_processing_if_unbroken();
-       Spanner::do_break_processing();
-       return;
+      do_break_processing_if_unbroken();
+      Spanner::do_break_processing();
+      return;
     }
 
     }
 
-  break_into_pieces (true);
+  break_into_pieces ();
   Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
   remove_all();
   
   for (int i=0; i < loose_elems.size(); i++) 
     {
   Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
   remove_all();
   
   for (int i=0; i < loose_elems.size(); i++) 
     {
-       Score_elem * elt = loose_elems[i];
-       Line_of_score *elt_line = elt->line_l();
+      Score_elem * elt = loose_elems[i];
+      Line_of_score *elt_line = elt->line_l();
        
        
-       if ( ! elt_line)
-         {
-           /* this piece doesn't know where it belongs.
-              Find out if it was broken, and use the broken remains
-              */
-           if (elt->spanner()) 
-             {
-               Spanner * sp = elt->spanner();
+      if (! elt_line)
+       {
+         /* this piece doesn't know where it belongs.
+            Find out if it was broken, and use the broken remains
+            */
+         if (elt->spanner()) 
+           {
+             Spanner * sp = elt->spanner();
                
                
-               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];
+             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];
                    
                    
-                   Spanner * broken_span_l 
-                       = sp->find_broken_piece (
-                           ((Score_elem*)my_broken_l)->line_l());
+                 Spanner * broken_span_l 
+                   = sp->find_broken_piece (
+                                            ((Score_elem*)my_broken_l)->line_l());
                    
                    
-                   if (broken_span_l) 
-                       my_broken_l->add_element (broken_span_l);
-                   
-                 }
-             }
-           else if (elt->item() 
-                      && elt->item()->breakable_b_ 
-                      && elt->item()->break_status_i () == 0) 
-                        {
-
-               // broken items
-               for (int j =0; j < 2; j++) 
-                 {
-                   Item * my_item = elt->item()->broken_to_a_[j];
-                   Line_of_score * item_line_l = my_item->line_l() ;
-                   if ( ! item_line_l) 
-                       continue;
+                 if (broken_span_l) 
+                   my_broken_l->add_element (broken_span_l);
                    
                    
-                   Axis_group_spanner * v
-                       = (Axis_group_spanner*)find_broken_piece (item_line_l);
-                   if (v)
-                       v->add_element (my_item);
-                 }
+               }
+           }
+         else if (elt->item() 
+                  && elt->item()->breakable_b_ 
+                  && elt->item()->break_status_i () == 0) 
+           {
+             // broken items
+             Direction  j=LEFT;
+             do 
+               {
+                 Item * my_item = elt->item()->broken_to_drul_[j];
+                 Line_of_score * item_line_l = my_item->line_l() ;
+                 if (! item_line_l) 
+                   continue;
                    
                    
-             }
-         }
-       else 
-         {
+                 Axis_group_spanner * v
+                   = (Axis_group_spanner*)find_broken_piece (item_line_l);
+                 if (v)
+                   v->add_element (my_item);
+               }
+             while ((j*=-1) != LEFT);
+           }
+       }
+      else 
+       {
          /* this piece *does* know where it belongs.
             Put it in appropriate piece of this spanner
             */
          /* this piece *does* know where it belongs.
             Put it in appropriate piece of this spanner
             */
-           Axis_group_spanner * my_broken_l
-               = (Axis_group_spanner*)find_broken_piece (elt->line_l());
-           my_broken_l->add_element (elt);
-         }
+         Axis_group_spanner * my_broken_l
+           = (Axis_group_spanner*)find_broken_piece (elt->line_l());
+         my_broken_l->add_element (elt);
+       }
     }
   
   Spanner::do_break_processing();
     }
   
   Spanner::do_break_processing();
index c0fff8176058f50db1c470a88c9213e5b5c4c05a..ac5a334e318e3bd54336f38a3ab57f713c6212d6 100644 (file)
 /** don't copy anything: an element can only be in one
   Axis_group_element at one time.  */
 Axis_group_administration::Axis_group_administration (
 /** don't copy anything: an element can only be in one
   Axis_group_element at one time.  */
 Axis_group_administration::Axis_group_administration (
-  Axis_group_administration const&)
+                                                     Axis_group_administration const&)
 {
 }
 
 bool 
 {
 }
 
 bool 
-Axis_group_administration::contains_b (Score_elem const *e)const
+Axis_group_administration::contains_b (Score_elem const *e) const
 {
   return elem_l_arr_.find_l (e);
 }
 
 Interval
 {
   return elem_l_arr_.find_l (e);
 }
 
 Interval
-Axis_group_administration::extent (Axis axis)const
+Axis_group_administration::extent (Axis axis) const
 {
   Interval r;
   for (int i=0; i < elem_l_arr_.size(); i++) 
 {
   Interval r;
   for (int i=0; i < elem_l_arr_.size(); i++) 
-       r.unite (elem_l_arr_[i]->extent (axis));
+    r.unite (elem_l_arr_[i]->extent (axis));
   return r;
 }
 
 void
 Axis_group_administration::add_element (Score_elem*e,
   return r;
 }
 
 void
 Axis_group_administration::add_element (Score_elem*e,
-                                      Axis_group_element*g, Axis a1, Axis a2)
+                                       Axis_group_element*g, Axis a1, Axis a2)
 {
   assert (! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2]);
   e->axis_group_l_a_[a1] = g;
   e->axis_group_l_a_[a2] = g;    
 {
   assert (! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2]);
   e->axis_group_l_a_[a1] = g;
   e->axis_group_l_a_[a2] = g;    
-  elem_l_arr_.push ( e);
+  elem_l_arr_.push (e);
 }
 
 
 }
 
 
@@ -59,9 +59,9 @@ Axis_group_administration::remove_all (Axis a1, Axis a2)
 {
   for (int i=0; i < elem_l_arr_.size(); i++) 
     {
 {
   for (int i=0; i < elem_l_arr_.size(); i++) 
     {
-       Score_elem*e=elem_l_arr_[i];
-       e->axis_group_l_a_[a1] = 0;
-       e->axis_group_l_a_[a2] = 0;  
+      Score_elem*e=elem_l_arr_[i];
+      e->axis_group_l_a_[a1] = 0;
+      e->axis_group_l_a_[a2] = 0;  
     }
   elem_l_arr_.clear();
 }
     }
   elem_l_arr_.clear();
 }
@@ -72,6 +72,6 @@ Axis_group_administration::print() const
 {
 #ifndef NPRINT
   for (int i=0; i < elem_l_arr_.size(); i++) 
 {
 #ifndef NPRINT
   for (int i=0; i < elem_l_arr_.size(); i++) 
-       DOUT << elem_l_arr_[i]->name() << ' ';
+    DOUT << elem_l_arr_[i]->name() << ' ';
 #endif
 }
 #endif
 }
index 4c073ac57edf180b90e1ce8ac6e73ca70b3afa1b..ac3e868a522f62d3af3bf9b895348f883c116668 100644 (file)
@@ -36,7 +36,7 @@ Bar_column_engraver::acknowledge_element (Score_elem_info info)
             bar_l_ = (Bar*)info.elem_l_->item();
     }
        
             bar_l_ = (Bar*)info.elem_l_->item();
     }
        
-  if ( bar_l_ && !barcol_p_) 
+  if (bar_l_ && !barcol_p_) 
     {
        barcol_p_ = new Bar_column;
        barcol_p_->breakable_b_ =true;
     {
        barcol_p_ = new Bar_column;
        barcol_p_->breakable_b_ =true;
index f4c4d2f96ba59272cf6fb936deb6e7c66e16cddd..c9a0025208fbb21fdb967d2584697702bc2e5036 100644 (file)
@@ -26,7 +26,7 @@ void
 Bar_column::do_substitute_dependency (Score_elem*o,Score_elem*n)
 {
   Script_column::do_substitute_dependency (o,n);
 Bar_column::do_substitute_dependency (Score_elem*o,Score_elem*n)
 {
   Script_column::do_substitute_dependency (o,n);
-  if ( o == bar_l_) 
+  if (o == bar_l_) 
     {
        bar_l_ = n ? (Bar*)n->item() : 0;
     }
     {
        bar_l_ = n ? (Bar*)n->item() : 0;
     }
index c390c78a31420cc04586cead10e5d28d5a6b6fc2..c11a7debeefae3b31455c16f560465bd6e006f94 100644 (file)
@@ -22,10 +22,10 @@ Bar_engraver::do_try_request (Request*r_l)
 {
   Command_req* c_l = r_l->command();
   if (!c_l|| !c_l->bar()) 
 {
   Command_req* c_l = r_l->command();
   if (!c_l|| !c_l->bar()) 
-       return false;
+    return false;
   Bar_req  * b= c_l->bar();
   if (bar_req_l_ && bar_req_l_->equal_b (b))
   Bar_req  * b= c_l->bar();
   if (bar_req_l_ && bar_req_l_->equal_b (b))
-       return false;
+    return false;
   
   bar_req_l_ = b;
 
   
   bar_req_l_ = b;
 
@@ -37,22 +37,24 @@ Bar_engraver::do_process_requests()
 {
   if (bar_req_l_) 
     {
 {
   if (bar_req_l_) 
     {
-       bar_p_ = new Bar;
-       bar_p_->type_str_=bar_req_l_->type_str_;
+      bar_p_ = new Bar;
+      bar_p_->type_str_=bar_req_l_->type_str_;
     }
     }
-  else if (!get_staff_info().time_C_->whole_in_measure_) 
+  else 
     {
     {
+      Time_description const *time = get_staff_info().time_C_;
+      if (time && !time->whole_in_measure_) 
        bar_p_ = new Bar;
     }
   
   if (bar_p_)
     {
        bar_p_ = new Bar;
     }
   
   if (bar_p_)
     {
-       announce_element (Score_elem_info (bar_p_, bar_req_l_));
+      announce_element (Score_elem_info (bar_p_, bar_req_l_));
     }
   else 
     {
     }
   else 
     {
-       Disallow_break_req r;
-       daddy_grav_l_->try_request (&r);
+      Disallow_break_req r;
+      daddy_grav_l_->try_request (&r);
     }
 }
 
     }
 }
 
@@ -60,11 +62,11 @@ Bar_engraver::do_process_requests()
 void 
 Bar_engraver::do_pre_move_processing()
 {
 void 
 Bar_engraver::do_pre_move_processing()
 {
-    if (bar_p_) 
-      {
-         typeset_element (bar_p_);
-         bar_p_ =0;
-      }
+  if (bar_p_) 
+    {
+      typeset_element (bar_p_);
+      bar_p_ =0;
+    }
 }
 
 void
 }
 
 void
index 4a468119c7960e816c47670a33ec1a6ed5cf75d1..1414f7b7de6a7e7112dd315f927de0c7a34c4039 100644 (file)
 #include "text-def.hh"
 #include "command-request.hh"
 #include "bar.hh"
 #include "text-def.hh"
 #include "command-request.hh"
 #include "bar.hh"
+#include "time-description.hh"
 
 Bar_number_grav::Bar_number_grav()
 {
 
 Bar_number_grav::Bar_number_grav()
 {
-  number_i_ =1;
   script_p_ =0;
 }
 
   script_p_ =0;
 }
 
@@ -25,27 +25,31 @@ void
 Bar_number_grav::acknowledge_element (Score_elem_info i)
 {
   if (i.origin_grav_l_arr_.size() == 1 &&
 Bar_number_grav::acknowledge_element (Score_elem_info i)
 {
   if (i.origin_grav_l_arr_.size() == 1 &&
-       i.elem_l_->is_type_b (Bar::static_name()) && !script_p_) 
-         {
-
-       script_p_ = new Script;
-       Text_def *td_p =new Text_def;
-       td_p->text_str_ = number_i_++;
-       script_p_->specs_l_ = td_p;
-       script_p_->breakable_b_ = true;
-       script_p_->dir_i_ = 1;
-
-       announce_element (Score_elem_info (script_p_, &dummy));
+      i.elem_l_->is_type_b (Bar::static_name()) && !script_p_) 
+    {
+      Time_description const * time = get_staff_info().time_C_;
+      if (!time || time->cadenza_b_)
+       return ;
+      
+      script_p_ = new Script;
+      Text_def *td_p =new Text_def;
+      td_p->text_str_ = time->bars_i_;
+
+      script_p_->specs_l_ = td_p;
+      script_p_->breakable_b_ = true;
+      script_p_->dir_ = UP;
+
+      announce_element (Score_elem_info (script_p_, &dummy));
     }
 }
 
 void
 Bar_number_grav::do_pre_move_processing()
 {
     }
 }
 
 void
 Bar_number_grav::do_pre_move_processing()
 {
-  if ( script_p_) 
+  if (script_p_) 
     {
     {
-       typeset_element (script_p_);
-       script_p_ =0;
+      typeset_element (script_p_);
+      script_p_ =0;
     }
 }
 
     }
 }
 
index 7dc97c7c59787885016533994bb7d5f4c079f8bd..cbf84388695b42dd74c1f8ab4fc48b4e45a704d7 100644 (file)
@@ -25,13 +25,13 @@ Bar::Bar()
 IMPLEMENT_IS_TYPE_B1(Bar,Item);
 
 void
 IMPLEMENT_IS_TYPE_B1(Bar,Item);
 
 void
-Bar::do_print()const
+Bar::do_print() const
 {
   DOUT << type_str_;
 }
 
 Molecule*
 {
   DOUT << type_str_;
 }
 
 Molecule*
-Bar::brew_molecule_p()const
+Bar::brew_molecule_p() const
 {    
   Paper_def *p = paper();
   Symbol s = p->lookup_l()->bar (type_str_, 
 {    
   Paper_def *p = paper();
   Symbol s = p->lookup_l()->bar (type_str_, 
diff --git a/lily/beam-grav.cc b/lily/beam-grav.cc
new file mode 100644 (file)
index 0000000..dcdce82
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+  beam-grav.cc -- implement Beam_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "duration-convert.hh"
+#include "time-description.hh"
+#include "beam-grav.hh"
+#include "stem.hh"
+#include "beam.hh"
+#include "musical-request.hh"
+#include "grouping.hh"
+#include "text-spanner.hh"
+#include "text-def.hh"
+
+Beam_engraver::Beam_engraver()
+{
+  span_reqs_drul_[LEFT] = span_reqs_drul_[RIGHT] =0;
+  beam_p_ =0;
+  current_grouping_p_ =0;
+}
+
+bool
+Beam_engraver::do_try_request(Request*r)
+{
+  Musical_req* mus_l = r->musical();
+  if (!mus_l)
+    return false;
+  
+  Beam_req * b = mus_l->beam();
+
+  if (!b)
+    return false;
+    
+  if (bool (beam_p_) == bool (b->spantype == Span_req::START))
+    return false;
+  
+  Direction d = (!beam_p_) ? LEFT : RIGHT;
+  if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l))
+    return false;
+  
+  span_reqs_drul_[d] = b;
+  return true;
+}
+
+void
+Beam_engraver::do_process_requests()
+{
+  if ( !beam_p_ && span_reqs_drul_[LEFT]) {
+    current_grouping_p_ = new Rhythmic_grouping;
+    beam_p_ = new Beam;
+    if (span_reqs_drul_[LEFT]->nplet) 
+      {
+       Text_spanner* t = new Text_spanner();
+       Text_def *defp = new Text_def;
+       t->set_support (beam_p_);
+       defp->align_i_ = 0;
+       defp->text_str_ = span_reqs_drul_[LEFT]->nplet;
+       defp->style_str_="italic";
+       t->spec_p_  = defp;
+       announce_element (Score_elem_info (t,0));
+       typeset_element (t);
+      }
+    announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT]));
+  }
+}
+
+void
+Beam_engraver::do_pre_move_processing()
+{
+  if (beam_p_ && span_reqs_drul_[RIGHT]) {
+    Rhythmic_grouping const * rg_C = get_staff_info().rhythmic_C_;
+    rg_C->extend (current_grouping_p_->interval());
+    beam_p_->set_grouping (*rg_C, *current_grouping_p_);
+    typeset_element (beam_p_);
+    beam_p_ = 0;
+
+    delete current_grouping_p_;
+    current_grouping_p_ = 0;
+
+    span_reqs_drul_[RIGHT] =
+      span_reqs_drul_[LEFT] = 0;
+  }
+}
+
+void
+Beam_engraver::do_removal_processing()
+{
+  if (beam_p_) 
+    {
+      span_reqs_drul_[LEFT]->warning ("unterminated beam");
+      typeset_element (beam_p_);
+      beam_p_ =0;
+    }
+}
+
+
+void
+Beam_engraver::acknowledge_element (Score_elem_info i)
+{
+  if (beam_p_ && i.elem_l_->is_type_b (Stem::static_name()))
+    {
+      Stem * s = (Stem*)i.elem_l_->item();
+      Rhythmic_req *rhythmic_req = i.req_l_->musical ()->rhythmic ();
+      if (rhythmic_req->duration_.durlog_i_<= 2) 
+       {
+         rhythmic_req->warning ("Stem doesn't fit in Beam");
+         return ;
+       }
+       
+      /*
+       TODO: do something sensible if it doesn't fit in the beam.
+       */
+      current_grouping_p_->add_child (get_staff_info().time_C_->whole_in_measure_,
+                                     rhythmic_req->duration());
+      /* 
+        TODO
+        should change rep. of flags too.k
+       */
+      s->flag_i_ = Duration_convert::type2_i
+       (rhythmic_req->duration_.durlog_i_);    
+      s->print_flag_b_ = false;
+      beam_p_->add (s);
+    }
+} 
+       
+IMPLEMENT_IS_TYPE_B1(Beam_engraver, Engraver);
+ADD_THIS_ENGRAVER(Beam_engraver);
index 70a1ce88d0ee69d130d2ead7fa137d8d33d6e1dc..927d85cd8d1b94f53f2b47124e08b49cb3cd4ac6 100644 (file)
@@ -32,7 +32,7 @@
 
 struct Stem_info {
   Real x;
 
 struct Stem_info {
   Real x;
-  int dir_i_;
+  int dir_;
   Real idealy_f_;
   Real miny_f_;
   int beams_i_;
   Real idealy_f_;
   Real miny_f_;
   int beams_i_;
@@ -44,45 +44,45 @@ struct Stem_info {
 Stem_info::Stem_info (Stem const *s)
 {
   x = s->hpos_f();
 Stem_info::Stem_info (Stem const *s)
 {
   x = s->hpos_f();
-  dir_i_ = s->dir_i_;
-  beams_i_ = intlog2( s->flag_i_) - 2;
+  dir_ = s->dir_;
+  beams_i_ = intlog2(s->flag_i_) - 2;
 
   /*
 
   /*
-   [todo] 
-       * get algorithm
-        * runtime
-
-   Breitkopf + H\"artel:
-       miny_f_ = interline + #beams * interbeam
-        ideal8 = 2 * interline + interbeam
-        ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
-
-   * B\"arenreiter:
-       miny_f_ = interline + #beams * interbeam
-        ideal8,16 = 2 interline + #beams * interbeam
-        ideal32,64,128 = 1.5 interline + #beams * interbeam
+    [todo] 
+    * get algorithm
+    * runtime
+
+    Breitkopf + H\"artel:
+    miny_f_ = interline + #beams * interbeam
+    ideal8 = 2 * interline + interbeam
+    ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
+
+    * B\"arenreiter:
+    miny_f_ = interline + #beams * interbeam
+    ideal8,16 = 2 interline + #beams * interbeam
+    ideal32,64,128 = 1.5 interline + #beams * interbeam
        
        
-   */
+    */
 
   Real notehead_y = s->paper()->interline_f ();
   // huh? why do i need the / 2
 
   Real notehead_y = s->paper()->interline_f ();
   // huh? why do i need the / 2
-//    Real interbeam_f = s->paper()->interbeam_f ();
+  //    Real interbeam_f = s->paper()->interbeam_f ();
   Real interbeam_f = s->paper()->interbeam_f () / 2;
          
   /* well eh, huh?
   Real interbeam_f = s->paper()->interbeam_f () / 2;
          
   /* well eh, huh?
-  idealy_f_  = dir_i_ * s->stem_start_f() + beams_i_ * interbeam_f; 
-  if ( beams_i_ < 3)
-       idealy_f_ += 2 * interline_f;
-  else
-       idealy_f_ += 1.5 * interline_f;
-  */
+     idealy_f_  = dir_ * s->stem_start_f() + beams_i_ * interbeam_f; 
+     if (beams_i_ < 3)
+     idealy_f_ += 2 * interline_f;
+     else
+     idealy_f_ += 1.5 * interline_f;
+     */
 
 
-  idealy_f_  = dir_i_ * s->stem_end_f();
+  idealy_f_  = dir_ * s->stem_end_f();
 
 
-  miny_f_ = dir_i_ * s->stem_start_f() + notehead_y + beams_i_ * interbeam_f;
+  miny_f_ = dir_ * s->stem_start_f() + notehead_y + beams_i_ * interbeam_f;
 
   idealy_f_ =  miny_f_ >? idealy_f_;
 
   idealy_f_ =  miny_f_ >? idealy_f_;
-//    assert (miny_f_ <= idealy_f_);
+  //    assert (miny_f_ <= idealy_f_);
 }
 
 
 }
 
 
@@ -90,7 +90,7 @@ Stem_info::Stem_info (Stem const *s)
 
 
 Offset
 
 
 Offset
-Beam::center()const
+Beam::center() const
 {
   Real w=(paper()->note_width () + width ().length ())/2.0;
   return Offset (w, (left_pos + w* slope)*paper()->internote_f ());
 {
   Real w=(paper()->note_width () + width ().length ())/2.0;
   return Offset (w, (left_pos + w* slope)*paper()->internote_f ());
@@ -109,6 +109,10 @@ Beam::add (Stem*s)
   stems.push (s);
   s->add_dependency (this);
   s->print_flag_b_ = false;
   stems.push (s);
   s->add_dependency (this);
   s->print_flag_b_ = false;
+
+  if (!spanned_drul_[LEFT])
+    set_bounds(LEFT,s);
+  set_bounds(RIGHT,s);
 }
 
 void
 }
 
 void
@@ -119,34 +123,34 @@ Beam::set_default_dir()
 
   for (int i=0; i <stems.size(); i++) 
     {
 
   for (int i=0; i <stems.size(); i++) 
     {
-       Stem *sl = stems[i];
-       int cur_down = sl->get_center_distance_from_top();
-       int cur_up = sl->get_center_distance_from_bottom();
-       if (cur_down) 
-         {
-           down += cur_down;
-           down_count++;
-         }
-       if (cur_up) 
-         {
-           up += cur_up;
-           up_count++;
-         }
+      Stem *sl = stems[i];
+      int cur_down = sl->get_center_distance_from_top();
+      int cur_up = sl->get_center_distance_from_bottom();
+      if (cur_down) 
+       {
+         down += cur_down;
+         down_count++;
+       }
+      if (cur_up) 
+       {
+         up += cur_up;
+         up_count++;
+       }
     }
   if (!down)
     }
   if (!down)
-       down_count = 1;
+    down_count = 1;
   if (!up)
   if (!up)
-       up_count = 1;
+    up_count = 1;
 
   // the following relation is equal to
   //        up / up_count > down / down_count
 
   // the following relation is equal to
   //        up / up_count > down / down_count
-  dir_i_ = (up * down_count > down * up_count) ? 1 : -1;
+  dir_ = (up * down_count > down * up_count) ? UP : DOWN;
 
 
-   for (int i=0; i <stems.size(); i++) 
-   {
-       Stem *sl = stems[i];
-       sl->dir_i_ = dir_i_;
-   }
+  for (int i=0; i <stems.size(); i++) 
+    {
+      Stem *sl = stems[i];
+      sl->dir_ = dir_;
+    }
 }
 
 /*
 }
 
 /*
@@ -163,57 +167,57 @@ Beam::solve_slope()
   Array<Stem_info> sinfo;
   for (int j=0; j <stems.size(); j++) 
     {
   Array<Stem_info> sinfo;
   for (int j=0; j <stems.size(); j++) 
     {
-       Stem *i = stems[j];
+      Stem *i = stems[j];
 
 
-       i->set_default_extents();
-       if (i->invisible_b())
-           continue;
+      i->set_default_extents();
+      if (i->invisible_b())
+       continue;
        
        
-       Stem_info info (i);
-       sinfo.push (info);
+      Stem_info info (i);
+      sinfo.push (info);
     }
   if (! sinfo.size())
     }
   if (! sinfo.size())
-       slope = left_pos = 0;
+    slope = left_pos = 0;
   else if (sinfo.size() == 1) 
     {
   else if (sinfo.size() == 1) 
     {
-       slope = 0;
-       left_pos = sinfo[0].idealy_f_;
+      slope = 0;
+      left_pos = sinfo[0].idealy_f_;
     }
   else 
     {
        
     }
   else 
     {
        
-       Real leftx = sinfo[0].x;
-       Least_squares l;
-       for (int i=0; i < sinfo.size(); i++) 
-         {
-           sinfo[i].x -= leftx;
-           l.input.push (Offset (sinfo[i].x, sinfo[i].idealy_f_));
-         }
-
-       l.minimise (slope, left_pos);
+      Real leftx = sinfo[0].x;
+      Least_squares l;
+      for (int i=0; i < sinfo.size(); i++) 
+       {
+         sinfo[i].x -= leftx;
+         l.input.push (Offset (sinfo[i].x, sinfo[i].idealy_f_));
+       }
+
+      l.minimise (slope, left_pos);
     }
   
   Real dy = 0.0;
   for (int i=0; i < sinfo.size(); i++) 
     {
     }
   
   Real dy = 0.0;
   for (int i=0; i < sinfo.size(); i++) 
     {
-       Real y = sinfo[i].x * slope + left_pos;
-       Real my = sinfo[i].miny_f_;
+      Real y = sinfo[i].x * slope + left_pos;
+      Real my = sinfo[i].miny_f_;
 
 
-       if (my - y > dy)
-           dy = my -y; 
+      if (my - y > dy)
+       dy = my -y;     
     }
   left_pos += dy;
     }
   left_pos += dy;
-  left_pos *= dir_i_;    
+  left_pos *= dir_;    
 
 
-  slope *= dir_i_;
+  slope *= dir_;
 
   /*
     This neat trick is by Werner Lemberg, damped = tanh (slope) corresponds
     with some tables in [Wanske]
 
   /*
     This neat trick is by Werner Lemberg, damped = tanh (slope) corresponds
     with some tables in [Wanske]
-   */
+    */
   slope = 0.6 * tanh (slope);  
 
   slope = 0.6 * tanh (slope);  
 
-                               // ugh
+  // ugh
   Real sl = slope*paper()->internote_f ();
   paper()->lookup_l ()->beam (sl, 20 PT);
   slope = sl /paper()->internote_f ();
   Real sl = slope*paper()->internote_f ();
   paper()->lookup_l ()->beam (sl, 20 PT);
   slope = sl /paper()->internote_f ();
@@ -225,10 +229,10 @@ Beam::set_stemlens()
   Real x0 = stems[0]->hpos_f();    
   for (int j=0; j <stems.size(); j++) 
     {
   Real x0 = stems[0]->hpos_f();    
   for (int j=0; j <stems.size(); j++) 
     {
-       Stem *s = stems[j];
+      Stem *s = stems[j];
 
 
-       Real x =  s->hpos_f()-x0;
-       s->set_stemend (left_pos + slope * x);  
+      Real x =  s->hpos_f()-x0;
+      s->set_stemend (left_pos + slope * x);   
     }
 }
 
     }
 }
 
@@ -236,11 +240,11 @@ Beam::set_stemlens()
 void
 Beam::do_post_processing()
 {
 void
 Beam::do_post_processing()
 {
-  if ( stems.size() < 2) 
+  if (stems.size() < 2) 
     {
     {
-       warning ("Beam with less than 2 stems");
-       transparent_b_ = true;
-       return ;
+      warning ("Beam with less than 2 stems");
+      transparent_b_ = true;
+      return ;
     }
   solve_slope();    
   set_stemlens();
     }
   solve_slope();    
   set_stemlens();
@@ -257,35 +261,35 @@ Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur)
 
   Array<int> b;
   {
 
   Array<int> b;
   {
-       Array<int> flags;
-       for (int j=0; j <stems.size(); j++) 
-         {
-           Stem *s = stems[j];
-
-           int f = intlog2(abs (s->flag_i_))-2;
-           assert (f>0);
-           flags.push (f);
-         }
-       int fi =0;
-       b= cur.generate_beams (flags, fi);
-       b.insert (0,0);
-       b.push (0);
-       assert (stems.size() == b.size ()/2);
-    }
+    Array<int> flags;
+    for (int j=0; j <stems.size(); j++) 
+      {
+       Stem *s = stems[j];
+
+       int f = intlog2(abs (s->flag_i_))-2;
+       assert (f>0);
+       flags.push (f);
+      }
+    int fi =0;
+    b= cur.generate_beams (flags, fi);
+    b.insert (0,0);
+    b.push (0);
+    assert (stems.size() == b.size ()/2);
+  }
 
   for (int j=0, i=0; i < b.size() && j <stems.size (); i+= 2, j++) 
     {
 
   for (int j=0, i=0; i < b.size() && j <stems.size (); i+= 2, j++) 
     {
-       Stem *s = stems[j];
-       s->beams_left_i_ = b[i];
-       s->beams_right_i_ = b[i+1];
+      Stem *s = stems[j];
+      s->beams_left_i_ = b[i];
+      s->beams_right_i_ = b[i+1];
     }
 }
 
 void
 Beam::do_pre_processing()
 {
     }
 }
 
 void
 Beam::do_pre_processing()
 {
-  if (!dir_i_)
-       set_default_dir();
+  if (!dir_)
+    set_default_dir();
 
 }
 
 
 }
 
@@ -294,18 +298,18 @@ Interval
 Beam::do_width() const
 {
   return Interval (stems[0]->hpos_f(),
 Beam::do_width() const
 {
   return Interval (stems[0]->hpos_f(),
-                    stems.top()->hpos_f ());
+                  stems.top()->hpos_f ());
 }
 
 /*
   beams to go with one stem.
   */
 Molecule
 }
 
 /*
   beams to go with one stem.
   */
 Molecule
-Beam::stem_beams (Stem *here, Stem *next, Stem *prev)const
+Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
 {
 {
-  assert (!next || next->hpos_f() > here->hpos_f () );
-  assert (!prev || prev->hpos_f() < here->hpos_f () );
-//    Real dy=paper()->internote_f ()*2;
+  assert (!next || next->hpos_f() > here->hpos_f ());
+  assert (!prev || prev->hpos_f() < here->hpos_f ());
+  //    Real dy=paper()->internote_f ()*2;
   Real dy = paper()->interbeam_f ();
   Real stemdx = paper()->rule_thickness ();
   Real sl = slope*paper()->internote_f ();
   Real dy = paper()->interbeam_f ();
   Real stemdx = paper()->rule_thickness ();
   Real sl = slope*paper()->internote_f ();
@@ -317,48 +321,48 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev)const
   /* half beams extending to the left. */
   if (prev) 
     {
   /* half beams extending to the left. */
   if (prev) 
     {
-       int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
-       int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
-       Real w = (here->hpos_f() - prev->hpos_f ())/4;
-       Symbol dummy;
-       Atom a (dummy);
-       if (lhalfs)             // generates warnings if not
-           a =  paper()->lookup_l ()->beam (sl, w);
-       a.translate (Offset (-w, -w * sl));
-       for (int j = 0; j  < lhalfs; j++) 
-         {
-           Atom b (a);
-           b.translate (-dir_i_ * dy * (lwholebeams+j), Y_AXIS);
-           leftbeams.add (b);
-         }
+      int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
+      int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
+      Real w = (here->hpos_f() - prev->hpos_f ())/4;
+      Symbol dummy;
+      Atom a (dummy);
+      if (lhalfs)              // generates warnings if not
+       a =  paper()->lookup_l ()->beam (sl, w);
+      a.translate (Offset (-w, -w * sl));
+      for (int j = 0; j  < lhalfs; j++) 
+       {
+         Atom b (a);
+         b.translate (-dir_ * dy * (lwholebeams+j), Y_AXIS);
+         leftbeams.add (b);
+       }
     }
        
   if (next)
     {
     }
        
   if (next)
     {
-       int rhalfs = here->beams_right_i_ - next->beams_left_i_;
-       int rwholebeams = here->beams_right_i_ <? next->beams_left_i_; 
+      int rhalfs = here->beams_right_i_ - next->beams_left_i_;
+      int rwholebeams = here->beams_right_i_ <? next->beams_left_i_; 
 
 
-       Real w = next->hpos_f() - here->hpos_f ();
-       Atom a = paper()->lookup_l ()->beam (sl, w + stemdx);
+      Real w = next->hpos_f() - here->hpos_f ();
+      Atom a = paper()->lookup_l ()->beam (sl, w + stemdx);
        
        
-       int j = 0;
-       for (; j  < rwholebeams; j++) 
-         {
-           Atom b (a);
-           b.translate (-dir_i_ * dy * j, Y_AXIS);
-           rightbeams.add (b); 
-         }
-
-       w /= 4;
-       if (rhalfs)
-           a = paper()->lookup_l ()->beam (sl, w);
+      int j = 0;
+      for (; j  < rwholebeams; j++) 
+       {
+         Atom b (a);
+         b.translate (-dir_ * dy * j, Y_AXIS);
+         rightbeams.add (b); 
+       }
+
+      w /= 4;
+      if (rhalfs)
+       a = paper()->lookup_l ()->beam (sl, w);
        
        
-       for (; j  < rwholebeams + rhalfs; j++) 
-         {
-           Atom b (a);
-           b.translate (-dir_i_ * dy * j, Y_AXIS);
-           rightbeams.add (b); 
-         }
+      for (; j  < rwholebeams + rhalfs; j++) 
+       {
+         Atom b (a);
+         b.translate (-dir_ * dy * j, Y_AXIS);
+         rightbeams.add (b); 
+       }
        
     }
   leftbeams.add (rightbeams);
        
     }
   leftbeams.add (rightbeams);
@@ -372,21 +376,21 @@ Beam::brew_molecule_p() const
  
   Molecule *mol_p = new Molecule;
   // huh? inter-what
  
   Molecule *mol_p = new Molecule;
   // huh? inter-what
-//    Real inter_f = paper()->interbeam_f ();
+  //    Real inter_f = paper()->interbeam_f ();
   Real inter_f = paper()->internote_f ();
   Real x0 = stems[0]->hpos_f();
   for (int j=0; j <stems.size(); j++) 
     {
   Real inter_f = paper()->internote_f ();
   Real x0 = stems[0]->hpos_f();
   for (int j=0; j <stems.size(); j++) 
     {
-       Stem *i = stems[j];
-       Stem * prev = (j > 0)? stems[j-1] : 0;
-       Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
-
-       Molecule sb = stem_beams (i, next, prev);
-       Real  x = i->hpos_f()-x0;
-       sb.translate (Offset (x, (x * slope  + left_pos)* inter_f));
-       mol_p->add (sb);
+      Stem *i = stems[j];
+      Stem * prev = (j > 0)? stems[j-1] : 0;
+      Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
+
+      Molecule sb = stem_beams (i, next, prev);
+      Real  x = i->hpos_f()-x0;
+      sb.translate (Offset (x, (x * slope  + left_pos)* inter_f));
+      mol_p->add (sb);
     }
     }
-  mol_p->translate (x0 - left_col_l_->hpos_f_, X_AXIS);
+  mol_p->translate (x0 - spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), X_AXIS);
   return mol_p;
 }
 
   return mol_p;
 }
 
@@ -394,7 +398,7 @@ Beam::brew_molecule_p() const
 IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
 
 void
 IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
 
 void
-Beam::do_print()const
+Beam::do_print() const
 {
 #ifndef NPRINT
   DOUT << "slope " <<slope << "left ypos " << left_pos;
 {
 #ifndef NPRINT
   DOUT << "slope " <<slope << "left ypos " << left_pos;
@@ -407,6 +411,6 @@ Beam::do_substitute_dependent (Score_elem*o,Score_elem*n)
 {
   if (o->is_type_b (Stem::static_name())) 
     {
 {
   if (o->is_type_b (Stem::static_name())) 
     {
-       stems.substitute ((Stem*)o->item(),  n?(Stem*) n->item ():0);
+      stems.substitute ((Stem*)o->item(),  n?(Stem*) n->item ():0);
     }
 }
     }
 }
index 1ef733c61a7705f2827b62702a0ec24f66bb5741..1bd0a0076208bc0c2fd95f268321c85e329ecf54 100644 (file)
 
 Bow::Bow()
 {
 
 Bow::Bow()
 {
-  left_pos_i_ = right_pos_i_ = 0;
-  left_dx_f_ = right_dx_f_ = 0.0;
+  pos_i_drul_[LEFT] = pos_i_drul_[RIGHT] = 0;
+  dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
 }
 
 
 Offset
 Bow::center() const
 {
 }
 
 
 Offset
 Bow::center() const
 {
-  int dy =  right_pos_i_-left_pos_i_;
+  int dy =  pos_i_drul_[RIGHT]-pos_i_drul_[LEFT];
 
   Real w = width().length ();
 
 
   Real w = width().length ();
 
@@ -35,22 +35,22 @@ Bow::brew_molecule_p() const
   Molecule*output = new Molecule;
   Real w = width().length ();
   
   Molecule*output = new Molecule;
   Real w = width().length ();
   
-  int dy = right_pos_i_ - left_pos_i_;
+  int dy = pos_i_drul_[RIGHT] - pos_i_drul_[LEFT];
   
   Real nw_f = paper()->note_width ();
   Real nh_f = paper()->internote_f ();
 
   
   
   Real nw_f = paper()->note_width ();
   Real nh_f = paper()->internote_f ();
 
   
-  w+= (right_dx_f_ - left_dx_f_) * nw_f ;
+  w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ;
   Real round_w = w;            // slur lookup rounds the slurwidth .
   
   Real round_w = w;            // slur lookup rounds the slurwidth .
   
-  Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_i_);
+  Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_);
 
   Real error = w-round_w;
   
   Atom a (sl);
 
   Real error = w-round_w;
   
   Atom a (sl);
-  a.translate (Offset ((left_dx_f_ + 0.5)*nw_f + error/2,
-                      left_pos_i_ * nh_f));
+  a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2,
+                      pos_i_drul_[LEFT] * nh_f));
   output->add (a);
   return output;
 }
   output->add (a);
   return output;
 }
index 3ebba2eb63646998e01843dd91240ae3ab2cd148..7f5139a831cf183e000918246d0cd60f0c1ab618 100644 (file)
@@ -20,7 +20,7 @@ Col_stats::str() const {
   String s (count_i_);
   s += " lines";
   if  (count_i_)
   String s (count_i_);
   s += " lines";
   if  (count_i_)
-       s += String (Real (cols_i_)/count_i_, ", (with an average of %.1f columns)");
+    s += String (Real (cols_i_)/count_i_, ", (with an average of %.1f columns)");
   
   return s;
 }
   
   return s;
 }
@@ -42,14 +42,14 @@ Col_stats::Col_stats()
 /* **************************************************************** */
 
 Line_of_cols
 /* **************************************************************** */
 
 Line_of_cols
-Break_algorithm::all_cols()const
+Break_algorithm::all_cols() const
 {
   Line_of_cols retval;
 {
   Line_of_cols retval;
-  for (PCursor<PCol*> c (pscore_l_->col_p_list_.top()); 
-        c.ok(); c++) 
-          {
+  for (PCursor<Paper_column*> c (pscore_l_->col_p_list_.top()); 
+       c.ok(); c++) 
+    {
        
        
-       retval.push (c);
+      retval.push (c);
     }
   return retval;
 }
     }
   return retval;
 }
@@ -61,12 +61,12 @@ Break_algorithm::find_break_indices() const
   Array<int> retval;
   
   for (int i=0; i < all.size(); i++)
   Array<int> retval;
   
   for (int i=0; i < all.size(); i++)
-       if (all[i]->breakable_b())
-           retval.push (i);
+    if (all[i]->breakable_b_)
+      retval.push (i);
   
   
-  if ( linelength <=0)
-       while ( retval.size() >2)
-           retval.del (1);
+  if (linelength <=0)
+    while (retval.size() >2)
+      retval.del (1);
 
   return retval;
 }
 
   return retval;
 }
@@ -79,13 +79,13 @@ Break_algorithm::find_breaks() const
   Line_of_cols retval;
   
   for (int i=0; i < all.size(); i++)
   Line_of_cols retval;
   
   for (int i=0; i < all.size(); i++)
-       if (all[i]->breakable_b())
-           retval.push (all[i]);
+    if (all[i]->breakable_b_)
+      retval.push (all[i]);
 
 
 
 
-  if ( linelength <=0)
-       while ( retval.size() >2)
-           retval.del (1);
+  if (linelength <=0)
+    while (retval.size() >2)
+      retval.del (1);
 
   return retval;
 }
 
   return retval;
 }
@@ -95,19 +95,19 @@ Break_algorithm::find_breaks() const
  
 
 Line_spacer*
  
 
 Line_spacer*
-Break_algorithm::generate_spacing_problem (Line_of_cols curline)const
+Break_algorithm::generate_spacing_problem (Line_of_cols curline) const
 {
   Line_spacer * sp= (*get_line_spacer)();
 
   sp->paper_l_ = pscore_l_->paper_l_;
   sp->add_column (curline[0], true, 0.0);
   for (int i=1; i< curline.size()-1; i++)
 {
   Line_spacer * sp= (*get_line_spacer)();
 
   sp->paper_l_ = pscore_l_->paper_l_;
   sp->add_column (curline[0], true, 0.0);
   for (int i=1; i< curline.size()-1; i++)
-       sp->add_column (curline[i]);
+    sp->add_column (curline[i]);
 
 
-  if ( linelength > 0)
-       sp->add_column (curline.top(), true, linelength);
+  if (linelength > 0)
+    sp->add_column (curline.top(), true, linelength);
   else
   else
-       sp->add_column (curline.top());
+    sp->add_column (curline.top());
 
   sp->prepare();
   return sp;
 
   sp->prepare();
   return sp;
@@ -132,11 +132,11 @@ bool
 Break_algorithm::feasible (Line_of_cols curline) const
 {
   if (linelength <=  0)
 Break_algorithm::feasible (Line_of_cols curline) const
 {
   if (linelength <=  0)
-       return true;
+    return true;
   
   Real l =0;
   for (int i=0; i < curline.size(); i++)
   
   Real l =0;
   for (int i=0; i < curline.size(); i++)
-       l +=curline[i]->width().length ();
+    l +=curline[i]->width().length ();
   return l < linelength;    
 }
 
   return l < linelength;    
 }
 
@@ -144,24 +144,24 @@ void
 Break_algorithm::problem_OK() const
 {
   if (!pscore_l_->col_p_list_.size())
 Break_algorithm::problem_OK() const
 {
   if (!pscore_l_->col_p_list_.size())
-       error ("Score does not have any columns");
+    error ("Score does not have any columns");
   OK();
 }
 
 void
   OK();
 }
 
 void
-Break_algorithm::OK()const
+Break_algorithm::OK() const
 {
 #ifndef NDEBUG
   iter_top (pscore_l_->col_p_list_,start);
 {
 #ifndef NDEBUG
   iter_top (pscore_l_->col_p_list_,start);
-  PCursor<PCol *> end (pscore_l_->col_p_list_.bottom());
+  PCursor<Paper_column *> end (pscore_l_->col_p_list_.bottom());
   
   
-  assert (start->breakable_b());    
-  assert (end->breakable_b());
+  assert (start->breakable_b_);    
+  assert (end->breakable_b_);
 #endif
 }
 
 Array<Col_hpositions>
 #endif
 }
 
 Array<Col_hpositions>
-Break_algorithm::solve()const
+Break_algorithm::solve() const
 {
   return do_solve();
 }
 {
   return do_solve();
 }
@@ -173,10 +173,10 @@ Break_algorithm::do_set_pscore()
 }
 
 void
 }
 
 void
-Break_algorithm::print_stats()const
+Break_algorithm::print_stats() const
 {
   if (approx_stats_.count_i_)
 {
   if (approx_stats_.count_i_)
-       *mlog << "\nApproximated: " << approx_stats_.str() << "\n";
+    *mlog << "\nApproximated: " << approx_stats_.str() << "\n";
   if (exact_stats_.count_i_)
   if (exact_stats_.count_i_)
-       *mlog << "Calculated exactly: " << exact_stats_.str() << "\n";
+    *mlog << "Calculated exactly: " << exact_stats_.str() << "\n";
 }
 }
diff --git a/lily/chord-iterator.cc b/lily/chord-iterator.cc
new file mode 100644 (file)
index 0000000..2bca2b1
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+  chord-iter.cc -- implement Chord_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "translator.hh"
+#include "debug.hh"
+#include "chord-iterator.hh"
+
+#include "music-list.hh"
+
+
+Chord_iterator::~Chord_iterator()
+{
+}
+
+Chord_iterator::Chord_iterator (Chord const *chord_C)
+{
+  chord_C_ = chord_C;
+}
+
+void
+Chord_iterator::construct_children()
+{
+  int j = 0;
+  for (PCursor<Music*> i (chord_C_->music_p_list_.top());  //, int j = 0; 
+       i.ok(); j++, i++) 
+    {
+      Music_iterator * mi =  get_iterator_p (i.ptr());
+      if (mi->ok()) 
+       {
+         set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_));
+         children_p_list_.bottom().add (mi);
+       }
+      else 
+       delete mi;
+    }
+}
+void
+Chord_iterator::do_print() const
+{
+#ifndef NPRINT
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++) 
+    {
+      i->print();
+    }
+#endif
+}
+
+void
+Chord_iterator::process_and_next (Moment until)
+{
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();) 
+    {
+      if  (i->next_moment() == until) 
+       {
+         i->process_and_next (until);
+       }
+      if (!i->ok()) 
+       delete i.remove_p();
+      else
+       i++;
+    }
+  Music_iterator::process_and_next (until);
+}
+
+
+IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
+
+Moment
+Chord_iterator::next_moment() const
+{
+  Moment next_ = infinity_mom;
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
+    next_ = next_ <? i->next_moment() ;
+  return next_;
+}
+
+
+
+bool
+Chord_iterator::ok() const
+{
+  return children_p_list_.size();
+}
index 1afaa3cc4470eee7bfe993ffd06f3947f8f01a77..a9bea179f0d4c6bc2c76e1605e67bba40ec19c36 100644 (file)
@@ -66,7 +66,7 @@ Clef_engraver::acknowledge_element (Score_elem_info info)
   if (info.elem_l_->name() == Bar::static_name ()) 
     {
        create_clef();
   if (info.elem_l_->name() == Bar::static_name ()) 
     {
        create_clef();
-       if ( !clef_req_l_)
+       if (!clef_req_l_)
            clef_p_->default_b_ = true;
     }
 }
            clef_p_->default_b_ = true;
     }
 }
index 8a2534b111782dab90037a25b793821db102c259..fc579ec3475298fb3b631e87e482ba53a342ec5d 100644 (file)
@@ -21,8 +21,8 @@ Clef_item::do_pre_processing()
 
   if (default_b_)
     {
 
   if (default_b_)
     {
-       empty_b_ = (break_status_i() != 1);
-       transparent_b_ = (break_status_i() != 1);
+      empty_b_ = (break_status_i() != 1);
+      transparent_b_ = (break_status_i() != 1);
     }
 }
 
     }
 }
 
@@ -39,13 +39,13 @@ Clef_item::read (String t)
 {
   type_= t;
   if (type_ == "violin")
 {
   type_= t;
   if (type_ == "violin")
-       y_off = 2;
+    y_off = 2;
   if (type_ == "alto")
   if (type_ == "alto")
-       y_off = 4;
+    y_off = 4;
   if (type_ == "tenor")
   if (type_ == "tenor")
-       y_off = 6;
+    y_off = 6;
   if (type_ == "bass")
   if (type_ == "bass")
-       y_off = 6;
+    y_off = 6;
 }
 void
 Clef_item::read (Clef_engraver const &k)
 }
 void
 Clef_item::read (Clef_engraver const &k)
@@ -54,11 +54,11 @@ Clef_item::read (Clef_engraver const &k)
 }
 
 Molecule*
 }
 
 Molecule*
-Clef_item::brew_molecule_p()const
+Clef_item::brew_molecule_p() const
 {
   String t = type_;
   if  (change_b_)
 {
   String t = type_;
   if  (change_b_)
-       t += "_change";
+    t += "_change";
   Symbol s = paper()->lookup_l ()->clef (t);
   Molecule*output = new Molecule (Atom (s));
   output->translate (paper()->internote_f () * y_off, Y_AXIS);
   Symbol s = paper()->lookup_l ()->clef (t);
   Molecule*output = new Molecule (Atom (s));
   output->translate (paper()->internote_f () * y_off, Y_AXIS);
index e05498f0e15c489718c901b3c25d72ca4f33237d..086b7c7e3e9492a9db256872c6f4ab931755a695 100644 (file)
@@ -16,20 +16,22 @@ Colinfo::print() const
 #ifndef NPRINT
   DOUT << "column { ";
   if (fixed())
 #ifndef NPRINT
   DOUT << "column { ";
   if (fixed())
-       DOUT << "fixed at " << fixed_position()<<", ";
+    DOUT << "fixed at " << fixed_position()<<", ";
   assert (pcol_l_);
   DOUT << "[" << minleft() << ", " << minright () << "]";
   DOUT <<"}\n";
 #endif
 }
 
   assert (pcol_l_);
   DOUT << "[" << minleft() << ", " << minright () << "]";
   DOUT <<"}\n";
 #endif
 }
 
-Colinfo::Colinfo (PCol *col_l, Real const *fixed_C)
+Colinfo::Colinfo (Paper_column *col_l, Real const *fixed_C)
 {
   if (fixed_C)
 {
   if (fixed_C)
-       fixpos_p_.set_l (fixed_C);
+    fixpos_p_.set_l (fixed_C);
   ugh_b_ = false;
   pcol_l_ = col_l;
   width = pcol_l_->width();
   ugh_b_ = false;
   pcol_l_ = col_l;
   width = pcol_l_->width();
+  if (width.empty_b())
+    width = Interval(0,0);
 }
 
 
 }
 
 
index d7850f5c27f1ccf0cf3f43587d20cfccf109dc22..62cc881bdebe42ea1aceaa27f46329e2c6818513 100644 (file)
@@ -26,7 +26,7 @@ Col_hpositions::~Col_hpositions()
 }
 
 void
 }
 
 void
-Col_hpositions::add (PCol*c)
+Col_hpositions::add (Paper_column*c)
 {
   cols.push (c);
 }
 {
   cols.push (c);
 }
@@ -43,7 +43,7 @@ Col_hpositions::print() const
 }
 
 void
 }
 
 void
-Col_hpositions::OK()const
+Col_hpositions::OK() const
 {
 #ifndef NDEBUG
   assert (config.size() == cols.size ());
 {
 #ifndef NDEBUG
   assert (config.size() == cols.size ());
index a5fd6aee0b3df972fc52f7b131f98e5bc37a001c..881c561e9592601a9c796b48cc557300d8758a08 100644 (file)
@@ -30,7 +30,7 @@ int idx (int dir, bool h_shift_b)
 {
   assert (abs (dir) == 1);
   int j = dir > 0 ? 0 : 3;
 {
   assert (abs (dir) == 1);
   int j = dir > 0 ? 0 : 3;
-  if ( h_shift_b) 
+  if (h_shift_b) 
        j += dir;
   return j;
 }
        j += dir;
   return j;
 }
@@ -57,12 +57,12 @@ Collision::do_pre_processing()
   for (int i=0; i < clash_l_arr_.size(); i++) 
     {
        Note_column* c_l = clash_l_arr_[i];
   for (int i=0; i < clash_l_arr_.size(); i++) 
     {
        Note_column* c_l = clash_l_arr_[i];
-       if (! c_l->dir_i_
+       if (! c_l->dir_) 
          {
            warning ("No stem direction set. Ignoring column in clash. ");
            continue;
          }
          {
            warning ("No stem direction set. Ignoring column in clash. ");
            continue;
          }
-       int d = (c_l->dir_i_);
+       int d = (c_l->dir_);
        
        clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l);
     }
        
        clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l);
     }
index 051ce84465731951952cc2894cf32f607ec4158c..69e7f4b7dbbb23d91c831d95ffbd8779a81cc075 100644 (file)
@@ -21,7 +21,7 @@ IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
 IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
 
 void
 IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
 
 void
-Cadenza_req::do_print()const
+Cadenza_req::do_print() const
 {
 #ifndef NPRINT
   DOUT << on_b_;
 {
 #ifndef NPRINT
   DOUT << on_b_;
@@ -29,7 +29,7 @@ Cadenza_req::do_print()const
 }
 
 bool
 }
 
 bool
-Cadenza_req::do_equal_b (Request*r)const
+Cadenza_req::do_equal_b (Request*r) const
 {
   Cadenza_req*cad =  r->command()->timing ()->cadenza ();
   
 {
   Cadenza_req*cad =  r->command()->timing ()->cadenza ();
   
@@ -44,7 +44,7 @@ Cadenza_req::Cadenza_req (bool b)
 
 
 bool
 
 
 bool
-Bar_req::do_equal_b (Request*r)const
+Bar_req::do_equal_b (Request*r) const
 {
   Bar_req * b = r->command()->bar ();
   return type_str_ == b->type_str_;
 {
   Bar_req * b = r->command()->bar ();
   return type_str_ == b->type_str_;
@@ -70,7 +70,7 @@ Partial_measure_req::Partial_measure_req (Moment m)
 }
 
 bool
 }
 
 bool
-Partial_measure_req::do_equal_b (Request* r)const
+Partial_measure_req::do_equal_b (Request* r) const
 {
   Partial_measure_req *p = r->command()->timing ()->partial ();
 
 {
   Partial_measure_req *p = r->command()->timing ()->partial ();
 
@@ -81,18 +81,18 @@ Partial_measure_req::do_equal_b (Request* r)const
 IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
 
 void
 IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
 
 void
-Timing_req::do_print()const{}
+Timing_req::do_print() const{}
 
 
 IMPLEMENT_IS_TYPE_B1(Command_req,Request);
 
 void
 
 
 IMPLEMENT_IS_TYPE_B1(Command_req,Request);
 
 void
-Command_req::do_print()const{}
+Command_req::do_print() const{}
 
 IMPLEMENT_IS_TYPE_B1(Disallow_break_req,Command_req);
 
 void
 
 IMPLEMENT_IS_TYPE_B1(Disallow_break_req,Command_req);
 
 void
-Disallow_break_req::do_print()const
+Disallow_break_req::do_print() const
 {
 }
 /* *************** */
 {
 }
 /* *************** */
@@ -103,7 +103,7 @@ void
 Barcheck_req::do_print() const{}
 
 bool
 Barcheck_req::do_print() const{}
 
 bool
-Barcheck_req::do_equal_b (Request*)const
+Barcheck_req::do_equal_b (Request*) const
 {
   return true;
 }
 {
   return true;
 }
@@ -158,12 +158,12 @@ Meter_change_req::do_print() const
 }
 
 bool
 }
 
 bool
-Meter_change_req::do_equal_b (Request * r)const
+Meter_change_req::do_equal_b (Request * r) const
 {
   Meter_change_req * m = r->command()->timing ()->meterchange ();
   
   return m->beats_i_ == beats_i_ 
 {
   Meter_change_req * m = r->command()->timing ()->meterchange ();
   
   return m->beats_i_ == beats_i_ 
-       && one_beat_i_ == m->one_beat_i_;
+    && one_beat_i_ == m->one_beat_i_;
 }
 
 Meter_change_req::Meter_change_req()
 }
 
 Meter_change_req::Meter_change_req()
@@ -187,14 +187,14 @@ Tempo_req::Tempo_req()
 }
 
 void
 }
 
 void
-Tempo_req::do_print()const
+Tempo_req::do_print() const
 {
   DOUT << dur_.str() << " = " <<metronome_i_ ;
 }
 IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req);
 
 bool
 {
   DOUT << dur_.str() << " = " <<metronome_i_ ;
 }
 IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req);
 
 bool
-Tempo_req::do_equal_b (Request *r)const
+Tempo_req::do_equal_b (Request *r) const
 {
   Tempo_req *t = r->command()->timing ()->tempo ();
   
 {
   Tempo_req *t = r->command()->timing ()->tempo ();
   
@@ -211,13 +211,13 @@ Measure_grouping_req::do_print() const
 {
   for (int i=0; i < elt_length_arr_.size(); i++) 
     {
 {
   for (int i=0; i < elt_length_arr_.size(); i++) 
     {
-       DOUT << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
+      DOUT << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
     }
 }
 
 
 bool 
     }
 }
 
 
 bool 
-Measure_grouping_req::do_equal_b (Request*)const
+Measure_grouping_req::do_equal_b (Request*) const
 {
   return false;                // todo
 }
 {
   return false;                // todo
 }
@@ -225,12 +225,12 @@ Measure_grouping_req::do_equal_b (Request*)const
 /* *************** */
 
 void
 /* *************** */
 
 void
-Key_change_req::transpose (Melodic_req const & d)const
+Key_change_req::transpose (Melodic_req const & d) const
 {
   WARN << "don't know how to transpose a key. \n";
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
 {
   WARN << "don't know how to transpose a key. \n";
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->transpose (d);
+      melodic_p_arr_[i]->transpose (d);
     }
 }
 
     }
 }
 
@@ -241,7 +241,7 @@ Key_change_req::squash_octaves()
 {
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
 {
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->octave_i_ = 0;
+      melodic_p_arr_[i]->octave_i_ = 0;
     }
 }
 
     }
 }
 
@@ -251,62 +251,62 @@ Key_change_req::do_print() const
 #ifndef NPRINT
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
 #ifndef NPRINT
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->print();
+      melodic_p_arr_[i]->print();
     }
 #endif
 }
 
 Key_change_req::Key_change_req()
 {
     }
 #endif
 }
 
 Key_change_req::Key_change_req()
 {
-       minor_b_ = false;
-       multi_octave_b_= false;
+  minor_b_ = false;
+  multi_octave_b_= false;
 }
 
 Key_change_req::Key_change_req (Key_change_req const&c)
 {
 }
 
 Key_change_req::Key_change_req (Key_change_req const&c)
 {
-       for (int i=0; i < c.melodic_p_arr_.size(); i++) 
-               melodic_p_arr_.push (c.melodic_p_arr_[i]->clone()->musical ()->melodic ());
-       minor_b_ = c.minor_b_;
-       multi_octave_b_ = c.multi_octave_b_;
+  for (int i=0; i < c.melodic_p_arr_.size(); i++) 
+    melodic_p_arr_.push (c.melodic_p_arr_[i]->clone()->musical ()->melodic ());
+  minor_b_ = c.minor_b_;
+  multi_octave_b_ = c.multi_octave_b_;
 }
 
 Key_change_req::~Key_change_req()
 {
 }
 
 Key_change_req::~Key_change_req()
 {
-       for (int i=0; i < melodic_p_arr_.size(); i++)
-               delete melodic_p_arr_[i];
+  for (int i=0; i < melodic_p_arr_.size(); i++)
+    delete melodic_p_arr_[i];
 }
 
 int
 Key_change_req::flats_i()
 {
 }
 
 int
 Key_change_req::flats_i()
 {
-       int flats_i = 0;
-       for ( int i = 0; i < melodic_p_arr_.size(); i++) 
-         {
-               Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
-               assert (mel_l);
-               if ( mel_l->accidental_i_ < 0)
-                       flats_i -= mel_l->accidental_i_;
-         }
-       return flats_i;
+  int flats_i = 0;
+  for (int i = 0; i < melodic_p_arr_.size(); i++) 
+    {
+      Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
+      assert (mel_l);
+      if (mel_l->accidental_i_ < 0)
+       flats_i -= mel_l->accidental_i_;
+    }
+  return flats_i;
 }
 
 int
 Key_change_req::minor_b()
 {
 }
 
 int
 Key_change_req::minor_b()
 {
-       return minor_b_;        
+  return minor_b_;     
 }
 
 int
 Key_change_req::sharps_i()
 {
 }
 
 int
 Key_change_req::sharps_i()
 {
-       int sharps_i = 0;
-       for ( int i = 0; i < melodic_p_arr_.size(); i++) 
-         {
-               Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
-               assert (mel_l);
-               if ( mel_l->accidental_i_ > 0)
-                       sharps_i+= mel_l->accidental_i_;
-         }
-       return sharps_i;
+  int sharps_i = 0;
+  for (int i = 0; i < melodic_p_arr_.size(); i++) 
+    {
+      Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
+      assert (mel_l);
+      if (mel_l->accidental_i_ > 0)
+       sharps_i+= mel_l->accidental_i_;
+    }
+  return sharps_i;
 }
 
 }
 
index d5c16cb442e5e607fbdbe9d2b0ac81e99429b5ee..3fe1a4114c00c78e77e375ca0195bf2d3c02ba55 100644 (file)
 
 Crescendo::Crescendo()
 {
 
 Crescendo::Crescendo()
 {
-  grow_dir_i_ =0;
-  dir_i_ = -1 ;
-  left_dyn_b_ = right_dyn_b_ =false;
+  grow_dir_ =0;
+  dir_ = DOWN ;
+  dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false;
   inside_staff_b_ = false;
 }
 
 Interval
   inside_staff_b_ = false;
 }
 
 Interval
-Crescendo::symbol_height()const
+Crescendo::symbol_height() const
 {
   return get_symbol().dim[Y_AXIS];
 }
 {
   return get_symbol().dim[Y_AXIS];
 }
@@ -30,25 +30,25 @@ Crescendo::symbol_height()const
 static Real absdyn_dim = 10 PT;        // ugh
 
 Symbol
 static Real absdyn_dim = 10 PT;        // ugh
 
 Symbol
-Crescendo::get_symbol()const
+Crescendo::get_symbol() const
 {    
   Real w_dim = width().length ();
 {    
   Real w_dim = width().length ();
-  if ( left_dyn_b_
+  if (dyn_b_drul_[LEFT]
     {
     {
-       w_dim -= absdyn_dim;
+      w_dim -= absdyn_dim;
     }
     }
-  if ( right_dyn_b_
+  if (dyn_b_drul_[RIGHT]
     {
     {
-       w_dim -= absdyn_dim;
+      w_dim -= absdyn_dim;
     }
   
   if (w_dim < 0) 
     {
     }
   
   if (w_dim < 0) 
     {
-       warning ("Crescendo too small");
-       w_dim = 0;
+      warning ("Crescendo too small");
+      w_dim = 0;
     }
 
     }
 
-  return Symbol (paper()->lookup_l ()->hairpin (w_dim, grow_dir_i_ < 0));
+  return Symbol (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0));
 }
 
 Molecule*
 }
 
 Molecule*
@@ -56,8 +56,8 @@ Crescendo::brew_molecule_p() const
 {
   Molecule* m_p =0;
   Real x_off_dim=0.0;
 {
   Molecule* m_p =0;
   Real x_off_dim=0.0;
-  if ( left_dyn_b_)
-       x_off_dim += absdyn_dim;
+  if (dyn_b_drul_[LEFT])
+    x_off_dim += absdyn_dim;
   
   m_p = new Molecule;
   Symbol s (get_symbol());
   
   m_p = new Molecule;
   Symbol s (get_symbol());
index 73fa9d3ca7706561f7f1189fa88cf01dd43b4528..499d286cf2ae5f61b8a4e196597587c1f9fc40db 100644 (file)
@@ -10,7 +10,7 @@ parse_dimen (String dim)
   char const *s = dim;
   while  (i > 0 && (isspace (s[i]) || isalpha (s[i])))
     {
   char const *s = dim;
   while  (i > 0 && (isspace (s[i]) || isalpha (s[i])))
     {
-       i--;
+      i--;
     }
   String unit (s + i+1);
   return convert_dimen (dim.value_f(), unit); 
     }
   String unit (s + i+1);
   return convert_dimen (dim.value_f(), unit); 
@@ -21,13 +21,13 @@ Real
 convert_dimen (Real quant, String unit)
 {
   if (unit == "cm")
 convert_dimen (Real quant, String unit)
 {
   if (unit == "cm")
-       return quant * CM_TO_PT;
+    return quant * CM_TO_PT;
   if (unit == "pt")
   if (unit == "pt")
-       return quant;
+    return quant;
   if (unit == "mm")
   if (unit == "mm")
-       return quant*CM_TO_PT/10;
+    return quant*CM_TO_PT/10;
   if (unit == "in")
   if (unit == "in")
-       return quant * INCH_TO_PT;
+    return quant * INCH_TO_PT;
   error ("unknown length unit: `" + unit+"'");
 }
 
   error ("unknown length unit: `" + unit+"'");
 }
 
index 837fae76d9827ede96ab1b331561c92813f5c8d5..62ab05f8b4a240920747f8f0de89c93c05adb3a3 100644 (file)
@@ -3,17 +3,17 @@
 void
 Directional_spanner::set_default_dir()
 {
 void
 Directional_spanner::set_default_dir()
 {
-  dir_i_ = -1;
+  dir_ = DOWN;
 }
 
 void
 Directional_spanner::do_pre_processing()
 {
 }
 
 void
 Directional_spanner::do_pre_processing()
 {
-  if (!dir_i_)
+  if (!dir_)
        set_default_dir();
 }
 
 Directional_spanner::Directional_spanner()
 {
        set_default_dir();
 }
 
 Directional_spanner::Directional_spanner()
 {
-  dir_i_ = 0;
+  dir_ = CENTER;
 }
 }
index a159d32d7268dfa34460f2bff1ad64a107962f5f..9da5b1386ca53657b63287e5e8b4e2d04737cceb 100644 (file)
@@ -18,7 +18,7 @@
 
 Dynamic_engraver::Dynamic_engraver()
 {
 
 Dynamic_engraver::Dynamic_engraver()
 {
-  dir_i_ =0;
+  dir_ = CENTER;
   do_post_move_processing();
   dynamic_p_ =0;
   to_end_cresc_p_ = cresc_p_ = 0;
   do_post_move_processing();
   dynamic_p_ =0;
   to_end_cresc_p_ = cresc_p_ = 0;
@@ -36,7 +36,7 @@ Dynamic_engraver::do_try_request (Request * r)
 {
   Musical_req * m = r->musical();
   if (!m || !m->dynamic())
 {
   Musical_req * m = r->musical();
   if (!m || !m->dynamic())
-       return false;
+    return false;
   dynamic_req_l_arr_.push (m->dynamic());
   return true;
 }
   dynamic_req_l_arr_.push (m->dynamic());
   return true;
 }
@@ -46,58 +46,58 @@ Dynamic_engraver::do_process_requests()
   Crescendo*  new_cresc_p=0; 
   for (int i=0; i < dynamic_req_l_arr_.size(); i++) 
     {
   Crescendo*  new_cresc_p=0; 
   for (int i=0; i < dynamic_req_l_arr_.size(); i++) 
     {
-       Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
-       if (dreq_l->absdynamic()) 
-         {
-           Text_def * td_p = new Text_def;
-           td_p->align_i_ = 0;
-           String loud =Dynamic_req::loudness_str (
-               dreq_l->absdynamic()->loudness_);
+      Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
+      if (dreq_l->absdynamic()) 
+       {
+         Text_def * td_p = new Text_def;
+         td_p->align_i_ = 0;
+         String loud =Dynamic_req::loudness_str (
+                                                 dreq_l->absdynamic()->loudness_);
            
            
-           td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex;
-           td_p->style_str_ = "dynamic";
+         td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex;
+         td_p->style_str_ = "dynamic";
 
 
-           assert (!dynamic_p_) ; // TODO
+         assert (!dynamic_p_) ; // TODO
                
                
-           dynamic_p_ = new Text_item (td_p);
-           announce_element (Score_elem_info (dynamic_p_, dreq_l));
-         }
-       else if (dreq_l->span_dynamic()) 
-         {
+         dynamic_p_ = new Text_item (td_p);
+         announce_element (Score_elem_info (dynamic_p_, dreq_l));
+       }
+      else if (dreq_l->span_dynamic()) 
+       {
 
 
-           Span_dynamic_req* span_l = dreq_l->span_dynamic();
-           if (span_l->spantype == Span_req::STOP) 
-             {
-               if (!cresc_p_) 
-                 {
-                   span_l->warning ("Can't find cresc to end ");
-                 }
-               else 
-                 {
-                   assert (!to_end_cresc_p_);
-                   to_end_cresc_p_ =cresc_p_;
-                   cresc_p_ = 0;
-                 }
-             }
-           else if (span_l->spantype == Span_req::START) 
-             {
-               cresc_req_l_ = span_l;
-               assert (!new_cresc_p);
-               new_cresc_p  = new Crescendo;
-               new_cresc_p->grow_dir_i_ = span_l->dynamic_dir_i_;
-               announce_element (Score_elem_info (new_cresc_p, span_l));
-             }
-         }
+         Span_dynamic_req* span_l = dreq_l->span_dynamic();
+         if (span_l->spantype == Span_req::STOP) 
+           {
+             if (!cresc_p_) 
+               {
+                 span_l->warning ("Can't find cresc to end ");
+               }
+             else 
+               {
+                 assert (!to_end_cresc_p_);
+                 to_end_cresc_p_ =cresc_p_;
+                 cresc_p_ = 0;
+               }
+           }
+         else if (span_l->spantype == Span_req::START) 
+           {
+             cresc_req_l_ = span_l;
+             assert (!new_cresc_p);
+             new_cresc_p  = new Crescendo;
+             new_cresc_p->grow_dir_ = span_l->dynamic_dir_;
+             announce_element (Score_elem_info (new_cresc_p, span_l));
+           }
+       }
     }
 
     }
 
-  if ( new_cresc_p) 
+  if (new_cresc_p) 
     {
     {
-       cresc_p_ = new_cresc_p;
-       cresc_p_->left_col_l_ = get_staff_info().musical_l ();
-       if (dynamic_p_) 
-         {
-           cresc_p_->left_dyn_b_ = true;
-         }
+      cresc_p_ = new_cresc_p;
+      cresc_p_->set_bounds(LEFT,get_staff_info().musical_l ());
+      if (dynamic_p_) 
+       {
+         cresc_p_->dyn_b_drul_[LEFT] = true;
+       }
     }
 }
 
     }
 }
 
@@ -107,19 +107,19 @@ Dynamic_engraver::do_pre_move_processing()
   Staff_symbol* s_l = get_staff_info().staff_sym_l_;
   if (dynamic_p_) 
     {
   Staff_symbol* s_l = get_staff_info().staff_sym_l_;
   if (dynamic_p_) 
     {
-       dynamic_p_->set_staffsym (s_l);
-       typeset_element (dynamic_p_);
-       dynamic_p_ = 0;
+      dynamic_p_->set_staffsym (s_l);
+      typeset_element (dynamic_p_);
+      dynamic_p_ = 0;
     }
     }
-  if ( to_end_cresc_p_) 
+  if (to_end_cresc_p_) 
     {
     {
-       if (dynamic_p_)
-           to_end_cresc_p_->right_dyn_b_=true;
+      if (dynamic_p_)
+       to_end_cresc_p_->dyn_b_drul_[RIGHT]=true;
        
        
-       to_end_cresc_p_->right_col_l_ = get_staff_info().musical_l ();
-       to_end_cresc_p_->set_staffsym (s_l);
-       typeset_element (to_end_cresc_p_);
-       to_end_cresc_p_ = 0;
+      to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_l ());
+      to_end_cresc_p_->set_staffsym (s_l);
+      typeset_element (to_end_cresc_p_);
+      to_end_cresc_p_ = 0;
     }
 }
 
     }
 }
 
@@ -127,7 +127,7 @@ void
 Dynamic_engraver::set_feature (Feature i)
 {
   if (i.type_ == "vdir")       
 Dynamic_engraver::set_feature (Feature i)
 {
   if (i.type_ == "vdir")       
-       dir_i_ = i.value_;
+    dir_ = (Direction) int(i.value_);
 }
 
 
 }
 
 
@@ -140,7 +140,7 @@ Dynamic_engraver::~Dynamic_engraver()
   delete to_end_cresc_p_;
   if (cresc_p_) 
     {
   delete to_end_cresc_p_;
   if (cresc_p_) 
     {
-       cresc_req_l_->warning ("unended crescendo");
+      cresc_req_l_->warning ("unended crescendo");
     }
   delete cresc_p_;
 }
     }
   delete cresc_p_;
 }
@@ -149,10 +149,10 @@ Dynamic_engraver::acknowledge_element (Score_elem_info i)
 {
   if (i.elem_l_->name() == Note_column::static_name ()) 
     {
 {
   if (i.elem_l_->name() == Note_column::static_name ()) 
     {
-       if (dynamic_p_) dynamic_p_->add_support (i.elem_l_);
-       if (to_end_cresc_p_)
-           to_end_cresc_p_->add_support (i.elem_l_);
-       if (cresc_p_) 
-           cresc_p_->add_support (i.elem_l_);
+      if (dynamic_p_) dynamic_p_->add_support (i.elem_l_);
+      if (to_end_cresc_p_)
+       to_end_cresc_p_->add_support (i.elem_l_);
+      if (cresc_p_) 
+       cresc_p_->add_support (i.elem_l_);
     }
 }
     }
 }
index ec744fee4563e588281bd81258382dfceabdacd7..9209796caee198ae25244265182e105041711116 100644 (file)
@@ -11,7 +11,7 @@
 #include "p-col.hh"
 
 void
 #include "p-col.hh"
 
 void
-Horizontal_vertical_group_item::do_print()const
+Horizontal_vertical_group_item::do_print() const
 {
   Horizontal_vertical_group_element::do_print();
 }
 {
   Horizontal_vertical_group_element::do_print();
 }
index 807573384f4022aa696d16eacafcc7b30159f9dc..8c4c573b26e478654de6b38fca1bb58536c05eaa 100644 (file)
@@ -17,25 +17,37 @@ Axis_group_element::do_unlink()
   remove_all();
 }
 
   remove_all();
 }
 
+void
+Axis_group_element::do_junk_links()
+{
+  axis_admin_.elem_l_arr_.set_size (0);
+}
+
 
 bool
 
 bool
-Axis_group_element::contains_b (Score_elem const*e)const
+Axis_group_element::contains_b (Score_elem const*e) const
 {
   return axis_admin_.contains_b (e);
 }
 
 Link_array<Score_elem>
 {
   return axis_admin_.contains_b (e);
 }
 
 Link_array<Score_elem>
-Axis_group_element::get_extra_dependencies()const
+Axis_group_element::get_extra_dependencies() const
 {
   return axis_admin_.elem_l_arr_;
 }
 
 void
 {
   return axis_admin_.elem_l_arr_;
 }
 
 void
-Axis_group_element::do_print()const
+Axis_group_element::do_print() const
 {
   axis_admin_.print();
 }
 
 {
   axis_admin_.print();
 }
 
+
+Axis_group_element::Axis_group_element()
+{
+  transparent_b_ = true;
+}
+
 // ****************
 
 
 // ****************
 
 
@@ -62,6 +74,7 @@ Vertical_group_element::remove_all()
 {
   axis_admin_.remove_all (Y_AXIS,Y_AXIS);
 }
 {
   axis_admin_.remove_all (Y_AXIS,Y_AXIS);
 }
+
 // ****************
 
 void
 // ****************
 
 void
@@ -84,7 +97,7 @@ Horizontal_group_element::remove_element (Score_elem*e)
 
 
 Interval
 
 
 Interval
-Horizontal_group_element::do_width()const
+Horizontal_group_element::do_width() const
 {
   return axis_admin_.extent (X_AXIS);
 }
 {
   return axis_admin_.extent (X_AXIS);
 }
index aae1051fb2360c6ec213b091a1456e42e18e9d60..3c7e7ca86b5670959a4e2db110c29d9c7af71d06 100644 (file)
@@ -18,7 +18,7 @@
 Engraver* get_engraver_p (String);
 
 void
 Engraver* get_engraver_p (String);
 
 void
-Engraver_group_engraver::print()const
+Engraver_group_engraver::print() const
 { 
   Engraver::print(); 
 }
 { 
   Engraver::print(); 
 }
@@ -33,16 +33,16 @@ Engraver_group_engraver::check_removal()
 {
   for (int i =0; i < group_l_arr_.size();) 
     {
 {
   for (int i =0; i < group_l_arr_.size();) 
     {
-       group_l_arr_[i]->check_removal();
-       if (group_l_arr_[i]->removable_b())
-           terminate_engraver (group_l_arr_[i]);
-       else 
-           i++;
+      group_l_arr_[i]->check_removal();
+      if (group_l_arr_[i]->removable_b())
+       terminate_engraver (group_l_arr_[i]);
+      else 
+       i++;
     }
 }
 
 bool
     }
 }
 
 bool
-Engraver_group_engraver::removable_b()const
+Engraver_group_engraver::removable_b() const
 {
   return !iterator_count_&& !group_l_arr_.size() ;
 }
 {
   return !iterator_count_&& !group_l_arr_.size() ;
 }
@@ -59,9 +59,9 @@ Engraver_group_engraver::set_feature (Feature d)
   // why the while construct?
   while (i.ok()) 
     {
   // why the while construct?
   while (i.ok()) 
     {
-       // this construction to ensure clean deletion
-       Engraver *grav_l = i++; 
-       grav_l->set_feature (d);
+      // this construction to ensure clean deletion
+      Engraver *grav_l = i++; 
+      grav_l->set_feature (d);
     }
 }
 
     }
 }
 
@@ -71,8 +71,8 @@ Engraver_group_engraver::sync_features()
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
-       Engraver *grav_l = i++; 
-       grav_l->sync_features();
+      Engraver *grav_l = i++; 
+      grav_l->sync_features();
     }
 }
 
     }
 }
 
@@ -82,8 +82,8 @@ Engraver_group_engraver::do_pre_move_processing()
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
-       Engraver *grav_l = i++; 
-       grav_l->pre_move_processing();
+      Engraver *grav_l = i++; 
+      grav_l->pre_move_processing();
     }
 }
 
     }
 }
 
@@ -93,8 +93,8 @@ Engraver_group_engraver::do_process_requests()
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
-       Engraver *grav_l = i++; 
-       grav_l->process_requests();
+      Engraver *grav_l = i++; 
+      grav_l->process_requests();
     }
 }
 
     }
 }
 
@@ -105,23 +105,23 @@ Engraver_group_engraver::do_post_move_processing()
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
   PCursor<Engraver*> i (grav_list_.top());
   while (i.ok()) 
     {
-               // this construction to ensure clean deletion
-       Engraver *grav_l = i++; 
-       grav_l->post_move_processing();
+      // this construction to ensure clean deletion
+      Engraver *grav_l = i++; 
+      grav_l->post_move_processing();
     }
 }
 
 
 bool
     }
 }
 
 
 bool
-Engraver_group_engraver::contains_b (Engraver* grav_l)const
+Engraver_group_engraver::contains_b (Engraver* grav_l) const
 {
   bool parent_b = Engraver::contains_b (grav_l);
   
   if (parent_b)
 {
   bool parent_b = Engraver::contains_b (grav_l);
   
   if (parent_b)
-       return true;
+    return true;
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
-       if (i->contains_b (grav_l))
-           return true;
+    if (i->contains_b (grav_l))
+      return true;
   return false;
 }
        
   return false;
 }
        
@@ -132,9 +132,9 @@ Engraver_group_engraver::do_try_request (Request*req_l)
 {
   bool hebbes_b =false;
   for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
 {
   bool hebbes_b =false;
   for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
-       hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
+    hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
   if (!hebbes_b && daddy_grav_l_)
   if (!hebbes_b && daddy_grav_l_)
-       hebbes_b = daddy_grav_l_->try_request (req_l);
+    hebbes_b = daddy_grav_l_->try_request (req_l);
   return hebbes_b ;
 }
 
   return hebbes_b ;
 }
 
@@ -152,11 +152,11 @@ Engraver_group_engraver::add (Engraver *grav_p)
 
   if (grav_p->is_type_b (Engraver_group_engraver::static_name())) 
     {
 
   if (grav_p->is_type_b (Engraver_group_engraver::static_name())) 
     {
-       group_l_arr_.push ((Engraver_group_engraver*)grav_p);
+      group_l_arr_.push ((Engraver_group_engraver*)grav_p);
     }
   else 
     {
     }
   else 
     {
-       nongroup_l_arr_ .push (grav_p);
+      nongroup_l_arr_ .push (grav_p);
     }
 }
 
     }
 }
 
@@ -186,15 +186,15 @@ IMPLEMENT_IS_TYPE_B2(Engraver_group_engraver,Engraver, Translator);
 ADD_THIS_ENGRAVER(Engraver_group_engraver);
 
 void
 ADD_THIS_ENGRAVER(Engraver_group_engraver);
 
 void
-Engraver_group_engraver::do_print()const
+Engraver_group_engraver::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-  if ( !check_debug)
-       return ;
+  if (!check_debug)
+    return ;
   DOUT << "ID: " << id_str_ ;
   DOUT << " iterators: " << iterator_count_<< "\n";
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
   DOUT << "ID: " << id_str_ ;
   DOUT << " iterators: " << iterator_count_<< "\n";
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
-       i->print();
+    i->print();
 #endif
 }
 
 #endif
 }
 
@@ -203,11 +203,11 @@ Engraver_group_engraver*
 Engraver_group_engraver::find_engraver_l (String n, String id)
 {
   if (name() == n && id_str_ == id)
 Engraver_group_engraver::find_engraver_l (String n, String id)
 {
   if (name() == n && id_str_ == id)
-       return this;
+    return this;
   Engraver_group_engraver * r = 0;
   for (int i =0; !r && i<  group_l_arr_.size(); i++) 
     {
   Engraver_group_engraver * r = 0;
   for (int i =0; !r && i<  group_l_arr_.size(); i++) 
     {
-       r = group_l_arr_[i]->find_engraver_l (n,id);
+      r = group_l_arr_[i]->find_engraver_l (n,id);
     }
   
   return r;
     }
   
   return r;
@@ -217,37 +217,37 @@ Translator*
 Engraver_group_engraver::find_get_translator_l (String n,String id)
 {
   Translator * ret=0;
 Engraver_group_engraver::find_get_translator_l (String n,String id)
 {
   Translator * ret=0;
-  Input_translator * itrans_l= itrans_l_-> recursive_find ( n);
+  Input_translator * itrans_l= itrans_l_-> recursive_find (n);
   if (itrans_l) 
     {
   if (itrans_l) 
     {
-       ret = find_engraver_l (n,id);
-       if (!ret) 
-         {
-           Engraver_group_engraver * group = 
-               itrans_l-> get_group_engraver_p();
+      ret = find_engraver_l (n,id);
+      if (!ret) 
+       {
+         Engraver_group_engraver * group = 
+           itrans_l-> get_group_engraver_p();
            
            
-           add (group);
-           ret = group;
+         add (group);
+         ret = group;
            
            
-           if (group->itrans_l_->is_name_b (n) )
-               ret ->id_str_ = id;
-           else
-               return ret->find_get_translator_l (n,id);
+         if (group->itrans_l_->is_name_b (n))
+           ret ->id_str_ = id;
+         else
+           return ret->find_get_translator_l (n,id);
 
 
-         }
+       }
     }
   else if (daddy_grav_l_)
     }
   else if (daddy_grav_l_)
-       ret =daddy_grav_l_->find_get_translator_l (n,id);
+    ret =daddy_grav_l_->find_get_translator_l (n,id);
   else 
     {
   else 
     {
-       warning ("Can't find or create `" + n + "' called `" + id + "'\n");
-       ret =0;
+      warning ("Can't find or create `" + n + "' called `" + id + "'\n");
+      ret =0;
     }
   return ret;
 }
 
 int
     }
   return ret;
 }
 
 int
-Engraver_group_engraver::depth_i()const
+Engraver_group_engraver::depth_i() const
 {
   return daddy_grav_l_->depth_i()  + 1;
 }
 {
   return daddy_grav_l_->depth_i()  + 1;
 }
@@ -256,7 +256,7 @@ Translator*
 Engraver_group_engraver::ancestor_l (int l)
 {
   if (!l || !daddy_grav_l_)
 Engraver_group_engraver::ancestor_l (int l)
 {
   if (!l || !daddy_grav_l_)
-       return this;
+    return this;
   
   return daddy_grav_l_->ancestor_l (l-1);
 }
   
   return daddy_grav_l_->ancestor_l (l-1);
 }
@@ -273,21 +273,21 @@ Engraver_group_engraver::do_announces()
 {
   for (int i=0; i < group_l_arr_.size(); i++) 
     {
 {
   for (int i=0; i < group_l_arr_.size(); i++) 
     {
-       group_l_arr_[i]->do_announces();
+      group_l_arr_[i]->do_announces();
     }
   
   Request dummy_req;
  
   for (int j =0; j < announce_info_arr_.size(); j++)
     {
     }
   
   Request dummy_req;
  
   for (int j =0; j < announce_info_arr_.size(); j++)
     {
-     Score_elem_info info = announce_info_arr_[j];
+      Score_elem_info info = announce_info_arr_[j];
      
      
-     if (!info.req_l_)
-           info.req_l_ = &dummy_req;
-     for (int i=0; i < nongroup_l_arr_.size(); i++) {  // Is this good enough?6
-          if (nongroup_l_arr_[i] != info.origin_grav_l_arr_[0])
-              nongroup_l_arr_[i]->acknowledge_element (info);
-       }
+      if (!info.req_l_)
+       info.req_l_ = &dummy_req;
+      for (int i=0; i < nongroup_l_arr_.size(); i++) { // Is this good enough?6
+       if (nongroup_l_arr_[i] != info.origin_grav_l_arr_[0])
+         nongroup_l_arr_[i]->acknowledge_element (info);
+      }
     }
   announce_info_arr_.clear();
 }
     }
   announce_info_arr_.clear();
 }
@@ -297,16 +297,16 @@ void
 Engraver_group_engraver::do_removal_processing()
 {
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
 Engraver_group_engraver::do_removal_processing()
 {
   for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
-       i->removal_processing();
+    i->removal_processing();
 }
 
 Staff_info
 }
 
 Staff_info
-Engraver_group_engraver::get_staff_info()const
+Engraver_group_engraver::get_staff_info() const
 {
   Staff_info inf = Engraver::get_staff_info();
 
   for (int i=0; i < nongroup_l_arr_.size(); i++)
 {
   Staff_info inf = Engraver::get_staff_info();
 
   for (int i=0; i < nongroup_l_arr_.size(); i++)
-       nongroup_l_arr_[i]->fill_staff_info (inf);
+    nongroup_l_arr_[i]->fill_staff_info (inf);
   
   return inf;
 }
   
   return inf;
 }
@@ -315,34 +315,34 @@ Translator*
 Engraver_group_engraver::get_default_interpreter()
 {
   // ? 
 Engraver_group_engraver::get_default_interpreter()
 {
   // ? 
-  if ( is_bottom_engraver_b())
-       return daddy_grav_l_->get_default_interpreter();
+  if (is_bottom_engraver_b())
+    return daddy_grav_l_->get_default_interpreter();
 
   Engraver_group_engraver *grav_p= itrans_l_->
 
   Engraver_group_engraver *grav_p= itrans_l_->
-       get_default_itrans_l()->get_group_engraver_p ();
+    get_default_itrans_l()->get_group_engraver_p ();
   add (grav_p);
   if (grav_p->is_bottom_engraver_b())
   add (grav_p);
   if (grav_p->is_bottom_engraver_b())
-       return grav_p;
+    return grav_p;
   else
   else
-       return grav_p->get_default_interpreter();
+    return grav_p->get_default_interpreter();
 }
 
 bool
 }
 
 bool
-Engraver_group_engraver::is_bottom_engraver_b()const
+Engraver_group_engraver::is_bottom_engraver_b() const
 {
   return !itrans_l_->get_default_itrans_l();
 }
 
 Engraver*
 {
   return !itrans_l_->get_default_itrans_l();
 }
 
 Engraver*
-Engraver_group_engraver::get_simple_engraver (char const *type)const
+Engraver_group_engraver::get_simple_engraver (char const *type) const
 {
   for (int i=0; i < nongroup_l_arr_.size(); i++) 
     {
 {
   for (int i=0; i < nongroup_l_arr_.size(); i++) 
     {
-       if (nongroup_l_arr_[i]->name() == type)
-           return nongroup_l_arr_[i];
+      if (nongroup_l_arr_[i]->name() == type)
+       return nongroup_l_arr_[i];
     }
     }
-  if ( daddy_grav_l_)
-       return daddy_grav_l_->get_simple_engraver (type);
+  if (daddy_grav_l_)
+    return daddy_grav_l_->get_simple_engraver (type);
   return 0;
 }
 
   return 0;
 }
 
index 52eba772e03b7caf8a9c961a4d97997b0f9448a5..11ac18d61e62230e57f1842ca16a6e0df1a428ec 100644 (file)
@@ -30,7 +30,7 @@ Engraver::post_move_processing()
 void
 Engraver::removal_processing()
 {
 void
 Engraver::removal_processing()
 {
-  if ( status < CREATION_INITED)
+  if (status < CREATION_INITED)
        do_creation_processing();
   
   do_removal_processing();
        do_creation_processing();
   
   do_removal_processing();
@@ -102,13 +102,13 @@ Engraver::typeset_element (Score_elem*p)
 }
 
 Paper_def*
 }
 
 Paper_def*
-Engraver::paper()const
+Engraver::paper() const
 {
   return daddy_grav_l_->paper();
 }
 
 bool
 {
   return daddy_grav_l_->paper();
 }
 
 bool
-Engraver::contains_b (Engraver *grav_l)const
+Engraver::contains_b (Engraver *grav_l) const
 {
   return this == grav_l;
 }
 {
   return this == grav_l;
 }
@@ -116,7 +116,10 @@ Engraver::contains_b (Engraver *grav_l)const
 Staff_info
 Engraver::get_staff_info() const
 {
 Staff_info
 Engraver::get_staff_info() const
 {
-  return daddy_grav_l_->get_staff_info();
+  if (daddy_grav_l_)
+    return daddy_grav_l_->get_staff_info();
+  Staff_info info;
+  return info;
 }
 
 void
 }
 
 void
index f3b202e8055ed5dba03a7c30de404a2c1789ad35..70c2b740af0b49ab8ca852a8f2bf4759afda2edc 100644 (file)
 #include "general-script-def.hh"
 #include "debug.hh"
 #include "symbol.hh"
 #include "general-script-def.hh"
 #include "debug.hh"
 #include "symbol.hh"
-int
-General_script_def::staff_dir_i()const
+Direction
+General_script_def::staff_dir() const
 {
 {
-  return -1;
+  return DOWN;
 }
 }
-int
-General_script_def::rel_stem_dir_i()const
+
+Direction
+General_script_def::rel_stem_dir() const
 {
 {
-  return 0;
+  return CENTER;
 }
 int
 }
 int
-General_script_def::priority_i()const
+General_script_def::priority_i() const
 {
   return 1000;
 }
 
 bool
 {
   return 1000;
 }
 
 bool
-General_script_def::inside_b()const
+General_script_def::inside_b() const
 {
   return false;
 }
 
 bool
 {
   return false;
 }
 
 bool
-General_script_def::equal_b (General_script_def const&g)const
+General_script_def::equal_b (General_script_def const&g) const
 {
   if (name() != g.name ())
 {
   if (name() != g.name ())
-       return false;
+    return false;
 
   return do_equal_b (&g);
 }
 
 bool
 
   return do_equal_b (&g);
 }
 
 bool
-General_script_def::do_equal_b (General_script_def const*)const
+General_script_def::do_equal_b (General_script_def const*) const
 {
   return true;
 }
 {
   return true;
 }
@@ -62,7 +63,7 @@ General_script_def::do_print() const
 }
 
 Atom
 }
 
 Atom
-General_script_def::get_atom (Paper_def*, int)const
+General_script_def::get_atom (Paper_def*, Direction) const
 {
   Symbol s;
   return Atom (s);
 {
   Symbol s;
   return Atom (s);
index f92156e6e4bb1cee36a881d0cc0b8d10f0336eea..f4213dd6a6a8f4fb29d7420167798561e09757c5 100644 (file)
@@ -6,14 +6,10 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "music.hh"
 #include "global-translator.hh"
 #include "global-translator.hh"
-#include "score.hh"
-#include "score-column.hh"
 
 Global_translator::Global_translator()
 {
 
 Global_translator::Global_translator()
 {
-  score_l_ = 0;
   last_mom_ = 0;
 }
 
   last_mom_ = 0;
 }
 
@@ -36,18 +32,11 @@ Global_translator::add_moment_to_process (Moment m)
 }
 
 int
 }
 
 int
-Global_translator::depth_i()const
+Global_translator::depth_i() const
 {
   return 0;
 }
 
 {
   return 0;
 }
 
-void
-Global_translator::set_score (Score *s)
-{
-  score_l_ = s;
-  last_mom_ = score_l_->music_p_->time_int().max ();
-}
-
 void
 Global_translator::modify_next (Moment &w)
 {
 void
 Global_translator::modify_next (Moment &w)
 {
@@ -58,7 +47,7 @@ Global_translator::modify_next (Moment &w)
 }
 
 int
 }
 
 int
-Global_translator::moments_left_i()const
+Global_translator::moments_left_i() const
 {
   return extra_mom_pq_.size();
 }
 {
   return extra_mom_pq_.size();
 }
@@ -70,3 +59,9 @@ Global_translator::prepare (Moment)
 
 
 IMPLEMENT_IS_TYPE_B1(Global_translator, Translator);
 
 
 IMPLEMENT_IS_TYPE_B1(Global_translator, Translator);
+
+Music_output*
+Global_translator::get_output_p()
+{
+  return 0;
+}
index 90d07e68512f7a8ce3a4d3b997f74a7ecea535d1..740899418b133a2f71c053397ecc3d16f31f98ed 100644 (file)
@@ -39,7 +39,7 @@ struct Break_node {
  */
 
 Array<Col_hpositions>
  */
 
 Array<Col_hpositions>
-Gourlay_breaking::do_solve()const
+Gourlay_breaking::do_solve() const
 {
 
   Array<Break_node> optimal_paths;
 {
 
   Array<Break_node> optimal_paths;
@@ -78,8 +78,8 @@ Gourlay_breaking::do_solve()const
            
          Line_of_cols line = all.slice (breaks[start_idx], breaks[break_idx]+1);
            
            
          Line_of_cols line = all.slice (breaks[start_idx], breaks[break_idx]+1);
            
-         line[0] = line[0]->postbreak_p_;
-         line.top() = line.top ()->prebreak_p_;
+         line[0] = line[0]->postbreak_l();
+         line.top() = line.top ()->prebreak_l();
            
          if (!feasible (line))
            break;
            
          if (!feasible (line))
            break;
@@ -110,22 +110,22 @@ Gourlay_breaking::do_solve()const
       for (int j=0; j < candidates.size(); j++) 
        {
          int start = candidates[j];
       for (int j=0; j < candidates.size(); j++) 
        {
          int start = candidates[j];
-         if ( optimal_paths[start].line_config_.energy_f_
+         if (optimal_paths[start].line_config_.energy_f_
               + candidate_lines[j].energy_f_  > minimal_energy)
                
            continue;
 
               + candidate_lines[j].energy_f_  > minimal_energy)
                
            continue;
 
-         if ( !candidate_lines[j].satisfies_constraints_b_) 
+         if (!candidate_lines[j].satisfies_constraints_b_) 
            {
              candidate_lines[j].solve_line();
            {
              candidate_lines[j].solve_line();
-             ((Break_algorithm*)this)->exact_stats_.add ( candidate_lines[j].cols);
+             ((Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols);
            }
            
          Real this_energy 
            = optimal_paths[start].line_config_.energy_f_ 
            + candidate_lines[j].energy_f_ ;
            
            }
            
          Real this_energy 
            = optimal_paths[start].line_config_.energy_f_ 
            + candidate_lines[j].energy_f_ ;
            
-         if ( this_energy < minimal_energy) 
+         if (this_energy < minimal_energy) 
            {
              minimal_j = j;
              minimal_energy = this_energy;
            {
              minimal_j = j;
              minimal_energy = this_energy;
@@ -143,24 +143,24 @@ Gourlay_breaking::do_solve()const
          optimal_paths[break_idx].line_config_ = candidate_lines[minimal_j];
        }
 
          optimal_paths[break_idx].line_config_ = candidate_lines[minimal_j];
        }
 
-      if ( !(break_idx % HAPPY_DOTS_I))
+      if (!(break_idx % HAPPY_DOTS_I))
        *mlog << "[" << break_idx << "]"<<flush;
     }
 
        *mlog << "[" << break_idx << "]"<<flush;
     }
 
-  if  ( break_idx % HAPPY_DOTS_I) 
+  if  (break_idx % HAPPY_DOTS_I) 
     *mlog << "[" << break_idx << "]"<<flush;
 
   Array<int> final_breaks;
 
   Array<Col_hpositions> lines;
     *mlog << "[" << break_idx << "]"<<flush;
 
   Array<int> final_breaks;
 
   Array<Col_hpositions> lines;
-  Real min_energy_f_ = infinity_f;
-  Real max_energy_f_ = 0;
+
+  Real max_energy_f = 0;
   
   /* skip 0-th element, since it is a "dummy" elt*/
   for (int i = optimal_paths.size()-1; i> 0;) 
     {
   
   /* skip 0-th element, since it is a "dummy" elt*/
   for (int i = optimal_paths.size()-1; i> 0;) 
     {
-      final_breaks.push ( i);
-      assert ( i > optimal_paths[i].prev_break_i_);
+      final_breaks.push (i);
+      assert (i > optimal_paths[i].prev_break_i_);
 
       // there was no "feasible path"
       if (!optimal_paths[i].line_config_.config.size()) {
 
       // there was no "feasible path"
       if (!optimal_paths[i].line_config_.config.size()) {
@@ -174,7 +174,7 @@ Gourlay_breaking::do_solve()const
   /*
     TODO print variation in energy
    */
   /*
     TODO print variation in energy
    */
-  if (max_energy_f
+  if (max_energy_f) 
     {
       ;
     }
     {
       ;
     }
@@ -182,7 +182,7 @@ Gourlay_breaking::do_solve()const
   
 
   for (int i= final_breaks.size(); i--;) 
   
 
   for (int i= final_breaks.size(); i--;) 
-    lines.push ( optimal_paths[final_breaks[i]].line_config_);
+    lines.push (optimal_paths[final_breaks[i]].line_config_);
 
   
   return lines;
 
   
   return lines;
index c106db08619a7971ce79e4db86bfb1f6fca62a9c..15401fced94581d929e41531601992163a92a9ed 100644 (file)
@@ -18,7 +18,7 @@ Rhythmic_grouping::init()
 }
 
 void
 }
 
 void
-Rhythmic_grouping::OK()const
+Rhythmic_grouping::OK() const
 {
 #ifndef NDEBUG
   assert (bool (children.size()) != bool (interval_));
 {
 #ifndef NDEBUG
   assert (bool (children.size()) != bool (interval_));
@@ -40,7 +40,7 @@ Rhythmic_grouping::length() const
 }
 
 MInterval
 }
 
 MInterval
-Rhythmic_grouping::interval()const
+Rhythmic_grouping::interval() const
 {
   if (interval_)
        return *interval_;
 {
   if (interval_)
        return *interval_;
@@ -138,7 +138,7 @@ Rhythmic_grouping::split (Array<MInterval> splitpoints)
   Array<Rhythmic_grouping*> ch;
   while (1) 
     {
   Array<Rhythmic_grouping*> ch;
   while (1) 
     {
-       if  ( i >= children.size() || j >= splitpoints.size ())
+       if  (i >= children.size() || j >= splitpoints.size ())
            break;
        
        assert (
            break;
        
        assert (
@@ -235,7 +235,7 @@ Rhythmic_grouping::junk()
 }
 
 void
 }
 
 void
-Rhythmic_grouping::print()const    
+Rhythmic_grouping::print() const    
 {
 #ifndef NPRINT
   DOUT << "{ \n";
 {
 #ifndef NPRINT
   DOUT << "{ \n";
@@ -253,7 +253,7 @@ bool
 Rhythmic_grouping::child_fit_b (Moment start)
 {
   if (children.size())
 Rhythmic_grouping::child_fit_b (Moment start)
 {
   if (children.size())
-       return ( children.top()->interval ().right== start);
+       return (children.top()->interval ().right== start);
 
   return true;
 }  
 
   return true;
 }  
@@ -347,7 +347,7 @@ Rhythmic_grouping::translate (Moment m)
 }
 
 void
 }
 
 void
-Rhythmic_grouping::extend (MInterval m)const
+Rhythmic_grouping::extend (MInterval m) const
 {    
   assert (m.left >= interval().left);
   while (m.right  >interval().right) 
 {    
   assert (m.left >= interval().left);
   while (m.right  >interval().right) 
index a5d1ecbebd9363e773823c74f964e8e6997b2cbb..b8707965a65003ffb1d0c0823ef208f6cf52a220 100644 (file)
 Head_column::Head_column()
 {
   stem_l_ = 0;
 Head_column::Head_column()
 {
   stem_l_ = 0;
-  dir_i_ =0;
+  dir_ =CENTER;
 }
 
 void
 Head_column::do_substitute_dependency (Score_elem*o,
 }
 
 void
 Head_column::do_substitute_dependency (Score_elem*o,
-                                     Score_elem*n)
+                                      Score_elem*n)
 {
   Script_column::do_substitute_dependency (o,n);
   if (o->name() == Note_head::static_name ()) 
     {
 {
   Script_column::do_substitute_dependency (o,n);
   if (o->name() == Note_head::static_name ()) 
     {
-       head_l_arr_.substitute ((Note_head*)o->item(), 
-                               (n)? (Note_head*)n->item() : 0);
+      head_l_arr_.substitute ((Note_head*)o->item(), 
+                             (n)? (Note_head*)n->item() : 0);
     }
   if (stem_l_ == o) 
     {
     }
   if (stem_l_ == o) 
     {
-       stem_l_ = n ? (Stem*)n->item():0;
+      stem_l_ = n ? (Stem*)n->item():0;
     }
 }
 
     }
 }
 
@@ -40,8 +40,8 @@ Head_column::set (Stem*stem_l)
 {
   stem_l_ = stem_l;
   Score_elem::add_dependency (stem_l);
 {
   stem_l_ = stem_l;
   Score_elem::add_dependency (stem_l);
-  for (int i=0; script_l_arr_.size(); i++)
-       script_l_arr_[i]->set_stem (stem_l);
+  for (int i=0; i < script_l_arr_.size(); i++)
+    script_l_arr_[i]->set_stem (stem_l);
 }
 
 void
 }
 
 void
@@ -49,7 +49,7 @@ Head_column::add (Script *script_l)
 {
   Script_column::add (script_l) ;
   if  (stem_l_)
 {
   Script_column::add (script_l) ;
   if  (stem_l_)
-       script_l->set_stem (stem_l_);
+    script_l->set_stem (stem_l_);
 }
 void
 Head_column::add (Note_head *n_l)
 }
 void
 Head_column::add (Note_head *n_l)
@@ -73,10 +73,10 @@ Head_column::do_print() const
 void
 Head_column::do_pre_processing()
 {
 void
 Head_column::do_pre_processing()
 {
-  if (!dir_i_)
+  if (!dir_)
     {
     {
-       if (stem_l_)
-           dir_i_ = stem_l_->dir_i_;
+      if (stem_l_)
+       dir_ = stem_l_->dir_;
     }
   Script_column::do_pre_processing();
 }
     }
   Script_column::do_pre_processing();
 }
index 163a1bf61c12df191437e150ce98f7c0d607aeaa..48701d148a9b9e9545209da0af0c15baf8ec8ec2 100644 (file)
 
 
 IMPLEMENT_IS_TYPE_B1(Horizontal_align_item,Item);
 
 
 IMPLEMENT_IS_TYPE_B1(Horizontal_align_item,Item);
-void
-Horizontal_align_item::OK() const
-{
-   for  (int i =0; i < item_l_arr_.size(); i++) 
-     assert ( pcol_l_ == item_l_arr_[i]->pcol_l_);
-}
+
 bool
 bool
-Horizontal_align_item::contains_b (Item *i)const
+Horizontal_align_item::contains_b (Item *i) const
 {
   return item_l_arr_.find_l (i);
 }
 {
   return item_l_arr_.find_l (i);
 }
@@ -37,10 +32,10 @@ Horizontal_align_item::do_substitute_dependency (Score_elem*o,Score_elem*n)
   int i;
   while ((i = item_l_arr_.find_i (o->item())) >=0) 
     {
   int i;
   while ((i = item_l_arr_.find_i (o->item())) >=0) 
     {
-       if (n)
-           item_l_arr_[i] = n->item();
-       else
-           item_l_arr_.del (i);
+      if (n)
+       item_l_arr_[i] = n->item();
+      else
+       item_l_arr_.del (i);
     }
 }
 
     }
 }
 
@@ -48,15 +43,15 @@ struct Horizontal_align_item_content {
   Item * item_l_;
   int priority_i_;
   static int compare (Horizontal_align_item_content const &h1, 
   Item * item_l_;
   int priority_i_;
   static int compare (Horizontal_align_item_content const &h1, 
-                       Horizontal_align_item_content const &h2) 
-                         {
-       return h1.priority_i_ - h2.priority_i_;
-    }
+                     Horizontal_align_item_content const &h2) 
+  {
+    return h1.priority_i_ - h2.priority_i_;
+  }
   Horizontal_align_item_content (Item*i, int p) 
   Horizontal_align_item_content (Item*i, int p) 
-    {
-       priority_i_ = p;
-       item_l_ = i;
-    }
+  {
+    priority_i_ = p;
+    item_l_ = i;
+  }
   Horizontal_align_item_content(){item_l_ =0; priority_i_ =0; }
 };
 
   Horizontal_align_item_content(){item_l_ =0; priority_i_ =0; }
 };
 
@@ -64,50 +59,49 @@ struct Horizontal_align_item_content {
 void
 Horizontal_align_item::do_pre_processing()
 {
 void
 Horizontal_align_item::do_pre_processing()
 {
-  OK();
   {  
   {  
-       Array<Horizontal_align_item_content> content;
-       for  (int i =0; i < item_l_arr_.size(); i++) 
-           content.push (
-               Horizontal_align_item_content (
-                   item_l_arr_[i], priority_i_arr_[i]));
-       content.sort (Horizontal_align_item_content::compare);
-       item_l_arr_.clear();
-       priority_i_arr_.clear();
-       for  (int i =0; i < content.size(); i++) 
-         {
-           item_l_arr_.push (content[i].item_l_);
-           priority_i_arr_.push (content[i].priority_i_);
-         }
-    }
+    Array<Horizontal_align_item_content> content;
+    for  (int i =0; i < item_l_arr_.size(); i++) 
+      content.push (
+                   Horizontal_align_item_content (
+                                                  item_l_arr_[i], priority_i_arr_[i]));
+    content.sort (Horizontal_align_item_content::compare);
+    item_l_arr_.clear();
+    priority_i_arr_.clear();
+    for  (int i =0; i < content.size(); i++) 
+      {
+       item_l_arr_.push (content[i].item_l_);
+       priority_i_arr_.push (content[i].priority_i_);
+      }
+  }
   
   Array<Interval> dims;
   Real total =0;
   for  (int i =0; i < item_l_arr_.size(); i++) 
     {
        
   
   Array<Interval> dims;
   Real total =0;
   for  (int i =0; i < item_l_arr_.size(); i++) 
     {
        
-       Interval item_width= item_l_arr_[i]->width();
-       if (item_width.empty_b()) 
-         {
-           item_width = Interval (0,0);
-         }
-       dims.push (item_width);
-       total += item_width.length();
+      Interval item_width= item_l_arr_[i]->width();
+      if (item_width.empty_b()) 
+       {
+         item_width = Interval (0,0);
+       }
+      dims.push (item_width);
+      total += item_width.length();
     }
 
   Real where_f= total * (align_i_-1.0)/2.0;
   Real center_dx_f = 0;
     }
 
   Real where_f= total * (align_i_-1.0)/2.0;
   Real center_dx_f = 0;
-  for ( int i=0 ;  i < item_l_arr_.size(); i++) 
+  for (int i=0 ;  i < item_l_arr_.size(); i++) 
     {
     {
-       Real dx = where_f -dims[i][-1];
-       item_l_arr_[i]->translate (dx , X_AXIS);
-       if (item_l_arr_[i] == center_l_)
-           center_dx_f = where_f;
-       where_f += dims[i].length();
+      Real dx = where_f -dims[i][-1];
+      item_l_arr_[i]->translate (dx , X_AXIS);
+      if (item_l_arr_[i] == center_l_)
+       center_dx_f = where_f;
+      where_f += dims[i].length();
     }
   if (center_dx_f && !align_i_)
     }
   if (center_dx_f && !align_i_)
-       for ( int i=0 ;  i < item_l_arr_.size(); i++) 
-           item_l_arr_[i]->translate (- center_dx_f , X_AXIS);
+    for (int i=0 ;  i < item_l_arr_.size(); i++) 
+      item_l_arr_[i]->translate (- center_dx_f , X_AXIS);
   
 }
 
   
 }
 
@@ -118,7 +112,7 @@ Horizontal_align_item::do_width() const
 }
 
 void
 }
 
 void
-Horizontal_align_item::do_print()const
+Horizontal_align_item::do_print() const
 {
 }
 
 {
 }
 
index ad7f5de1f4664be02b4bc44a8eb2b2793fdb52f6..035c93b2448334ec41fe3fb435c8c17efa3ea8ea 100644 (file)
@@ -35,7 +35,7 @@ Identifier::error (String expect)
   ::error (e);
 }
 
   ::error (e);
 }
 
-Identifier::Identifier ( int code)
+Identifier::Identifier (int code)
 {
   token_code_i_ = code; 
   accessed_b_ = 0;
 {
   token_code_i_ = code; 
   accessed_b_ = 0;
@@ -43,7 +43,7 @@ Identifier::Identifier ( int code)
 }
 
 void
 }
 
 void
-Identifier::print()const
+Identifier::print() const
 {
   DOUT << "identifier ";
   do_print();
 {
   DOUT << "identifier ";
   do_print();
@@ -70,7 +70,7 @@ DEFAULT_PRINT(Paper_def_id,Paper_def, paperdef);
 
 
 void
 
 
 void
-Duration_id::do_print()const
+Duration_id::do_print() const
 {}
 
 void
 {}
 
 void
index 5fad1355f2ea8c600b7b6742f2bd17b91febd8ee..0585a0b25d3a6303971b9bcc531b6248d2d02e2a 100644 (file)
@@ -9,31 +9,33 @@
 
 #include "lily-proto.hh"
 #include "plist.hh"
 
 #include "lily-proto.hh"
 #include "plist.hh"
+#include "music-output.hh"
 
 /** all stuff which goes onto midi. notes, signs, symbols in a score
      #Audio_score# contains the items, the columns.
     
     */
 
 
 /** all stuff which goes onto midi. notes, signs, symbols in a score
      #Audio_score# contains the items, the columns.
     
     */
 
-class Audio_score {
+class Audio_score : public Music_output {
 public:
 public:
-    Audio_score (Score* l);
+  Audio_score ();
+  ~Audio_score () {}
 
 
-    void add (Audio_column*);
-    void add_staff (Audio_staff* l);
-    void add (Audio_element*p);
+  void add (Audio_column*);
+  void add_staff (Audio_staff* l);
+  void add (Audio_element*p);
 
     
 
     
-    void output (Midi_stream& midi_stream_r);
-    void output_header_track (Midi_stream& midi_stream_r);
+  void output (Midi_stream& midi_stream_r);
+  void output_header_track (Midi_stream& midi_stream_r);
 
 
-    void print() const;
-    void process();
+  void print() const;
+  void process();
 
 
-    Pointer_list<Audio_column*> audio_column_p_list_;
-    Link_list<Audio_staff*> audio_staff_l_list_;
-    Pointer_list<Audio_element*> audio_elem_p_list_;
-    Score* score_l_;
+  Pointer_list<Audio_column*> audio_column_p_list_;
+  Link_list<Audio_staff*> audio_staff_l_list_;
+  Pointer_list<Audio_element*> audio_elem_p_list_;
+  Midi_def  * midi_l_;
 };
 
 #endif // AUDIO_SCORE_HH
 };
 
 #endif // AUDIO_SCORE_HH
index a461f52c25480ca6d54fcce71f1c8ce5064256e9..526d3ccd26ab4f8aeecbbcd97d2e26b262f94f8b 100644 (file)
 
 class Axis_group_item : public virtual Axis_group_element, public Item {
 protected:
 
 class Axis_group_item : public virtual Axis_group_element, public Item {
 protected:
-    virtual void do_breakable_col_processing();
-    void OK()const;
-    virtual void do_print() const;
+  virtual void do_breakable_col_processing();
+  void OK() const;
+  virtual void do_print() const;
+  virtual void do_junk_links() { 
+    Item::do_junk_links();
+    Axis_group_element::do_junk_links();
+  }
+  virtual void do_unlink() {
+    Item::do_unlink();
+    Axis_group_element::do_unlink();
+  }
 public:
 public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
 #endif // AXIS_ITEM_HH
 };
 
 #endif // AXIS_ITEM_HH
index 2b7d6e22bf2bbf6b58890577f49fb356e98d3a6f..028529a6ef21473d1e39ebc66d9c2ff2519f842b 100644 (file)
   useful example of this is the Vertical_group_spanner */
 class Axis_group_spanner : public Spanner, public virtual Axis_group_element
 {
   useful example of this is the Vertical_group_spanner */
 class Axis_group_spanner : public Spanner, public virtual Axis_group_element
 {
-    void do_break_processing_if_unbroken();
+  void do_break_processing_if_unbroken();
 protected:
 protected:
-    virtual void do_break_processing();
-    virtual void do_print()const;
+  virtual void do_junk_links () { 
+    Spanner::do_junk_links();
+    Axis_group_element::do_junk_links();
+  }
+  virtual void do_unlink() {
+    Spanner::do_unlink();
+    Axis_group_element::do_unlink();
+  }
+  virtual void do_break_processing();
+  virtual void do_print() const;
 
 public:
 
 public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
 #endif // SPAN_AXIS_GROUP_HH
 };
 
 #endif // SPAN_AXIS_GROUP_HH
index 92d0cd88062a2c90f46d0b77ef07ad12045f9601..e2e030f0b9fd3b9184e8a43d05d4b9e141aa231e 100644 (file)
@@ -15,21 +15,22 @@ axis-group.hh -- declare Axis_group_administration, Axis_group_element
 #include "real.hh"
 #include "lily-proto.hh"
 #include "score-elem.hh"
 #include "real.hh"
 #include "lily-proto.hh"
 #include "score-elem.hh"
+
 /**
   Do the dirty work for Axis_group_element.
  */
 struct Axis_group_administration {
 /**
   Do the dirty work for Axis_group_element.
  */
 struct Axis_group_administration {
-    Link_array<Score_elem> elem_l_arr_;
-    
-    Interval extent (Axis)const;
-    void print() const ;
-    Axis_group_administration (Axis_group_administration const&);
-    Axis_group_administration(){}
-    void remove_all (Axis a1,Axis a2);
+  Link_array<Score_elem> elem_l_arr_;
     
     
-    bool contains_b (Score_elem const *)const;
-    void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
-    void remove_element (Score_elem*, Axis a1, Axis a2);
+  Interval extent (Axis) const;
+  void print() const ;
+  Axis_group_administration (Axis_group_administration const&);
+  Axis_group_administration(){}
+  void remove_all (Axis a1,   Axis a2);
+
+  bool contains_b (Score_elem const *) const;
+  void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
+  void remove_element (Score_elem*, Axis a1, Axis a2);
 };
 
 /** 
 };
 
 /** 
@@ -38,16 +39,18 @@ struct Axis_group_administration {
   */
 class Axis_group_element : public virtual Score_elem {
 protected:
   */
 class Axis_group_element : public virtual Score_elem {
 protected:
-    Axis_group_administration axis_admin_;
-    virtual void do_print()const;
-    virtual Link_array<Score_elem> get_extra_dependencies()const;
-    virtual void do_unlink();
+  Axis_group_administration axis_admin_;
+  virtual void do_print() const;
+  virtual Link_array<Score_elem> get_extra_dependencies() const;
+  virtual void do_unlink();
+  virtual void do_junk_links();
 
 public:
 
 public:
-    virtual void remove_all()=0;
-    virtual void add_element (Score_elem*)=0;
-    virtual void remove_element (Score_elem*)=0;
-    virtual bool contains_b (Score_elem const *)const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  Axis_group_element();
+  virtual void remove_all()=0;
+  virtual void add_element (Score_elem*)=0;
+  virtual void remove_element (Score_elem*)=0;
+  virtual bool contains_b (Score_elem const *) const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 #endif // Axis_group_administration_HH
 };
 #endif // Axis_group_administration_HH
index ad1956648a997bf1f0dc8aadd2df9fd9bf69e28f..fcce6d53a62bc4c151b748ab2563e549968355d6 100644 (file)
   catch bars, and put a number over them.
  */
 class Bar_number_grav : public Engraver {
   catch bars, and put a number over them.
  */
 class Bar_number_grav : public Engraver {
-    Script * script_p_;
-    int number_i_;
+  Script * script_p_;
 protected:
 
 protected:
 
-    void acknowledge_element (Score_elem_info);
-    void do_pre_move_processing();
+  void acknowledge_element (Score_elem_info);
+  void do_pre_move_processing();
 public:
 public:
-    Bar_number_grav();
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  Bar_number_grav();
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 #endif // BAR_NUMBER_GRAV_HH
 };
 #endif // BAR_NUMBER_GRAV_HH
index c03527e6ccdc78ad91bcaa8b5dbecc94a810c458..ce886830b0e69e08aacd8b449e0ce5b0563b1878 100644 (file)
  */
 class Bar:public Item {
 public:
  */
 class Bar:public Item {
 public:
-    String type_str_;
-    int spanned_i_;
+  String type_str_;
+  int spanned_i_;
     
     
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    SCORE_ELEM_CLONE(Bar);
-    Bar();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Bar);
+  Bar();
 private:
 private:
-    void do_print() const;
+  void do_print() const;
 protected:
 protected:
-    virtual void do_pre_processing();
-    Molecule*brew_molecule_p()const;
+  virtual void do_pre_processing();
+  Molecule*brew_molecule_p() const;
 };
 #endif // BAR_HH
 
 };
 #endif // BAR_HH
 
diff --git a/lily/include/beam-grav.hh b/lily/include/beam-grav.hh
new file mode 100644 (file)
index 0000000..3db08fc
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+  beam-grav.hh -- declare Beam_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BEAM_GRAV_HH
+#define BEAM_GRAV_HH
+
+#include "engraver.hh"
+#include "drul-array.hh"
+
+/**
+  Generate a beam. Eats stems.
+ */
+class Beam_engraver : public Engraver
+{
+  Drul_array<Beam_req *> span_reqs_drul_;
+  Beam *beam_p_;
+  Rhythmic_grouping *current_grouping_p_;
+
+public:
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Beam_engraver();
+protected:
+  virtual void do_removal_processing();
+  virtual void do_process_requests();
+  virtual bool do_try_request (Request*);
+  virtual void acknowledge_element (Score_elem_info);
+  virtual void do_pre_move_processing();
+};
+
+#endif // BEAM_GRAV_HH
index 48b4f9bb4cbfa62e33897064e7d1c03d64730383..ad775b7a3c8e60db44ab0967c36a14fbd66d8005 100644 (file)
   direction */
 class Beam:  public Directional_spanner {
 public:
   direction */
 class Beam:  public Directional_spanner {
 public:
-    Link_array<Stem> stems;
-    /// the slope of the beam in posns / point (dimension)   
-    Real slope;
+  Link_array<Stem> stems;
+  /// the slope of the beam in posns / point (dimension)   
+  Real slope;
 
 
-    /// position of leftmost end of beam  
-    Real left_pos;
+  /// position of leftmost end of beam  
+  Real left_pos;
    
 
    
 
-    /* *************** */
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Beam();
-    void add (Stem*);
+  /* *************** */
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Beam();
+  void add (Stem*);
 
 
-    void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
-    void set_stemlens();
-    SCORE_ELEM_CLONE(Beam);
+  void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
+  void set_stemlens();
+  SCORE_ELEM_CLONE(Beam);
 protected:
 protected:
-    virtual Interval do_width()const;    
-    virtual Offset center() const;
-    virtual void set_default_dir();
-    virtual void do_pre_processing();
-    virtual void do_post_processing();
-    virtual void do_substitute_dependent (Score_elem*, Score_elem*);
+  virtual Interval do_width() const;    
+  virtual Offset center() const;
+  virtual void set_default_dir();
+  virtual void do_pre_processing();
+  virtual void do_post_processing();
+  virtual void do_substitute_dependent (Score_elem*, Score_elem*);
 
 
-    virtual void do_print() const;
+  virtual void do_print() const;
 
 private:
 
 private:
-    Molecule stem_beams (Stem *here, Stem *next, Stem *prev)const;
-    void solve_slope();
-    Molecule*brew_molecule_p()const;
+  Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
+  void solve_slope();
+  Molecule*brew_molecule_p() const;
 };
 
 #endif // BEAM_HH
 };
 
 #endif // BEAM_HH
index e483c36ac2786bfe4c88d15d66b9d907c6b7298f..1ef139c60ee980d3e67c5458f78abf2c1b022273 100644 (file)
   */
 class Bow : public Directional_spanner {
 protected:
   */
 class Bow : public Directional_spanner {
 protected:
-    int left_pos_i_;
-    int right_pos_i_;
-    Real left_dx_f_;
-    Real right_dx_f_;
+  Drul_array<int> pos_i_drul_;
+  Drul_array<Real> dx_f_drul_;
     
     
-    Molecule*brew_molecule_p()const;
+  Molecule*brew_molecule_p() const;
 public:
 public:
-    Bow();
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Offset center() const;  
+  Bow();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Offset center() const;  
 };
 #endif // BOW_HH
 };
 #endif // BOW_HH
index 36db4b88ba2b707e9583cdd6567885a4eb0ad2c4..45490033bd4bd303a96d35220fcafb6b7709bc3c 100644 (file)
@@ -16,8 +16,8 @@ struct Box {
     
     Interval &x() {return interval_a_[X_AXIS]; }
     Interval &y(){ return interval_a_[Y_AXIS]; }
     
     Interval &x() {return interval_a_[X_AXIS]; }
     Interval &y(){ return interval_a_[Y_AXIS]; }
-    Interval x()const{ return interval_a_[X_AXIS]; }
-    Interval y()const{return interval_a_[Y_AXIS]; }
+    Interval x() const{ return interval_a_[X_AXIS]; }
+    Interval y() const{return interval_a_[Y_AXIS]; }
     Interval operator[](Axis a) {
        return interval_a_[a];
     }
     Interval operator[](Axis a) {
        return interval_a_[a];
     }
index 73b07d21ee722aca821281c5c021387cbddd21b0..676be223df3cb88737d640b8ccb313d297e0779f 100644 (file)
@@ -16,7 +16,7 @@
 struct Break_caching : Break_algorithm
 {
     void do_set_pscore();
 struct Break_caching : Break_algorithm
 {
     void do_set_pscore();
-    Array<Col_hpositions> do_solve()const;
+    Array<Col_hpositions> do_solve() const;
 };
 
     
 };
 
     
index 000ef3ec92d1c5aa091d047bfeeb826b325b4df0..b77414482e8a4ee6abd8619728ea4ea87e52b259 100644 (file)
@@ -24,7 +24,7 @@ struct Col_stats
 
     Col_stats(); 
     void add (Line_of_cols const&l);
 
     Col_stats(); 
     void add (Line_of_cols const&l);
-    String str()const;
+    String str() const;
 };
 
 /** Class representation of an algorithm which decides where to put
 };
 
 /** Class representation of an algorithm which decides where to put
@@ -43,7 +43,7 @@ protected:
     Line_of_cols find_breaks() const;
 
     Line_of_cols all_cols() const;
     Line_of_cols find_breaks() const;
 
     Line_of_cols all_cols() const;
-    Array<int> find_break_indices()const;
+    Array<int> find_break_indices() const;
     
 
     /// helper: solve for the columns in #curline#.
     
 
     /// helper: solve for the columns in #curline#.
@@ -53,13 +53,13 @@ protected:
     void approximate_solve_line (Col_hpositions*) const;
 
     /// does curline fit on the paper?    
     void approximate_solve_line (Col_hpositions*) const;
 
     /// does curline fit on the paper?    
-    bool feasible (Line_of_cols)const;
+    bool feasible (Line_of_cols) const;
     
 
     
 
-    Line_spacer* generate_spacing_problem (Line_of_cols)const;
+    Line_spacer* generate_spacing_problem (Line_of_cols) const;
 
 
-    virtual Array<Col_hpositions> do_solve()const=0;
-    void print_stats()const;
+    virtual Array<Col_hpositions> do_solve() const=0;
+    void print_stats() const;
 
     virtual void do_set_pscore();
 public:
 
     virtual void do_set_pscore();
 public:
@@ -72,9 +72,9 @@ public:
     void set_pscore (Paper_score*);
 
     /// check if the spacing/breaking problem is well-stated
     void set_pscore (Paper_score*);
 
     /// check if the spacing/breaking problem is well-stated
-    void problem_OK()const;
-    void OK()const;
-    Array<Col_hpositions> solve()const;
+    void problem_OK() const;
+    void OK() const;
+    Array<Col_hpositions> solve() const;
 };
 
 #endif // BREAK_HH
 };
 
 #endif // BREAK_HH
diff --git a/lily/include/chord-iterator.hh b/lily/include/chord-iterator.hh
new file mode 100644 (file)
index 0000000..a3adc4a
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  chord-iter.hh -- declare Chord_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CHORD_ITER_HH
+#define CHORD_ITER_HH
+
+
+#include "music-iterator.hh"
+#include "plist.hh"
+
+class Chord_iterator : public Music_iterator
+{
+  const Chord *chord_C_;
+  Pointer_list<Music_iterator*> children_p_list_;
+public:
+  ~Chord_iterator();
+  Chord_iterator (Chord const*);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+  virtual void do_print() const;
+  virtual void construct_children();
+  virtual void process_and_next (Moment);
+  virtual Moment next_moment() const;
+  virtual bool ok() const;
+};
+
+#endif // CHORD_ITER_HH
index ad8a674242d04a252a9313b56b3b449d4f9e8db7..33190aceeb214d5312fdbae3b30ce29d201b0838 100644 (file)
@@ -14,7 +14,7 @@
 class Clef_item : public Item {
 protected:
     virtual void do_pre_processing();
 class Clef_item : public Item {
 protected:
     virtual void do_pre_processing();
-    Molecule* brew_molecule_p()const;
+    Molecule* brew_molecule_p() const;
 public:
     
     String type_;
 public:
     
     String type_;
index 36a2f73f721fa3d06a8b8ede55fec088ee228eb8..505c11f991b2463dd9047852086eed7f72d5451e 100644 (file)
@@ -16,7 +16,7 @@
 
 /// helper struct for #Spacing_problem#
 struct Colinfo {
 
 /// helper struct for #Spacing_problem#
 struct Colinfo {
-    PCol *pcol_l_;
+    Paper_column *pcol_l_;
     P<Real> fixpos_p_;
     Interval width;
     int rank_i_;
     P<Real> fixpos_p_;
     Interval width;
     int rank_i_;
@@ -24,11 +24,11 @@ struct Colinfo {
     bool ugh_b_;               
     /* *************** */
     Colinfo();
     bool ugh_b_;               
     /* *************** */
     Colinfo();
-    Colinfo (PCol *,Real const *);
+    Colinfo (Paper_column *,Real const *);
 
     void print() const;
     bool fixed() const { return fixpos_p_.get_C();}
 
     void print() const;
     bool fixed() const { return fixpos_p_.get_C();}
-    Real fixed_position()const { return *fixpos_p_; }
+    Real fixed_position() const { return *fixpos_p_; }
     Real minright() const { return width.right; }
     Real minleft() const { return -width.left; }
 };
     Real minright() const { return width.right; }
     Real minleft() const { return -width.left; }
 };
index 3f198f2ca11330e1088bbe5399820d58e8ffdfd6..56f70c8506672a2bc45bb966337fb1c6cc8d5bc5 100644 (file)
@@ -10,7 +10,7 @@
 #include "varray.hh"
 #include "lily-proto.hh"
 
 #include "varray.hh"
 #include "lily-proto.hh"
 
-typedef Array<PCol*>  Line_of_cols;
+typedef Array<Paper_column*>  Line_of_cols;
 
 struct Col_hpositions {
     Line_spacer * spacer_l_;
 
 struct Col_hpositions {
     Line_spacer * spacer_l_;
@@ -22,7 +22,7 @@ struct Col_hpositions {
     bool satisfies_constraints_b_;
 
     /* ************** */
     bool satisfies_constraints_b_;
 
     /* ************** */
-    void OK()const;
+    void OK() const;
     ~Col_hpositions();
     void solve_line();
     void approximate_solve_line();
     ~Col_hpositions();
     void solve_line();
     void approximate_solve_line();
@@ -30,7 +30,7 @@ struct Col_hpositions {
       constraints.  should always work */
     void stupid_solution();
     Col_hpositions();
       constraints.  should always work */
     void stupid_solution();
     Col_hpositions();
-    void add (PCol*c);
+    void add (Paper_column*c);
     void print() const;
 };
 
     void print() const;
 };
 
index f5adca4428b9194c647087aa2caf2b61aed9d80f..848d4d9e43c58149a3e069070c51c518700a9ca4 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     Tempo_req();
     REQUESTMETHODS(Tempo_req, tempo);
 
     Tempo_req();
     REQUESTMETHODS(Tempo_req, tempo);
-    bool do_equal_b (Request *)const;
+    bool do_equal_b (Request *) const;
 };
 
 class Partial_measure_req  : public Timing_req  {
 };
 
 class Partial_measure_req  : public Timing_req  {
@@ -73,7 +73,7 @@ public:
 
     Partial_measure_req (Moment);
     REQUESTMETHODS(Partial_measure_req, partial);
 
     Partial_measure_req (Moment);
     REQUESTMETHODS(Partial_measure_req, partial);
-    bool do_equal_b (Request*)const;
+    bool do_equal_b (Request*) const;
 };
 
 /**
 };
 
 /**
@@ -85,7 +85,7 @@ public:
 
     Meter_change_req();
     void set (int,int);
 
     Meter_change_req();
     void set (int,int);
-    bool do_equal_b (Request*)const;
+    bool do_equal_b (Request*) const;
     REQUESTMETHODS(Meter_change_req, meterchange);
 };
 
     REQUESTMETHODS(Meter_change_req, meterchange);
 };
 
@@ -94,7 +94,7 @@ class Cadenza_req  : public Timing_req  {
 public:
     /// turn on?
     bool on_b_;
 public:
     /// turn on?
     bool on_b_;
-    bool do_equal_b (Request*)const;
+    bool do_equal_b (Request*) const;
     Cadenza_req (bool);
     REQUESTMETHODS(Cadenza_req,cadenza);
 };
     Cadenza_req (bool);
     REQUESTMETHODS(Cadenza_req,cadenza);
 };
@@ -102,7 +102,7 @@ public:
 /// check if we're at start of a  measure.
 class Barcheck_req  : public Timing_req  {
 public:
 /// check if we're at start of a  measure.
 class Barcheck_req  : public Timing_req  {
 public:
-    bool do_equal_b (Request *)const;
+    bool do_equal_b (Request *) const;
     REQUESTMETHODS(Barcheck_req,barcheck);
 };
 
     REQUESTMETHODS(Barcheck_req,barcheck);
 };
 
@@ -110,7 +110,7 @@ class Measure_grouping_req : public Timing_req  {
 public:
     Array<int> beat_i_arr_;
     Array<Moment> elt_length_arr_;
 public:
     Array<int> beat_i_arr_;
     Array<Moment> elt_length_arr_;
-    bool do_equal_b (Request *)const;
+    bool do_equal_b (Request *) const;
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
@@ -120,7 +120,7 @@ class Bar_req  : public Command_req  {
 public:
     String type_str_;
     Bar_req (String);
 public:
     String type_str_;
     Bar_req (String);
-    bool do_equal_b (Request*)const;
+    bool do_equal_b (Request*) const;
 
     REQUESTMETHODS(Bar_req,bar);
 };
 
     REQUESTMETHODS(Bar_req,bar);
 };
index 4539ac209c22fed87eb6f821cf367b5936cfce63..99e0e287ccacd7a89aa16d1a08b8360623d60a99 100644 (file)
  */
 class Crescendo : public Spanner , public Staff_side {
 public:
  */
 class Crescendo : public Spanner , public Staff_side {
 public:
-    int grow_dir_i_;
+  int grow_dir_;
     
     
-/// if there is a dynamic at the end, make the sign smaller.
-    bool right_dyn_b_;
+  /// if there is a dynamic at the end, make the sign smaller.
+  Drul_array<bool> dyn_b_drul_;
 
 
-    /// if there is a dynamic at the end, make the sign smaller.
-    bool left_dyn_b_;
-    Crescendo();
+  Crescendo();
 protected:
 protected:
-    SCORE_ELEM_CLONE(Crescendo);
-    virtual Molecule*brew_molecule_p()const;
-    virtual Interval symbol_height()const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Crescendo);
+  virtual Molecule*brew_molecule_p() const;
+  virtual Interval symbol_height() const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
     
 private:
     
 private:
-    Symbol get_symbol()const;
-    
+  Symbol get_symbol() const;
 };
 
 #endif // CRESCENDO_HH
 };
 
 #endif // CRESCENDO_HH
diff --git a/lily/include/direction.hh b/lily/include/direction.hh
new file mode 100644 (file)
index 0000000..032effc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  direction.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DIRECTION_HH
+#define DIRECTION_HH
+
+enum Direction 
+{
+  UP=1,
+  DOWN=-1,
+  LEFT=-1,
+  RIGHT=1,
+  CENTER=0,
+  SMALLER=-1,
+  BIGGER=1,
+
+};
+
+
+#endif // DIRECTION_HH
index abff328b59000f7424925be93a558a595a96c4cd..7854a348cea4184797ef3a0c5ef637401636825d 100644 (file)
@@ -14,7 +14,7 @@ class Directional_spanner : public Spanner{
 public:
     
     /// -1 below heads, +1 above heads.
 public:
     
     /// -1 below heads, +1 above heads.
-    int dir_i_;
+    Direction dir_;
     Directional_spanner();
     
     /// offset of "center" relative to left-column/0-pos of staff
     Directional_spanner();
     
     /// offset of "center" relative to left-column/0-pos of staff
diff --git a/lily/include/drul-array.hh b/lily/include/drul-array.hh
new file mode 100644 (file)
index 0000000..69db537
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  drul-array.hh -- declare Drul_array
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DRUL_ARRAY_HH
+#define DRUL_ARRAY_HH
+
+#include "direction.hh"
+
+/**
+  Left/right or Up/down arrays. Drul is nicer sounding than udlr
+ */
+template<class T>
+struct Drul_array
+{
+  T array_[2];
+  T &operator[] (Direction d)
+  {
+    assert (d==1 || d== -1);
+    return array_[(d+1)/2];
+  }
+  T operator[]  (Direction d) const
+  {
+    assert (d==1 || d== -1);
+    return array_[(d+1)/2];
+  }
+};
+
+#endif // DRUL_ARRAY_HH
index 26556edf9dfd356df0993240d0396013509f6703..bf71902245faac2e42464a9e849c5c3352674694 100644 (file)
@@ -13,7 +13,7 @@
 #include "engraver.hh"
 
 class Dynamic_engraver : public Engraver {
 #include "engraver.hh"
 
 class Dynamic_engraver : public Engraver {
-    int dir_i_;
+    Direction dir_;
     Text_item * dynamic_p_;
     Crescendo * to_end_cresc_p_;
     Crescendo * cresc_p_;
     Text_item * dynamic_p_;
     Crescendo * to_end_cresc_p_;
     Crescendo * cresc_p_;
index 8e0fcd515442b399340972e953dfd3bd64adbb8d..52475d905a6667b6bab809fc2123e9e4a83494bb 100644 (file)
  */
 class Horizontal_vertical_group_item  : public Axis_group_item, public Horizontal_vertical_group_element {
 protected:
  */
 class Horizontal_vertical_group_item  : public Axis_group_item, public Horizontal_vertical_group_element {
 protected:
-    virtual void do_print() const;
-    virtual void remove_all() { Horizontal_vertical_group_element::remove_all (); }
+  virtual void do_print() const;
+  virtual void remove_all() { Horizontal_vertical_group_element::remove_all (); }
+  virtual void do_unlink () { Horizontal_vertical_group_element::do_unlink (); }
+  SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
 public:
 public:
-    virtual void add_element (Score_elem*e) { Horizontal_vertical_group_element::add_element (e); }
-    virtual void remove_element (Score_elem*e) { Horizontal_vertical_group_element::remove_element (e); }
+  virtual void add_element (Score_elem*e) { Horizontal_vertical_group_element::add_element (e); }
+  virtual void remove_element (Score_elem*e) { Horizontal_vertical_group_element::remove_element (e); }
 
 
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
-  
-       
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
 #endif // ELEM_GROUP_ITEM_HH
 };
 
 #endif // ELEM_GROUP_ITEM_HH
index 61ad7519f309e65f4c57d1418f46ee14d10e0b20..d65c17312370202fe5e307fc02715ec1ed9e001f 100644 (file)
@@ -22,7 +22,7 @@
 class Horizontal_group_element : public virtual Axis_group_element {
 protected:
     virtual void remove_all();
 class Horizontal_group_element : public virtual Axis_group_element {
 protected:
     virtual void remove_all();
-    virtual Interval do_width()const;
+    virtual Interval do_width() const;
 
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
 
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
@@ -35,7 +35,7 @@ public:
  */
 class Vertical_group_element : public virtual Axis_group_element {
 protected:
  */
 class Vertical_group_element : public virtual Axis_group_element {
 protected:
-    virtual Interval do_height()const;
+    virtual Interval do_height() const;
     virtual void remove_all();
 
 public:
     virtual void remove_all();
 
 public:
index 03e26c9610ab20ef96f6a57d75a4ede38c94671b..cdfee08c3858bfa6b49e58f1178abf35f9b5e317 100644 (file)
@@ -30,10 +30,10 @@ protected:
     
     Array<Score_elem_info> announce_info_arr_;
     
     
     Array<Score_elem_info> announce_info_arr_;
     
-    virtual void do_print()const;
-    virtual bool removable_b()const;
+    virtual void do_print() const;
+    virtual bool removable_b() const;
 public:
 public:
-    Engraver*get_simple_engraver (char const*typeinfo)const;
+    Engraver*get_simple_engraver (char const*typeinfo) const;
     virtual void print() const ;
 
     Input_translator * itrans_l_;
     virtual void print() const ;
 
     Input_translator * itrans_l_;
@@ -68,13 +68,13 @@ public:
     virtual bool try_request (Request*);
     virtual void do_process_requests();
 
     virtual bool try_request (Request*);
     virtual void do_process_requests();
 
-    virtual Staff_info get_staff_info()const;
+    virtual Staff_info get_staff_info() const;
     
     virtual Engraver_group_engraver * find_engraver_l (String name,String id);
     virtual void do_announces();    
     virtual void announce_element (Score_elem_info);
     virtual void add (Engraver* grav_p);
     
     virtual Engraver_group_engraver * find_engraver_l (String name,String id);
     virtual void do_announces();    
     virtual void announce_element (Score_elem_info);
     virtual void add (Engraver* grav_p);
-    virtual bool contains_b (Engraver*)const;
+    virtual bool contains_b (Engraver*) const;
 
     virtual Translator* find_get_translator_l (String name, String id);
     virtual Translator * get_default_interpreter();
 
     virtual Translator* find_get_translator_l (String name, String id);
     virtual Translator * get_default_interpreter();
index a7507044370ec7cdbe5c33521371d00c61806432..335ab13034131178db0e6e1301d70a1bef4e6c28 100644 (file)
@@ -94,15 +94,15 @@ protected:
 
     virtual void sync_features() {}
    
 
     virtual void sync_features() {}
    
-    virtual bool contains_b (Engraver*grav_l)const;
+    virtual bool contains_b (Engraver*grav_l) const;
     /**
       Get information on the staff. Default: ask daddy.
       */
     /**
       Get information on the staff. Default: ask daddy.
       */
-    virtual Staff_info get_staff_info()const;
+    virtual Staff_info get_staff_info() const;
     virtual void fill_staff_info (Staff_info&);
 
 
     virtual void fill_staff_info (Staff_info&);
 
 
-    virtual void do_print()const;  
+    virtual void do_print() const;  
     /*    
          @see{try_request}
          Default: always return false
     /*    
          @see{try_request}
          Default: always return false
index 4f927b2dfd73a5a5a1d8f6858ff0426dc01b6ca7..3788df867cbd0fddc933595376e7b05076ddd891 100644 (file)
@@ -13,6 +13,8 @@
 #include "lily-proto.hh"
 #include "input.hh"
 #include "virtual-methods.hh"
 #include "lily-proto.hh"
 #include "input.hh"
 #include "virtual-methods.hh"
+#include "direction.hh"
+
 /**
   Definition of anything that is put aside staff/notes.
  */
 /**
   Definition of anything that is put aside staff/notes.
  */
@@ -20,18 +22,18 @@ class General_script_def : public Input {
 public:
     VIRTUAL_COPY_CONS(General_script_def,General_script_def);
     DECLARE_MY_RUNTIME_TYPEINFO;
 public:
     VIRTUAL_COPY_CONS(General_script_def,General_script_def);
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual int staff_dir_i()const;
+    virtual Direction staff_dir() const;
     void print() const;
     void print() const;
-    virtual int rel_stem_dir_i()const;
-    virtual int priority_i()const;
-    virtual bool inside_b()const;
-    virtual Atom get_atom (Paper_def* p, int dir_i_)const;
-    bool equal_b (General_script_def const&)const;
+    virtual Direction rel_stem_dir() const;
+    virtual int priority_i() const;
+    virtual bool inside_b() const;
+    virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+    bool equal_b (General_script_def const&) const;
     virtual ~General_script_def() {}
     
 protected:
     virtual ~General_script_def() {}
     
 protected:
-    virtual bool do_equal_b (General_script_def const *)const;
-    virtual void do_print()const;
+    virtual bool do_equal_b (General_script_def const *) const;
+    virtual void do_print() const;
 };
 
 #endif // GENERAL_SCRIPT_DEF_HH
 };
 
 #endif // GENERAL_SCRIPT_DEF_HH
index 25f596871445738b2fd693469012cdd2cd19c244..ae97418b7ffd6494082ddc9eb780002f5db5d8b2 100644 (file)
 #include "pqueue.hh"
 
 class Global_translator : public virtual Translator {
 #include "pqueue.hh"
 
 class Global_translator : public virtual Translator {
-    PQueue<Moment> extra_mom_pq_;
-    Moment last_mom_;
+  PQueue<Moment> extra_mom_pq_;
 public:
 public:
-    Score *score_l_;
+  Moment last_mom_;
+  Global_translator();
+  int moments_left_i() const;
+  void modify_next (Moment&);
+  void add_moment_to_process (Moment);
+
+  virtual Music_output *get_output_p ();     
+  virtual void prepare (Moment);
+  virtual void process() {}
+  virtual void finish() {}
+  virtual void start() {}
     
     
-    Global_translator();
-    int moments_left_i()const;
-    void modify_next (Moment&);
-    void add_moment_to_process (Moment);
-
-    virtual void set_score (Score*);
-    virtual void prepare (Moment);
-    virtual void process() {}
-    virtual void finish() {}
-    virtual void start() {}
-    
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  DECLARE_MY_RUNTIME_TYPEINFO;
 protected:
     
 protected:
     
-    virtual Global_translator *global_l() { return this; }
-    virtual int depth_i() const;
-    virtual Translator *ancestor_l (int);
+  virtual Global_translator *global_l() { return this; }
+  virtual int depth_i() const;
+  virtual Translator *ancestor_l (int);
 };
 
 
 };
 
 
index 99fa0c93407a91ef6d94363d48ef20753acb4b2c..d8c3472a14898ff3c74dbab8deaa14cf489a9bfc 100644 (file)
@@ -22,7 +22,7 @@ struct Gourlay_breaking : public Break_algorithm
     /// maximum number of measures in a line
     int max_measures_i_;
     void do_set_pscore();
     /// maximum number of measures in a line
     int max_measures_i_;
     void do_set_pscore();
-    Array<Col_hpositions> do_solve()const;
+    Array<Col_hpositions> do_solve() const;
     Gourlay_breaking();
 };
 #endif // GOURLAY_BREAKING_HH
     Gourlay_breaking();
 };
 #endif // GOURLAY_BREAKING_HH
index 13fcbd790a09eefd323940fca2e664ab17d24b15..d88ed2876b5f0b8e9c4d3f7407b37818e6733d3e 100644 (file)
@@ -21,7 +21,7 @@ struct Rhythmic_grouping {
     /* *************** */
 
     Array<MInterval> intervals();
     /* *************** */
 
     Array<MInterval> intervals();
-    MInterval interval()const;
+    MInterval interval() const;
     Moment length() const;
     void intersect (MInterval);
     
     Moment length() const;
     void intersect (MInterval);
     
index 57c560b18b6eee3f8a7dccb112821785d47fd1f9..ab38222b1a88d15086ba0e6bae58c8dfe96a892e 100644 (file)
 class Head_column : public Script_column
 { 
 public:
 class Head_column : public Script_column
 { 
 public:
-    Link_array<Note_head> head_l_arr_;
-    /** The relative position of the "voice" containing this
-      chord. Normally this would be the same as the stem direction,
-      but rests do not have stems.  
-
-      Hmm. outdated.. Rests *do* have stems.
-      */
-
-    int dir_i_;
-    Stem* stem_l_;
-
-    void add (Note_head*);
-    virtual void add (Script*s);
-    virtual void set (Stem*);
-    Head_column();
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  Link_array<Note_head> head_l_arr_;
+  /** The relative position of the "voice" containing this
+    chord. Normally this would be the same as the stem direction,
+    but rests do not have stems.  
+
+    Hmm. outdated.. Rests *do* have stems.
+    */
+
+  Direction dir_;
+  Stem* stem_l_;
+
+  void add (Note_head*);
+  virtual void add (Script*s);
+  void set (Stem*);
+  Head_column();
+  DECLARE_MY_RUNTIME_TYPEINFO;
 protected:
 
 
 protected:
 
 
-    virtual void do_pre_processing();
-    virtual void do_print()const;
-    virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+  virtual void do_pre_processing();
+  virtual void do_print() const;
+  virtual void do_substitute_dependency (Score_elem*,Score_elem*);
 };
 #endif // HEAD_COLUMN_HH
 };
 #endif // HEAD_COLUMN_HH
index c5fcae96a8006284ad39e920ab3bfd29054a5614..d5919b0de5e8cfbb4711d98bd130bf783a5c53f8 100644 (file)
@@ -16,7 +16,7 @@
 
 struct Header : Assoc<String, String>
 {
 
 struct Header : Assoc<String, String>
 {
-  String TeX_string()const;
+  String TeX_string() const;
 };
 
 #endif // HEADER_HH
 };
 
 #endif // HEADER_HH
index c1d6313657eb56478599daf8c4a129ddecfcfb1a..07c1934eda1a11b4ad8c044d6f1c3e4fd2d40552 100644 (file)
@@ -35,15 +35,14 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Horizontal_align_item);
     void add (Item*, int p);
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Horizontal_align_item);
     void add (Item*, int p);
-    void OK()const;
     Horizontal_align_item();
 protected:
     
     virtual void do_substitute_dependency (Score_elem * , Score_elem *);
     /// do calculations before determining horizontal spacing
     virtual void do_pre_processing();
     Horizontal_align_item();
 protected:
     
     virtual void do_substitute_dependency (Score_elem * , Score_elem *);
     /// do calculations before determining horizontal spacing
     virtual void do_pre_processing();
-    virtual void do_print()const;
-    virtual Interval do_width()const;
-    bool contains_b (Item*)const;
+    virtual void do_print() const;
+    virtual Interval do_width() const;
+    bool contains_b (Item*) const;
 };
 #endif // HORIZONTAL_ALIGN_ITEM_HH
 };
 #endif // HORIZONTAL_ALIGN_ITEM_HH
index b9045a4bdb5e520e551e2af3229ad0e79fde65e1..35918c95706313a092d1e2b7b042c4a14a74ae94 100644 (file)
 #include "elem-group.hh"
 #include "axis-group-item.hh"
 
 #include "elem-group.hh"
 #include "axis-group-item.hh"
 
+/**
+  Group stuff in horizontal sense. Example: Paper_column
+ */
 class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
 protected:
 class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
 protected:
-    virtual void remove_all() { Horizontal_group_element::remove_all (); }
-    virtual void do_print() const;
+  virtual void remove_all() { Horizontal_group_element::remove_all (); }
+  virtual void do_unlink () { 
+    Axis_group_item::do_unlink ();
+  }
+  virtual void do_junk_links() {
+    Axis_group_item::do_junk_links();
+  }
+  virtual void do_print() const;
 public:
 public:
-    virtual void add_element (Score_elem*e) { Horizontal_group_element::add_element (e); }
-    virtual void remove_element (Score_elem*e) { Horizontal_group_element::remove_element (e); }
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    SCORE_ELEM_CLONE(Horizontal_group_item);
-  
-
+  virtual void add_element (Score_elem*e) { Horizontal_group_element::add_element (e); }
+  virtual void remove_element (Score_elem*e) { Horizontal_group_element::remove_element (e); }
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Horizontal_group_item);
 };
 
 #endif // HORIZONTAL_GROUP_ITEM_HH
 };
 
 #endif // HORIZONTAL_GROUP_ITEM_HH
index 83fb5ba89dd063a91d52948be7f7a2408af646e8..068ec5836cf6defd292de401a7484e82b9a1b563 100644 (file)
@@ -21,7 +21,7 @@ struct Idealspacing {
     int left_i_;
     int right_i_;
     
     int left_i_;
     int right_i_;
     
-    void print()const;
+    void print() const;
     void OK() const ;
     Idealspacing();
 };
     void OK() const ;
     Idealspacing();
 };
index dd4b8f75f82b5577381f95454ccce8643217fdd0..935f962e39df71e631c85714755f154c34295025 100644 (file)
@@ -28,7 +28,7 @@ struct Identifier : public Input {
     Identifier (int code) ;
     virtual ~Identifier() ;
 
     Identifier (int code) ;
     virtual ~Identifier() ;
 
-    void print()const;
+    void print() const;
     DECLARE_MY_RUNTIME_TYPEINFO;
     void error (String);
     IDACCESSOR(Input_translator, input_translator)
     DECLARE_MY_RUNTIME_TYPEINFO;
     void error (String);
     IDACCESSOR(Input_translator, input_translator)
@@ -45,7 +45,7 @@ struct Identifier : public Input {
     IDACCESSOR(Duration, duration)
 
 protected:
     IDACCESSOR(Duration, duration)
 
 protected:
-    virtual void do_print()const=0;
+    virtual void do_print() const=0;
 private:
     Identifier (Identifier const&);
 };
 private:
     Identifier (Identifier const&);
 };
@@ -57,7 +57,7 @@ struct Idclass : Identifier {\
        Idclass (Class*st, int code);\
        virtual Class* accessor ();\
        ~Idclass();\
        Idclass (Class*st, int code);\
        virtual Class* accessor ();\
        ~Idclass();\
-       virtual void do_print()const; \
+       virtual void do_print() const; \
 }\
 
 
 }\
 
 
index 7e28fd7a82f2d29f70c858df106671b2cbd6c905..a7bd31693de716636b382b45f2a5007e63196faf 100644 (file)
@@ -31,7 +31,7 @@ public:
       */
     void assert_solution (Vector sol) const;
     /// solve the problem using a projected gradient method
       */
     void assert_solution (Vector sol) const;
     /// solve the problem using a projected gradient method
-    Vector constraint_solve (Vector)const;
+    Vector constraint_solve (Vector) const;
     /**
       Solve it. First try it the easy way.
      */
     /**
       Solve it. First try it the easy way.
      */
@@ -65,7 +65,7 @@ public:
     Real eval (Vector v);
 
     void eliminate_var (int idx, Real value);
     Real eval (Vector v);
 
     void eliminate_var (int idx, Real value);
-    void OK()const;
+    void OK() const;
     void print() const;
 
 };
     void print() const;
 
 };
index e465931074c1f035117ef801161023e504e3cb07..524c6772e1bf248d1ffb9f9f25b723289c477430 100644 (file)
@@ -12,6 +12,7 @@
 #include "boxes.hh"
 #include "string.hh"
 #include "score-elem.hh"
 #include "boxes.hh"
 #include "string.hh"
 #include "score-elem.hh"
+#include "drul-array.hh"
 
 /**
   A horizontally fixed size element of the score.
 
 /**
   A horizontally fixed size element of the score.
 */
 class Item : public virtual Score_elem {
 public:
 */
 class Item : public virtual Score_elem {
 public:
-    /// indirection to the column it is in
-    PCol * pcol_l_;
-    
-    Item * broken_to_a_[2];
-
-    /// should be put in a breakable col.
-    bool breakable_b_;
-    int break_status_i_;
-    /// nobreak = 0, pre = -1, post = 1
-    int break_status_i()const;
-    Item * find_prebroken_piece (PCol*)const;
-    Item * find_prebroken_piece (Line_of_score*)const;    
-
-    virtual Item *item() { return this; }
-    Item();
-    Real hpos_f() const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual Line_of_score * line_l() const;
+  Link_array<Spanner> attached_span_l_arr_;
+  Drul_array<Item*> broken_to_drul_;
+
+  /// should be put in a breakable col.
+  bool breakable_b_;
+  int break_status_i_;
+  /// nobreak = 0, pre = -1, post = 1
+  int break_status_i() const;
+  Item * find_prebroken_piece (int) const;
+  Item * find_prebroken_piece (Line_of_score*) const;    
+
+  virtual Item *item() { return this; }
+  Item();
+  Real hpos_f() const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual Line_of_score * line_l() const;
     
     
+  static int left_right_compare (Item const *, Item const*);
 protected:
 protected:
-    virtual void  do_breakable_col_processing();
-    virtual void handle_prebroken_dependencies();
-    virtual void do_print()const;
-
-    void copy_breakable_items();
+  virtual void do_unlink ();
+  virtual void do_junk_links();
+  virtual void  do_breakable_col_processing();
+  virtual void handle_prebroken_dependencies();
+  virtual void do_print() const;
+  virtual bool linked_b() const;
+
+  void copy_breakable_items();
 };
 
 
 };
 
 
index 84d1ac709fe6a2562ccc44bf53fd7c5c6499d3aa..3f4b7f30e067d962b82add51a2f885c102ad938b 100644 (file)
@@ -28,7 +28,7 @@ struct Key_item : Item {
     void set_c_position (int);
 protected:
     virtual void do_pre_processing();
     void set_c_position (int);
 protected:
     virtual void do_pre_processing();
-    Molecule* brew_molecule_p()const;
+    Molecule* brew_molecule_p() const;
 };
 
 #endif // KEYITEM_HH
 };
 
 #endif // KEYITEM_HH
index 10c5779455d6573dff75f297bd8ca802ad200556..4a68fa8148733814511429fc0385986bc9ef2ca8 100644 (file)
@@ -18,7 +18,7 @@ public:
  
     Octave_key();
     void set (int i, int acc);
  
     Octave_key();
     void set (int i, int acc);
-    int acc (int i)const { return accidental_i_arr_[i]; }
+    int acc (int i) const { return accidental_i_arr_[i]; }
 };
 
 /// administration of accidentals
 };
 
 /// administration of accidentals
index c024791de5cac2fcff7058e95a8f010e3c85d43b..f5aa4f56c980e6d1964c5941e0bc68e57109cd20 100644 (file)
@@ -67,6 +67,8 @@ struct Element_group;
 struct Element_group_item;
 struct Feature;
 struct General_script_def;
 struct Element_group_item;
 struct Feature;
 struct General_script_def;
+struct Music_output;
+struct Music_output_def;
 struct Global_translator;
 struct Group_change_req;
 struct Group_feature_req;
 struct Global_translator;
 struct Group_change_req;
 struct Group_feature_req;
@@ -142,7 +144,7 @@ struct Notename_table;
 struct Offset;
 struct Output;
 struct Performer;
 struct Offset;
 struct Output;
 struct Performer;
-struct PCol;
+struct Paper_column;
 struct Paper_score;
 struct Paper_def;
 struct Partial_measure_req;
 struct Paper_score;
 struct Paper_def;
 struct Partial_measure_req;
index f6f6cfe5c767bd476b73aa39483b6ac7728ce2a5..053e59a902495388883914d4a62beff5119c5c0b 100644 (file)
@@ -26,7 +26,7 @@ class Line_spacer
     
 public:
     Paper_def * paper_l_;
     
 public:
     Paper_def * paper_l_;
-    Paper_def *paper_l()const;
+    Paper_def *paper_l() const;
     Line_spacer();
     
     /** solve the spacing problem
     Line_spacer();
     
     /** solve the spacing problem
@@ -41,7 +41,7 @@ public:
     
     /** add a col to the problem. columns have to be added left to
       right. The column contains info on it's minimum width.  */
     
     /** add a col to the problem. columns have to be added left to
       right. The column contains info on it's minimum width.  */
-    virtual void add_column (PCol  *, bool fixed=false, Real fixpos=0.0)=0;
+    virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0)=0;
 
     /**
       can the posed problem be solved?
 
     /**
       can the posed problem be solved?
index 415a5376bef8297dbc927f6bde82cfc24d5284ba..12058cfc8e3f9c47a5e87f93875626521dfee0c8 100644 (file)
@@ -48,7 +48,7 @@ class Spacing_problem {
     /// mark column #i# as being loose.
     void loosen_column (int i);
     /// the index of #c# in #cols#
     /// mark column #i# as being loose.
     void loosen_column (int i);
     /// the index of #c# in #cols#
-    int col_id (PCol const *c) const;
+    int col_id (Paper_column const *c) const;
 
     /// generate an (nonoptimal) solution
     Vector find_initial_solution() const;
 
     /// generate an (nonoptimal) solution
     Vector find_initial_solution() const;
@@ -57,7 +57,7 @@ class Spacing_problem {
     bool check_feasible() const;
 
     /// does #this# contain the column #w#? 
     bool check_feasible() const;
 
     /// does #this# contain the column #w#? 
-    bool contains (PCol const *w);
+    bool contains (Paper_column const *w);
 
     /// make the energy function
     void make_matrices (Matrix &quad, Vector &lin,Real&) const;
 
     /// make the energy function
     void make_matrices (Matrix &quad, Vector &lin,Real&) const;
@@ -76,7 +76,7 @@ class Spacing_problem {
     not in this problem, the spacing is ignored.
     */
     void add_ideal (Idealspacing const *i);
     not in this problem, the spacing is ignored.
     */
     void add_ideal (Idealspacing const *i);
-    void print_ideal (Idealspacing const *)const; 
+    void print_ideal (Idealspacing const *) const; 
     Vector try_initial_solution() const;
     void calcideal();
 
     Vector try_initial_solution() const;
     void calcideal();
 
@@ -86,10 +86,10 @@ public:
     static Line_spacer *constructor() {
        return new Line_spacer;
     }
     static Line_spacer *constructor() {
        return new Line_spacer;
     }
-    Array<PCol*> error_pcol_l_arr() const;
+    Array<Paper_column*> error_pcol_l_arr() const;
 
     virtual   Array<Real> solve() const;
 
     virtual   Array<Real> solve() const;
-    virtual  void add_column (PCol  *, bool fixed=false, Real fixpos=0.0);
+    virtual  void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0);
  
 
     virtual Vector default_solution() contains { 
  
 
     virtual Vector default_solution() contains { 
index 467f331201dfb3ea82a62cbb0c0d53436a2f961c..4d0ed37e2d8aa16eb90a471d8831625f1632a0fa 100644 (file)
@@ -43,7 +43,7 @@ public:
 protected:
     virtual void do_pre_processing();    
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
 protected:
     virtual void do_pre_processing();    
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
-    virtual Molecule* brew_molecule_p()const;
+    virtual Molecule* brew_molecule_p() const;
 };
 #endif // LOCALKEYITEM_HH
 
 };
 #endif // LOCALKEYITEM_HH
 
index 46155bded379665843b126cbff469388075495a2..ce55ce46575e2f5b75874edb5671a789091bd961 100644 (file)
@@ -20,42 +20,42 @@ struct Lookup {
     String texsetting;
     /* *************** */
     void add (String, Symtable*);
     String texsetting;
     /* *************** */
     void add (String, Symtable*);
-    void print()const;
+    void print() const;
 
 
-    Symbol linestaff (int n, Real w)const;
-    Symbol fill (Box b)const;
-    Symbol beam_element (int,int,Real=0)const;
+    Symbol linestaff (int n, Real w) const;
+    Symbol fill (Box b) const;
+    Symbol beam_element (int,int,Real=0) const;
 
     /// round slope to closest TeXslope
 
     /// round slope to closest TeXslope
-    Symbol beam (Real&,Real)const;
+    Symbol beam (Real&,Real) const;
 
     /**
       pos == 3 : 3 lines above staff (extending below note)
 
       pos == -3: below staff
       */
 
     /**
       pos == 3 : 3 lines above staff (extending below note)
 
       pos == -3: below staff
       */
-    Symbol streepjes (int pos)const;
+    Symbol streepjes (int pos) const;
 
     Symbol vbrace (Real &dy) const;
 
     Symbol vbrace (Real &dy) const;
-    Symbol meter (Array<Scalar>)const;
-    Symbol stem (Real y1_pos, Real y2_pos)const;
-    Symbol rule_symbol (Real height, Real width)const;
-    Symbol accidental (int)const;
-    Symbol ball (int)const;
-    Symbol flag (int)const;
-    Symbol rest (int, bool outside)const;
-    Symbol clef (String)const;
-    Symbol bar (String, Real height)const;
+    Symbol meter (Array<Scalar>) const;
+    Symbol stem (Real y1_pos, Real y2_pos) const;
+    Symbol rule_symbol (Real height, Real width) const;
+    Symbol accidental (int) const;
+    Symbol ball (int) const;
+    Symbol flag (int) const;
+    Symbol rest (int, bool outside) const;
+    Symbol clef (String) const;
+    Symbol bar (String, Real height) const;
     
     
-    Symbol dots (int)const;
-    Symbol slur (int dy, Real &dx, int dir)const;
-    Symbol half_slur (int dy, Real &dx, int dir, int xpart)const;
-    Symbol half_slur_middlepart (Real &dx, int dir)const;
-    Symbol big_slur (int dy, Real &dx, int dir)const;
-    Symbol text (String style, String text, int align = 1)const;
-    Symbol script (String idx)const;
-    Symbol hairpin (Real & width, bool decresc)const;
-    Symbol dynamic (String)const;
+    Symbol dots (int) const;
+    Symbol slur (int dy, Real &dx, int dir) const;
+    Symbol half_slur (int dy, Real &dx, int dir, int xpart) const;
+    Symbol half_slur_middlepart (Real &dx, int dir) const;
+    Symbol big_slur (int dy, Real &dx, int dir) const;
+    Symbol text (String style, String text, int align = 1) const;
+    Symbol script (String idx) const;
+    Symbol hairpin (Real & width, bool decresc) const;
+    Symbol dynamic (String) const;
     Lookup();
     Lookup (Lookup const &);
     ~Lookup();
     Lookup();
     Lookup (Lookup const &);
     ~Lookup();
index 9c1d72d820f4d8719979adb795919d1dabcd618b..e9e372f8ae11644c909093848751e8ca62e21e5f 100644 (file)
   generate meters. 
   */
 class Meter_engraver : public Engraver {
   generate meters. 
   */
 class Meter_engraver : public Engraver {
+protected:
+  virtual void do_process_requests();
+  virtual void do_pre_move_processing();
 public:
 public:
-    Time_description time_;
-    Rhythmic_grouping  default_grouping_;
-    
-    Meter_change_req * meter_req_l_;
-    Meter * meter_p_;
-    virtual void fill_staff_info (Staff_info&);
-    virtual bool do_try_request (Request *req_l);
-    virtual void do_process_requests();
-    virtual void do_pre_move_processing();
-    virtual void do_creation_processing();
-    virtual void do_post_move_processing();
-    Meter_engraver();
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  Meter * meter_p_;
+
+  Meter_engraver();
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 #endif // METERGRAV_HH
 };
 #endif // METERGRAV_HH
index bb96d961e897f50cc4aee9b1f7faaf61eae8ef62..115158dfdcd0cec62a0545452a65f0d5d3c66b09 100644 (file)
 #include "real.hh"
 #include "string.hh"
 #include "moment.hh"
 #include "real.hh"
 #include "string.hh"
 #include "moment.hh"
-
+#include "music-output-def.hh"
 
 /** 
   definitions for midi output. Rather empty
  */
 
 /** 
   definitions for midi output. Rather empty
  */
-struct Midi_def {
-    // ugh!
-    static int den_i_s;
-    static int num_i_s;
-
-    /// output file name
-    String outfile_str_;
-
-    Input_translator* itrans_p_;
-
-    /// duration of whole note
-    Real whole_seconds_f_;
-
-    Midi_def();
-    Midi_def (Midi_def const& midi_c_r);
-    ~Midi_def();
-
-    Real duration_to_seconds_f (Moment);
-    Global_translator* get_global_translator_p() const;
-    int get_tempo_i (Moment moment);
-    void print() const;
-    void set (Input_translator* itrans_p);
-    void set_tempo (Moment moment, int count_per_minute_i);
+class Midi_def : public Music_output_def {
+public:
+  // ugh!
+  static int den_i_s;
+  static int num_i_s;
+  VIRTUAL_COPY_CONS(Midi_def, Music_output_def);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Input_translator* itrans_p_;
+
+  /// duration of whole note
+  Real whole_seconds_f_;
+
+  Midi_def();
+  Midi_def (Midi_def const& midi_c_r);
+  ~Midi_def();
+
+  Real duration_to_seconds_f (Moment);
+  int get_tempo_i (Moment moment);
+  void print() const;
+  void set (Input_translator* itrans_p);
+  void set_tempo (Moment moment, int count_per_minute_i);
+protected:
+  virtual Global_translator * get_global_translator_p ();  
 };
 
 #endif // MIDI_DEF_HH
 };
 
 #endif // MIDI_DEF_HH
index 636fc659c9111a3d87a8eba96d9638b1462320e2..352af5f3799194511c3ee3d264712b604927ad22 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-  music-iterator.hh -- declare {Music,Chord,Voice}_iterator
+  music-iterator.hh -- declare Music_iterator
 
   source file of the GNU LilyPond music typesetter
 
 
   source file of the GNU LilyPond music typesetter
 
 #include "plist.hh"
 #include "varray.hh"
 #include "moment.hh"
 #include "plist.hh"
 #include "varray.hh"
 #include "moment.hh"
+#include "virtual-methods.hh"
 
 class Music_iterator {
 
 class Music_iterator {
-   Array<Translator *>report_to_l_arr_;
-   void push_translator (Translator*);
-    void pop_translator();
+  Array<Translator *>report_to_l_arr_;
+  void push_translator (Translator*);
+  void pop_translator();
 protected:
 protected:
-    bool first_b_;
-    virtual void do_print()const;
+  bool first_b_;
+  virtual void do_print() const;
     
     
-    virtual Translator * get_req_translator_l();
-    Music_iterator* get_iterator_p (Music*)const;
-    void set_translator (Translator*);
-    Music_iterator *daddy_iter_l_;
+  virtual Translator * get_req_translator_l();
+  Music_iterator* get_iterator_p (Music*) const;
+  void set_translator (Translator*);
+  Music_iterator *daddy_iter_l_;
     
 public:
     
 public:
-    Translator *report_to_l()const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  Translator *report_to_l() const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
  
  
-    static Music_iterator* static_get_iterator_p (Music*,Translator*);
-    Music_iterator();
+  static Music_iterator* static_get_iterator_p (Music*,Translator*);
+  Music_iterator();
     
     
-    virtual void process_and_next (Moment until);
-    virtual Moment next_moment()const;
-    virtual bool ok()const;
-    virtual ~Music_iterator();
-    virtual void construct_children();
-    void print()const;
-};
-
-
-class Chord_iterator : public Music_iterator
-{
-    const Chord *chord_C_;
-    Pointer_list<Music_iterator*> children_p_list_;
-public:
-    ~Chord_iterator();
-    Chord_iterator (Chord const*);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-protected:
-    virtual void do_print()const;
-    virtual void construct_children();
-    virtual void process_and_next (Moment);
-    virtual Moment next_moment()const;
-    virtual bool ok()const;
-};
-
-class Request_chord_iterator : public Music_iterator {
-    const Request_chord * elt_l_;
-    Moment elt_duration_;
-    bool last_b_;
-public:
-    Request_chord_iterator (Request_chord*);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-
-protected:
-    virtual void process_and_next (Moment);
-    virtual Moment next_moment()const;
-    virtual void construct_children();
-    virtual bool ok()const;
-    virtual void do_print()const;
-};
-
-
-class Voice_iterator :  private PCursor<Music*>, public Music_iterator
-{
-    Moment here_mom_;
-    const Voice * voice_C_;
-    Music_iterator * iter_p_;
-    void start_next_element();
-    void leave_element();
-    void set_voice_translator();
-    
-public:
-    Voice_iterator (Voice const*);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-protected:
-    virtual void do_print()const;
-    virtual void construct_children();
-    ~Voice_iterator();    
-    virtual void process_and_next (Moment);
-    virtual Moment next_moment()const;
-    virtual bool ok()const;
+  virtual void process_and_next (Moment until);
+  virtual Moment next_moment() const;
+  virtual bool ok() const;
+  virtual ~Music_iterator();
+  virtual void construct_children();
+  void print() const;
 };
 
 #endif // MUSIC_ITERATOR_HH
 };
 
 #endif // MUSIC_ITERATOR_HH
index 2ce9625999c963c0890d1f6e03ec1aadb5dfcebd..f084c19ecb00409deff1bd3a9f00193aea763053 100644 (file)
@@ -45,7 +45,7 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Chord,Music);
     virtual void translate (Moment dt);
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Chord,Music);
     virtual void translate (Moment dt);
-    virtual MInterval time_int()const;
+    virtual MInterval time_int() const;
 };
 
 /**
 };
 
 /**
@@ -71,7 +71,7 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Voice, Music);
     virtual void translate (Moment dt);
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Voice, Music);
     virtual void translate (Moment dt);
-    virtual MInterval time_int()const;
+    virtual MInterval time_int() const;
 };
 
 /** A simple piece of music, which wishes to change the spot of its
 };
 
 /** A simple piece of music, which wishes to change the spot of its
diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh
new file mode 100644 (file)
index 0000000..b0b8316
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  music-output-def.hh -- declare Music_output_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Music_output_DEF_HH
+#define Music_output_DEF_HH
+#include "string.hh"
+#include "lily-proto.hh"
+#include "virtual-methods.hh"
+
+/**
+  Definition of how to output mudela. 
+ */
+class Music_output_def  
+{
+public:
+  VIRTUAL_COPY_CONS(Music_output_def, Music_output_def);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual void print () const {}
+  virtual ~Music_output_def () {}
+  virtual Global_translator * get_global_translator_p () { return 0; }
+  String outfile_str_;
+};
+#endif // Music_output_DEF_HH
diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh
new file mode 100644 (file)
index 0000000..f777f1b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  music-output.hh -- declare Music_output
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Music_output_HH
+#define Music_output_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+
+/**
+  Output something that was defined in a mudela file. 
+ */
+class Music_output 
+{
+public:
+  Header * header_l_;
+  String default_out_str_;
+  String origin_str_;
+  int errorlevel_i_;
+
+  virtual void process() {} 
+  virtual ~Music_output (){}
+  Music_output() 
+  {
+    errorlevel_i_ = 0;
+  }
+       
+};
+#endif // Music_output_HH
index 5aec401462e5f8e8ef7f008d1a3edec941a579eb..a267fc04eb08e0341c3c67b45b1d949397924d6c 100644 (file)
@@ -42,7 +42,7 @@ public:
     /// what name (or look for this name)
     String id_str_;    
 
     /// what name (or look for this name)
     String id_str_;    
 
-    virtual MInterval time_int()const;
+    virtual MInterval time_int() const;
     virtual ~Music(){}
     void print() const;
     virtual void transpose (Melodic_req const *);
     virtual ~Music(){}
     void print() const;
     virtual void transpose (Melodic_req const *);
index 2346d1625ce86c65acbb35a7849bd663b8ac3ce2..64328afc97688b28d6875fc88c979f0a88d9e179 100644 (file)
 class Musical_req  : public virtual Request  {
 public:
     
 class Musical_req  : public virtual Request  {
 public:
     
-    virtual Lyric_req* lreq_l() { return 0; }
-    virtual Note_req *note() { return 0;}
-    virtual Stem_req *stem() { return 0;}
-    virtual Melodic_req *melodic() { return 0; }
-    virtual Slur_req *slur() { return 0 ; }
-    virtual Beam_req *beam() { return 0 ; }
-    virtual Rhythmic_req*rhythmic() { return 0; }
-    virtual Musical_script_req*musicalscript() { return 0; }
-    virtual Text_req*text() { return 0; }
-    virtual Rest_req *rest() { return 0; }
-    virtual Skip_req* skip() { return 0; }
-    virtual Dynamic_req* dynamic() { return 0; }
-    virtual Absolute_dynamic_req * absdynamic() { return 0; }
-    virtual Tie_req * tie() { return 0; }
-    virtual Span_dynamic_req * span_dynamic() { return 0; }
-    REQUESTMETHODS(Musical_req, musical);
+  virtual Lyric_req* lreq_l() { return 0; }
+  virtual Note_req *note() { return 0;}
+  virtual Stem_req *stem() { return 0;}
+  virtual Melodic_req *melodic() { return 0; }
+  virtual Slur_req *slur() { return 0 ; }
+  virtual Beam_req *beam() { return 0 ; }
+  virtual Rhythmic_req*rhythmic() { return 0; }
+  virtual Musical_script_req*musicalscript() { return 0; }
+  virtual Text_req*text() { return 0; }
+  virtual Rest_req *rest() { return 0; }
+  virtual Skip_req* skip() { return 0; }
+  virtual Dynamic_req* dynamic() { return 0; }
+  virtual Absolute_dynamic_req * absdynamic() { return 0; }
+  virtual Tie_req * tie() { return 0; }
+  virtual Span_dynamic_req * span_dynamic() { return 0; }
+  REQUESTMETHODS(Musical_req, musical);
 };
 
 
 };
 
 
@@ -47,50 +47,50 @@ public:
  */
 class Rhythmic_req  : public virtual Musical_req  {
 public:
  */
 class Rhythmic_req  : public virtual Musical_req  {
 public:
-    Duration duration_;
+  Duration duration_;
     
     
-    /* *************** */
-    void set_duration (Duration);
-    bool do_equal_b (Request*)const;
-    virtual Moment duration() const;
-    Rhythmic_req();
-    static int compare (Rhythmic_req const&,Rhythmic_req const&);
-    REQUESTMETHODS(Rhythmic_req, rhythmic);
+  /* *************** */
+  void set_duration (Duration);
+  bool do_equal_b (Request*) const;
+  virtual Moment duration() const;
+  Rhythmic_req();
+  static int compare (Rhythmic_req const&,Rhythmic_req const&);
+  REQUESTMETHODS(Rhythmic_req, rhythmic);
 };
 
 class Skip_req  : public Rhythmic_req  {
 public:
 };
 
 class Skip_req  : public Rhythmic_req  {
 public:
-    REQUESTMETHODS(Skip_req, skip);
+  REQUESTMETHODS(Skip_req, skip);
 };
 struct Spacing_req :virtual Request {
 };
 struct Spacing_req :virtual Request {
-    Moment next;
-    Real distance;
-    Real strength;
-    /* *************** */
-    Spacing_req();
-    REQUESTMETHODS(Spacing_req, spacing);
+  Moment next;
+  Real distance;
+  Real strength;
+  /* *************** */
+  Spacing_req();
+  REQUESTMETHODS(Spacing_req, spacing);
 };
 
 class Blank_req  : public Spacing_req, Rhythmic_req  {
 public:
 };
 
 class Blank_req  : public Spacing_req, Rhythmic_req  {
 public:
-    REQUESTMETHODS(Spacing_req, spacing);
+  REQUESTMETHODS(Spacing_req, spacing);
     
 };
 
 /// Put a text above or below (?) this staff.
 class Text_req  : public virtual Musical_req  {
 public:
     
 };
 
 /// Put a text above or below (?) this staff.
 class Text_req  : public virtual Musical_req  {
 public:
-    /// preferred position (above/below)
-    int dir_i_;
-    /// the characteristics of the text
-    Text_def *tdef_p_;
+  /// preferred position (above/below)
+  Direction dir_;
+  /// the characteristics of the text
+  Text_def *tdef_p_;
 
 
-    /* *************** */
-    Text_req (int d, Text_def*);
-    ~Text_req();
-    Text_req (Text_req const&);
+  /* *************** */
+  Text_req (int d, Text_def*);
+  ~Text_req();
+  Text_req (Text_req const&);
 
 
-    REQUESTMETHODS(Text_req,text);
+  REQUESTMETHODS(Text_req,text);
 };
 
 /** Put a text in lyric_staff
 };
 
 /** Put a text in lyric_staff
@@ -98,65 +98,55 @@ public:
   */
 class Lyric_req  : public  Rhythmic_req, public Text_req  {
 public:
   */
 class Lyric_req  : public  Rhythmic_req, public Text_req  {
 public:
-    Lyric_req (Text_def* t_p);
-    REQUESTMETHODS(Lyric_req, lreq_l);
+  Lyric_req (Text_def* t_p);
+  REQUESTMETHODS(Lyric_req, lreq_l);
 };
 
 /// request which has some kind of pitch
 struct Melodic_req :virtual Musical_req
 {
 };
 
 /// request which has some kind of pitch
 struct Melodic_req :virtual Musical_req
 {
-    /// 0 is c, 6 is b
-    int notename_i_;
-    /// 0 is central c
-    int octave_i_;
+  /// 0 is c, 6 is b
+  int notename_i_;
+  /// 0 is central c
+  int octave_i_;
 
     /// 0 natural, 1 sharp, etc
 
     /// 0 natural, 1 sharp, etc
-    int accidental_i_;
+  int accidental_i_;
 
 
-    /// return height from central c (in halflines)
-    int height()const;
+  /// return height from central c (in halflines)
+  int height() const;
 
 
-    /// transpose. #delta# is relative to central c.
-    void transpose (Melodic_req const &delta);
-    /// return pitch from central c (in halfnotes)
-    int pitch()const; 
-    Melodic_req();
-    bool do_equal_b (Request*)const;
-    static int compare (Melodic_req const&,Melodic_req const&);
-    REQUESTMETHODS(Melodic_req,melodic);
+  /// transpose. #delta# is relative to central c.
+  void transpose (Melodic_req const &delta);
+  /// return pitch from central c (in halfnotes)
+  int pitch() const; 
+  Melodic_req();
+  bool do_equal_b (Request*) const;
+  static int compare (Melodic_req const&,Melodic_req const&);
+  REQUESTMETHODS(Melodic_req,melodic);
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
 public:
     
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
 public:
     
-    /// force/supress printing of accidental.
-    bool forceacc_b_;
-    Note_req();
-    bool do_equal_b (Request*)const;
-    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic (); }
-    REQUESTMETHODS(Note_req, note);
- };
+  /// force/supress printing of accidental.
+  bool forceacc_b_;
+  Note_req();
+  bool do_equal_b (Request*) const;
+  Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic (); }
+  REQUESTMETHODS(Note_req, note);
+};
 
 /**
 Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
 */
 class Rest_req : public Rhythmic_req {
 public:
 
 /**
 Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
 */
 class Rest_req : public Rhythmic_req {
 public:
-    REQUESTMETHODS(Rest_req,rest);
+  REQUESTMETHODS(Rest_req,rest);
 };
 
 };
 
-/**
-  attach a stem to the noteball.
-  Rhythmic_req parent needed to  determine if it will fit inside a beam.
-  */
-class Stem_req  : public Rhythmic_req  {
-public:
-    /// preferred direction for the stem
-    int dir_i_;
-    Stem_req();
-    REQUESTMETHODS(Stem_req,stem);
-};
+
 
 /**
   Requests to start or stop something.
 
 /**
   Requests to start or stop something.
@@ -164,14 +154,14 @@ public:
 */
 class Span_req  : public virtual Musical_req  {
 public:
 */
 class Span_req  : public virtual Musical_req  {
 public:
-    /// should the spanner start or stop, or is it unwanted?
-    enum {
-       NOSPAN, START, STOP
-    } spantype ;
-    bool do_equal_b (Request*)const;
-    REQUESTMETHODS(Span_req,span);
+  /// should the spanner start or stop, or is it unwanted?
+  enum {
+    NOSPAN, START, STOP
+  } spantype ;
+  bool do_equal_b (Request*) const;
+  REQUESTMETHODS(Span_req,span);
 
 
-    Span_req();
+  Span_req();
   
 };
 
   
 };
 
@@ -179,12 +169,12 @@ public:
 will try to put an appropriate number over the beam */
 class Beam_req  : public Span_req  {
 public:
 will try to put an appropriate number over the beam */
 class Beam_req  : public Span_req  {
 public:
-    int nplet;
+  int nplet;
 
 
-    /* *************** */
-     REQUESTMETHODS(Beam_req,beam);
+  /* *************** */
+  REQUESTMETHODS(Beam_req,beam);
 
 
-    Beam_req();
+  Beam_req();
 };
 
 /**
 };
 
 /**
@@ -192,45 +182,45 @@ public:
  */
 class Tie_req : public Musical_req {
 public:
  */
 class Tie_req : public Musical_req {
 public:
-    REQUESTMETHODS(Tie_req, tie);
+  REQUESTMETHODS(Tie_req, tie);
 };
 
 /// a slur
 class Slur_req  : public Span_req  {
 public:
 };
 
 /// a slur
 class Slur_req  : public Span_req  {
 public:
- REQUESTMETHODS(Slur_req,slur);
 REQUESTMETHODS(Slur_req,slur);
 
 };
 
 class Musical_script_req : public Musical_req,  public Script_req {
 public:
 
 };
 
 class Musical_script_req : public Musical_req,  public Script_req {
 public:
-    REQUESTMETHODS(Musical_script_req, musicalscript);
+  REQUESTMETHODS(Musical_script_req, musicalscript);
 };
 
 
 class Dynamic_req  : public virtual Musical_req  {
 public:
 };
 
 
 class Dynamic_req  : public virtual Musical_req  {
 public:
-    /// for absolute dynamics
-    enum Loudness {
-       FFF, FF, F, MF, MP, P, PP, PPP
-    };
-    static String loudness_str (Loudness);
-    REQUESTMETHODS(Dynamic_req, dynamic);
+  /// for absolute dynamics
+  enum Loudness {
+    FFF, FF, F, MF, MP, P, PP, PPP
+  };
+  static String loudness_str (Loudness);
+  REQUESTMETHODS(Dynamic_req, dynamic);
 };
 
 class Absolute_dynamic_req  : public Dynamic_req  {
 public:
 };
 
 class Absolute_dynamic_req  : public Dynamic_req  {
 public:
-    Loudness loudness_;
-    Absolute_dynamic_req();
-    REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
+  Loudness loudness_;
+  Absolute_dynamic_req();
+  REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
 };
 
 class Span_dynamic_req  : public Dynamic_req, public Span_req  {
 public:
 };
 
 class Span_dynamic_req  : public Dynamic_req, public Span_req  {
 public:
-    /// Grow or shrink the volume: 1=cresc, -1 = decresc 
-    int dynamic_dir_i_;
-    Span_dynamic_req();
-    REQUESTMETHODS(Span_dynamic_req, span_dynamic);
+  /// Grow or shrink the volume: 1=cresc, -1 = decresc 
+  Direction dynamic_dir_;
+  Span_dynamic_req();
+  REQUESTMETHODS(Span_dynamic_req, span_dynamic);
 };
 
 #endif // MUSICALREQUESTS_HH
 };
 
 #endif // MUSICALREQUESTS_HH
index 766906c282e804c63052ed9a493222402c2ace8a..7930c9c7a27a8a7d6ba9476ab24cf74f3ccc86ba 100644 (file)
@@ -21,7 +21,7 @@
 #include "input.hh"
 
 class My_lily_parser {
 #include "input.hh"
 
 class My_lily_parser {
-  char const* here_ch_C()const;
+  char const* here_ch_C() const;
   Array<Input> define_spot_array_;
   String init_str_;
 
   Array<Input> define_spot_array_;
   String init_str_;
 
@@ -53,7 +53,7 @@ public:
  
   Moment plet_mom();
   void add_notename (String, Melodic_req* req_p);
  
   Moment plet_mom();
   void add_notename (String, Melodic_req* req_p);
-  Input here_input()const;
+  Input here_input() const;
   void remember_spot();
   Input pop_spot();
     
   void remember_spot();
   Input pop_spot();
     
index 43784776f9cae929c884131bf319c7151258d07a..9c68248eb12dea2bdbb6766752d16e91d7422117 100644 (file)
@@ -21,10 +21,10 @@ class Note_column_engraver :public Engraver {
     Note_column *ncol_p_;
     Rest_column *restcol_p_;
     bool h_shift_b_;
     Note_column *ncol_p_;
     Rest_column *restcol_p_;
     bool h_shift_b_;
-    int dir_i_;
+    Direction dir_;
     
 
     
 
-    bool acceptable_elem_b (Score_elem const*)const;
+    bool acceptable_elem_b (Score_elem const*) const;
 protected:
     virtual void set_feature (Feature);
     virtual void acknowledge_element (Score_elem_info);
 protected:
     virtual void set_feature (Feature);
     virtual void acknowledge_element (Score_elem_info);
index 3ee218ec125f2261857fcc04f0b95d0662c54762..3c2eb7568e60f084cae277416fb4bfd5794f95f5 100644 (file)
   (chord) and scripts) as a single entity.  */
 class Note_column : public Head_column {
 protected:
   (chord) and scripts) as a single entity.  */
 class Note_column : public Head_column {
 protected:
-    virtual void do_pre_processing();
+  virtual void do_pre_processing();
 
 public:
 
 public:
-    bool h_shift_b_;
+  bool h_shift_b_;
     
     
-    Interval_t<int> head_positions_interval()const;
+  Interval_t<int> head_positions_interval() const;
         
         
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Note_column();
-    virtual void set (Stem *);
-    void sort();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Note_column();
+  void sort();
 };
 
 #endif // NOTE_COLUMN_HH
 };
 
 #endif // NOTE_COLUMN_HH
index 6fab4812b5595d455cf9ef522863a546742a389b..c6826f2cfca729166ab2c27fd74d68c72d67f6e5 100644 (file)
@@ -33,7 +33,7 @@ public:
     int dots_i_;
     int balltype_i_;
     int dot_delta_y_i_;
     int dots_i_;
     int balltype_i_;
     int dot_delta_y_i_;
-    int x_dir_i_;
+    Direction x_dir_;
     
     /* *************** */
     
     
     /* *************** */
     
@@ -46,9 +46,9 @@ public:
     void set_dots();
     static int compare (Note_head * const &a, Note_head *const &b) ;
 protected:
     void set_dots();
     static int compare (Note_head * const &a, Note_head *const &b) ;
 protected:
-    virtual    void do_print()const;
+    virtual    void do_print() const;
     virtual void do_pre_processing();
     virtual void do_pre_processing();
-    virtual    Molecule* brew_molecule_p()const;
+    virtual    Molecule* brew_molecule_p() const;
 };
 #endif // NOTEHEAD_HH
 
 };
 #endif // NOTEHEAD_HH
 
index b4ed5478aca191551e681eacec20046790d8edc9..ea22500fd7b68fe5ba706be21dfe4ff1b98968ac 100644 (file)
 
 /// 2d vector 
 struct Offset {
 
 /// 2d vector 
 struct Offset {
-    Real coordinate_a_[NO_AXES];
+  Real coordinate_a_[NO_AXES];
     
     
-    Real &y() { return coordinate_a_[Y_AXIS]; }
-    Real &x() { return coordinate_a_[X_AXIS]; }
-    Real y()const { return coordinate_a_[Y_AXIS]; }
-    Real x()const { return coordinate_a_[X_AXIS]; }
+  Real &y() { return coordinate_a_[Y_AXIS]; }
+  Real &x() { return coordinate_a_[X_AXIS]; }
+  Real y() const { return coordinate_a_[Y_AXIS]; }
+  Real x() const { return coordinate_a_[X_AXIS]; }
     
     
-    Real &operator[](Axis i) {
-       return coordinate_a_[i];
-    }
-    Real operator[](Axis i) const{
-       return coordinate_a_[i];
-    }
+  Real &operator[](Axis i) {
+    return coordinate_a_[i];
+  }
+  Real operator[](Axis i) const{
+    return coordinate_a_[i];
+  }
     
     
-    Offset operator+=(Offset o) {
-       x()+=o.x ();
-       y()+=o.y ();
-       return *this;
-    }
-    Offset (Real ix , Real iy) {
-       x()=ix;
-       y()=iy;
-    }
-    Offset() {
-       x()=0.0;
-       y()=0.0;
-    }
+  Offset operator+=(Offset o) {
+    x()+=o.x ();
+    y()+=o.y ();
+    return *this;
+  }
+  Offset (Real ix , Real iy) {
+    x()=ix;
+    y()=iy;
+  }
+  Offset() {
+    x()=0.0;
+    y()=0.0;
+  }
 };
 
 inline Offset
 };
 
 inline Offset
-operator+(Offset o1, Offset const& o2)
+operator+ (Offset o1, Offset const& o2)
 {
 {
-    o1 += o2;
-    return o1;
+  o1 += o2;
+  return o1;
 }
     
 #endif // OFFSET_HH
 }
     
 #endif // OFFSET_HH
index 797fde9584ee671e33b0b019b3ebb7d11e4e44a6..c297bb78430b8a0ddc5cd718144c69601611f60a 100644 (file)
@@ -1,11 +1,17 @@
-#ifndef COLS_HH
-#define COLS_HH
+/*
+  p-col.hh -- declare  Paper_column
 
 
+  source file of the GNU LilyPond music typesetter
 
 
-#include "boxes.hh"
-#include "plist.hh"
-#include "item.hh"
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef P_COL_HH
+#define P_COL_HH
 
 
+#include "horizontal-group-item.hh"
+#include "plist.hh"
 
 /**
    stuff grouped vertically.
 
 /**
    stuff grouped vertically.
     \end{itemize}
   */
 
     \end{itemize}
   */
 
-class PCol { 
+class Paper_column : public Horizontal_group_item { 
 public:
 public:
-    Link_list<Item *> its;
-    Link_list<Spanner *> starters;
-    
-    /** prebreak is put before end of line.
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Paper_column);
+  
+  /** prebreak is put before end of line.
     if broken here, then (*this) column is discarded, and prebreak
     is put at end of line, owned by Col
     */
     if broken here, then (*this) column is discarded, and prebreak
     is put at end of line, owned by Col
     */
-    PCol *prebreak_p_;
+  Paper_column *prebreak_l() const;
 
 
-    /// postbreak at beginning of the new line
-    PCol *postbreak_p_;
-    
-    /** if this column is pre or postbreak, then this field points to
-     the parent.  */
-    PCol *daddy_l_;
+  /// postbreak at beginning of the new line
+  Paper_column *postbreak_l() const;
     
     
-    /// if lines are broken then this column is in #line#
-    Line_of_score *line_l_;
+  /// if lines are broken then this column is in #line#
+  Line_of_score *line_l_;
 
 
-    /** if lines are broken then this column x-coord #hpos# if not
-      known, then hpos == -1.(ugh?)  */
-
-    Real hpos_f_;                      // should use ptr?
-
-    bool error_mark_b_;
-    bool used_b_ ;             // manual override.. 
+  virtual Line_of_score *line_l () const;
+  bool error_mark_b_;
+  bool used_b_ ;               // manual override.. 
     
     
-    Paper_score * pscore_l_;
+  /* *************** */
 
 
-    /* *************** */
-    /// which  one (left =0)
-    int rank_i() const;
+  /// which  one (left =0)
+  int rank_i() const;
 
 
-    /// does this column have items
-    bool used_b() const;
-    bool breakpoint_b() const;
-    void clean_breakable_items();
+  /// does this column have items
+  bool used_b() const;
+  bool breakpoint_b() const;
     
     
-    void add (Item *i);
+  void add (Item *i);
 
 
-    /// Can this be broken? true eg. for bars. 
-    bool breakable_b()const;
-    
-    Interval width() const;
-    virtual ~PCol();
-    PCol();
+  Paper_column();
 
 
-    /**
-      which col comes first?.
-      signed compare on columns.
+  /**
+    which col comes first?.
+    signed compare on columns.
 
 
-      @return < 0 if c1 < c2.
+    @return < 0 if c1 < c2.
     */
     */
-    static int compare (const PCol &c1, const PCol &c2);
-    void set_rank (int);
+  static int compare (const Paper_column &c1, const Paper_column &c2);
+  void set_rank (int);
 
 
-    void OK() const;
-    void set_breakable();
-    virtual void do_set_breakable();
-    void print()const;
+  void OK() const;
+  virtual void do_print() const;
 private:
     
 private:
     
-    /**
-      The ranking: left is smaller than right 
-      -1 is uninitialised.
-     */
-    int rank_i_;
-    PCol (PCol const&){}
+  /**
+    The ranking: left is smaller than right 
+    -1 is uninitialised.
+    */
+  int rank_i_;
+
 };
 
 
 #include "compare.hh"
 };
 
 
 #include "compare.hh"
-INSTANTIATE_COMPARE(PCol &, PCol::compare);
+INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
      
      
+#endif // P_COL_HH
 
 
-#endif
index 7c497cd919d07e27f5d9b0570159a5e7b40b1fad..1ca1f30ac8971b7ffcc71fb5af1a4b927f7d275f 100644 (file)
 #include "parray.hh"
 #include "lily-proto.hh"
 #include "plist.hh"
 #include "parray.hh"
 #include "lily-proto.hh"
 #include "plist.hh"
+#include "music-output.hh"
 
 /** all stuff which goes onto paper. notes, signs, symbols in a score
      #Paper_score# contains the items, the columns.
     
     */
 
 
 /** all stuff which goes onto paper. notes, signs, symbols in a score
      #Paper_score# contains the items, the columns.
     
     */
 
-class Paper_score {
+class Paper_score : public Music_output {
 public:
 public:
-    Paper_def *paper_l_;
+  Paper_def *paper_l_;
 
 
-    /// the columns, ordered left to right
-    Pointer_list<PCol *> col_p_list_;
+  /// the columns, ordered left to right
+  Link_list<Paper_column *> col_p_list_;
 
 
-    /// the idealspacings, no particular order
-    Pointer_list<Idealspacing*> suz_p_list_;
+  /// crescs etc; no particular order
+  Pointer_list<Spanner *> span_p_list_;
 
 
-    /// crescs etc; no particular order
-    Pointer_list<Spanner *> span_p_list_;
-
-    /// other elements
-    Pointer_list<Score_elem*> elem_p_list_;
-    
-    Super_elem *super_elem_l_;
-
-    /* *************** */
-    /* CONSTRUCTION */
+  /// other elements
+  Pointer_list<Score_elem*> elem_p_list_;
     
     
-    Paper_score (Paper_def*);
-    /// add a line to the broken stuff. Positions given in #config#
-    void set_breaking (Array<Col_hpositions> const &);
-
-    /** add an item.
-       add the item in specified containers. If breakstatus is set
-       properly, add it to the {pre,post}break of the pcol.
-       */
-    void typeset_item (Item *item_p,  PCol *pcol_l);
-
-    /// add to bottom of pcols
-    void add (PCol*);
-
-    /**
-      @return argument as a cursor of the list
-      */
-    PCursor<PCol *> find_col (PCol const *)const;
-
-    Link_array<PCol> col_range (PCol *left_l, PCol *right_l) const;
-    Link_array<PCol> breakable_col_range (PCol*,PCol*) const;
-    Link_array<PCol> broken_col_range (PCol*,PCol*) const;
+  Super_elem *super_elem_l_;
     
     
-    /* MAIN ROUTINES */
-    void process();
+  Paper_score ();
+  /// add a line to the broken stuff. Positions given in #config#
+  void set_breaking (Array<Col_hpositions> const &);
 
 
-    /// last deed of this struct
-    void output (Tex_stream &ts);
 
 
-    /* UTILITY ROUTINES */
+  /// add to bottom of pcols
+  void add_column (Paper_column*);
 
 
+  /**
+    @return argument as a cursor of the list
+    */
+  PCursor<Paper_column *> find_col (Paper_column const *) const;
+
+  Link_array<Paper_column> col_range (Paper_column *left_l, Paper_column *right_l) const;
+  Link_array<Paper_column> breakable_col_range (Paper_column*,Paper_column*) const;
+  Link_array<Item> broken_col_range (Item const*,Item const*) const;
+    
     
     
-    /* STANDARD ROUTINES */
-    void OK()const;
-    void print() const;
-    ~Paper_score();
-    void typeset_element (Score_elem*);
-    void typeset_broken_spanner (Spanner*);
-    /// add a Spanner
-    void typeset_unbroken_spanner (Spanner*);
+  /* STANDARD ROUTINES */
+  void OK() const;
+  void print() const;
+  
+  void typeset_element (Score_elem*);
+  void typeset_broken_spanner (Spanner*);
+  /// add a Spanner
+  void typeset_unbroken_spanner (Spanner*);
  
     
  
     
+protected:
+    /* MAIN ROUTINES */
+  virtual void process();
+  virtual ~Paper_score();
+
 private:
 private:
-    /// before calc_breaking
-    void preprocess();
+  /// before calc_breaking
+  void preprocess();
 
 
-    void calc_idealspacing();
-    /// calculate where the lines are to be broken, and use results
-    void calc_breaking();
+  void calc_idealspacing();
+  /// calculate where the lines are to be broken, and use results
+  void calc_breaking();
 
 
-    /// after calc_breaking
-    void postprocess();
+  /// after calc_breaking
+  void postprocess();
     
     
-    /// delete unused columns
-    void clean_cols();
+  /// delete unused columns
+  void clean_cols();
 };
 
 #endif
 };
 
 #endif
index 41b8e2d38e8d5c5464a9df9e7b40a1a1fec69d99..2210b2f4c2eb697d5a7dfb6f78e456e0b1483109 100644 (file)
@@ -12,9 +12,9 @@
 #include "lily-proto.hh"
 
 #include "real.hh"
 #include "lily-proto.hh"
 
 #include "real.hh"
-#include "string.hh"
-#include "moment.hh"
 
 
+#include "moment.hh"
+#include "music-output-def.hh"
 
 /** 
 
 
 /** 
 
   TODO: 
   
   add support for multiple fontsizes 
   TODO: 
   
   add support for multiple fontsizes 
-  split into "Input_paper_def" and Paper_def
 
   add support for other len->wid conversions.
 
   Input_engraver should be in here.
  */
 
   add support for other len->wid conversions.
 
   Input_engraver should be in here.
  */
-class Paper_def {
-    Lookup *lookup_p_;
-    Assoc<String, Real> *real_vars_p_;
-
-    Input_translator * itrans_p_;
+class Paper_def : public Music_output_def {
+  Lookup *lookup_p_;
+  Assoc<String, Real> *real_vars_p_;
+
+  Input_translator * itrans_p_;
+protected:
+  virtual  Global_translator * get_global_translator_p();
+  VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
+  DECLARE_MY_RUNTIME_TYPEINFO;
 public:    
 public:    
-    String outfile_str_;
-    
-    
-    /* *************** */
-    void set_var (String, Real);
-    Real get_var (String)const;
-    void reinit();
-    Paper_def();
-    void set (Lookup*);
-    void set (Input_translator *);
-    Global_translator * get_global_translator_p()const;
-    ~Paper_def();
-    Paper_def (Paper_def const&);
-    /// The distance between beams
-    Real interbeam_f()const;
-    /**
-      The distance between lines
-     */
-    Real interline_f()const;
-    /// half the distance between lines
-    Real internote_f()const;
-
-    /// thickness of the standard line 
-    Real rule_thickness()const;
-    Real whole_width()const;
-    Real linewidth_f()const;
-    /// height of the staff
-    Real standard_height()const;
-
-    /// width of a crotchet ball
-    Real note_width() const;
-    void print() const;
-
-    Lookup const * lookup_l(); // TODO naming
-
-    /** convert a duration to an idealspacing
-      influence using the geometric_ and  parameters.
-      */
-    Real duration_to_dist (Moment, Real)const;
-  Real geometric_spacing(Moment)const;
-  Real arithmetic_constant(Moment minimal_mom)const;
-  Real arithmetic_spacing( Moment mom,Real constant)const;
+  virtual ~Paper_def();
+
+  void set_var (String, Real);
+  Real get_var (String) const;
+  void reinit();
+  Paper_def();
+  void set (Lookup*);
+  void set (Input_translator *);
+
+  Paper_def (Paper_def const&);
+  /// The distance between beams
+  Real interbeam_f() const;
+  /**
+    The distance between lines
+    */
+  Real interline_f() const;
+  /// half the distance between lines
+  Real internote_f() const;
+
+  /// thickness of the standard line 
+  Real rule_thickness() const;
+  Real whole_width() const;
+  Real linewidth_f() const;
+  /// height of the staff
+  Real standard_height() const;
+
+  /// width of a crotchet ball
+  Real note_width() const;
+  void print() const;
+
+  Lookup const * lookup_l();   // TODO naming
+
+  /** convert a duration to an idealspacing
+    influence using the geometric_ and  parameters.
+    */
+  Real duration_to_dist (Moment, Real) const;
+  Real geometric_spacing(Moment) const;
+  Real arithmetic_constant(Moment minimal_mom) const;
+  Real arithmetic_spacing( Moment mom,Real constant) const;
 };
 
 #endif // Paper_def_HH
 };
 
 #endif // Paper_def_HH
index 5c640cc6365a5133fee89cce747325a0b1ae0b59..e06dd3b017864370a9a91c253a62df7621fc0a18 100644 (file)
@@ -43,7 +43,7 @@ protected:
 
     bool is_bottom_performer_b() const;
     virtual Performer_group_performer* find_performer_l (String name, String id);
 
     bool is_bottom_performer_b() const;
     virtual Performer_group_performer* find_performer_l (String name, String id);
-    virtual void do_print()const;
+    virtual void do_print() const;
 
 private:
     Pointer_list<Performer*> perf_p_list_;
 
 private:
     Pointer_list<Performer*> perf_p_list_;
index 3ef601188a110a3ab0140288448b6123ada5a0cf..9098a0223888245c8fa0b0397f8fe966b573dd33 100644 (file)
@@ -35,7 +35,7 @@ class Active_constraints {
     Ineq_constrained_qp const *opt;
 
 public:
     Ineq_constrained_qp const *opt;
 
 public:
-    String status()const;
+    String status() const;
     
     Vector vec (int k) const { return opt->cons[k]; }
     Real rhs (int k) const { return opt->consrhs[k]; }
     
     Vector vec (int k) const { return opt->cons[k]; }
     Real rhs (int k) const { return opt->consrhs[k]; }
diff --git a/lily/include/request-iterator.hh b/lily/include/request-iterator.hh
new file mode 100644 (file)
index 0000000..866bb7e
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  request-iter.hh -- declare Request_chord_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REQUEST_ITER_HH
+#define REQUEST_ITER_HH
+
+#include "music-iterator.hh"
+
+class Request_chord_iterator : public Music_iterator {
+  const Request_chord * elt_l_;
+  Moment elt_duration_;
+  bool last_b_;
+public:
+  Request_chord_iterator (Request_chord*);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+
+protected:
+  virtual void process_and_next (Moment);
+  virtual Moment next_moment() const;
+  virtual void construct_children();
+  virtual bool ok() const;
+  virtual void do_print() const;
+};
+
+
+#endif // REQUEST_ITER_HH
index 3dc1eb9ba22d06171611b95b7fbd73a715a52fc0..e93f493176cc8f08f78c8888bc47a8acf92269b7 100644 (file)
@@ -15,6 +15,7 @@
 #include "virtual-methods.hh"
 #include "input.hh"
 #include "music.hh"
 #include "virtual-methods.hh"
 #include "input.hh"
 #include "music.hh"
+#include "direction.hh"
 
 /**
  a voice element wants something printed.
 
 /**
  a voice element wants something printed.
@@ -49,7 +50,7 @@ public:
     bool equal_b (Request*) const;
 protected:
     virtual bool do_equal_b (Request*) const;
     bool equal_b (Request*) const;
 protected:
     virtual bool do_equal_b (Request*) const;
-    virtual void do_print()const;
+    virtual void do_print() const;
 };
 
 #define REQUESTMETHODS(T,accessor)     \
 };
 
 #define REQUESTMETHODS(T,accessor)     \
@@ -65,11 +66,11 @@ virtual void do_print() const
   this also a request */
 class Script_req  : public virtual Request { 
 public:
   this also a request */
 class Script_req  : public virtual Request { 
 public:
-    int dir_i_;
+    Direction dir_;
     General_script_def *scriptdef_p_;
 
     /* *************** */
     General_script_def *scriptdef_p_;
 
     /* *************** */
-    bool do_equal_b (Request*)const;
+    bool do_equal_b (Request*) const;
 
     Script_req();
     REQUESTMETHODS(Script_req,script);
 
     Script_req();
     REQUESTMETHODS(Script_req,script);
index 0e19baa4611fa24048483e12280aa5d4e54e5d99..699c84a280786d30413c5732f01a4e3f307dd357 100644 (file)
 
   */
 
 
   */
 
-class Score_column : public PCol {
+class Score_column : public Paper_column {
     friend class Score;
     friend class Score_engraver;
 
     bool musical_b_;
     Moment when_;
 public:
     friend class Score;
     friend class Score_engraver;
 
     bool musical_b_;
     Moment when_;
 public:
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Score_column);
     /// length of notes/rests in this column
     Array<Moment> durations;
     
     /// length of notes/rests in this column
     Array<Moment> durations;
     
@@ -42,8 +44,7 @@ public:
     void add_duration (Moment);
     void preprocess();
     bool musical_b() { return musical_b_; }
     void add_duration (Moment);
     void preprocess();
     bool musical_b() { return musical_b_; }
-    void print() const;
-    virtual void do_set_breakable();
+    void do_print() const;
 
 
 };
 
 
 };
index 7e7259f6a25320b1fb9549e0c6b4232b56852c9b..c67510040a249734fbff950c30693712acedbf83 100644 (file)
   (elem) */
 class Score_elem : private Directed_graph_node {
 
   (elem) */
 class Score_elem : private Directed_graph_node {
 
-    /// member: the symbols
-    Molecule *output;          // should scrap, and use temp var?
-
-
-
-    /**
-      for administration of what was done already
-     */
-    enum Status {
-       ORPHAN,                 // not yet added to pstaff
-       VIRGIN,                 // added to pstaff
-       PREBREAKING,
-       PREBROKEN,
-       PRECALCING,
-       PRECALCED,              // calcs before spacing done
-       BREAKING,
-       BROKEN,
-       POSTCALCING,            // busy calculating. This is used to trap cyclic deps.
-       POSTCALCED,             // after spacing calcs done
-       OUTPUT,                 // molecule has been output
-       DELMARKED,              // mark for 'unclean' deletion
-       DELETED,                // to catch malloc mistakes.
-    };
+  /// member: the symbols
+  Molecule *output;            // should scrap, and use temp var?
+
+
+
+  /**
+    for administration of what was done already
+    */
+  enum Status {
+    ORPHAN,                    // not yet added to pstaff
+    VIRGIN,                    // added to pstaff
+    PREBREAKING,
+    PREBROKEN,
+    PRECALCING,
+    PRECALCED,         // calcs before spacing done
+    BREAKING,
+    BROKEN,
+    POSTCALCING,               // busy calculating. This is used to trap cyclic deps.
+    POSTCALCED,                // after spacing calcs done
+    BREWED,
+    TEXOUTPUT,                 // molecule has been output
+    DELETED,           // to catch malloc mistakes.
+  };
     
     
-    Status status_;
+  Status status_;
 
 
-    Score_elem* dependency (int) const;
-    Score_elem* dependent (int) const;
-    int dependent_size() const;
-    int dependency_size() const;
+  Score_elem* dependency (int) const;
+  Score_elem* dependent (int) const;
+  int dependent_size() const;
+  int dependency_size() const;
 public:
 public:
-    /**
-      This is  needed, because #output# may still be
-      NULL.
-      */
-    Offset offset_;
+  /**
+    This is  needed, because #output# may still be
+    NULL.
+    */
+  Offset offset_;
 
 
 
 
 
 
 
 
-    Paper_score *pscore_l_;    
-    Axis_group_element * axis_group_l_a_[2];
+  Paper_score *pscore_l_;    
+  Axis_group_element * axis_group_l_a_[NO_AXES];
 
 
-    Score_elem (Score_elem const&);
-    virtual String TeX_string() const ;
-    String TeX_string_without_offset (Offset)const;
+  Score_elem (Score_elem const&);
+  virtual String TeX_output_str () const ;
     virtual void print() const;
     
     virtual void print() const;
     
-    Paper_def *paper() const;
+  Paper_def *paper() const;
 
 
-    virtual ~Score_elem();
-    Score_elem();
-    DECLARE_MY_RUNTIME_TYPEINFO;    
+  virtual ~Score_elem();
+  Score_elem();
+  DECLARE_MY_RUNTIME_TYPEINFO;    
     
     
-    Interval extent (Axis)const;
-    Interval width() const;
-    Interval height() const;
-    Status status() const;
+  Interval extent (Axis) const;
+  Interval width() const;
+  Interval height() const;
+  Status status() const;
     
     
-     /**
-      translate the symbol. The symbol does not have to be created yet. 
-      */
-    void translate (Offset);
-    /**
-      translate in one direction
-     */
+  /**
+    translate the symbol. The symbol does not have to be created yet. 
+    */
+  void translate (Offset);
+  /**
+    translate in one direction
+    */
     
     
-    void translate (Real, Axis);
-    Real relative_coordinate (Axis_group_element*, Axis)const;
-    Offset absolute_offset()const;
-    Real absolute_coordinate (Axis)const;
-    Axis_group_element*common_group (Score_elem const* s, Axis a)const;
-
-    void add_processing();
-    void OK() const;
-    void pre_processing();
-    void breakable_col_processing();
-    void break_processing();
+  void translate (Real, Axis);
+  Real relative_coordinate (Axis_group_element*, Axis) const;
+  Offset absolute_offset() const;
+  Real absolute_coordinate (Axis) const;
+  Axis_group_element*common_group (Score_elem const* s, Axis a) const;
+
+  void add_processing();
+  void OK() const;
+  void pre_processing();
+  void breakable_col_processing();
+  void break_processing();
     
     
-    void post_processing();
-    void molecule_processing();
-
-    /**
-      Remove all  links (dependencies, dependents, Axis_group_elements.
-     */
-    void unlink();
-    void unlink_all();
-    void substitute_dependency (Score_elem*,Score_elem*);
-    void remove_dependency (Score_elem*);
-    /**
-      add a dependency. It may be the 0 pointer, in which case, it is ignored.
-     */
-    void add_dependency (Score_elem*);    
-    void copy_dependencies (Score_elem const&);
-    /**
-      junk the dependency array. Don't do derived stuff.
-     */
-    void junk_dependencies();
-    
-
-    /*
-      virtual accessors
-     */
-
-    virtual Spanner* spanner()  { return 0; }
-    virtual Item * item() { return 0; }
-    virtual Line_of_score * line_l() const;
-    SCORE_ELEM_CLONE(Score_elem);
+  void post_processing();
+  void molecule_processing();
+
+  /**
+    Remove all  links (dependencies, dependents, Axis_group_elements.
+    */
+  void unlink();
+  void unlink_all();
+  void substitute_dependency (Score_elem*,Score_elem*);
+  void remove_dependency (Score_elem*);
+  /**
+    add a dependency. It may be the 0 pointer, in which case, it is ignored.
+    */
+  void add_dependency (Score_elem*);    
+
+  /*
+    virtual accessors
+    */
+
+  virtual Spanner* spanner()  { return 0; }
+  virtual Item * item() { return 0; }
+  virtual Line_of_score * line_l() const;
+  virtual bool linked_b() const;
+  SCORE_ELEM_CLONE(Score_elem);
  
  
-    /// no dimension, translation is noop
-    bool empty_b_;
-    /// do not print anything black
-    bool transparent_b_;
+  /// no dimension, translation is noop
+  bool empty_b_;
+  /// do not print anything black
+  bool transparent_b_;
 protected:
 
 protected:
 
-    virtual  Interval do_height()const;
-    virtual Interval do_width()const;
+  virtual Interval do_height() const;
+  virtual Interval do_width() const;
     
     
-    /// do printing of derived info.
-    virtual void do_print() const {}
-    /// generate the molecule    
-    virtual Molecule* brew_molecule_p()const;
-    ///executed directly after the item is added to the Paper_score
-    virtual void do_add_processing();
-    /// do calculations before determining horizontal spacing
-    virtual void do_pre_processing();
-
-    virtual void do_breakable_col_processing();
-    /// do calculations after determining horizontal spacing
-    virtual void do_post_processing();
+  /// do printing of derived info.
+  virtual void do_print() const {}
+  /// generate the molecule    
+  virtual Molecule* brew_molecule_p() const;
+  ///executed directly after the item is added to the Paper_score
+  virtual void do_add_processing();
+  /// do calculations before determining horizontal spacing
+  virtual void do_pre_processing();
+
+  virtual void do_breakable_col_processing();
+  /// do calculations after determining horizontal spacing
+  virtual void do_post_processing();
+  virtual String do_TeX_output_str () const;
     
     
-    virtual void do_substitute_dependency (Score_elem * , Score_elem *);
-    virtual void do_substitute_dependent (Score_elem *, Score_elem *);
-    virtual void do_break_processing();
-    virtual void handle_broken_dependencies();
-    virtual void handle_prebroken_dependencies();
-    virtual Link_array<Score_elem> get_extra_dependencies()const;
-    virtual void do_unlink();
+  virtual void do_substitute_dependency (Score_elem * , Score_elem *);
+  virtual void do_substitute_dependent (Score_elem *, Score_elem *);
+  virtual void do_break_processing();
+  virtual void handle_broken_dependencies();
+  virtual void handle_prebroken_dependencies();
+  virtual Link_array<Score_elem> get_extra_dependencies() const;
+  virtual void do_unlink();
+  virtual void do_junk_links();
+  String make_TeX_string (Offset) const;
 };
 
 
 };
 
 
index 5cb3936bb5118ef03211ac643c2a0db201420cc0..6328c9bd26f9a8c4b6482123ef4ceee67cc840be 100644 (file)
   Top level engraver. Puts elements into appropriate columns.
  */
 class Score_engraver : 
   Top level engraver. Puts elements into appropriate columns.
  */
 class Score_engraver : 
-    public Engraver_group_engraver, public Global_translator 
+  public Engraver_group_engraver, public Global_translator 
 {
 {
-    Line_of_score * scoreline_l_;
-    bool disallow_break_b_;
-    int breaks_i_;
+  Line_of_score * scoreline_l_;
+  bool disallow_break_b_;
+  int breaks_i_;
 
 
+  Link_array<Score_elem> elem_p_arr_;
     
     
-    Array<Item*> nobreak_item_p_arr_;
-    Link_array<Score_elem> musical_item_p_arr_;
+  Score_column* command_column_l_;
+  Score_column* musical_column_l_;
     
     
-    Score_column* command_column_l_;
-    Score_column* musical_column_l_;
-    
-    friend class Score;
-    void set_columns (Score_column*,Score_column*);
-    void typeset_all();
+  void set_columns (Score_column*,Score_column*);
+  void typeset_all();
     
 public:
     
 public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-
-    Score_engraver();
+  Paper_score * pscore_p_;
+  DECLARE_MY_RUNTIME_TYPEINFO;
 
 
+  Score_engraver();
+  virtual Music_output *get_output_p ();  
 protected:   
 protected:   
-    /* Global_translator interface */
-    virtual void set_score (Score * score_l);
-    virtual void prepare (Moment);
-    virtual void finish();
-    virtual void process();
-    virtual int depth_i() const { return Global_translator::depth_i ();}
-    virtual Translator* ancestor_l (int l) { return Global_translator::ancestor_l (l);}
+  virtual void prepare (Moment);
+  virtual void finish();
+  virtual void process();
+  virtual int depth_i() const { return Global_translator::depth_i ();}
+  virtual Translator* ancestor_l (int l) { return Global_translator::ancestor_l (l);}
 
 protected:
 
 protected:
-    /* Engraver_group_engraver interface */
-    virtual Staff_info get_staff_info()const;
-    virtual bool do_try_request (Request*);
-    virtual void do_creation_processing();
-    virtual void do_removal_processing();
-    virtual void announce_element (Score_elem_info);
-    virtual void do_announces();
-    virtual void typeset_element (Score_elem*elem_p);
-    virtual Paper_def * paper() const;
-    virtual void do_pre_move_processing();
+  /* Engraver_group_engraver interface */
+  virtual Staff_info get_staff_info() const;
+  virtual bool do_try_request (Request*);
+  virtual void do_creation_processing();
+  virtual void do_removal_processing();
+  virtual void announce_element (Score_elem_info);
+  virtual void do_announces();
+  virtual void typeset_element (Score_elem*elem_p);
+  virtual Paper_def * paper() const;
+  virtual void do_pre_move_processing();
 };
 
 #endif // SCORE_GRAV_HH
 };
 
 #endif // SCORE_GRAV_HH
index 1a56148425cb3c971313ece2bd041ecfa007628e..2638962d83d726793790329fc17e76ce759276e5 100644 (file)
   Top level performer. Completely takes care of MIDI output
  */
 class Score_performer: 
   Top level performer. Completely takes care of MIDI output
  */
 class Score_performer: 
-    public Performer_group_performer, public Global_translator 
+  public Performer_group_performer, public Global_translator 
 {
 public:
 {
 public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Score_performer();
-    ~Score_performer();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Score_performer();
+  ~Score_performer();
+  Audio_score *performance_p_;
 
 protected:
 
 protected:
-    virtual Translator* ancestor_l (int l);
-    virtual int depth_i() const;
-
-    virtual void finish();
-    virtual void prepare (Moment mom);
-    virtual void process();
-    virtual void set_score (Score* score_l);
-    virtual void start();
-    virtual int get_tempo_i() const;
-    virtual void play (Audio_element* p);
-
+  virtual Translator* ancestor_l (int l);
+  virtual int depth_i() const;
+
+  virtual void finish();
+  virtual void prepare (Moment mom);
+  virtual void process();
+  virtual void start();
+  virtual int get_tempo_i() const;
+  virtual void play (Audio_element* p);
+  virtual Music_output *get_output_p ();
 private:
 private:
-    void header (Midi_stream&);
+  void header (Midi_stream&);
 
 
-    Moment now_mom_;
-    Audio_column* audio_column_l_;
+  Moment now_mom_;
+  Audio_column* audio_column_l_;
 };
 
 #endif // SCORE_PERFORMER_HH
 };
 
 #endif // SCORE_PERFORMER_HH
index aa2501d9c22a6949fbc8f0dfd33f42268beee119..8d9666b0c5542381abb86f8f03fa25c0783cd902 100644 (file)
 #include "varray.hh"
 #include "lily-proto.hh"
 #include "plist.hh"
 #include "varray.hh"
 #include "lily-proto.hh"
 #include "plist.hh"
-#include "moment.hh"
-#include "assoc.hh"
 #include "string.hh"
 #include "input.hh"
 #include "lily-proto.hh"
 #include "string.hh"
 #include "input.hh"
 #include "lily-proto.hh"
+#include "parray.hh"
 
 /// the total music def of one movement
 class Score: public Input {
 public:
 
 /// the total music def of one movement
 class Score: public Input {
 public:
-    /// paper_, staffs_ and commands_ form the problem definition.
-    Paper_def *paper_p_;
-    Midi_def *midi_p_;
-    Music * music_p_;
-    Paper_score *pscore_p_;
-    Audio_score* audio_score_p_;
-    Header * header_p_;
+  /// paper_, staffs_ and commands_ form the problem definition.
+  Link_array<Music_output_def> def_p_arr_;
+  Music * music_p_;
+  Header * header_p_;
 
 
-    int errorlevel_i_;
+  int errorlevel_i_;
     
     
-    /* *************************************************************** */
-
-    /// construction
-    Score();
-    Score (Score const&);
-    ~Score();    
-
-    /// do everything except outputting to file
-    void process();
-    
-    /// output to file
-    void output (String fn);
-
-    ///
-    void set (Midi_def* midi_p);
-    ///
-    void set (Paper_def* midi_p);
-
-    void print() const;
-
+  /// construction
+  Score();
+  Score (Score const&);
+  ~Score();    
+
+  void process();
+  void add (Music_output_def *def_p);
+  void print() const;
 private:
 private:
-    void run_translator (Global_translator*);
-    void midi_output();
-    void paper_output();
-
-    /// do midi stuff
-    void midi();
-
-    /// do paper stuff
-    void paper();
-
-    // utils:
-    PCursor<Score_column*> create_cols (Moment, PCursor<Score_column*> &last);
-
-    /**
-      make the pcol_l_ fields of each Score_column point to the correct PCol,
-      remove any unnecessary Score_column's
-     */
-    void do_cols();
-
-    /// remove unused cols
-    void clean_cols();
-    
-    /// add #Idealspacings# to #pscore_#
-    void calc_idealspacing();
+  void run_translator (Music_output_def*);
 };
 };
+
 #endif
 #endif
index 9b9cf7d33f5f275c85c581eb49cd8b4527101f28..fc1cac844e563988edcf04bec2b116a402190867 100644 (file)
@@ -8,31 +8,33 @@
 #define SCORELINE_HH
 
 #include "colhpos.hh"
 #define SCORELINE_HH
 
 #include "colhpos.hh"
-#include "spanner-elem-group.hh"
+#include "spanner.hh"
 
 /// the columns of a score that form one line.
 
 /// the columns of a score that form one line.
-class Line_of_score : public Spanner{
+class Line_of_score : public Spanner 
+{
 public:
 public:
-    Link_array<PCol> cols;
-    bool error_mark_b_;
-    virtual String TeX_string() const;    
+  Link_array<Paper_column> cols;
+  bool error_mark_b_;
+  virtual String TeX_output_str () const;    
     
     
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Line_of_score();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Line_of_score();
     
     
-    void add (Score_elem *);
+  void add (Score_elem *);
 
 
-    /// is #c# contained in #*this#?
-    bool contains_b (PCol const *c)const;
+  /// is #c# contained in #*this#?
+  bool contains_b (Paper_column const *c) const;
     
     
-    Link_array<Line_of_score> get_lines()const;
-    void set_breaking (Array<Col_hpositions> const&);
+  Link_array<Line_of_score> get_lines() const;
+  void set_breaking (Array<Col_hpositions> const&);
 
 protected:
 
 protected:
-    virtual void break_into_pieces (bool);
-    virtual Interval do_width()const;
-    virtual void do_print() const;
-    SCORE_ELEM_CLONE(Line_of_score);
+  virtual void do_breakable_col_processing ();
+  virtual void break_into_pieces (bool);
+  virtual Interval do_width() const;
+  virtual void do_print() const;
+  SCORE_ELEM_CLONE(Line_of_score);
 };
 
 #endif
 };
 
 #endif
index 1dd72b7ec7eeec4df0d00c8443e57eea98e1ee3e..ac5bf63561e51530b9dda5ba3db10eb2f81c5071 100644 (file)
 /** The characteristics of a certain kind of accent. It is not the
   accent itself.  */
 class Script_def : public General_script_def {
 /** The characteristics of a certain kind of accent. It is not the
   accent itself.  */
 class Script_def : public General_script_def {
-    /// invert if below staff?
-    bool invertsym_b_;
-    String symidx_str_;
+  /// invert if below staff?
+  bool invertsym_b_;
+  String symidx_str_;
     
 
     
 
-    /// on the other side of the stem?
-    int rel_stem_dir_i_;
+  /// on the other side of the stem?
+  Direction rel_stem_dir_;
 
 
-    /// below or above staff?
-    int staff_dir_i_;
+  /// below or above staff?
+  Direction staff_dir_;
 
 
-    /// how close to the note do we want to be?
-    int priority_i_;
+  /// how close to the note do we want to be?
+  int priority_i_;
     
     
-    /// follow the ball inside staff?
-    bool inside_staff_b_;
+  /// follow the ball inside staff?
+  bool inside_staff_b_;
 
 public:
 
 public:
-    virtual int staff_dir_i()const;
-    virtual int rel_stem_dir_i()const;
-    virtual int priority_i()const;
-    virtual bool inside_b()const;
-    virtual Atom get_atom (Paper_def* p, int dir_i_)const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
-
-    virtual bool do_equal_b (General_script_def const *)const;
-    virtual void do_print() const;
-    Script_def();
-    void set_from_input (String, bool, int, int ,bool,int);
+  virtual Direction staff_dir() const;
+  virtual Direction rel_stem_dir() const;
+  virtual int priority_i() const;
+  virtual bool inside_b() const;
+  virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
+
+  virtual bool do_equal_b (General_script_def const *) const;
+  virtual void do_print() const;
+  Script_def();
+  void set_from_input (String, bool, int, int ,bool,int);
 protected:
 protected:
-    VIRTUAL_COPY_CONS(Script_def,General_script_def);
+  VIRTUAL_COPY_CONS(Script_def,General_script_def);
 
 };
 
 
 };
 
index c15eae63302a084a5df6a7274a9b48ce21ca06ab..35a945af5a8665ed0154619881e91d69f9afe34a 100644 (file)
@@ -18,10 +18,10 @@ class Script : public Item, public Staff_side {
     Stem *stem_l_;
 
 protected:
     Stem *stem_l_;
 
 protected:
-    Molecule *brew_molecule_p()const;
+    Molecule *brew_molecule_p() const;
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
     virtual void do_print() const;
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
     virtual void do_print() const;
-    virtual Interval symbol_height()const;
+    virtual Interval symbol_height() const;
     virtual void do_pre_processing();
     virtual Interval do_width() const;
     SCORE_ELEM_CLONE(Script);
     virtual void do_pre_processing();
     virtual Interval do_width() const;
     SCORE_ELEM_CLONE(Script);
index 35b2ca0df3c3b46797a4467952e57471d35ce822..6662399cc7b86348b7d987d95ca05d3954a4ef6e 100644 (file)
@@ -15,7 +15,7 @@ class Slur_engraver :public Engraver {
     Array<Slur_req*> new_slur_req_l_arr_;
     Array<Slur *> slur_l_stack_;
     Array<Slur*> end_slur_l_arr_;
     Array<Slur_req*> new_slur_req_l_arr_;
     Array<Slur *> slur_l_stack_;
     Array<Slur*> end_slur_l_arr_;
-    int dir_i_;
+    Direction dir_;
     /* *************** */
 protected:
     virtual ~Slur_engraver();
     /* *************** */
 protected:
     virtual ~Slur_engraver();
index eda25e6ffa9b34fac773043c9036ac95f29484c4..8cb16c13023aa3ccf595f9ca8041f2e5d9087d8f 100644 (file)
@@ -31,7 +31,7 @@ protected:
     
     virtual void acknowledge_element (Score_elem_info);
     virtual void do_pre_move_processing();
     
     virtual void acknowledge_element (Score_elem_info);
     virtual void do_pre_move_processing();
-    virtual Span_bar* get_span_bar_p()const;
+    virtual Span_bar* get_span_bar_p() const;
 };
 
 #endif // SPAN_BAR_GRAV_HH
 };
 
 #endif // SPAN_BAR_GRAV_HH
index 644d9de0b4a6fbcaba3cb75e841d993b57959d75..d49974c902acc1c37b5faf74c3cee67ae0e54d28 100644 (file)
@@ -24,11 +24,11 @@ public:
     void set (Vertical_align_element *);
 
 protected:
     void set (Vertical_align_element *);
 
 protected:
-    virtual Interval do_width()const;
+    virtual Interval do_width() const;
     virtual void do_pre_processing();
     
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
     virtual void do_pre_processing();
     
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
-    virtual Molecule * brew_molecule_p()const;
+    virtual Molecule * brew_molecule_p() const;
     virtual Symbol get_bar_sym (Real dy) const;
 };
 
     virtual Symbol get_bar_sym (Real dy) const;
 };
 
index 836424c0c21d7adaf089c7353b393cff0af090f5..7881c183e788e2c4dacba61e512d113922a45185 100644 (file)
@@ -23,7 +23,7 @@ class Span_score_bar_engraver : public Span_bar_engraver
 {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
 {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual Span_bar* get_span_bar_p()const;
+    virtual Span_bar* get_span_bar_p() const;
 };
 
 /**
 };
 
 /**
index ace2c84dc9848d45883d06e9219fd7d7567e61c0..5b25faa3ca0bf4df4dc1e35342d7be9daceb0102 100644 (file)
@@ -31,7 +31,7 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Piano_brace);
 protected:
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Piano_brace);
 protected:
-    virtual Interval do_width()const;
+    virtual Interval do_width() const;
     virtual Symbol get_bar_sym (Real) const;
 };
 
     virtual Symbol get_bar_sym (Real) const;
 };
 
diff --git a/lily/include/spanner-elem-group.hh b/lily/include/spanner-elem-group.hh
deleted file mode 100644 (file)
index 2f65af2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  spanner-elem-group.hh -- declare Spanner_elem_group
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef SPANNER_ELEM_GROUP_HH
-#define SPANNER_ELEM_GROUP_HH
-
-#include "spanner.hh"
-#include "elem-group.hh"
-
-class Spanner_elem_group : public Spanner, public Horizontal_vertical_group_element {
-    
-protected:
-    virtual Interval do_width()const;
-    virtual void do_print() const;
-    SCORE_ELEM_CLONE(Spanner_elem_group);
-public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-};
-#endif // SPANNER_ELEM_GROUP_HH
index 1152be157b5320dddd94591407f6917342d4c3f3..44529faaf0fb1c86334120ba09172ee69696a28a 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "lily-proto.hh"
 #include "score-elem.hh"
 
 #include "lily-proto.hh"
 #include "score-elem.hh"
+#include "drul-array.hh"
 
 /** A symbol which is attached between two columns. A spanner is a
   symbol which spans across several columns, so its final appearance
 
 /** A symbol which is attached between two columns. A spanner is a
   symbol which spans across several columns, so its final appearance
   length of stems of notes they encompass.
 
   */
   length of stems of notes they encompass.
 
   */
-class Spanner:public virtual Score_elem {
+class Spanner : public virtual Score_elem {
 public:
 public:
-    PCol *left_col_l_, *right_col_l_;
-    
-    /* *************** */
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual Spanner* spanner() { return this; }    
-    Spanner();
-    bool broken_b() const;
-    Spanner* find_broken_piece (Line_of_score*)const;
+  
+  Drul_array<Item*> spanned_drul_;
+  void set_bounds(Direction d, Item*);
+
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual Spanner* spanner() { return this; }    
+  Spanner();
+  bool broken_b() const;
+
+  Spanner* find_broken_piece (Line_of_score*) const;
 protected:
 protected:
-    void set_my_columns();
-    SCORE_ELEM_CLONE(Spanner);
-
-    /**
-      this is virtual; for instance, Line_of_score overrides it.
-     */
-    virtual void break_into_pieces (bool);
-
-    Link_array<Spanner> broken_into_l_arr_;
-       
-    virtual void do_break_processing();
-    virtual Interval do_width()const;
-    virtual void do_print()const;
-    virtual Line_of_score*line_l()const;
+  void set_my_columns();
+  SCORE_ELEM_CLONE(Spanner);
+
+  /**
+    this is virtual; for instance, Line_of_score overrides it.
+    */
+  virtual void break_into_pieces ();
+
+  Link_array<Spanner> broken_into_l_arr_;
+
+  virtual void do_unlink();
+  virtual void do_junk_links();
+  virtual String do_TeX_output_str () const;
+  virtual void do_break_processing();
+  virtual Interval do_width() const;
+  virtual void do_print() const;
+  virtual Line_of_score*line_l() const;
 };
 #endif
 };
 #endif
index e8dc25db3be5c260e83b0782093eb0f85652ca3b..22c4d9634e3ac232f7bcc6a8acd62bbe2abf8c2f 100644 (file)
@@ -51,7 +51,7 @@ class Spring_spacer : public Line_spacer {
   /// mark column #i# as being loose.
   void loosen_column (int i);
   /// the index of #c# in #cols#
   /// mark column #i# as being loose.
   void loosen_column (int i);
   /// the index of #c# in #cols#
-  int col_id (PCol const *c) const;
+  int col_id (Paper_column const *c) const;
 
   /// generate an (nonoptimal) solution
   Vector find_initial_solution() const;
 
   /// generate an (nonoptimal) solution
   Vector find_initial_solution() const;
@@ -60,7 +60,7 @@ class Spring_spacer : public Line_spacer {
   bool check_feasible() const;
 
   /// does #this# contain the column #w#? 
   bool check_feasible() const;
 
   /// does #this# contain the column #w#? 
-  bool contains (PCol const *w);
+  bool contains (Paper_column const *w);
 
   /// make the energy function
   void make_matrices (Matrix &quad, Vector &lin,Real&) const;
 
   /// make the energy function
   void make_matrices (Matrix &quad, Vector &lin,Real&) const;
@@ -82,17 +82,17 @@ class Spring_spacer : public Line_spacer {
   void add_ideal (Idealspacing const *i);
   Vector try_initial_solution() const;
   void calc_idealspacing();
   void add_ideal (Idealspacing const *i);
   Vector try_initial_solution() const;
   void calc_idealspacing();
-  void set_fixed_cols (Mixed_qp&)const;
+  void set_fixed_cols (Mixed_qp&) const;
 
   Score_column* scol_l (int);
   void connect (int i,int j, Real,Real);
 
   Score_column* scol_l (int);
   void connect (int i,int j, Real,Real);
-  Line_of_cols error_pcol_l_arr()const;
+  Line_of_cols error_pcol_l_arr() const;
 public:
   static Line_spacer *constructor();
 
   virtual void solve (Col_hpositions*) const;
   virtual void lower_bound_solution (Col_hpositions*) const;
 public:
   static Line_spacer *constructor();
 
   virtual void solve (Col_hpositions*) const;
   virtual void lower_bound_solution (Col_hpositions*) const;
-  virtual void add_column (PCol  *, bool fixed=false, Real fixpos=0.0);
+  virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0);
  
 
   virtual Vector default_solution() const;
  
 
   virtual Vector default_solution() const;
index 5cceb59bdb0f65b0574ea3794ace91195df2e5ac..f5413d93460e83a8e86e3f1565b13f116961c0d4 100644 (file)
@@ -28,10 +28,10 @@ struct Staff_info {
     Score * score_l_;
     Moment when();
     Score *score_l();
     Score * score_l_;
     Moment when();
     Score *score_l();
-    PCol * command_pcol_l();
+    Paper_column * command_pcol_l();
     Score_column* musical_l();
     Score_column *command_l();
     Score_column* musical_l();
     Score_column *command_l();
-    PCol * musical_pcol_l();
+    Paper_column * musical_pcol_l();
     Staff_info();
 };
 
     Staff_info();
 };
 
index 7e7a75ea0254693ed113e245aec94a54957f0e9d..c682c9efbd24d9dcf0e16bc6a36567e0ca66a28c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "score-elem.hh"
 #include "interval.hh"
 
 #include "score-elem.hh"
 #include "interval.hh"
+#include "direction.hh"
 
 /** A symbol which sits along a staff.
 
 
 /** A symbol which sits along a staff.
 
@@ -19,9 +20,9 @@
 class Staff_side : virtual Score_elem {
     Link_array<Score_elem> support_l_arr_;
     int staff_size_i_;
 class Staff_side : virtual Score_elem {
     Link_array<Score_elem> support_l_arr_;
     int staff_size_i_;
-    Interval support_height()const;
+    Interval support_height() const;
     Staff_symbol* staff_sym_l_;
     Staff_symbol* staff_sym_l_;
-    int get_position_i()const;
+    int get_position_i() const;
 
     void read_staff_sym();
 public:
 
     void read_staff_sym();
 public:
@@ -29,7 +30,7 @@ public:
     /**
       Vertical dir of symbol relative to staff. -1 = below staff?
       */
     /**
       Vertical dir of symbol relative to staff. -1 = below staff?
       */
-    int dir_i_;
+    Direction dir_;
     Interval sym_int_;
     
     /// follow the support inside the staff?
     Interval sym_int_;
     
     /// follow the support inside the staff?
index 705d92b0e5d57caf41318b0e02ffb03eb6251426..31b69273cc96d65cac23e404a804f62646f4a4d7 100644 (file)
   */
 class Staff_symbol : public Spanner
 {
   */
 class Staff_symbol : public Spanner
 {
-    /// this many lines.
-    int no_lines_i_;
+  /// this many lines.
+  int no_lines_i_;
 public:
 public:
-
-
-    void set_extent (PCol* p1, PCol* p2);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Staff_symbol (int lines);
-    Real inter_note_f()const;
-    int steps_i()const;
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Staff_symbol (int lines);
+  Real inter_note_f() const;
+  int steps_i() const;
 protected:
 protected:
-    SCORE_ELEM_CLONE(Staff_symbol);
-    virtual Molecule* brew_molecule_p() const;
-    virtual void do_print()const;
+  SCORE_ELEM_CLONE(Staff_symbol);
+  virtual Molecule* brew_molecule_p() const;
+  virtual void do_print() const;
 };
 #endif // STAFFSYM_HH
 };
 #endif // STAFFSYM_HH
diff --git a/lily/include/stem-beam-grav.hh b/lily/include/stem-beam-grav.hh
deleted file mode 100644 (file)
index c7fe5ff..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  stem-beam-grav.hh -- part of GNU LilyPond
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STEMBEAMGRAV_HH
-#define STEMBEAMGRAV_HH
-#include "engraver.hh"
-
-/**
-  TODO:
-  override default_grouping if setting a n-plet
-  
- */
-class Stem_beam_engraver : public Engraver {
-    Stem * stem_p_;
-    Beam * beam_p_;
-    Beam_req * beam_req_l_;
-    Stem_req * stem_req_l_;
-    Beam_req * start_req_l_;
-    bool end_beam_b_;
-    Rhythmic_grouping *current_grouping;
-    int default_dir_i_;
-public:
-    /* *************** */
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Stem_beam_engraver();
-
-protected:
-    ~Stem_beam_engraver();
-    virtual void set_feature (Feature dir_i_);
-    virtual bool do_try_request (Request*);
-    virtual void do_process_requests();
-    virtual void acknowledge_element (Score_elem_info);
-    virtual void do_pre_move_processing();
-    virtual void do_post_move_processing();
-};
-#endif // STEMBEAMGRAV_HH
diff --git a/lily/include/stem-grav.hh b/lily/include/stem-grav.hh
new file mode 100644 (file)
index 0000000..c5807f7
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  stem-grav.hh -- declare Stem_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STEM_GRAV_HH
+#define STEM_GRAV_HH
+
+#include "engraver.hh"
+
+/**
+  Make stems upon receiving noteheads.
+ */
+class Stem_engraver : public Engraver
+{
+  Direction dir_;
+  Stem *stem_p_;
+  Rhythmic_req *rhythmic_req_l_;
+protected:
+  virtual void acknowledge_element (Score_elem_info);
+  virtual void do_pre_move_processing ();
+  virtual void set_feature (Feature dir_i_);
+
+public:
+  Stem_engraver();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // STEM_GRAV_HH
index 3ea7c356087c38556025cfab24e77424c2cb72a7..4cf67df0e2daec57075d467984c161f6c2c9b317 100644 (file)
   */
 class Stem : public Item {
     
   */
 class Stem : public Item {
     
-    Real stem_bottom_f_, stem_top_f_;
+  Real stem_bottom_f_, stem_top_f_;
     
     
     
     
-    /// needed for determining direction/length
-    int staff_size_i_;
-
-    /**extent of the stem (positions).
-      fractional, since Beam has to adapt them.
-      */
-
-
-    /**
-      geen gedonder, jij gaat onder.
-      -1 stem points down, +1: stem points up
-      */
-    Real stem_xoffset_f_;
-    /**
-      store the wholes (for vapourware tremolo)
-     */
-    Link_array<Note_head> whole_l_arr_;
-    Link_array<Note_head> head_l_arr_;
-    Link_array<Note_head> rest_l_arr_;
+  /// needed for determining direction/length
+  int staff_size_i_;
+
+  /**extent of the stem (positions).
+    fractional, since Beam has to adapt them.
+    */
+
+
+  /**
+    geen gedonder, jij gaat onder.
+    -1 stem points down, +1: stem points up
+    */
+  Real stem_xoffset_f_;
+  /**
+    store the wholes (for vapourware tremolo)
+    */
+  Link_array<Note_head> whole_l_arr_;
+  Link_array<Note_head> head_l_arr_;
+  Link_array<Note_head> rest_l_arr_;
     
 public:
     
 public:
-    /// flagtype? 4 none, 8 8th flag, 0 = beam.
-    int flag_i_;
+  /// flagtype? 4 none, 8 8th flag, 0 = beam.
+  int flag_i_;
 
 
-    int beams_left_i_;
-    int beams_right_i_;
+  int beams_left_i_;
+  int beams_right_i_;
 
 
-    /// false if in beam
-    bool print_flag_b_;
+  /// false if in beam
+  bool print_flag_b_;
     
     
-    int dir_i_;
+  Direction dir_;
 
     
 
     
-    /* *************** */
-    Stem (int staff_size_i);
+  /* *************** */
+  Stem ();
     
     
-    /// ensure that this Stem also encompasses the Notehead #n#
-    void add (Note_head*n);
+  /// ensure that this Stem also encompasses the Notehead #n#
+  void add (Note_head*n);
 
 
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  DECLARE_MY_RUNTIME_TYPEINFO;
 
 
-    Real hpos_f()const;
+  Real hpos_f() const;
     
     
-    void do_print() const;
-    void set_stemend (Real);
-    int get_default_dir();
-    int get_center_distance_from_top();
-    int get_center_distance_from_bottom();
-    void set_default_dir();
-    void set_default_stemlen();
-    void set_default_extents();
-    void set_noteheads();
-
-    Real stem_length_f()const;
-    Real stem_end_f()const;
-    Real stem_start_f() const;
-
-    bool invisible_b()const;
+  void do_print() const;
+  void set_stemend (Real);
+  Direction get_default_dir();
+  int get_center_distance_from_top();
+  int get_center_distance_from_bottom();
+  void set_default_dir();
+  void set_default_stemlen();
+  void set_default_extents();
+  void set_noteheads();
+
+  Real stem_length_f() const;
+  Real stem_end_f() const;
+  Real stem_start_f() const;
+
+  bool invisible_b() const;
     
     
-    /// heads that the stem encompasses (positions)
-    int max_head_i() const;
-    int min_head_i() const;
+  /// heads that the stem encompasses (positions)
+  int max_head_i() const;
+  int min_head_i() const;
 protected:
 protected:
-    virtual void do_substitute_dependency (Score_elem*,Score_elem*);
-    virtual void do_pre_processing();
-    virtual Interval do_width() const;
-    Molecule* brew_molecule_p() const;
+  virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+  virtual void do_pre_processing();
+  virtual Interval do_width() const;
+  Molecule* brew_molecule_p() const;
 };
 #endif
 };
 #endif
index eb12e833a19942486327933ec80c2461a17cf426..1b5a994037c3ec7eba81255bc31d9f2508270483 100644 (file)
@@ -20,7 +20,7 @@ public:
     Line_of_score * line_of_score_l_;
     void add_broken_line (Line_of_score*);
     Super_elem();
     Line_of_score * line_of_score_l_;
     void add_broken_line (Line_of_score*);
     Super_elem();
-    virtual String TeX_string()const;
+    virtual String TeX_output_str() const;
 protected:
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
     virtual void handle_broken_dependencies();
 protected:
     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
     virtual void handle_broken_dependencies();
index f099fc657baa3ab2878f228e725b9fe2b14f921a..09f7e14e4a930f2a7f23f0c78d914e7c28ab2e80 100644 (file)
@@ -19,7 +19,7 @@ struct Symbol {
 
     Symbol (String, Box);
     Symbol();
 
     Symbol (String, Box);
     Symbol();
-    String str()const;         // for printing.
+    String str() const;                // for printing.
 };
 
 
 };
 
 
index 43a21aa50126fc214d0d9b125037f9498babca41..c0768988b9fa1b835e831418a30e74e30b588c8b 100644 (file)
@@ -10,8 +10,8 @@
 struct  Symtable : public Assoc<String, Symbol> {
     String id_str;
     
 struct  Symtable : public Assoc<String, Symbol> {
     String id_str;
     
-    Symbol lookup (String)const;
-    void print()const;
+    Symbol lookup (String) const;
+    void print() const;
 };
 
 
 };
 
 
@@ -22,7 +22,7 @@ struct Symtables : private Assoc<String, Symtable*> {
     Symtables();
     Symtables (Symtables const&);
     void add (String, Symtable*);
     Symtables();
     Symtables (Symtables const&);
     void add (String, Symtable*);
-    void print()const;
+    void print() const;
 };
 
 
 };
 
 
index 3f13add20511664f9e11c7050220da09411d67ae..d40a4c7b2778da142c53f7bf1c9070ec47ab0fbf 100644 (file)
@@ -14,7 +14,7 @@
 
 class Text_def : public General_script_def {
 protected:
 
 class Text_def : public General_script_def {
 protected:
-    virtual Atom get_atom (Paper_def* p, int dir_i_)const;
+    virtual Atom get_atom (Paper_def* p, Direction dir_) const;
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Text_def,General_script_def);
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Text_def,General_script_def);
 public:
@@ -30,7 +30,7 @@ public:
     
     virtual void do_print() const;
     virtual ~Text_def() {};
     
     virtual void do_print() const;
     virtual ~Text_def() {};
-    virtual bool do_equal_b (const General_script_def*)const;
+    virtual bool do_equal_b (const General_script_def*) const;
     Text_def();
     virtual void print() const;
     Interval width (Paper_def*) const;
     Text_def();
     virtual void print() const;
     Interval width (Paper_def*) const;
index 80540bae26a2d1f7deb36938767560fa9a8fe055..8bc0bb44a9d6fc4489d12dd264476778c905ee64 100644 (file)
@@ -12,7 +12,7 @@
 class Text_engraver : public Engraver{
     Text_item * text_p_;
     Text_req * text_req_l_;
 class Text_engraver : public Engraver{
     Text_item * text_p_;
     Text_req * text_req_l_;
-    int dir_i_;
+    Direction dir_;
     /* *************** */
 protected:
     virtual void set_feature (Feature);
     /* *************** */
 protected:
     virtual void set_feature (Feature);
index 45436405401352897085df8b73715e42120e5a75..ba7ae59db60e656b8ffab3f0761268909f19bb91 100644 (file)
@@ -24,14 +24,14 @@ public:
     
     /* ***************/
 
     
     /* ***************/
 
-    Text_item (General_script_def*,int dir=0);
+    Text_item (General_script_def*,Direction dir=0);
     virtual ~Text_item();
     DECLARE_MY_RUNTIME_TYPEINFO;
 
 protected:
     General_script_def * tdef_p_;
 
     virtual ~Text_item();
     DECLARE_MY_RUNTIME_TYPEINFO;
 
 protected:
     General_script_def * tdef_p_;
 
-    virtual Interval symbol_height()const;
+    virtual Interval symbol_height() const;
 
     virtual Molecule* brew_molecule_p() const;
     virtual void do_pre_processing();
 
     virtual Molecule* brew_molecule_p() const;
     virtual void do_pre_processing();
index 3bed16878765acc811c9ce3feda54dc0a66e83fb..c5c9cae052809a4a38cb95d6af34686c62429dd4 100644 (file)
@@ -30,7 +30,7 @@ protected:
     virtual void do_pre_processing();
     virtual void do_post_processing();
     virtual Interval height() const ;
     virtual void do_pre_processing();
     virtual void do_post_processing();
     virtual Interval height() const ;
-    virtual Molecule* brew_molecule_p()const;
+    virtual Molecule* brew_molecule_p() const;
     virtual void do_print() const;
 };
 #endif // TEXTSPANNER_HH
     virtual void do_print() const;
 };
 #endif // TEXTSPANNER_HH
index 63f472e3d8295ce70c4d648d919ba30c6d0292f6..ecdfd4fea7d26ef4942877a35a0d1365dc0b2b94 100644 (file)
@@ -17,7 +17,7 @@ class Tie_engraver : public Engraver {
     Tie * tie_p_;
     Moment end_mom_;
     Tie_req * req_l_;
     Tie * tie_p_;
     Moment end_mom_;
     Tie_req * req_l_;
-    int dir_i_;
+    Direction dir_;
     Tie_req *end_req_l_;
     Melodic_req * end_melodic_req_l_;
     Melodic_req  * melodic_req_l_;
     Tie_req *end_req_l_;
     Melodic_req * end_melodic_req_l_;
     Melodic_req  * melodic_req_l_;
index fde107fb8120966a88aa3fb873e7c4067ce9bc7a..30673fc9eede1ea7fc21b7b96f40af37faeb0788 100644 (file)
@@ -23,9 +23,9 @@ class Tie : public Bow {
     
 public:
     bool same_pitch_b_;
     
 public:
     bool same_pitch_b_;
-    Note_head * left_head_l_;
-    Note_head * right_head_l_;
-    void set_head (int, Note_head*head_l);
+    Drul_array<Note_head *> head_l_drul_;
+
+    void set_head (Direction, Note_head*head_l);
 
     Tie();
     DECLARE_MY_RUNTIME_TYPEINFO;
 
     Tie();
     DECLARE_MY_RUNTIME_TYPEINFO;
index cbc25ded74e413c8b5528b4acb36cd8e503d8244..cafd9a066435a49e93365d1deccb81d2180241fb 100644 (file)
@@ -39,12 +39,12 @@ struct Time_description {
     Time_description();
     void add (Moment dt);
     bool allow_meter_change_b();
     Time_description();
     void add (Moment dt);
     bool allow_meter_change_b();
-    String str()const;
+    String str() const;
     void print() const;
     void setpartial (Moment p);
     void print() const;
     void setpartial (Moment p);
-    String try_set_partial_str (Moment)const;
-    Moment barleft()const;
-    Moment next_bar_moment()const;
+    String try_set_partial_str (Moment) const;
+    Moment barleft() const;
+    Moment next_bar_moment() const;
     void set_meter (int,int);
     static int compare (const Time_description&, const Time_description&);
 };
     void set_meter (int,int);
     static int compare (const Time_description&, const Time_description&);
 };
index d65a831689318395bf22530cf1af5d1e8877dbd0..be8b6730a056233c768627d61852c2133a8a07f7 100644 (file)
  */
 class Timing_engraver : public Engraver
 {   
  */
 class Timing_engraver : public Engraver
 {   
-    Time_description time_;
-    Rhythmic_grouping  default_grouping_;
-    
-    Link_array<Timing_req> timing_req_l_arr_;
-    virtual void fill_staff_info (Staff_info&);
-    virtual bool do_try_request (Request *req_l);
-    virtual void do_process_requests();
-    virtual void do_pre_move_processing();
-    virtual void do_creation_processing();
-    virtual void do_post_move_processing();
-    Timing_engraver();
-    DECLARE_MY_RUNTIME_TYPEINFO;
-}
+public:
+  Time_description time_;
+  Rhythmic_grouping  default_grouping_;
+  Link_array<Timing_req> timing_req_l_arr_;
+protected: 
+  virtual void do_creation_processing ();
+  virtual void fill_staff_info (Staff_info&);
+  virtual bool do_try_request (Request *req_l);
+  virtual void do_process_requests();
+  virtual void do_pre_move_processing();
+  virtual void do_post_move_processing();
+public:
+  Meter_change_req * meter_req_l () const;
+  Timing_engraver();
+  DECLARE_MY_RUNTIME_TYPEINFO;
+};
 
 #endif // TIMING_GRAV_HH
 
 #endif // TIMING_GRAV_HH
index 17088c668fed2625a991bbf5a4772a0b6e0ff9b4..bfcf734e307007a63cf610844bc29637e9048edb 100644 (file)
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
 
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
 
+/** Make some kind of #Element#s from Requests. Elements are made by
+  hierarchically grouped #Translator#s
+  */
 class Translator {
 public:
 class Translator {
 public:
-    String id_str_;
+  String id_str_;
     
     
-    int iterator_count_;
+  int iterator_count_;
     
     
-    virtual Global_translator *global_l() { return 0; }
-
-    /// Score_register = 0, Staff_registers = 1, etc)
-    virtual void print()const;
-    virtual int depth_i()const=0;
-    virtual bool is_bottom_engraver_b() const { return false; }
-    virtual bool try_request (Request*);
-    virtual Translator *find_get_translator_l (String name, String id)=0;
-    virtual Translator *ancestor_l (int l=1)=0;
-    virtual ~Translator(){}
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Translator();
-    virtual Translator *get_default_interpreter()=0;
+  virtual Global_translator *global_l() { return 0; }
+
+  virtual void print() const;
+    
+  /// Score_register = 0, Staff_registers = 1, etc)
+  virtual int depth_i() const=0;
+  virtual bool is_bottom_engraver_b() const { return false; }
+  virtual bool try_request (Request*);
+  virtual Translator *find_get_translator_l (String name, String id)=0;
+  virtual Translator *ancestor_l (int l=1)=0;
+  virtual ~Translator(){}
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Translator();
+  virtual Translator *get_default_interpreter()=0;
 };
 
 #endif // TRANSLATOR_HH
 };
 
 #endif // TRANSLATOR_HH
index 3683b304ba94d6c8f57c3ebae49100e9cd7cc47b..bb6b7ed48f937217b1eefa836eb5537b9895d6af 100644 (file)
@@ -19,7 +19,7 @@ class Vertical_align_element : virtual public Score_elem {
     Link_array<Score_elem> elem_l_arr_;
 public:
     void add (Score_elem*);
     Link_array<Score_elem> elem_l_arr_;
 public:
     void add (Score_elem*);
-    bool contains_b (Score_elem const*)const;
+    bool contains_b (Score_elem const*) const;
     Vertical_align_element();
     DECLARE_MY_RUNTIME_TYPEINFO;
 protected:
     Vertical_align_element();
     DECLARE_MY_RUNTIME_TYPEINFO;
 protected:
index ee08375d6ecbce87b58dab1bea8501c8241d6657..720b2989324e212a870d25778305d09d7dd670b8 100644 (file)
 class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_element
 {
 protected:
 class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_element
 {
 protected:
-    SCORE_ELEM_CLONE(Vertical_group_spanner);
-    virtual void remove_all() { Vertical_group_element::remove_all (); }
+  SCORE_ELEM_CLONE(Vertical_group_spanner);
+  virtual void remove_all() { Vertical_group_element::remove_all (); }
+  virtual void do_junk_links () { Axis_group_spanner::do_junk_links (); }
+  virtual void do_unlink () { Axis_group_spanner::do_unlink (); }
 public:
 public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual void add_element (Score_elem*e) { Vertical_group_element::add_element (e); }
-    virtual void remove_element (Score_elem*e) { Vertical_group_element::remove_element (e); }
-  
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual void add_element (Score_elem*e) { Vertical_group_element::add_element (e); }
+  virtual void remove_element (Score_elem*e) { Vertical_group_element::remove_element (e); }  
 };
 
 #endif // SPAN_VERTICAL_GROUP_HH
 };
 
 #endif // SPAN_VERTICAL_GROUP_HH
index 38f57d574db6085b927b5292d1a03426541176ce..e6b9a3de84f019609f98e5adee90faac89059d05 100644 (file)
@@ -17,7 +17,7 @@
  */
 class Voice_group_engravers  : public Engraver_group_engraver {
     Moment termination_mom_;
  */
 class Voice_group_engravers  : public Engraver_group_engraver {
     Moment termination_mom_;
-    int dir_i_;
+    Direction dir_;
 
 protected:
     virtual void do_print() const;
 
 protected:
     virtual void do_print() const;
diff --git a/lily/include/voice-iterator.hh b/lily/include/voice-iterator.hh
new file mode 100644 (file)
index 0000000..49bfbfc
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+  voice-iter.hh -- declare Voice_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef VOICE_ITER_HH
+#define VOICE_ITER_HH
+
+
+#include "music-iterator.hh"
+#include "pcursor.hh"
+
+class Voice_iterator :  private PCursor<Music*>, public Music_iterator
+{
+  Moment here_mom_;
+  const Voice * voice_C_;
+  Music_iterator * iter_p_;
+  void start_next_element();
+  void leave_element();
+  void set_voice_translator();
+    
+public:
+  Voice_iterator (Voice const*);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+  virtual void do_print() const;
+  virtual void construct_children();
+  ~Voice_iterator();    
+  virtual void process_and_next (Moment);
+  virtual Moment next_moment() const;
+  virtual bool ok() const;
+};
+
+#endif // VOICE_ITER_HH
index 6f16af30c8883ae53b417701a9adf5995b6c4b05..a7d69ff0838d7e1d59478045f91340c3a01dae13 100644 (file)
@@ -14,7 +14,7 @@
 
 /// wordwrap type algorithm: move to next line if current is optimal.
 struct Word_wrap : Break_algorithm {
 
 /// wordwrap type algorithm: move to next line if current is optimal.
 struct Word_wrap : Break_algorithm {
-    virtual Array<Col_hpositions> do_solve()const;
+    virtual Array<Col_hpositions> do_solve() const;
     Word_wrap();
 };
 
     Word_wrap();
 };
 
index f7b204fcff11c58de7311c6b68179cf77be02a56..a8cbd0a9db92cff01f5c050432e97bd21beeb7e4 100644 (file)
@@ -210,10 +210,10 @@ Ineq_constrained_qp::constraint_solve (Vector start) const
 
   
 Vector
 
   
 Vector
-Ineq_constrained_qp::solve (Vector start)const
+Ineq_constrained_qp::solve (Vector start) const
 { 
   /* no hassle if no constraints*/
 { 
   /* no hassle if no constraints*/
-  if ( ! cons.size()) 
+  if (! cons.size()) 
     {
        Choleski_decomposition chol (quad);
        return - chol.solve (lin);
     {
        Choleski_decomposition chol (quad);
        return - chol.solve (lin);
index 34a65b7f3e1f49f6bea2bb26c9561107b92ff3ab..ff277cc672cf4fe94d2821ac08b490c9492e5e5e 100644 (file)
@@ -27,7 +27,7 @@ void
 Input_translator::print() const
 {
 #ifndef NPRINT
 Input_translator::print() const
 {
 #ifndef NPRINT
-  if ( ! check_debug)
+  if (! check_debug)
        return ;
   DOUT << base_str_ <<" " << type_str_<<" {\n";
   DOUT << "Consists of ";
        return ;
   DOUT << base_str_ <<" " << type_str_<<" {\n";
   DOUT << "Consists of ";
@@ -46,7 +46,7 @@ Input_translator::print() const
 Input_translator *
 Input_translator::recursive_find (String nm)
 {
 Input_translator *
 Input_translator::recursive_find (String nm)
 {
-  if ( is_name_b (nm))
+  if (is_name_b (nm))
        return this;
 
   Input_translator * r =0;
        return this;
 
   Input_translator * r =0;
@@ -119,7 +119,7 @@ Input_translator::add (Input_translator *ip)
 Input_translator*
 Input_translator::get_default_itrans_l()
 {
 Input_translator*
 Input_translator::get_default_itrans_l()
 {
-  if ( contains_itrans_p_list_.size())
+  if (contains_itrans_p_list_.size())
        return contains_itrans_p_list_.top();
   else
        return 0;
        return contains_itrans_p_list_.top();
   else
        return 0;
index 6c4a7699c814da15146eba6ce18e0a8f8c9a0a00..6d72b4c5b81d0c013435b14375333672386e4a34 100644 (file)
 #include "item.hh"
 #include "p-col.hh"
 #include "elem-group.hh"
 #include "item.hh"
 #include "p-col.hh"
 #include "elem-group.hh"
+#include "spanner.hh"
 
 Item::Item()
 {
   breakable_b_ = false;
   break_status_i_ = 0;
 
 Item::Item()
 {
   breakable_b_ = false;
   break_status_i_ = 0;
-  pcol_l_ = 0;
-  broken_to_a_[0] = broken_to_a_[1]=0;
+  broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
 }
 
 IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
 }
 
 IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
@@ -26,21 +26,22 @@ void
 Item::do_print() const
 {
 #ifndef NPRINT
 Item::do_print() const
 {
 #ifndef NPRINT
-  DOUT << "(unknown)";
+  DOUT << "breakable_b_: " << breakable_b_;
+  DOUT << "break_status_i_: " <<break_status_i_;
 #endif
 }
 
 
 Real 
 #endif
 }
 
 
 Real 
-Item::hpos_f()const
+Item::hpos_f() const
 {
 {
-  return pcol_l_->hpos_f_ + absolute_coordinate (X_AXIS);
+  return absolute_coordinate (X_AXIS);
 }
 
 Line_of_score *
 }
 
 Line_of_score *
-Item::line_l()const
+Item::line_l() const
 {
 {
-  return pcol_l_->line_l_;
+  return  (axis_group_l_a_[X_AXIS])? axis_group_l_a_[X_AXIS]->line_l() : 0;
 }
 
 int
 }
 
 int
@@ -52,36 +53,37 @@ Item::break_status_i() const
 void
 Item::copy_breakable_items()
 {
 void
 Item::copy_breakable_items()
 {
-  if ( broken_to_a_[0] || broken_to_a_[1])
-       return;
-  Item *new_copies[2];
-  for (int i=0; i < 2; i++) 
+  if (broken_to_drul_[LEFT] || broken_to_drul_[RIGHT])
+    return;
+  Drul_array<Item *> new_copies;
+  Direction  i=LEFT;
+  do 
     {
     {
-       Item * item_p = clone()->item ();
-       item_p->copy_dependencies (*this);
-       
-       item_p->break_status_i_ =  -1+ 2*i;
-       pscore_l_->typeset_item (item_p, pcol_l_);
-       item_p->handle_prebroken_dependencies();
-       new_copies[i] =item_p;
+      Item * item_p = clone()->item ();
+
+      item_p->break_status_i_ =  i;
+      pscore_l_->typeset_element (item_p);
+      item_p->handle_prebroken_dependencies();
+      new_copies[i] =item_p;
     }
     }
-  broken_to_a_= new_copies;
+  while ((i *= -1) != LEFT);
+  broken_to_drul_= new_copies;
 }
 
 void
 Item::do_breakable_col_processing()
 {
 }
 
 void
 Item::do_breakable_col_processing()
 {
-  if (!breakable_b_ || !pcol_l_->breakable_b())
-       return;
+  if (!breakable_b_)
+    return;
 
   copy_breakable_items();
   handle_prebroken_dependencies();
 
   /*
     Otherwise the broken items won't be pre_process()'ed.
 
   copy_breakable_items();
   handle_prebroken_dependencies();
 
   /*
     Otherwise the broken items won't be pre_process()'ed.
-   */
-  add_dependency (broken_to_a_[0]);
-  add_dependency (broken_to_a_[1]);    
+    */
+  add_dependency (broken_to_drul_[LEFT]);
+  add_dependency (broken_to_drul_[RIGHT]);    
 
 }
 
 
 }
 
@@ -89,32 +91,67 @@ Item*
 Item::find_prebroken_piece (Line_of_score*l) const
 {
   if (line_l() == l) 
 Item::find_prebroken_piece (Line_of_score*l) const
 {
   if (line_l() == l) 
-       return (Item*)this;
-  else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
-       return broken_to_a_[0];
-  else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
-       return broken_to_a_[1];
+    return (Item*)this;
+  else if (broken_to_drul_[LEFT] && broken_to_drul_[LEFT]->line_l() == l)
+    return broken_to_drul_[LEFT];
+  else if (broken_to_drul_[RIGHT] && broken_to_drul_[RIGHT]->line_l() == l)
+    return broken_to_drul_[RIGHT];
 
   return 0;
 }
 
 Item*
 
   return 0;
 }
 
 Item*
-Item::find_prebroken_piece (PCol*c)const
+Item::find_prebroken_piece (int breakstatus) const
 {
 {
-  if (c == pcol_l_)
-       return (Item *) this;   // ugh
+  if (!breakstatus)
+    return (Item *) this;      // ugh
+  else
+    return (Item*) broken_to_drul_[(Direction)breakstatus];
+}
 
 
-  if (c == pcol_l_->prebreak_p_)
-       return (Item *) broken_to_a_[0];
-  else if (c==pcol_l_->postbreak_p_)
-       return  (Item *)broken_to_a_[1];
+void
+Item::handle_prebroken_dependencies()
+{
+  if (breakable_b_)
+    Score_elem::handle_prebroken_dependencies();
+}
 
 
-  assert (false);
+int
+Item::left_right_compare(Item const *l, Item const *r)
+{
+  while (!l->is_type_b (Paper_column::static_name ()))
+    l = l->axis_group_l_a_[X_AXIS]->item();
+  while (!r->is_type_b (Paper_column::static_name ()))
+    r = r->axis_group_l_a_[X_AXIS]->item();
+
+  Paper_column *p1 = (Paper_column*)l;
+  Paper_column* p2 = (Paper_column*)r;
+  return p1->rank_i () - p2->rank_i ();
+}
+
+
+bool
+Item::linked_b() const
+{
+  return Score_elem::linked_b() || attached_span_l_arr_.size();
 }
 
 void
 }
 
 void
-Item::handle_prebroken_dependencies()
+Item::do_junk_links()
+{
+  attached_span_l_arr_.set_size(0);
+}
+
+void
+Item::do_unlink()
 {
 {
-  if ( breakable_b_)
-       Score_elem::handle_prebroken_dependencies();
+  for (int i=0; i < attached_span_l_arr_.size (); i++) {
+    Spanner *&s= attached_span_l_arr_[i];
+    if (s->spanned_drul_[LEFT] == this)
+      s->set_bounds (LEFT, 0);
+    if  (s->spanned_drul_[RIGHT] == this)
+      s->set_bounds (RIGHT,0);
+    s =0;
+  }
+  attached_span_l_arr_.set_size (0);
 }
 }
index 96d51998c4732303ee95a695c4cbc0ca17ba9ecd..f2d81ae9073645b0ad530e4906a547464258472b 100644 (file)
@@ -65,7 +65,7 @@ Key_engraver::acknowledge_element (Score_elem_info info)
     }
   else if (info.elem_l_->name() == Bar::static_name ()) 
     {
     }
   else if (info.elem_l_->name() == Bar::static_name ()) 
     {
-       if ( !keyreq_l_)
+       if (!keyreq_l_)
            default_key_b_ = true;
        create_key();
     }
            default_key_b_ = true;
        create_key();
     }
index 12276dcbbf8653a20993fb586ffe1ffa818f56ac..5fbfd29f39f39eaa9558e472c15c66b5956d929a 100644 (file)
@@ -63,7 +63,7 @@ Key_item::add (int p, int a)
 
 
 Molecule*
 
 
 Molecule*
-Key_item::brew_molecule_p()const
+Key_item::brew_molecule_p() const
 {
   Molecule*output = new Molecule;
   Real inter = paper()->internote_f ();
 {
   Molecule*output = new Molecule;
   Real inter = paper()->internote_f ();
@@ -76,7 +76,7 @@ Key_item::brew_molecule_p()const
        Molecule m (a);
        output->add_right (m);  
     }
        Molecule m (a);
        output->add_right (m);  
     }
-  if ( pitch.size()) 
+  if (pitch.size()) 
     {
        Molecule m (paper()->lookup_l ()->fill (Box (
        Interval (0, paper()->note_width ()),
     {
        Molecule m (paper()->lookup_l ()->fill (Box (
        Interval (0, paper()->note_width ()),
index d4d0527aa06e1d20f987da38e4ef8a0a2cf15177..160dee4a64a72c015b4a377aed084b4689ecd687 100644 (file)
@@ -28,7 +28,7 @@ void
 Key_performer::do_print() const
 {
 #ifndef NPRINT
 Key_performer::do_print() const
 {
 #ifndef NPRINT
-  if ( key_req_l_)
+  if (key_req_l_)
        key_req_l_->print();
 #endif
 }
        key_req_l_->print();
 #endif
 }
@@ -36,21 +36,21 @@ Key_performer::do_print() const
 void
 Key_performer::process_requests()
 {
 void
 Key_performer::process_requests()
 {
-  if ( key_req_l_)
-       play (new Audio_key (key_req_l_) );
+  if (key_req_l_)
+       play (new Audio_key (key_req_l_));
   key_req_l_ = 0;
 }
 
 bool
 Key_performer::do_try_request (Request* req_l)
 {
   key_req_l_ = 0;
 }
 
 bool
 Key_performer::do_try_request (Request* req_l)
 {
-  if ( key_req_l_)
+  if (key_req_l_)
        return false;
 
        return false;
 
-  if ( req_l->command())
+  if (req_l->command())
        key_req_l_ = req_l->command()->keychange ();
 
        key_req_l_ = req_l->command()->keychange ();
 
-  if ( key_req_l_)
+  if (key_req_l_)
        return true;
 
   return false;
        return true;
 
   return false;
index f027ee86d91591151fcd7622221cf948ffbab497..0274d1653fc2bdd5a8bcc75749e8e48cf6c27343 100644 (file)
@@ -45,7 +45,7 @@ Keyword_table::Keyword_table (Keyword_ent *tab)
   lookup with binsearch, return tokencode.
 */
 int
   lookup with binsearch, return tokencode.
 */
 int
-Keyword_table::lookup (char const *s)const
+Keyword_table::lookup (char const *s) const
 {
   int     lo,
           hi,
 {
   int     lo,
           hi,
index 8e702b7c793d00b52041edad18b5473f1d298d2f..fa82ddd56379f5118a93036d09bd3ac1857597f8 100644 (file)
@@ -87,6 +87,10 @@ LYRICS               ({AA}|{NATIONAL})[^0-9 \t\n\f]*
 %%
 
 
 %%
 
 
+<*>\r          {
+       // windows-suck-suck-suck
+}
+
 <notes,incl,INITIAL,lyrics>{
   "%{" {
        yy_push_state(longcomment);
 <notes,incl,INITIAL,lyrics>{
   "%{" {
        yy_push_state(longcomment);
index 9d544d061e371867ff1451d72946b1d05d473bff..5915e7854430b973b46ed2b5156d476a3e279b60 100644 (file)
@@ -12,6 +12,7 @@
 #include "bar.hh"
 #include "debug.hh"
 #include "line-group-grav.hh"
 #include "bar.hh"
 #include "debug.hh"
 #include "line-group-grav.hh"
+#include "p-col.hh"
 
 Line_group_engraver::Line_group_engraver()
 {
 
 Line_group_engraver::Line_group_engraver()
 {
@@ -21,7 +22,7 @@ Line_group_engraver::Line_group_engraver()
 void
 Line_group_engraver::acknowledge_element (Score_elem_info  elem)
 {
 void
 Line_group_engraver::acknowledge_element (Score_elem_info  elem)
 {
-  if ( !elem.elem_l_->axis_group_l_a_[Y_AXIS])
+  if (!elem.elem_l_->axis_group_l_a_[Y_AXIS])
        staffline_p_->add_element (elem.elem_l_);
 }
 
        staffline_p_->add_element (elem.elem_l_);
 }
 
@@ -29,7 +30,7 @@ Line_group_engraver::acknowledge_element (Score_elem_info  elem)
 void
 Line_group_engraver::do_removal_processing()
 {
 void
 Line_group_engraver::do_removal_processing()
 {
-  staffline_p_->right_col_l_ = get_staff_info().command_pcol_l ();
+  staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (staffline_p_);
   staffline_p_ = 0;
 }
   typeset_element (staffline_p_);
   staffline_p_ = 0;
 }
@@ -38,7 +39,7 @@ void
 Line_group_engraver::do_creation_processing()
 {
   staffline_p_ = new Vertical_group_spanner ;
 Line_group_engraver::do_creation_processing()
 {
   staffline_p_ = new Vertical_group_spanner ;
-  staffline_p_->left_col_l_ = get_staff_info().command_pcol_l ();
+  staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
 
   // don't broadcast to self.
   announce_element (Score_elem_info (staffline_p_,0));
 
   // don't broadcast to self.
   announce_element (Score_elem_info (staffline_p_,0));
index 5f51ad3ad43929b4a8881762b643abc70d1562df..c59589481a49085f6217cf8fdb709d0dbfc3cf35 100644 (file)
@@ -14,7 +14,7 @@ Line_spacer::Line_spacer()
   paper_l_ =0;
 }
 Paper_def*
   paper_l_ =0;
 }
 Paper_def*
-Line_spacer::paper_l()const
+Line_spacer::paper_l() const
 { 
   return paper_l_ ;
 }
 { 
   return paper_l_ ;
 }
index 82134c860846ba8e7395d9d4482c4114df238297..7da053d41898f008bd779cdf02160bb99c15d068 100644 (file)
@@ -26,43 +26,43 @@ Local_key_engraver::do_pre_move_processing()
   Local_key_item *key_item_p = 0;
   if (mel_l_arr_.size()) 
     {
   Local_key_item *key_item_p = 0;
   if (mel_l_arr_.size()) 
     {
-       for (int i=0; i  < mel_l_arr_.size(); i++) 
-         {
-           Item * support_l = support_l_arr_[i];
-           Note_req * note_l = mel_l_arr_[i];
+      for (int i=0; i  < mel_l_arr_.size(); i++) 
+       {
+         Item * support_l = support_l_arr_[i];
+         Note_req * note_l = mel_l_arr_[i];
 
 
-           if (tied_l_arr_.find_l (support_l) && 
-               !note_l->forceacc_b_)
-               continue;
+         if (tied_l_arr_.find_l (support_l) && 
+             !note_l->forceacc_b_)
+           continue;
            
            
-           if (!note_l->forceacc_b_ &&
-               local_key_.oct (note_l->octave_i_).acc (note_l->notename_i_)
-               == note_l->accidental_i_) 
-               continue;
-           if (!key_item_p) 
-             {
-               int c0_i=0;
+         if (!note_l->forceacc_b_ &&
+             local_key_.oct (note_l->octave_i_).acc (note_l->notename_i_)
+             == note_l->accidental_i_) 
+           continue;
+         if (!key_item_p) 
+           {
+             int c0_i=0;
 
 
-               Staff_info inf = get_staff_info();
-               if (inf.c0_position_i_l_)
-                   c0_i = *get_staff_info().c0_position_i_l_;  
+             Staff_info inf = get_staff_info();
+             if (inf.c0_position_i_l_)
+               c0_i = *get_staff_info().c0_position_i_l_;      
                
                
-               key_item_p = new Local_key_item (c0_i);
-             }
-           key_item_p->add (note_l);
-           key_item_p->add_support (support_l);
-           local_key_.oct (note_l->octave_i_)
-               .set (note_l->notename_i_, note_l->accidental_i_);
-         }
+             key_item_p = new Local_key_item (c0_i);
+           }
+         key_item_p->add (note_l);
+         key_item_p->add_support (support_l);
+         local_key_.oct (note_l->octave_i_)
+           .set (note_l->notename_i_, note_l->accidental_i_);
+       }
        
     }
   if (key_item_p) 
     {
        
     }
   if (key_item_p) 
     {
-       for (int i=0; i < support_l_arr_.size(); i++)
-           key_item_p->add_support (support_l_arr_[i]);
+      for (int i=0; i < support_l_arr_.size(); i++)
+       key_item_p->add_support (support_l_arr_[i]);
        
        
-       announce_element (Score_elem_info (key_item_p, 0)); // ugh ugh ugh
-       typeset_element (key_item_p);
+      announce_element (Score_elem_info (key_item_p, 0)); // ugh ugh ugh
+      typeset_element (key_item_p);
     }
   
   mel_l_arr_.clear();
     }
   
   mel_l_arr_.clear();
@@ -80,32 +80,32 @@ Local_key_engraver::acknowledge_element (Score_elem_info info)
   Score_elem * elem_l = info.elem_l_;
   if (info.req_l_->musical() && info.req_l_->musical ()->note ()) 
     {
   Score_elem * elem_l = info.elem_l_;
   if (info.req_l_->musical() && info.req_l_->musical ()->note ()) 
     {
-       Note_req * note_l = info.req_l_->musical()->note ();
-       Item * item_l = info.elem_l_->item();
+      Note_req * note_l = info.req_l_->musical()->note ();
+      Item * item_l = info.elem_l_->item();
 
 
-       mel_l_arr_.push (note_l);
-       support_l_arr_.push (item_l);
+      mel_l_arr_.push (note_l);
+      support_l_arr_.push (item_l);
        
     }
   else if (info.req_l_->command()
        
     }
   else if (info.req_l_->command()
-              && info.req_l_->command()->keychange ()) 
-                {
-       Key_engraver * key_grav_l =
-           (Key_engraver*)info.origin_grav_l_arr_[0];
-       key_C_ = &key_grav_l->key_;
-       local_key_ = *key_C_;
+          && info.req_l_->command()->keychange ()) 
+    {
+      Key_engraver * key_grav_l =
+       (Key_engraver*)info.origin_grav_l_arr_[0];
+      key_C_ = &key_grav_l->key_;
+      local_key_ = *key_C_;
     }
   else if (elem_l->name() == Key_item::static_name ()) 
     {
     }
   else if (elem_l->name() == Key_item::static_name ()) 
     {
-       Key_engraver * key_grav_l =
-           (Key_engraver*)info.origin_grav_l_arr_[0];
-       key_C_ = &key_grav_l->key_;
+      Key_engraver * key_grav_l =
+       (Key_engraver*)info.origin_grav_l_arr_[0];
+      key_C_ = &key_grav_l->key_;
     }
   else if (elem_l->name() == Tie::static_name ()) 
     {
     }
   else if (elem_l->name() == Tie::static_name ()) 
     {
-       Tie * tie_l = (Tie*)elem_l->spanner();
-       if (tie_l->same_pitch_b_)
-           tied_l_arr_.push (tie_l-> right_head_l_);
+      Tie * tie_l = (Tie*)elem_l->spanner();
+      if (tie_l->same_pitch_b_)
+       tied_l_arr_.push (tie_l-> head_l_drul_[RIGHT]);
     }
 }
 
     }
 }
 
@@ -115,8 +115,8 @@ Local_key_engraver::do_process_requests()
   Time_description const * time_C_ = get_staff_info().time_C_;
   if (time_C_ && !time_C_->whole_in_measure_)
     {
   Time_description const * time_C_ = get_staff_info().time_C_;
   if (time_C_ && !time_C_->whole_in_measure_)
     {
-       if (key_C_)
-           local_key_= *key_C_;
+      if (key_C_)
+       local_key_= *key_C_;
     }
 }
 
     }
 }
 
index b81adc5fcf2b6be148e965778e350fd9963dae52..33037e26ead1c56da0334263fa58bb6c13a82cba 100644 (file)
@@ -56,7 +56,7 @@ Local_key_item::do_pre_processing()
 }
 
 Molecule*
 }
 
 Molecule*
-Local_key_item::brew_molecule_p()const
+Local_key_item::brew_molecule_p() const
 {
   Molecule* output = new Molecule;
   Molecule*octmol = 0;
 {
   Molecule* output = new Molecule;
   Molecule*octmol = 0;
index 18407dece2e63f86c6d32713d720a77e9d682ebc..480abb5f9a06212c7f62abbccfaf2f2360ce2794 100644 (file)
@@ -45,13 +45,13 @@ Lookup::add (String s, Symtable*p)
 }
 
 void
 }
 
 void
-Lookup::print()const
+Lookup::print() const
 {
 {
-  #ifndef NPRINT
+#ifndef NPRINT
   DOUT << "Lookup: " << texsetting << " {\n";
   symtables_->print();
   DOUT << "}\n";
   DOUT << "Lookup: " << texsetting << " {\n";
   symtables_->print();
   DOUT << "}\n";
-  #endif
+#endif
 }
 
 Symbol
 }
 
 Symbol
@@ -75,7 +75,7 @@ Symbol
 Lookup::ball (int j) const
 {
   if (j > 2)
 Lookup::ball (int j) const
 {
   if (j > 2)
-       j = 2;
+    j = 2;
 
   Symtable * st = (*symtables_)("balls");
   return st->lookup (String (j));
 
   Symtable * st = (*symtables_)("balls");
   return st->lookup (String (j));
@@ -136,8 +136,8 @@ Lookup::dots (int j) const
 {
   if (j>3) 
     {
 {
   if (j>3) 
     {
-       j = 3;
-       warning ("max 3 dots"); // todo
+      j = 3;
+      warning ("max 3 dots");  // todo
     }
   return (*symtables_)("dots")->lookup (j);
 }
     }
   return (*symtables_)("dots")->lookup (j);
 }
@@ -158,13 +158,13 @@ Lookup::streepjes (int i) const
   
   if (i < 0) 
     {
   
   if (i < 0) 
     {
-       idx = "botlines";
-       arg = -i;
+      idx = "botlines";
+      arg = -i;
     }
   else 
     {
     }
   else 
     {
-       arg = i;
-       idx = "toplines";
+      arg = i;
+      idx = "toplines";
     }
   Symbol ret = (*symtables_)("streepjes")->lookup (idx);
   
     }
   Symbol ret = (*symtables_)("streepjes")->lookup (idx);
   
@@ -227,9 +227,9 @@ Lookup::stem (Real y1,Real y2) const
 {
   if (y1 > y2) 
     {
 {
   if (y1 > y2) 
     {
-       Real t = y1;
-       y1 = y2;
-       y2 = t;
+      Real t = y1;
+      y1 = y2;
+      y2 = t;
     }
   Symbol s;
   
     }
   Symbol s;
   
@@ -253,31 +253,31 @@ Lookup::vbrace (Real &y) const
 {
   if (y < 2* 20 PT) 
     {
 {
   if (y < 2* 20 PT) 
     {
-       warning ( "piano brace too small (" + print_dimen (y)+ ")");
-       y = 2*20 PT;
+      warning ("piano brace too small (" + print_dimen (y)+ ")");
+      y = 2*20 PT;
     }
   if (y > 67 * 2 PT) 
     {
     }
   if (y > 67 * 2 PT) 
     {
-       warning ( "piano brace too big (" + print_dimen (y)+ ")");      
-       y = 67 *2 PT;
+      warning ("piano brace too big (" + print_dimen (y)+ ")");        
+      y = 67 *2 PT;
     }
   
   int idx = int (rint ((y/2.0 - 20) + 148));
   
   Symbol s = (*symtables_)("param")->lookup ("brace");
   {
     }
   
   int idx = int (rint ((y/2.0 - 20) + 148));
   
   Symbol s = (*symtables_)("param")->lookup ("brace");
   {
-       Array<String> a;
-       a.push (idx);
-       s.tex = substitute_args (s.tex,a);
-       s.dim.y() = Interval (0,y);
-    }
+    Array<String> a;
+    a.push (idx);
+    s.tex = substitute_args (s.tex,a);
+    s.dim.y() = Interval (0,y);
+  }
   {
   {
-       Array<String> a;
-       a.push (print_dimen (y/2));
-       a.push (print_dimen (0));
-       a.push (s.tex);
-       s.tex = substitute_args ("\\placebox{%}{%}{%}", a);
-    }
+    Array<String> a;
+    a.push (print_dimen (y/2));
+    a.push (print_dimen (0));
+    a.push (s.tex);
+    s.tex = substitute_args ("\\placebox{%}{%}{%}", a);
+  }
 
        
   return s;
 
        
   return s;
index c29b46d5fe1741d56b6cb9f35d10854dab1937f1..a10cf614b2b3baf93c6ab8b8b701c85f7e507bc7 100644 (file)
@@ -33,12 +33,12 @@ Lyric_engraver::do_try_request (Request*r)
 void
 Lyric_engraver::do_process_requests()
 {
 void
 Lyric_engraver::do_process_requests()
 {
-  if ( lreq_l_) 
+  if (lreq_l_) 
     {
        lyric_item_p_ =  new Text_item (lreq_l_->tdef_p_);
 
        lyric_item_p_->translate (paper()->note_width ()/2 , X_AXIS);
     {
        lyric_item_p_ =  new Text_item (lreq_l_->tdef_p_);
 
        lyric_item_p_->translate (paper()->note_width ()/2 , X_AXIS);
-       lyric_item_p_->dir_i_ = -1;
+       lyric_item_p_->dir_ = DOWN;
        lyric_item_p_->fat_b_ = true;
        announce_element (Score_elem_info (lyric_item_p_, lreq_l_));
     }
        lyric_item_p_->fat_b_ = true;
        announce_element (Score_elem_info (lyric_item_p_, lreq_l_));
     }
@@ -53,7 +53,7 @@ Lyric_engraver::do_post_move_processing()
 void
 Lyric_engraver::do_pre_move_processing()
 {
 void
 Lyric_engraver::do_pre_move_processing()
 {
-  if ( lyric_item_p_)
+  if (lyric_item_p_)
     {
        typeset_element (lyric_item_p_);
        lyric_item_p_ =0;
     {
        typeset_element (lyric_item_p_);
        lyric_item_p_ =0;
index b800f3d1adaeca6d94564677a208910c9949753b..9a7fef130c0f0ec011c5521e40e0d7cd8c6c69e9 100644 (file)
@@ -28,7 +28,7 @@ void
 Lyric_performer::do_print() const
 {
 #ifndef NPRINT
 Lyric_performer::do_print() const
 {
 #ifndef NPRINT
-  if ( lreq_arr_.size())
+  if (lreq_arr_.size())
        lreq_arr_[ 0 ]->print();
 #endif
 }
        lreq_arr_[ 0 ]->print();
 #endif
 }
@@ -36,8 +36,8 @@ Lyric_performer::do_print() const
 void
 Lyric_performer::process_requests()
 {
 void
 Lyric_performer::process_requests()
 {
-  if ( lreq_arr_.size() && lreq_arr_[ 0 ]->tdef_p_->text_str_.length_i() )
-       play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_) );
+  if (lreq_arr_.size() && lreq_arr_[ 0 ]->tdef_p_->text_str_.length_i())
+       play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_));
   lreq_arr_.clear();
 }
 
   lreq_arr_.clear();
 }
 
@@ -45,7 +45,7 @@ bool
 Lyric_performer::do_try_request (Request* req_l)
 {
   Musical_req* m_l = req_l->musical();
 Lyric_performer::do_try_request (Request* req_l)
 {
   Musical_req* m_l = req_l->musical();
-  if ( !m_l || ! m_l->lreq_l()) 
+  if (!m_l || ! m_l->lreq_l()) 
        return false;
   lreq_arr_.push (m_l->lreq_l());
 
        return false;
   lreq_arr_.push (m_l->lreq_l());
 
index eb9f611543d0df08c6262e8a973d62a68d910d61..8c68dd1bc06c9da1f4bb0a9bbcc94c18ad228eea 100644 (file)
@@ -106,14 +106,14 @@ static File_path path;
 void
 do_one_file (String init_str, String file_str)
 {
 void
 do_one_file (String init_str, String file_str)
 {
-  if ( init_str != "" && "" == path.find (init_str) 
+  if (init_str != "" && "" == path.find (init_str)
     {
     {
-       error ( "Can not find `" + init_str +"\'");
+       error ("Can not find `" + init_str +"\'");
        return ;
     }
        return ;
     }
-  if ( file_str!= "" && path.find (file_str) == "" 
+  if (file_str!= "" && path.find (file_str) == ""
     {
     {
-       error ( "Can not find `" + file_str + "'");
+       error ("Can not find `" + file_str + "'");
        return ;
     }
   
        return ;
     }
   
@@ -142,7 +142,7 @@ main (int argc, char **argv)
        path.add (env_l);
     }
   path.add ("");
        path.add (env_l);
     }
   path.add ("");
-  path.add (String (DIR_DATADIR) + "/init/" );
+  path.add (String (DIR_DATADIR) + "/init/");
   
   path.push (DIR_DATADIR);
 
   
   path.push (DIR_DATADIR);
 
@@ -152,7 +152,7 @@ main (int argc, char **argv)
   
   while (Long_option_init const * opt = oparser()) 
     {
   
   while (Long_option_init const * opt = oparser()) 
     {
-       switch ( opt->shortname)
+       switch (opt->shortname)
          {
        case 'o':
            set_default_output (oparser.optional_argument_ch_C_);
          {
        case 'o':
            set_default_output (oparser.optional_argument_ch_C_);
@@ -188,7 +188,7 @@ main (int argc, char **argv)
 
   int p=0;
   const char *arg ;
 
   int p=0;
   const char *arg ;
-  while ( (arg= oparser.get_next_arg())) 
+  while ((arg= oparser.get_next_arg())) 
     {
        String f (arg);
        destill_inname (f);
     {
        String f (arg);
        destill_inname (f);
@@ -207,7 +207,7 @@ main (int argc, char **argv)
 void
 destill_inname (String &name_str_r)
 {
 void
 destill_inname (String &name_str_r)
 {
-  if ( name_str_r.length_i())
+  if (name_str_r.length_i())
       {
       if (name_str_r[ 0 ] != '-') 
            {
       {
       if (name_str_r[ 0 ] != '-') 
            {
index 7f5a0d3bc8bf190b9d6d291034daead654d15ed3..378acbc74140ae017dbcc8b16e58df9e8577ee56 100644 (file)
 #include "meter-grav.hh"
 #include "meter.hh"
 #include "command-request.hh"
 #include "meter-grav.hh"
 #include "meter.hh"
 #include "command-request.hh"
-#include "score-grav.hh"
-
+#include "timing-grav.hh"
+#include "engraver-group.hh"
 Meter_engraver::Meter_engraver()
 { 
 Meter_engraver::Meter_engraver()
 { 
-  meter_req_l_ = 0;
   meter_p_ =0;
   meter_p_ =0;
-  default_grouping_ = Rhythmic_grouping (MInterval (0,4),4); // ugh
-}
-
-void
-Meter_engraver::fill_staff_info (Staff_info&inf)
-{
-  inf.time_C_ = &time_;
-  inf.rhythmic_C_ = &default_grouping_;
-}
-
-bool
-Meter_engraver::do_try_request (Request*r)
-{
-  bool gotcha = false;
-
-  if (r->command() && r->command ()->timing ()) 
-    {
-       gotcha = true;
-       Timing_req * tr_l = r->command()->timing ();
-       Meter_change_req *m_l = tr_l->meterchange();
-       if (m_l) 
-         {
-           meter_req_l_ = m_l;
-
-           int b_i= m_l->beats_i_;
-           int o_i = m_l->one_beat_i_;
-           if (! time_.allow_meter_change_b())
-               tr_l->warning ("Meter change not allowed here");
-           else
-             {
-               time_.set_meter (b_i, o_i);
-               default_grouping_ = 
-                   Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i);
-             }
-         }
-       else if (tr_l->partial()) 
-         {
-           Moment m = tr_l->partial()->duration_;
-           String error = time_.try_set_partial_str (m);
-           if (error != "") 
-             {
-               tr_l->warning (error);
-             }
-           else 
-               time_.setpartial (m);
-         }
-       else if (tr_l->barcheck()) 
-         {
-           if (time_.whole_in_measure_) 
-             {
-               tr_l ->warning ("Barcheck failed");
-           
-               time_.whole_in_measure_ = 0; // resync
-               time_.error_b_ = true;
-             }
-
-         }
-       else if (tr_l->cadenza()) 
-         {
-           time_.set_cadenza (tr_l->cadenza()->on_b_);
-
-         }
-       else if (tr_l->measuregrouping()) 
-         {
-           default_grouping_ = parse_grouping (
-                   tr_l->measuregrouping()->beat_i_arr_,
-                   tr_l->measuregrouping()->elt_length_arr_);
-
-       }       
-    }
-  
-  return gotcha;
-}
-
-void
-Meter_engraver::do_creation_processing()
-{
-  time_.when_ = get_staff_info().when ();
 }
 
 void
 Meter_engraver::do_process_requests()
 {
 }
 
 void
 Meter_engraver::do_process_requests()
 {
-  if (meter_req_l_) 
+  Timing_engraver * timing_grav_l= (Timing_engraver*)
+    daddy_grav_l_->get_simple_engraver (Timing_engraver::static_name());
+  
+  Meter_change_req *req = timing_grav_l->meter_req_l();
+  if (req)
     {
     {
-       Array<Scalar> args;
-       args.push (meter_req_l_->beats_i_);
-       args.push (meter_req_l_->one_beat_i_);
+      Array<Scalar> args;
+      args.push (req->beats_i_);
+      args.push (req->one_beat_i_);
        
        
-       meter_p_ = new Meter (args);
+      meter_p_ = new Meter (args);
     }
 
   if (meter_p_)
     }
 
   if (meter_p_)
-       announce_element (Score_elem_info (meter_p_, meter_req_l_));
+    announce_element (Score_elem_info (meter_p_, req));
 }
 
 void
 }
 
 void
@@ -116,26 +41,9 @@ Meter_engraver::do_pre_move_processing()
 {
   if (meter_p_) 
     {
 {
   if (meter_p_) 
     {
-       typeset_element (meter_p_);
-       meter_p_ =0;
-       meter_req_l_ = 0;
-    }
-
-  Engraver_group_engraver * grav_l = daddy_grav_l_;
-  while (grav_l->daddy_grav_l_) 
-    {
-       grav_l = grav_l->daddy_grav_l_;
+      typeset_element (meter_p_);
+      meter_p_ =0;
     }
     }
-  
-  assert (grav_l->name() == Score_engraver::static_name ());
-  if (!time_.cadenza_b_)
-       ((Score_engraver*)grav_l)->add_moment_to_process (time_.next_bar_moment());
-}
-
-void
-Meter_engraver::do_post_move_processing()
-{
-  time_.add (get_staff_info().when ()  - time_.when_);
 }
 
 
 }
 
 
index 0d23bb9a9bf7ce7c48a3249d12518cac448dcc68..63eb06946b4b0499bab4794b34d6ec84014153f0 100644 (file)
@@ -26,30 +26,30 @@ void
 Meter_performer::do_print() const
 {
 #ifndef NPRINT
 Meter_performer::do_print() const
 {
 #ifndef NPRINT
-  if ( meter_req_l_)
-       meter_req_l_->print();
+  if (meter_req_l_)
+    meter_req_l_->print();
 #endif
 }
 
 void
 Meter_performer::process_requests()
 {
 #endif
 }
 
 void
 Meter_performer::process_requests()
 {
-  if ( meter_req_l_)
-       play (new Audio_meter (meter_req_l_) );
+  if (meter_req_l_)
+    play (new Audio_meter (meter_req_l_));
   meter_req_l_ = 0;
 }
 
 bool
 Meter_performer::do_try_request (Request* req_l)
 {
   meter_req_l_ = 0;
 }
 
 bool
 Meter_performer::do_try_request (Request* req_l)
 {
-  if ( meter_req_l_)
-       return false;
+  if (meter_req_l_)
+    return false;
 
 
-  if ( req_l->command())
-       meter_req_l_ = req_l->command()->meterchange ();
+  if (req_l->command())
+    meter_req_l_ = req_l->command()->meterchange ();
 
 
-  if ( meter_req_l_)
-       return true;
+  if (meter_req_l_)
+    return true;
 
   return false;
 }
 
   return false;
 }
index e8fcd8f9f04883c75e94c9c6d721a9af697e614d..aa41b7922bbf785aabb15792fd25a7764ee34f20 100644 (file)
@@ -11,7 +11,7 @@ Meter::Meter (Array<Scalar>a)
 }
 
 Molecule*
 }
 
 Molecule*
-Meter::brew_molecule_p()const
+Meter::brew_molecule_p() const
 {
   Symbol s = paper()->lookup_l ()->meter (args);
   return new Molecule (Atom (s));
 {
   Symbol s = paper()->lookup_l ()->meter (args);
   return new Molecule (Atom (s));
index 2307155ba826342cee66815480e70d1c063b0bb3..c3ffe65d4742f8506cd98a96d09a46470be86e27 100644 (file)
@@ -10,9 +10,9 @@
 #include "misc.hh"
 #include "midi-def.hh"
 #include "input-translator.hh"
 #include "misc.hh"
 #include "midi-def.hh"
 #include "input-translator.hh"
-#include "performer-group-performer.hh"
+#include "audio-score.hh"
 #include "assoc-iter.hh"
 #include "assoc-iter.hh"
-
+#include "score-performer.hh"
 #include "debug.hh"
 
 // classes, alphasorted
 #include "debug.hh"
 
 // classes, alphasorted
@@ -32,7 +32,7 @@ Midi_def::Midi_def()
   outfile_str_ = ""; 
   itrans_p_ = 0;
   // ugh
   outfile_str_ = ""; 
   itrans_p_ = 0;
   // ugh
-  set_tempo (Moment (1, 4), 60 );
+  set_tempo (Moment (1, 4), 60);
 }
 
 Midi_def::Midi_def (Midi_def const& s)
 }
 
 Midi_def::Midi_def (Midi_def const& s)
@@ -50,22 +50,28 @@ Midi_def::~Midi_def()
 Real
 Midi_def::duration_to_seconds_f (Moment mom)
 {
 Real
 Midi_def::duration_to_seconds_f (Moment mom)
 {
-  if ( !mom)
+  if (!mom)
        return 0;
   
   return Moment (whole_seconds_f_) * mom;
 }
 
 Global_translator*
        return 0;
   
   return Moment (whole_seconds_f_) * mom;
 }
 
 Global_translator*
-Midi_def::get_global_translator_p() const
+Midi_def::get_global_translator_p() 
 {
 {
-  return  itrans_p_->get_group_performer_p()->global_l ();
+  Global_translator *g =     itrans_p_->get_group_performer_p()->global_l ();
+
+  assert (g->is_type_b (Score_performer::static_name()));
+  Score_performer * perf = (Score_performer*)g;
+  perf->performance_p_ = new Audio_score;
+  perf->performance_p_->midi_l_ = this;
+  return g;
 }
 
 int
 Midi_def::get_tempo_i (Moment moment)
 {
 }
 
 int
 Midi_def::get_tempo_i (Moment moment)
 {
-  return Moment (whole_seconds_f_) * Moment (60 ) * moment;
+  return Moment (whole_seconds_f_) * Moment (60) * moment;
 }
 
 void
 }
 
 void
@@ -73,7 +79,7 @@ Midi_def::print() const
 {
 #ifndef NPRINT
   DOUT << "Midi {";
 {
 #ifndef NPRINT
   DOUT << "Midi {";
-  DOUT << "4/min: " << Real (60) / ( whole_seconds_f_ * 4 );
+  DOUT << "4/min: " << Real (60) / (whole_seconds_f_ * 4);
   DOUT << "out: " << outfile_str_;
   DOUT << "}\n";
 #endif
   DOUT << "out: " << outfile_str_;
   DOUT << "}\n";
 #endif
@@ -89,6 +95,7 @@ Midi_def::set (Input_translator* itrans_p)
 void
 Midi_def::set_tempo (Moment moment, int count_per_minute_i)
 {
 void
 Midi_def::set_tempo (Moment moment, int count_per_minute_i)
 {
-  whole_seconds_f_ = Moment (count_per_minute_i) / Moment (60 ) / moment;
+  whole_seconds_f_ = Moment (count_per_minute_i) / Moment (60) / moment;
 }
 
 }
 
+IMPLEMENT_IS_TYPE_B1( Midi_def, Music_output_def);
index 47af53eb3b59591637a8bb4628a939b1dbbd52a4..e7e914782de5af34bdd6ae166f1e1acf615839bf 100644 (file)
@@ -71,7 +71,7 @@ Midi_duration::Midi_duration (Real seconds_f)
 String
 Midi_duration::str() const
 {
 String
 Midi_duration::str() const
 {
-  return String ("<duration: ") + String (seconds_f_ ) + ">";
+  return String ("<duration: ") + String (seconds_f_) + ">";
 }
 
 Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
 }
 
 Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
@@ -270,14 +270,14 @@ String
 Midi_instrument::str() const
 {
   Byte program_byte = 0;
 Midi_instrument::str() const
 {
   Byte program_byte = 0;
-  for ( int i = 0; instrument_name_sz_a_[i]; i++)
-    if ( instrument_str_ == String (instrument_name_sz_a_[ i ])) 
+  for (int i = 0; instrument_name_sz_a_[i]; i++)
+    if (instrument_str_ == String (instrument_name_sz_a_[ i ])) 
       {
        program_byte = (Byte)i;
        break;
       }
 
       {
        program_byte = (Byte)i;
        break;
       }
 
-  String str = String ((char)( 0xc0 + channel_i_) );
+  String str = String ((char)(0xc0 + channel_i_));
   str += String ((char)program_byte);
   return str;
 }
   str += String ((char)program_byte);
   return str;
 }
@@ -298,7 +298,7 @@ String
 Midi_item::i2varint_str (int i)
 {
   int buffer_i = i & 0x7f;
 Midi_item::i2varint_str (int i)
 {
   int buffer_i = i & 0x7f;
-  while ( (i >>= 7) > 0) 
+  while ((i >>= 7) > 0) 
     {
       buffer_i <<= 8;
       buffer_i |= 0x80;
     {
       buffer_i <<= 8;
       buffer_i |= 0x80;
@@ -306,10 +306,10 @@ Midi_item::i2varint_str (int i)
     }
 
   String str;
     }
 
   String str;
-  while ( 1) 
+  while (1) 
     {
       str += (char)buffer_i;
     {
       str += (char)buffer_i;
-      if ( buffer_i & 0x80)
+      if (buffer_i & 0x80)
        buffer_i >>= 8;
       else
        break;
        buffer_i >>= 8;
       else
        break;
@@ -330,7 +330,7 @@ Midi_key::str() const
   int flats_i = k->flats_i();
 
   // midi cannot handle non-conventional keys
   int flats_i = k->flats_i();
 
   // midi cannot handle non-conventional keys
-  if ( flats_i && sharps_i)
+  if (flats_i && sharps_i)
     return "";
   int accidentals_i = sharps_i - flats_i;
 
     return "";
   int accidentals_i = sharps_i - flats_i;
 
@@ -356,7 +356,7 @@ Midi_meter::str() const
 
   String str = "ff5804";
   str += String_convert::i2hex_str (num_i, 2, '0');
 
   String str = "ff5804";
   str += String_convert::i2hex_str (num_i, 2, '0');
-  str += String_convert::i2hex_str (intlog2( den_i) , 2, '0' );
+  str += String_convert::i2hex_str (intlog2(den_i) , 2, '0');
   str += String_convert::i2hex_str (clocks_per_1_i_, 2, '0');
   str += String_convert::i2hex_str (8, 2, '0');
   return String_convert::hex2bin_str (str);
   str += String_convert::i2hex_str (clocks_per_1_i_, 2, '0');
   str += String_convert::i2hex_str (8, 2, '0');
   return String_convert::hex2bin_str (str);
@@ -383,16 +383,16 @@ Midi_note::pitch_i() const
 String
 Midi_note::str() const
 {
 String
 Midi_note::str() const
 {
-  if ( pitch_i() == INT_MAX)
+  if (pitch_i() == INT_MAX)
     return String ("");
 
     return String ("");
 
-  Byte status_byte = (char)( 0x90 + channel_i_);
+  Byte status_byte = (char)(0x90 + channel_i_);
 
   String str = String ((char)status_byte);
 
   String str = String ((char)status_byte);
-  str += (char)( pitch_i() + c0_pitch_i_c_);
+  str += (char)(pitch_i() + c0_pitch_i_c_);
 
   // poor man's staff dynamics:
 
   // poor man's staff dynamics:
-  str += (char)( dynamic_byte_ - 0x10 * channel_i_);
+  str += (char)(dynamic_byte_ - 0x10 * channel_i_);
 
   return str;
 }
 
   return str;
 }
@@ -414,13 +414,13 @@ Midi_note_off::pitch_i() const
 String
 Midi_note_off::str() const
 {
 String
 Midi_note_off::str() const
 {
-  if ( pitch_i() == INT_MAX)
+  if (pitch_i() == INT_MAX)
     return String ("");
 
     return String ("");
 
-  Byte status_byte = (char)( 0x80 + channel_i_);
+  Byte status_byte = (char)(0x80 + channel_i_);
 
   String str = String ((char)status_byte);
 
   String str = String ((char)status_byte);
-  str += (char)( pitch_i() + Midi_note::c0_pitch_i_c_);
+  str += (char)(pitch_i() + Midi_note::c0_pitch_i_c_);
   str += (char)aftertouch_byte_;
   return str;
 }
   str += (char)aftertouch_byte_;
   return str;
 }
@@ -428,7 +428,7 @@ Midi_note_off::str() const
 Midi_tempo::Midi_tempo (Audio_item* audio_item_l)
   : Midi_item (audio_item_l)
 {
 Midi_tempo::Midi_tempo (Audio_item* audio_item_l)
   : Midi_item (audio_item_l)
 {
-  per_minute_4_i_ = ( (Audio_tempo*)audio_item_l_)->per_minute_4_i_;
+  per_minute_4_i_ = ((Audio_tempo*)audio_item_l_)->per_minute_4_i_;
 }
 
 Midi_tempo::Midi_tempo (int per_minute_4_i)
 }
 
 Midi_tempo::Midi_tempo (int per_minute_4_i)
@@ -449,8 +449,8 @@ Midi_tempo::str() const
 Midi_text::Midi_text (Audio_item* audio_item_l)
   : Midi_item (audio_item_l)
 {
 Midi_text::Midi_text (Audio_item* audio_item_l)
   : Midi_item (audio_item_l)
 {
-  text_str_ = ( (Audio_text*)audio_item_l_)->text_str_;
-  type_ = (Type)( (Audio_text*)audio_item_l_)->type_;
+  text_str_ = ((Audio_text*)audio_item_l_)->text_str_;
+  type_ = (Type)((Audio_text*)audio_item_l_)->type_;
 }
 
 Midi_text::Midi_text (Midi_text::Type type, String text_str)
 }
 
 Midi_text::Midi_text (Midi_text::Type type, String text_str)
@@ -512,14 +512,14 @@ Midi_track::Midi_track()
 void 
 Midi_track::add (int delta_time_i, String event_str)
 {
 void 
 Midi_track::add (int delta_time_i, String event_str)
 {
-  if ( delta_time_i < 0) 
+  if (delta_time_i < 0) 
     {
     {
-      cout << String_convert::bin2hex_str (i2varint_str (delta_time_i) ) << endl;
+      cout << String_convert::bin2hex_str (i2varint_str (delta_time_i)) << endl;
       cout << String_convert::bin2hex_str (event_str) << endl;
     }
   assert (delta_time_i >= 0);
   assert(event_str.length_i());
       cout << String_convert::bin2hex_str (event_str) << endl;
     }
   assert (delta_time_i >= 0);
   assert(event_str.length_i());
-  Midi_chunk::add (i2varint_str (delta_time_i) + event_str );
+  Midi_chunk::add (i2varint_str (delta_time_i) + event_str);
 }
 
 void 
 }
 
 void 
@@ -527,8 +527,8 @@ Midi_track::add (Moment delta_time_moment, Midi_item* mitem_l)
 {
   // use convention of 384 clocks per 4
   // use Duration_convert
 {
   // use convention of 384 clocks per 4
   // use Duration_convert
-  int delta_time_i = delta_time_moment * Moment (384) / Moment (1, 4 );
-  // ? int ( delta_time_moment * 4 * 384) 
+  int delta_time_i = delta_time_moment * Moment (384) / Moment (1, 4);
+  // ? int (delta_time_moment * 4 * 384) 
   add (delta_time_i, mitem_l->str());
 }
 
   add (delta_time_i, mitem_l->str());
 }
 
index 5f1b3ee501652a6494d9463950ca771526014b7d..0521e87c756537bd54d7075da9af731bcef7ef3c 100644 (file)
@@ -28,31 +28,31 @@ Midi_stream::~Midi_stream()
 }
 
 Midi_stream&
 }
 
 Midi_stream&
-Midi_stream::operator <<( String str)
+Midi_stream::operator <<(String str)
 {
 {
-  if ( check_debug)
+  if (check_debug)
        str = String_convert::bin2hex_str (str);
   
   *os_p_ << str;
 
        str = String_convert::bin2hex_str (str);
   
   *os_p_ << str;
 
-  if ( check_debug)
+  if (check_debug)
       *os_p_ << "\n";
 
   return *this;
 }
 
 Midi_stream&
       *os_p_ << "\n";
 
   return *this;
 }
 
 Midi_stream&
-Midi_stream::operator <<( Midi_item const& mitem_c_r)
+Midi_stream::operator <<(Midi_item const& mitem_c_r)
 {
 //    *this << mitem_c_r.str();
   mitem_c_r.output (this);
 {
 //    *this << mitem_c_r.str();
   mitem_c_r.output (this);
-  if ( check_debug)
+  if (check_debug)
       *os_p_ << "\n";
   return *this;
 }
 
 Midi_stream&
       *os_p_ << "\n";
   return *this;
 }
 
 Midi_stream&
-Midi_stream::operator <<( int i)
+Midi_stream::operator <<(int i)
 {
   // output binary string ourselves
   *this << Midi_item::i2varint_str (i);
 {
   // output binary string ourselves
   *this << Midi_item::i2varint_str (i);
@@ -63,6 +63,6 @@ void
 Midi_stream::open()
 {
   os_p_ = new ofstream (filename_str_);
 Midi_stream::open()
 {
   os_p_ = new ofstream (filename_str_);
-  if ( !*os_p_)
+  if (!*os_p_)
        error ("can't open `" + filename_str_ + "\'");
 }
        error ("can't open `" + filename_str_ + "\'");
 }
index aea8fcc0d7091e3ce3b423d155bbc821f0af05c0..36c8000024989bc44f85b75a7febbef3cae4e4d2 100644 (file)
@@ -27,7 +27,7 @@ compare (Midi_note_event const& left, Midi_note_event const& right)
 }
 
 Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l)
 }
 
 Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l)
-  : PCursor<Audio_item*>( audio_staff_l->audio_item_l_list_)
+  : PCursor<Audio_item*>(audio_staff_l->audio_item_l_list_)
 {
   track_l_ = track_l;
   last_mom_ = 0;
 {
   track_l_ = track_l;
   last_mom_ = 0;
@@ -36,7 +36,7 @@ Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l)
 Midi_walker::~Midi_walker()
 { 
   // ugh
 Midi_walker::~Midi_walker()
 { 
   // ugh
-  do_stop_notes (last_mom_ + Moment (10, 1) );
+  do_stop_notes (last_mom_ + Moment (10, 1));
 }
 
 /**
 }
 
 /**
@@ -46,11 +46,11 @@ void
 Midi_walker::do_start_note (Midi_note* note_l)
 {
   Moment stop_mom = note_l->duration() + ptr ()->audio_column_l_->at_mom ();
 Midi_walker::do_start_note (Midi_note* note_l)
 {
   Moment stop_mom = note_l->duration() + ptr ()->audio_column_l_->at_mom ();
-  for ( int i=0; i < stop_note_queue.size(); i++) 
+  for (int i=0; i < stop_note_queue.size(); i++) 
     {
     {
-       if ( stop_note_queue[ i ].val->pitch_i() == note_l->pitch_i ()) 
+       if (stop_note_queue[ i ].val->pitch_i() == note_l->pitch_i ()) 
          {
          {
-           if ( stop_note_queue[ i ].key < stop_mom)
+           if (stop_note_queue[ i ].key < stop_mom)
                stop_note_queue[ i ].ignore_b_ = true;
            else // skip the stopnote 
                return; 
                stop_note_queue[ i ].ignore_b_ = true;
            else // skip the stopnote 
                return; 
@@ -71,10 +71,10 @@ Midi_walker::do_start_note (Midi_note* note_l)
 void
 Midi_walker::do_stop_notes (Moment max_mom)
 {
 void
 Midi_walker::do_stop_notes (Moment max_mom)
 {
-  while ( stop_note_queue.size() && stop_note_queue.front ().key <= max_mom) 
+  while (stop_note_queue.size() && stop_note_queue.front ().key <= max_mom) 
     {
        Midi_note_event e = stop_note_queue.get();
     {
        Midi_note_event e = stop_note_queue.get();
-       if ( e.ignore_b_) 
+       if (e.ignore_b_) 
            continue;
        
        Moment stop_mom = e.key;
            continue;
        
        Moment stop_mom = e.key;
@@ -101,11 +101,11 @@ Midi_walker::process()
   do_stop_notes (ptr()->audio_column_l_->at_mom ());
 
   Midi_item* p = ptr()->midi_item_p ();
   do_stop_notes (ptr()->audio_column_l_->at_mom ());
 
   Midi_item* p = ptr()->midi_item_p ();
-  if ( !p )
+  if (!p)
        return;
   p->channel_i_ = track_l_->number_i_;
   
        return;
   p->channel_i_ = track_l_->number_i_;
   
-  if ( p->name() != Midi_note::static_name ())
+  if (p->name() != Midi_note::static_name ())
        output_event (ptr()->audio_column_l_->at_mom (), p);
   else
        do_start_note ((Midi_note*)p);
        output_event (ptr()->audio_column_l_->at_mom (), p);
   else
        do_start_note ((Midi_note*)p);
index 56a6476ff6d379d3e4782d88e729af88d939756a..ef36b59d149a2f552e0ed5cb475d4e05c94c459c 100644 (file)
@@ -1,26 +1,24 @@
 /*
 /*
-  music-iterator.cc -- implement {Music,Chord,Voice}_iterator
+  music-iterator.cc -- implement Music_iterator
 
   source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
   source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "debug.hh"
 #include "music-list.hh"
 #include "music-iterator.hh"
 #include "music-list.hh"
 #include "music-iterator.hh"
+#include "voice-iterator.hh"
+#include "chord-iterator.hh"
+#include "request-iterator.hh"
 #include "translator.hh"
 #include "translator.hh"
-#include "request.hh"
-#include "debug.hh"
 
 
 IMPLEMENT_IS_TYPE_B(Music_iterator);
 
 
 
 IMPLEMENT_IS_TYPE_B(Music_iterator);
 
-Chord_iterator::~Chord_iterator()
-{
-}
 
 void
 
 void
-Music_iterator::do_print()const
+Music_iterator::do_print() const
 {
 
 }
 {
 
 }
@@ -29,12 +27,15 @@ void
 Music_iterator::print() const
 {
 #ifndef NPRINT
 Music_iterator::print() const
 {
 #ifndef NPRINT
-  if ( !check_debug)
-       return ;
+  if (!check_debug)
+    return ;
   DOUT << name() << "{";
   DOUT << "report to " << 
   DOUT << name() << "{";
   DOUT << "report to " << 
-       report_to_l() << " (" << report_to_l ()->name () << ")\n";
-  DOUT << "next at " << next_moment() << " ";
+    report_to_l() << " (" << report_to_l ()->name () << ")\n";
+  if (ok())
+    DOUT << "next at " << next_moment() << " ";
+  else
+    DOUT << "not feeling well today..";
   do_print();
   DOUT << "}\n";
 #endif
   do_print();
   DOUT << "}\n";
 #endif
@@ -45,7 +46,7 @@ Music_iterator::get_req_translator_l()
 {
   assert (report_to_l());
   if (report_to_l()->is_bottom_engraver_b ())
 {
   assert (report_to_l());
   if (report_to_l()->is_bottom_engraver_b ())
-       return report_to_l();
+    return report_to_l();
 
   set_translator (report_to_l()->get_default_interpreter ());
   return report_to_l();
 
   set_translator (report_to_l()->get_default_interpreter ());
   return report_to_l();
@@ -67,10 +68,10 @@ Music_iterator::pop_translator()
 }
 
 Translator* 
 }
 
 Translator* 
-Music_iterator::report_to_l()const
+Music_iterator::report_to_l() const
 {
   if (! report_to_l_arr_.size())
 {
   if (! report_to_l_arr_.size())
-       return 0;
+    return 0;
   return report_to_l_arr_.top();
 }
 
   return report_to_l_arr_.top();
 }
 
@@ -79,11 +80,11 @@ void
 Music_iterator::set_translator (Translator*trans)
 {   
   if (report_to_l()==trans)
 Music_iterator::set_translator (Translator*trans)
 {   
   if (report_to_l()==trans)
-       return;
-  if ( report_to_l())
-       pop_translator();
+    return;
+  if (report_to_l())
+    pop_translator();
   if (trans)
   if (trans)
-       push_translator (trans);
+    push_translator (trans);
 }
 
 void
 }
 
 void
@@ -98,7 +99,7 @@ Music_iterator::~Music_iterator()
 }
 
 Moment
 }
 
 Moment
-Music_iterator::next_moment()const
+Music_iterator::next_moment() const
 {
   return 0;
 }
 {
   return 0;
 }
@@ -110,39 +111,39 @@ Music_iterator::process_and_next (Moment)
 }
 
 bool
 }
 
 bool
-Music_iterator::ok()const
+Music_iterator::ok() const
 {
   return first_b_;
 }
 
 Music_iterator*
 Music_iterator::static_get_iterator_p (Music *m,
 {
   return first_b_;
 }
 
 Music_iterator*
 Music_iterator::static_get_iterator_p (Music *m,
-                                     Translator *report_l)
+                                      Translator *report_l)
 {
   Music_iterator * p =0;
   if (m->is_type_b (Request_chord::static_name()))
 {
   Music_iterator * p =0;
   if (m->is_type_b (Request_chord::static_name()))
-       p = new Request_chord_iterator ((Request_chord*) m);
+    p = new Request_chord_iterator ((Request_chord*) m);
   else if (m->is_type_b (Chord::static_name())) 
   else if (m->is_type_b (Chord::static_name())) 
-       p =  new Chord_iterator ((Chord*) m);
+    p =  new Chord_iterator ((Chord*) m);
   else if (m->is_type_b (Voice::static_name())) 
   else if (m->is_type_b (Voice::static_name())) 
-       p =  new Voice_iterator ((Voice*) m);
+    p =  new Voice_iterator ((Voice*) m);
   
   if (m -> type_str_ != "") 
     {
   
   if (m -> type_str_ != "") 
     {
-       Translator * a =report_l->
-           find_get_translator_l (m-> type_str_, m->id_str_);
-           p->set_translator (a);
+      Translator * a =report_l->
+       find_get_translator_l (m-> type_str_, m->id_str_);
+      p->set_translator (a);
     }
 
 
   if (! p->report_to_l())
     }
 
 
   if (! p->report_to_l())
-        p ->set_translator (report_l);
+    p ->set_translator (report_l);
   
   return p;
 }
 
 Music_iterator*
   
   return p;
 }
 
 Music_iterator*
-Music_iterator::get_iterator_p (Music*m)const
+Music_iterator::get_iterator_p (Music*m) const
 {
   Music_iterator*p = static_get_iterator_p (m,report_to_l());
   p->daddy_iter_l_ = (Music_iterator*)this;
 {
   Music_iterator*p = static_get_iterator_p (m,report_to_l());
   p->daddy_iter_l_ = (Music_iterator*)this;
@@ -156,252 +157,3 @@ Music_iterator::Music_iterator()
   first_b_ = true;
 }
 
   first_b_ = true;
 }
 
-/* ************** */
-
-Chord_iterator::Chord_iterator (Chord const *chord_C)
-{
-  chord_C_ = chord_C;
-}
-
-void
-Chord_iterator::construct_children()
-{
-  int j = 0;
-  for (PCursor<Music*> i (chord_C_->music_p_list_.top());  //, int j = 0; 
-       i.ok(); j++, i++) 
-         {
-       Music_iterator * mi =  get_iterator_p (i.ptr());
-       if ( mi->ok()) 
-         {
-           set_translator (mi->report_to_l()->ancestor_l (
-               chord_C_->multi_level_i_) );
-           children_p_list_.bottom().add (mi);
-         }
-       else 
-           delete mi;
-    }
-}
-void
-Chord_iterator::do_print() const
-{
-#ifndef NPRINT
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++) 
-    {
-       i->print();
-    }
-#endif
-}
-
-void
-Chord_iterator::process_and_next (Moment until)
-{
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();) 
-    {
-       if  (i->next_moment() == until) 
-         {
-           i->process_and_next (until);
-         }
-       if (!i->ok()) 
-           delete i.remove_p();
-       else
-           i++;
-    }
-  Music_iterator::process_and_next (until);
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
-
-Moment
-Chord_iterator::next_moment()const
-{
-  Moment next_ = infinity_mom;
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
-       next_ = next_ <? i->next_moment() ;
-  return next_;
-}
-
-
-
-bool
-Chord_iterator::ok()const
-{
-  return children_p_list_.size();
-}
-
-/* ************** */
-
-void
-Voice_iterator::do_print()const
-{
-  if (iter_p_)
-       iter_p_->print();
-}
-
-Voice_iterator::Voice_iterator (Voice const*v)
-  : PCursor<Music*> ( v->music_p_list_)
-{
-  here_mom_ = v->offset_mom_;
-  voice_C_ = v;
-  iter_p_ =0;
-}
-
-void
-Voice_iterator::construct_children()
-{
-  while (PCursor<Music*>::ok()) 
-    {
-       start_next_element();
-       if ( !iter_p_->ok()) 
-         {
-           leave_element();
-         }
-       else 
-         {
-           set_voice_translator();
-           break;
-         }
-    }
-}
-
-void 
-Voice_iterator::leave_element()
-{
-  delete iter_p_;
-  iter_p_ =0;
-  MInterval elt_time = ptr()->time_int ();
-  if (!elt_time.empty_b())
-       here_mom_ += elt_time.length();
-  PCursor<Music*>::next();
-}
-
-void
-Voice_iterator::start_next_element()
-{
-  assert (!iter_p_);
-  iter_p_ = get_iterator_p (ptr());
-}
-
-void
-Voice_iterator::set_voice_translator()
-{
-  if (iter_p_->report_to_l()->depth_i () > report_to_l ()->depth_i ())
-       set_translator (iter_p_->report_to_l());
-}
-
-Voice_iterator::~Voice_iterator()
-{
-  assert (! iter_p_);
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Voice_iterator,Music_iterator);
-
-void
-Voice_iterator::process_and_next (Moment until)
-{
-  while (1) 
-    {
-       Moment local_until = until - here_mom_;
-       while ( iter_p_->ok()) 
-         {
-           Moment here = iter_p_->next_moment();
-           if (here != local_until)
-               goto loopexit;
-           
-           iter_p_->process_and_next (local_until);
-         }
-
-       if (!iter_p_->ok()) 
-         {
-           leave_element();
-           if ( PCursor<Music*>::ok()) 
-             {
-               start_next_element();
-               set_voice_translator();
-             }
-           else 
-             {
-               goto loopexit;
-             }
-         }
-    }
-
-loopexit:
-
-  Music_iterator::process_and_next (until);
-}
-
-Moment
-Voice_iterator::next_moment()const
-{
-  return iter_p_->next_moment() + here_mom_;
-}
-
-bool
-Voice_iterator::ok()const
-{
-  return iter_p_;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Request_chord_iterator,Music_iterator);
-
-void
-Request_chord_iterator::construct_children()
-{
-  get_req_translator_l();
-}
-
-Request_chord_iterator::Request_chord_iterator (Request_chord*el_l)
-{
-  elt_l_ = el_l;
-  elt_duration_ = el_l->time_int().length (); 
-  last_b_ = false;
-}
-
-
-bool
-Request_chord_iterator::ok()const
-{
-  return (elt_duration_ && !last_b_) || first_b_; 
-}
-
-
-
-Moment
-Request_chord_iterator::next_moment()const
-{
-  Moment m (0);
-  if  (!first_b_) 
-       m = elt_duration_;
-  return m;
-}
-
-void
-Request_chord_iterator::do_print() const
-{
-#ifndef NPRINT
-  DOUT << "duration: " << elt_duration_;
-#endif
-}
-void
-Request_chord_iterator::process_and_next (Moment mom)
-{
-  if ( first_b_) 
-    {
-       for (PCursor<Music*> i (elt_l_->music_p_list_); 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 ("Junking request: " + String (req_l->name()));
-
-         }
-       first_b_ = false;
-    }
-
-  if ( mom >= elt_duration_)
-       last_b_ = true;  
-}
index ad10bce46e277864fad7bb445557610a3d89543d..93a64e6a014703140eb77d7011f87c3b70ce30ee 100644 (file)
@@ -25,7 +25,7 @@ IMPLEMENT_IS_TYPE_B1(Voice,Music_list);
 IMPLEMENT_IS_TYPE_B1(Chord,Music_list);
 
 MInterval
 IMPLEMENT_IS_TYPE_B1(Chord,Music_list);
 
 MInterval
-Chord::time_int()const
+Chord::time_int() const
 {
   MInterval m;
   for (iter (music_p_list_.top(), i); i.ok (); i++)
 {
   MInterval m;
   for (iter (music_p_list_.top(), i); i.ok (); i++)
@@ -62,7 +62,7 @@ Voice::time_int() const
       /*
          c4 <> c4
       */
       /*
          c4 <> c4
       */
-       if ( !interval.empty_b())
+       if (!interval.empty_b())
            last += interval.length();
     }
   return  offset_mom_ + MInterval (0,last);
            last += interval.length();
     }
   return  offset_mom_ + MInterval (0,last);
@@ -98,7 +98,7 @@ Music_list::transpose (Melodic_req const*rq)
 }
 
 void
 }
 
 void
-Music_list::do_print()const
+Music_list::do_print() const
 {
 #ifndef NPRINT
   for (iter (music_p_list_.top(),i); i.ok (); i++)
 {
 #ifndef NPRINT
   for (iter (music_p_list_.top(),i); i.ok (); i++)
diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc
new file mode 100644 (file)
index 0000000..5de256a
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+  music-output-def.cc -- implement Music_output_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "music-output-def.hh"
+
+IMPLEMENT_IS_TYPE_B(Music_output_def);
+
index 6cd34fc2a0ed8f91abf96da7a58b671ed09fefe2..7de77d1fc9551ee6d5eed197aa5165054593cc4c 100644 (file)
@@ -18,10 +18,10 @@ Music::time_int() const
 }
 
 void
 }
 
 void
-Music::print()const
+Music::print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-  if ( ! check_debug)
+  if (! check_debug)
        return ;
   DOUT << name() << "{";
   if  (type_str_!="" || id_str_!="")
        return ;
   DOUT << name() << "{";
   if  (type_str_!="" || id_str_!="")
@@ -43,7 +43,7 @@ Music::translate (Moment)
 }
 
 void
 }
 
 void
-Music::do_print()const
+Music::do_print() const
 {
 }
 
 {
 }
 
index 4924a934be1b6246489ee83b5d35cc902e0080d9..9ffd4f494c1d6a8c12ce36d461b88ba09e07e620 100644 (file)
 #include "music-list.hh"
 
 
 #include "music-list.hh"
 
 
-IMPLEMENT_IS_TYPE_B1(Stem_req,Rhythmic_req);
-
-void
-Stem_req::do_print() const
-{
-#ifndef NPRINT
-  Rhythmic_req::do_print();
-  DOUT << "dir : " << dir_i_;
-#endif
-}
-
-Stem_req::Stem_req()
-{
-  dir_i_ = 0;
-}
-
-/* ************** */
 
 IMPLEMENT_IS_TYPE_B1(Musical_req,Request);
 void
 
 IMPLEMENT_IS_TYPE_B1(Musical_req,Request);
 void
-Musical_req::do_print()const{}
+Musical_req::do_print() const{}
 void
 void
-Tie_req::do_print()const{}
+Tie_req::do_print() const{}
 
 
 /* *************** */
 
 
 /* *************** */
@@ -64,7 +47,7 @@ Spacing_req::Spacing_req()
 IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
 
 void
 IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
 
 void
-Spacing_req::do_print()const
+Spacing_req::do_print() const
 {
 #ifndef NPRINT
   DOUT << "next " << next << "dist " << distance << "strength\n";
 {
 #ifndef NPRINT
   DOUT << "next " << next << "dist " << distance << "strength\n";
@@ -75,7 +58,7 @@ Spacing_req::do_print()const
 IMPLEMENT_IS_TYPE_B2(Blank_req,Spacing_req,Rhythmic_req);
 
 void
 IMPLEMENT_IS_TYPE_B2(Blank_req,Spacing_req,Rhythmic_req);
 
 void
-Blank_req::do_print()const
+Blank_req::do_print() const
 {
   Spacing_req::do_print();
 }
 {
   Spacing_req::do_print();
 }
@@ -114,7 +97,7 @@ Melodic_req::transpose (Melodic_req const & delta)
 IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
 
 bool
 IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
 
 bool
-Melodic_req::do_equal_b (Request*r)const
+Melodic_req::do_equal_b (Request*r) const
 {
   Melodic_req* m= r->musical()->melodic ();
   return !compare (*m, *this);
 {
   Melodic_req* m= r->musical()->melodic ();
   return !compare (*m, *this);
@@ -129,7 +112,7 @@ Melodic_req::compare (Melodic_req const &m1 , Melodic_req const&m2)
   
   if (o)
        return o;
   
   if (o)
        return o;
-  if ( n)
+  if (n)
        return n;
   if (a)
        return a;
        return n;
   if (a)
        return a;
@@ -170,7 +153,7 @@ Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
 }
 
 bool
 }
 
 bool
-Rhythmic_req::do_equal_b (Request*r)const
+Rhythmic_req::do_equal_b (Request*r) const
 {
   Rhythmic_req* rh = r->musical()->rhythmic ();
 
 {
   Rhythmic_req* rh = r->musical()->rhythmic ();
 
@@ -209,7 +192,7 @@ Lyric_req::Lyric_req (Text_def* def_p)
   :Text_req (0, def_p)
 {
   def_p->align_i_ = 0; // centre
   :Text_req (0, def_p)
 {
   def_p->align_i_ = 0; // centre
-  dir_i_ = -1;         // lyrics below (invisible) staff
+  dir_ = DOWN;         // lyrics below (invisible) staff
 }
 
 
 }
 
 
@@ -224,7 +207,7 @@ Lyric_req::do_print() const
 
 /* *************** */
 bool
 
 /* *************** */
 bool
-Note_req::do_equal_b (Request*r)const
+Note_req::do_equal_b (Request*r) const
 {
   return Rhythmic_req::do_equal_b (r) && Melodic_req::do_equal_b (r);
 }
 {
   return Rhythmic_req::do_equal_b (r) && Melodic_req::do_equal_b (r);
 }
@@ -267,17 +250,17 @@ Beam_req::Beam_req()
 
 IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
 void
 
 IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
 void
-Beam_req::do_print()const{}
+Beam_req::do_print() const{}
 /* *************** */
 
 IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
 void
 /* *************** */
 
 IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
 void
-Slur_req::do_print()const{}
+Slur_req::do_print() const{}
 /* *************** */
 
 
 bool
 /* *************** */
 
 
 bool
-Span_req:: do_equal_b (Request*r)const
+Span_req:: do_equal_b (Request*r) const
 {
   Span_req * s = r->span();
   return spantype - s->spantype;
 {
   Span_req * s = r->span();
   return spantype - s->spantype;
@@ -291,17 +274,17 @@ Span_req::Span_req()
 /* *************** */
 Script_req::Script_req (Script_req const&s)
 {
 /* *************** */
 Script_req::Script_req (Script_req const&s)
 {
-  dir_i_ = s.dir_i_;
+  dir_ = s.dir_;
   scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone() : 0;
 }
 
 /*
   don't check dirs?
   
   scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone() : 0;
 }
 
 /*
   don't check dirs?
   
-  (d1.dir_i_ == d2.dir_i_)
+  (d1.dir_ == d2.dir_)
  */
 bool
  */
 bool
-Script_req::do_equal_b (Request*r)const
+Script_req::do_equal_b (Request*r) const
 {
   Script_req * s = r->script();
   
 {
   Script_req * s = r->script();
   
@@ -310,7 +293,7 @@ Script_req::do_equal_b (Request*r)const
 
 Script_req::Script_req()
 {
 
 Script_req::Script_req()
 {
-  dir_i_ = 0;
+  dir_ = CENTER;
   scriptdef_p_ = 0;
 }
 
   scriptdef_p_ = 0;
 }
 
@@ -321,7 +304,7 @@ void
 Script_req::do_print() const
 {
 #ifndef NPRINT
 Script_req::do_print() const
 {
 #ifndef NPRINT
-  DOUT << " dir " << dir_i_ ;
+  DOUT << " dir " << dir_ ;
   scriptdef_p_->print();
 #endif
 }
   scriptdef_p_->print();
 #endif
 }
@@ -352,12 +335,12 @@ Text_req::~Text_req()
 Text_req::Text_req (Text_req const& src)
 {
   tdef_p_ = new Text_def (*src.tdef_p_);
 Text_req::Text_req (Text_req const& src)
 {
   tdef_p_ = new Text_def (*src.tdef_p_);
-  dir_i_ = src.dir_i_;
+  dir_ = src.dir_;
 }
 
 Text_req::Text_req (int dir_i, Text_def* tdef_p)       
 {
 }
 
 Text_req::Text_req (int dir_i, Text_def* tdef_p)       
 {
-  dir_i_ = dir_i;
+  dir_ = Direction(dir_i);
   tdef_p_ = tdef_p;
 }
 
   tdef_p_ = tdef_p;
 }
 
@@ -368,7 +351,7 @@ void
 Text_req::do_print() const
 {
 #ifndef NPRINT
 Text_req::do_print() const
 {
 #ifndef NPRINT
-  DOUT << " dir " << dir_i_ ;
+  DOUT << " dir " << dir_ ;
   tdef_p_->print();
 #endif
 }
   tdef_p_->print();
 #endif
 }
@@ -435,18 +418,18 @@ Absolute_dynamic_req::Absolute_dynamic_req()
 
 Span_dynamic_req::Span_dynamic_req()
 {
 
 Span_dynamic_req::Span_dynamic_req()
 {
-  dynamic_dir_i_  = 0;
+  dynamic_dir_  = CENTER;
 }
 
 
 IMPLEMENT_IS_TYPE_B1(Span_dynamic_req,Musical_req);
 
 void
 }
 
 
 IMPLEMENT_IS_TYPE_B1(Span_dynamic_req,Musical_req);
 
 void
-Span_dynamic_req::do_print()const
+Span_dynamic_req::do_print() const
 {
 #ifndef NPRINT
   Span_req::do_print();
 {
 #ifndef NPRINT
   Span_req::do_print();
-  DOUT << "louder/louder: " <<dynamic_dir_i_;
+  DOUT << "softer/louder: " <<dynamic_dir_;
 #endif
 }
 
 #endif
 }
 
index 857d364ede06983728cef17f530f3e72070876db..f09f0dd6c81d0274220af01bedee72382e4ccd1f 100644 (file)
@@ -101,7 +101,7 @@ My_lily_lexer::set_identifier (String name_str, Identifier*i)
   Identifier *old = lookup_identifier (name_str);
   if  (old) 
     {
   Identifier *old = lookup_identifier (name_str);
   if  (old) 
     {
-       old->warning( "redeclaration of \\" + name_str);
+       old->warning("redeclaration of \\" + name_str);
        delete old;
     }
   (*identifier_assoc_p_)[name_str] = i;
        delete old;
     }
   (*identifier_assoc_p_)[name_str] = i;
@@ -121,7 +121,7 @@ My_lily_lexer::~My_lily_lexer()
   delete identifier_assoc_p_;
 }
 void
   delete identifier_assoc_p_;
 }
 void
-My_lily_lexer::print_declarations (bool init_b)const
+My_lily_lexer::print_declarations (bool init_b) const
 {
   for (Assoc_iter<String,Identifier*> ai (*identifier_assoc_p_); ai.ok(); 
         ai++) 
 {
   for (Assoc_iter<String,Identifier*> ai (*identifier_assoc_p_); ai.ok(); 
         ai++) 
index eb5d2f0d82c25cacedad75f8b05dd11698b1b440..0b1121190a80b5f57b14ad5d9076cd606c0c9d17 100644 (file)
@@ -33,7 +33,7 @@ My_lily_parser::set_debug()
 #ifndef NPRINT
   String s = "";
   if (init_parse_b_) 
 #ifndef NPRINT
   String s = "";
   if (init_parse_b_) 
-       s = "Init";
+    s = "Init";
   set_yydebug (!monitor->silence (s+"Parser") && check_debug);
   lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug);
 #endif
   set_yydebug (!monitor->silence (s+"Parser") && check_debug);
   lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug);
 #endif
@@ -46,10 +46,10 @@ My_lily_parser::print_declarations()
   String s = "";
   
   if (init_parse_b_) 
   String s = "";
   
   if (init_parse_b_) 
-       s = "Init";
+    s = "Init";
   if (!monitor->silence (s+"Declarations") && check_debug) 
     {
   if (!monitor->silence (s+"Declarations") && check_debug) 
     {
-       lexer_p_->print_declarations (init_parse_b_);
+      lexer_p_->print_declarations (init_parse_b_);
     }
 #endif   
 }
     }
 #endif   
 }
@@ -69,14 +69,14 @@ My_lily_parser::parse_file (String init, String s)
   print_declarations();
 
   init_parse_b_ = false;
   print_declarations();
 
   init_parse_b_ = false;
-    set_debug();
+  set_debug();
   lexer_p_->new_input (s , source_l_);
   do_yyparse();
   print_declarations();
 
   
   if (!define_spot_array_.empty())
   lexer_p_->new_input (s , source_l_);
   do_yyparse();
   print_declarations();
 
   
   if (!define_spot_array_.empty())
-       warning ("Braces don't match.");
+    warning ("Braces don't match.");
 }
 
 My_lily_parser::~My_lily_parser()
 }
 
 My_lily_parser::~My_lily_parser()
@@ -92,7 +92,7 @@ My_lily_parser::remember_spot()
 }
 
 char const * 
 }
 
 char const * 
-My_lily_parser::here_ch_C()const
+My_lily_parser::here_ch_C() const
 {
   return lexer_p_->here_ch_C();
 }
 {
   return lexer_p_->here_ch_C();
 }
@@ -101,8 +101,8 @@ void
 My_lily_parser::parser_error (String s)
 {
   here_input().error (s);
 My_lily_parser::parser_error (String s)
 {
   here_input().error (s);
-  if ( fatal_error_i_)
-       exit (fatal_error_i_);
+  if (fatal_error_i_)
+    exit (fatal_error_i_);
   error_level_i_ = 1;
 }
 
   error_level_i_ = 1;
 }
 
@@ -125,7 +125,7 @@ void
 My_lily_parser::set_last_duration (Duration const *d)
 {
   if (last_duration_mode_b_)
 My_lily_parser::set_last_duration (Duration const *d)
 {
   if (last_duration_mode_b_)
-       default_duration_ = *d;
+    default_duration_ = *d;
 }
 
 
 }
 
 
@@ -151,25 +151,22 @@ My_lily_parser::get_rest_element (String s,  Duration * duration_p)
   Chord* velt_p = new Request_chord;
   velt_p->set_spot (here_input());
 
   Chord* velt_p = new Request_chord;
   velt_p->set_spot (here_input());
 
-  if (s=="s") { /* Space */
-       Skip_req * skip_p = new Skip_req;
-       skip_p->duration_ = *duration_p;
+  if (s=="s")
+    { /* Space */
+    Skip_req * skip_p = new Skip_req;
+    skip_p->duration_ = *duration_p;
 
 
-       skip_p->set_spot (here_input());
-       velt_p->add (skip_p);
+    skip_p->set_spot (here_input());
+    velt_p->add (skip_p);
     }
   else 
     {
     }
   else 
     {
-       Rest_req * rest_req_p = new Rest_req;
-       rest_req_p->duration_ = *duration_p;
-       rest_req_p->set_spot (here_input());
+      Rest_req * rest_req_p = new Rest_req;
+      rest_req_p->duration_ = *duration_p;
+      rest_req_p->set_spot (here_input());
        
        
-       velt_p->add (rest_req_p);
+      velt_p->add (rest_req_p);
     }
     }
-  Stem_req * stem_p = new Stem_req;
-  stem_p->duration_ = *duration_p;
-  stem_p->set_spot ( here_input());
-  velt_p->add (stem_p);
 
   delete duration_p;
   return velt_p;
 
   delete duration_p;
   return velt_p;
@@ -183,15 +180,6 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
 
   v->add (rq);
   
 
   v->add (rq);
   
-  if (duration_p->durlog_i_ >= 1) 
-    {
-       Stem_req * stem_req_p = new Stem_req();
-       stem_req_p->duration_ = *duration_p;
-       
-       stem_req_p->set_spot (here_input());
-       v->add (stem_req_p);
-    }
-
   rq->set_duration (*duration_p);
   rq->set_spot (here_input());
   delete duration_p ;
   rq->set_duration (*duration_p);
   rq->set_spot (here_input());
   delete duration_p ;
@@ -205,57 +193,57 @@ My_lily_parser::get_parens_request (char c)
   switch (c) 
     {
 
   switch (c) 
     {
 
-  case '~':
-       req_p = new Tie_req;
-       break;
-  case '[':
-  case ']':
-  {
+    case '~':
+      req_p = new Tie_req;
+      break;
+    case '[':
+    case ']':
+      {
        Beam_req*b = new Beam_req;
        int p_i=plet_.type_i_ ; // ugh . Should junk?
        if (p_i!= 1)
        Beam_req*b = new Beam_req;
        int p_i=plet_.type_i_ ; // ugh . Should junk?
        if (p_i!= 1)
-           b->nplet = p_i;
+         b->nplet = p_i;
        req_p = b;
        req_p = b;
-    }
-  break;
-
-  case '>':
-  case '!':
-  case '<':
-       req_p = new Span_dynamic_req;
-       break;
+      }
+    break;
+
+    case '>':
+    case '!':
+    case '<':
+      req_p = new Span_dynamic_req;
+      break;
   
   
-  case ')':
-  case '(':
-       req_p = new Slur_req;
-       break;
-  default:
-       assert (false);
-       break;
+    case ')':
+    case '(':
+      req_p = new Slur_req;
+      break;
+    default:
+      assert (false);
+      break;
     }
   
   switch (c) 
     {
     }
   
   switch (c) 
     {
-  case '<':
-  case '>':
-  case '(':
-  case '[':
-       req_p->span()->spantype = Span_req::START;
-       break;
-  case '!':
-  case ')':
-  case ']':
-       req_p->span()->spantype = Span_req::STOP;
-       break;
+    case '<':
+    case '>':
+    case '(':
+    case '[':
+      req_p->span()->spantype = Span_req::START;
+      break;
+    case '!':
+    case ')':
+    case ']':
+      req_p->span()->spantype = Span_req::STOP;
+      break;
        
        
-  default:
-       break;
+    default:
+      break;
     }
 
     }
 
-   if (req_p->musical()->span_dynamic ()) 
-   {
-       Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ;
-       s_l->dynamic_dir_i_ = (c == '<') ? 1:-1;
+  if (req_p->musical()->span_dynamic ()) 
+    {
+      Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ;
+      s_l->dynamic_dir_ = (c == '<') ? UP:DOWN;
     }
 
   req_p->set_spot (here_input());
     }
 
   req_p->set_spot (here_input());
@@ -281,12 +269,12 @@ My_lily_parser::add_requests (Chord*v)
 {
   for (int i = 0; i < pre_reqs.size(); i++) 
     {
 {
   for (int i = 0; i < pre_reqs.size(); i++) 
     {
-       v->add (pre_reqs[i]);
+      v->add (pre_reqs[i]);
     }
   pre_reqs.clear();
   for (int i = 0; i <post_reqs.size(); i++) 
     {
     }
   pre_reqs.clear();
   for (int i = 0; i <post_reqs.size(); i++) 
     {
-       v->add (post_reqs[i]);
+      v->add (post_reqs[i]);
     }
   post_reqs.clear();
 }
     }
   post_reqs.clear();
 }
@@ -298,7 +286,7 @@ My_lily_parser::pop_spot()
 }
 
 Input
 }
 
 Input
-My_lily_parser::here_input()const
+My_lily_parser::here_input() const
 {
   Source_file * f_l= lexer_p_->source_file_l();
   return Input (f_l, here_ch_C());
 {
   Source_file * f_l= lexer_p_->source_file_l();
   return Input (f_l, here_ch_C());
index 34e12316d014578c0bd4014eb581434428aa0781..a77557793e876a84f513688874ab8582c451cb4f 100644 (file)
 #include "rest-column.hh"
 
 bool
 #include "rest-column.hh"
 
 bool
-Note_column_engraver::acceptable_elem_b (Score_elem const*elem_C)const
+Note_column_engraver::acceptable_elem_b (Score_elem const*elem_C) const
 {
   char const*nC = elem_C->name();
   return (nC == Script::static_name() || nC == Note_head::static_name () 
 {
   char const*nC = elem_C->name();
   return (nC == Script::static_name() || nC == Note_head::static_name () 
-           || nC == Stem::static_name());
+         || nC == Stem::static_name());
 }
 Note_column*
 Note_column_engraver::note_col_l()
 {
   if (!ncol_p_)
     {
 }
 Note_column*
 Note_column_engraver::note_col_l()
 {
   if (!ncol_p_)
     {
-       ncol_p_ = new Note_column;
-       announce_element (Score_elem_info (ncol_p_, 0));
+      ncol_p_ = new Note_column;
+      announce_element (Score_elem_info (ncol_p_, 0));
     }
   return ncol_p_;
 }
     }
   return ncol_p_;
 }
@@ -36,8 +36,8 @@ Note_column_engraver::rest_col_l()
 {
   if (!restcol_p_) 
     {
 {
   if (!restcol_p_) 
     {
-       restcol_p_  = new Rest_column;
-       announce_element (Score_elem_info (restcol_p_,0));
+      restcol_p_  = new Rest_column;
+      announce_element (Score_elem_info (restcol_p_,0));
     }
   return restcol_p_;
 }
     }
   return restcol_p_;
 }
@@ -46,49 +46,49 @@ void
 Note_column_engraver::acknowledge_element (Score_elem_info i)
 {
   if (!acceptable_elem_b (i.elem_l_))
 Note_column_engraver::acknowledge_element (Score_elem_info i)
 {
   if (!acceptable_elem_b (i.elem_l_))
-       return;
+    return;
 
 
   char const*nC = i.elem_l_->name();
 
   if (nC == Script::static_name() && i.req_l_ && i.req_l_->musical ()) 
     {
 
 
   char const*nC = i.elem_l_->name();
 
   if (nC == Script::static_name() && i.req_l_ && i.req_l_->musical ()) 
     {
-       script_l_arr_.push ((Script*)i.elem_l_->item());
+      script_l_arr_.push ((Script*)i.elem_l_->item());
     }
   else if (nC == Note_head::static_name()) 
     {
     }
   else if (nC == Note_head::static_name()) 
     {
-       Note_head * h_l = (Note_head*)i.elem_l_->item();
-       if (h_l->rest_b_)
-           rest_col_l()->add (h_l);
-       else
-           note_col_l()->add (h_l);
+      Note_head * h_l = (Note_head*)i.elem_l_->item();
+      if (h_l->rest_b_)
+       rest_col_l()->add (h_l);
+      else
+       note_col_l()->add (h_l);
 
     }
   else if (nC == Stem::static_name())
     {
 
     }
   else if (nC == Stem::static_name())
     {
-       stem_l_ = (Stem*)i.elem_l_->item();
+      stem_l_ = (Stem*)i.elem_l_->item();
     }
 
     }
 
-  if ( ncol_p_ || restcol_p_) 
+  if (ncol_p_ || restcol_p_) 
     {
     {
-       if ( stem_l_) 
-         {
-           if (restcol_p_&& !restcol_p_->stem_l_)
-               restcol_p_->set (stem_l_);
-           if (ncol_p_ && !ncol_p_->stem_l_)
-               ncol_p_->set (stem_l_);
-         }
+      if (stem_l_) 
+       {
+         if (restcol_p_&& !restcol_p_->stem_l_)
+           restcol_p_->set (stem_l_);
+         if (ncol_p_ && !ncol_p_->stem_l_)
+           ncol_p_->set (stem_l_);
+       }
   
   
   
   
-       for (int i=0; i < script_l_arr_.size(); i++) 
-         {
-           if (restcol_p_)
-               restcol_p_->add (script_l_arr_[i]);
-           if ( ncol_p_)
-               ncol_p_->add (script_l_arr_[i]);
-         }
+      for (int i=0; i < script_l_arr_.size(); i++) 
+       {
+         if (restcol_p_)
+           restcol_p_->add (script_l_arr_[i]);
+         if (ncol_p_)
+           ncol_p_->add (script_l_arr_[i]);
+       }
   
   
-       script_l_arr_.clear();
+      script_l_arr_.clear();
     }
 
 }
     }
 
 }
@@ -98,21 +98,21 @@ Note_column_engraver::do_pre_move_processing()
 {
   if (ncol_p_) 
     {
 {
   if (ncol_p_) 
     {
-       if (! ncol_p_->h_shift_b_)
-           ncol_p_->h_shift_b_ = h_shift_b_;
-       if (! ncol_p_->dir_i_)
-           ncol_p_->dir_i_ = dir_i_;
+      if (! ncol_p_->h_shift_b_)
+       ncol_p_->h_shift_b_ = h_shift_b_;
+      if (! ncol_p_->dir_)
+       ncol_p_->dir_ = dir_;
 
 
-       typeset_element (ncol_p_);
-       ncol_p_ =0;
+      typeset_element (ncol_p_);
+      ncol_p_ =0;
     }
   if (restcol_p_) 
     {
     }
   if (restcol_p_) 
     {
-       if (! restcol_p_->dir_i_)
-           restcol_p_->dir_i_ = dir_i_;
+      if (! restcol_p_->dir_)
+       restcol_p_->dir_ = dir_;
 
 
-       typeset_element (restcol_p_);
-       restcol_p_ =0;
+      typeset_element (restcol_p_);
+      restcol_p_ =0;
     }
 }
 
     }
 }
 
@@ -126,15 +126,15 @@ Note_column_engraver::do_post_move_processing()
 void
 Note_column_engraver::set_feature (Feature i)
 {
 void
 Note_column_engraver::set_feature (Feature i)
 {
-   if (i.type_ == "vdir")      
-       dir_i_ = i.value_;
-   if (i.type_ == "hshift")
-        h_shift_b_ = (bool)(int)i.value_;
+  if (i.type_ == "vdir")       
+    dir_ = (Direction) int(i.value_);
+  if (i.type_ == "hshift")
+    h_shift_b_ = (bool)(int)i.value_;
 }
 
 Note_column_engraver::Note_column_engraver()
 {
 }
 
 Note_column_engraver::Note_column_engraver()
 {
-  dir_i_ =0;
+  dir_ =CENTER;
   h_shift_b_ = false;
   
   ncol_p_=0;
   h_shift_b_ = false;
   
   ncol_p_=0;
index 19cf429928ccd33c9aded260de7c238bf5a24851..f310d0828c356f5f3b470f5ee9901cb4bf98b5d2 100644 (file)
 
 IMPLEMENT_IS_TYPE_B1(Note_column,Head_column);
 
 
 IMPLEMENT_IS_TYPE_B1(Note_column,Head_column);
 
-void
-Note_column::set (Stem*s)
-{
-  stem_l_ = s;
-  add_support (s);
-}
-
 Note_column::Note_column()
 {
   h_shift_b_ =false;
 Note_column::Note_column()
 {
   h_shift_b_ =false;
@@ -33,10 +26,10 @@ Note_column::sort()
 }
   
 Interval_t<int>
 }
   
 Interval_t<int>
-Note_column::head_positions_interval()const
+Note_column::head_positions_interval() const
 {
   ((Note_column*)this)->sort();
 {
   ((Note_column*)this)->sort();
-  return Interval_t<int> ( head_l_arr_[0]->position_i_, 
+  return Interval_t<int> (head_l_arr_[0]->position_i_, 
                             head_l_arr_.top()->position_i_);
 
 }
                             head_l_arr_.top()->position_i_);
 
 }
@@ -45,9 +38,9 @@ Note_column::head_positions_interval()const
 void
 Note_column::do_pre_processing()
 {
 void
 Note_column::do_pre_processing()
 {
-  if (!dir_i_&& !stem_l_)
+  if (!dir_&& !stem_l_)
     {
     {
-       dir_i_ = (head_positions_interval().center () >=  5) ? -1 : 1;
+       dir_ = (head_positions_interval().center () >=  5) ? DOWN:UP;
     }
   Head_column::do_pre_processing();
 }
     }
   Head_column::do_pre_processing();
 }
index dd2ac9da14b8d063210cf06fc7975565e4265a33..9ae829f7ff37f1673a9cdedf62af86decb0b921d 100644 (file)
@@ -26,7 +26,7 @@ void
 Note_performer::do_print() const
 {
 #ifndef NPRINT
 Note_performer::do_print() const
 {
 #ifndef NPRINT
-  if ( note_req_l_) 
+  if (note_req_l_) 
     {
        note_req_l_->print();
     }
     {
        note_req_l_->print();
     }
@@ -37,20 +37,20 @@ void
 Note_performer::process_requests() 
 {
   // this is _really_ braindead, but it generates some output
 Note_performer::process_requests() 
 {
   // this is _really_ braindead, but it generates some output
-  if ( !note_req_l_ || !note_req_l_->melodic()  || !note_req_l_->rhythmic ())
+  if (!note_req_l_ || !note_req_l_->melodic()  || !note_req_l_->rhythmic ())
        return;
 
        return;
 
-  play (new Audio_note (note_req_l_) );
+  play (new Audio_note (note_req_l_));
   note_req_l_ = 0;
 }
 
 bool 
 Note_performer::do_try_request (Request* req_l)
 {
   note_req_l_ = 0;
 }
 
 bool 
 Note_performer::do_try_request (Request* req_l)
 {
-  if ( note_req_l_)
+  if (note_req_l_)
        return false;
   
        return false;
   
-  if ( !req_l->musical() || !req_l->musical ()->note ())
+  if (!req_l->musical() || !req_l->musical ()->note ())
        return false;
 
   note_req_l_ = req_l->musical()->melodic ();
        return false;
 
   note_req_l_ = req_l->musical()->melodic ();
index ec84dbba52762626257c223bc5a9935d77c0bd60..6bb466a5af0f085a2dd93a8ad96845d8f461939d 100644 (file)
@@ -49,7 +49,7 @@ Request*
 get_script_req (int d , General_script_def*def)
 {
   Musical_script_req* script_req_p = new Musical_script_req;
 get_script_req (int d , General_script_def*def)
 {
   Musical_script_req* script_req_p = new Musical_script_req;
-  script_req_p->dir_i_ =d;
+  script_req_p->dir_ =d;
   script_req_p->scriptdef_p_=def;
   return script_req_p;
 }
   script_req_p->scriptdef_p_=def;
   return script_req_p;
 }
index 6871240ff97166c38112074f1dab9763dd664cde..0afaabd49fedf07e473554d3041a6f9c117befae 100644 (file)
@@ -31,7 +31,7 @@
 
 Note_head::Note_head (int ss)
 {
 
 Note_head::Note_head (int ss)
 {
-  x_dir_i_ = 0;
+  x_dir_ = CENTER;
   staff_size_i_=ss;
   position_i_ = 0;
   balltype_i_ = 0;
   staff_size_i_=ss;
   position_i_ = 0;
   balltype_i_ = 0;
@@ -46,14 +46,14 @@ Note_head::do_pre_processing()
 {
   // 8 ball looks the same as 4 ball:
   if (balltype_i_ > 2 && !rest_b_)
 {
   // 8 ball looks the same as 4 ball:
   if (balltype_i_ > 2 && !rest_b_)
-       balltype_i_ = 2;
+    balltype_i_ = 2;
        
   if (rest_b_) 
     {
        
   if (rest_b_) 
     {
-       if (balltype_i_ == 0)
-           position_i_ += 6;
-       else if (balltype_i_ == 0)
-           position_i_ += 4;
+      if (balltype_i_ == 0)
+       position_i_ += 6;
+      else if (balltype_i_ == 0)
+       position_i_ += 4;
     }
 }
 
     }
 }
 
@@ -68,13 +68,13 @@ Note_head::set_rhythmic (Rhythmic_req*r_req_l)
 IMPLEMENT_IS_TYPE_B1(Note_head,Item);
 
 void
 IMPLEMENT_IS_TYPE_B1(Note_head,Item);
 
 void
-Note_head::do_print()const
+Note_head::do_print() const
 {
 #ifndef NPRINT
   if (rest_b_)
 {
 #ifndef NPRINT
   if (rest_b_)
-       DOUT << "REST! ";
+    DOUT << "REST! ";
   DOUT << "balltype_i_ "<< balltype_i_ << ", position_i_ = "<< position_i_
   DOUT << "balltype_i_ "<< balltype_i_ << ", position_i_ = "<< position_i_
-        << "dots_i_ " << dots_i_;
+       << "dots_i_ " << dots_i_;
 #endif
 }
 
 #endif
 }
 
@@ -89,9 +89,9 @@ void
 Note_head::set_dots()
 {
   if (!(position_i_ %2) && rest_b_ && balltype_i_ == 0)
 Note_head::set_dots()
 {
   if (!(position_i_ %2) && rest_b_ && balltype_i_ == 0)
-       dot_delta_y_i_ = -1;
+    dot_delta_y_i_ = -1;
   else if (!(position_i_ %2))
   else if (!(position_i_ %2))
-       dot_delta_y_i_ = 1;
+    dot_delta_y_i_ = 1;
 }
 
 /*
 }
 
 /*
@@ -110,39 +110,39 @@ Note_head::brew_molecule_p() const
   bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
   
   if (!rest_b_)
   bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
   
   if (!rest_b_)
-       s = p->lookup_l()->ball (balltype_i_);
+    s = p->lookup_l()->ball (balltype_i_);
   else 
     {
   else 
     {
-       s = p->lookup_l()->rest (balltype_i_, streepjes_b);
+      s = p->lookup_l()->rest (balltype_i_, streepjes_b);
     }
   out = new Molecule (Atom (s));
     }
   out = new Molecule (Atom (s));
-  out->translate (x_dir_i_ * s.dim.x().length () , X_AXIS);
+  out->translate (x_dir_ * s.dim.x().length () , X_AXIS);
   if (dots_i_) 
     {
   if (dots_i_) 
     {
-       Symbol d = p->lookup_l()->dots (dots_i_);
-       Molecule dm;
-       dm.add (Atom (d));
-       dm.translate (inter_f * dot_delta_y_i_ , Y_AXIS);
-       out->add_right (dm);
+      Symbol d = p->lookup_l()->dots (dots_i_);
+      Molecule dm;
+      dm.add (Atom (d));
+      dm.translate (inter_f * dot_delta_y_i_ , Y_AXIS);
+      out->add_right (dm);
     }
 
   
   if (rest_b_) 
     {
     }
 
   
   if (rest_b_) 
     {
-       streepjes_b = false;
+      streepjes_b = false;
     }
   
   if (streepjes_b) 
     {
     }
   
   if (streepjes_b) 
     {
-       int dir = sign (position_i_);
-       int s =(position_i_<-1) ? -((-position_i_)/2): (position_i_-staff_size_i_)/2;
+      int dir = sign (position_i_);
+      int s =(position_i_<-1) ? -((-position_i_)/2): (position_i_-staff_size_i_)/2;
        
        
-       Symbol str = p->lookup_l()->streepjes (s);
-       Molecule sm;
-       sm.add (Atom (str));
-       if (position_i_ % 2)
-           sm.translate (-inter_f* dir, Y_AXIS);
-       out->add (sm);      
+      Symbol str = p->lookup_l()->streepjes (s);
+      Molecule sm;
+      sm.add (Atom (str));
+      if (position_i_ % 2)
+       sm.translate (-inter_f* dir, Y_AXIS);
+      out->add (sm);       
     }
   
   out->translate (inter_f*position_i_, Y_AXIS);
     }
   
   out->translate (inter_f*position_i_, Y_AXIS);
index 9e5be116646cac5dc2ba974513f8778e1d1f5c95..715adecd83122c555615721e43cfce11ad90658c 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-  p-col.cc -- implement PCol
+  p-col.cc -- implement Paper_column
 
   source file of the GNU LilyPond music typesetter
 
 
   source file of the GNU LilyPond music typesetter
 
 
 #include "p-col.hh"
 #include "p-score.hh"
 
 #include "p-col.hh"
 #include "p-score.hh"
-
 #include "debug.hh"
 
 #include "debug.hh"
 
-Interval
-PCol::width() const
-{
-  Interval w;
-
-  for (iter_top (its,i); i.ok(); i++)
-       w.unite (i->width());
-  if (w.empty_b())
-       w.unite (Interval (0,0));
-  return w;
-}
-
-void
-PCol::clean_breakable_items()
-{
-  if (!line_l_) 
-    {
-       its.junk_links();
-    }
-  if (prebreak_p_) 
-       prebreak_p_->clean_breakable_items();
-  if (postbreak_p_) 
-       postbreak_p_->clean_breakable_items();
-}
 
 int
 
 int
-PCol::rank_i() const
+Paper_column::rank_i() const
 {
   return rank_i_;
 }
 
 void
 {
   return rank_i_;
 }
 
 void
-PCol::set_rank (int i)
+Paper_column::set_rank (int i)
 {
   rank_i_ = i;
 {
   rank_i_ = i;
-  if (prebreak_p_)
-       prebreak_p_->rank_i_ = i;
-  if (postbreak_p_)
-       postbreak_p_->rank_i_ = i;
+  if (prebreak_l())
+    prebreak_l()->rank_i_ = i;
+  if (postbreak_l())
+    postbreak_l()->rank_i_ = i;
 }
 
 void
 }
 
 void
-PCol::print() const
+Paper_column::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-  DOUT << "PCol {";
-
   DOUT << "rank: " << rank_i_ << '\n';
   DOUT << "rank: " << rank_i_ << '\n';
-
-  DOUT << "# symbols: " << its.size() ;
-     if (prebreak_p_){
-        DOUT << "\npre: ";
-        prebreak_p_->print();
+  if (prebreak_l())
+    {
+      DOUT << "\npre: ";
+      prebreak_l()->print();
     }
     }
-    if (postbreak_p_) {
+  if (postbreak_l()) 
+    {
       DOUT << "post: ";
       DOUT << "post: ";
-      postbreak_p_->print();
+      postbreak_l()->print();
     } 
     } 
-  else if (daddy_l_) 
+  if (break_status_i_)
     {
     {
-       DOUT <<'\n' << ((this == daddy_l_->prebreak_p_) ?
-                      "prebreak" : "postbreak");
-       DOUT << '\n';
+      DOUT <<'\n' << ((break_status_i_ == -1)? "prebreak" : "postbreak");
+      DOUT << '\n';
     }
   DOUT << "extent: " << width().str () << "\n";
     }
   DOUT << "extent: " << width().str () << "\n";
-  DOUT << "}\n";
 #endif 
 }
 
 int
 #endif 
 }
 
 int
-PCol::compare (PCol const &c1, PCol const &c2)
+Paper_column::compare (Paper_column const &c1, Paper_column const &c2)
 {
   return c1.rank_i() - c2.rank_i ();
 }
 
 {
   return c1.rank_i() - c2.rank_i ();
 }
 
-void
-PCol::OK() const
+Paper_column*
+Paper_column::prebreak_l() const
 {
 {
-#ifndef NDEBUG
-  if (prebreak_p_ || postbreak_p_) 
-    {
-       assert (prebreak_p_&&postbreak_p_);
-       assert (prebreak_p_->daddy_l_ == this);
-       assert (postbreak_p_->daddy_l_ == this);
-    }
-#endif
+  return (Paper_column*)broken_to_drul_[LEFT];
 }
 
 }
 
-void
-PCol::set_breakable()
+Paper_column*
+Paper_column::postbreak_l() const
 {
 {
-  if (breakable_b())
-       return;
-
-  do_set_breakable();
-  prebreak_p_->pscore_l_ = pscore_l_;
-  postbreak_p_->pscore_l_ = pscore_l_;
-
-  prebreak_p_->daddy_l_ = postbreak_p_->daddy_l_ = this;
+  return(Paper_column*) broken_to_drul_[RIGHT];
 }
 }
-void
-PCol::do_set_breakable()
-{
-   prebreak_p_ = new PCol;
-  postbreak_p_ = new PCol;
-}
-  
-
 bool
 bool
-PCol::breakpoint_b() const
+Paper_column::breakpoint_b() const
 {
   return !line_l_;
 }
 
 {
   return !line_l_;
 }
 
-bool
-PCol::breakable_b() const
-{
-  return prebreak_p_||postbreak_p_||daddy_l_;
-}
-
-PCol::PCol()
+Paper_column::Paper_column()
 {
   used_b_ = false;
   error_mark_b_ = false;
 {
   used_b_ = false;
   error_mark_b_ = false;
-  daddy_l_ = 0;
-  prebreak_p_=0;
-  postbreak_p_=0;
   line_l_=0;
   line_l_=0;
-  hpos_f_ = -1.0;
-  pscore_l_ = 0;
   rank_i_ = -1;
 }
 
   rank_i_ = -1;
 }
 
-PCol::~PCol()
-{
-  delete prebreak_p_;
-  delete postbreak_p_;
-}
-
-void
-PCol::add (Item *i)
+Line_of_score*
+Paper_column::line_l() const
 {
 {
-  its.bottom().add (i);
-  i->pcol_l_ = this; 
+  return line_l_;
 }
 
 bool
 }
 
 bool
-PCol::used_b()const
+Paper_column::used_b() const
 {
 {
-  return daddy_l_ || breakable_b() || its.size ()|| used_b_;
+  return linked_b();
 }
 }
+
+IMPLEMENT_IS_TYPE_B1(Paper_column, Horizontal_group_item);
+
index dbf5d84525803e33ad8b3fed93e88620eccb250d..ffa0dcfc2bcb1e1f22c2a544f3be61d7803f0f03 100644 (file)
 #include "p-score.hh"
 #include "tex-stream.hh"
 #include "p-col.hh"
 #include "p-score.hh"
 #include "tex-stream.hh"
 #include "p-col.hh"
-
+#include "header.hh"
 #include "word-wrap.hh"
 #include "gourlay-breaking.hh"
 
 #include "word-wrap.hh"
 #include "gourlay-breaking.hh"
 
-Paper_score::Paper_score (Paper_def*p)
+Paper_score::Paper_score ()
 {
 {
-  paper_l_ = p;
   super_elem_l_   = new Super_elem;
   typeset_element (super_elem_l_);
 }
 
   super_elem_l_   = new Super_elem;
   typeset_element (super_elem_l_);
 }
 
-Paper_score::~Paper_score()
+Paper_score::~Paper_score ()
 {
 {
-  super_elem_l_->unlink_all();
+  super_elem_l_->unlink_all ();
+  for (PCursor<Score_elem*> i(elem_p_list_.top()); i.ok(); i++)
+    assert(!i->linked_b());
 }
 
 void
 Paper_score::typeset_element (Score_elem * elem_p)
 {
 }
 
 void
 Paper_score::typeset_element (Score_elem * elem_p)
 {
-  elem_p_list_.bottom().add (elem_p);
+  elem_p_list_.bottom ().add (elem_p);
   elem_p->pscore_l_ = this;
 
   elem_p->pscore_l_ = this;
 
-  elem_p->add_processing();
-}
-
-void
-Paper_score::typeset_item (Item *i, PCol *c)
-{
-  assert (c && i);
-  int breakstat = i->break_status_i_;
-
-  if (breakstat == -1) 
-    {
-       c = c->prebreak_p_;
-  }else if (breakstat == 1) 
-    {
-       c = c->postbreak_p_;
-    }
-
-  c->add (i);
-  typeset_element (i);
+  elem_p->add_processing ();
 }
 
 void
 Paper_score::typeset_broken_spanner (Spanner*span_p)
 {
 }
 
 void
 Paper_score::typeset_broken_spanner (Spanner*span_p)
 {
-  span_p->left_col_l_->starters.bottom().add (span_p);
-  assert (span_p->left_col_l_->line_l_ == span_p->right_col_l_->line_l_);
-
   typeset_element (span_p);
 }
 
   typeset_element (span_p);
 }
 
@@ -71,111 +51,82 @@ Paper_score::typeset_broken_spanner (Spanner*span_p)
 void
 Paper_score::typeset_unbroken_spanner (Spanner*span_p)
 {
 void
 Paper_score::typeset_unbroken_spanner (Spanner*span_p)
 {
-  span_p_list_.bottom().add (span_p);
+  span_p_list_.bottom ().add (span_p);
   span_p->pscore_l_=this;
 
   span_p->pscore_l_=this;
 
-  if (span_p->left_col_l_) 
-       span_p->left_col_l_->used_b_ = true;
-  if ( span_p->right_col_l_)
-       span_p->right_col_l_->used_b_ = true;
   
   // do not init start/stop fields. These are for broken spans only.
   
   // do not init start/stop fields. These are for broken spans only.
-  span_p->add_processing();
+  span_p->add_processing ();
 }
 
 
 void
 }
 
 
 void
-Paper_score::clean_cols()
+Paper_score::clean_cols ()
 {
   int rank_i = 0;
 {
   int rank_i = 0;
-  for (iter_top (col_p_list_,c); c.ok();)
-       if (!c->used_b()) 
-         {
-           delete c.remove_p();
-         }
-       else 
-         {
-           c->set_rank (rank_i++);
-           c++;
-         }
-}
-
-void
-Paper_score::add (PCol *p)
-{
-  p->pscore_l_ = this;
-  if (p->breakable_b())
+  for (iter_top (col_p_list_,c); c.ok ();)
     {
     {
-       p->prebreak_p_->pscore_l_ = this;
-       p->postbreak_p_->pscore_l_ = this;
+      c->set_rank (rank_i++);
+      c++;
     }
     }
-  col_p_list_.bottom().add (p);
 }
 
 void
 }
 
 void
-Paper_score::output (Tex_stream &ts)
+Paper_score::add_column (Paper_column *p)
 {
 {
-  ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
-  ts<< super_elem_l_->TeX_string();
-  ts << "\n\\EndLilyPondOutput";
+  col_p_list_.bottom ().add (p);
+  typeset_element(p);
 }
 
 
 }
 
 
+
 void
 void
-Paper_score::OK()const
+Paper_score::OK () const
 {
 #ifndef NDEBUG
 {
 #ifndef NDEBUG
-  for (iter_top (col_p_list_,cc); cc.ok(); cc++)
-       cc->OK();
-  for (PCursor<Score_elem*> i (elem_p_list_.top()); i.ok (); i++) 
-       i->OK();
+  for (PCursor<Score_elem*> i (elem_p_list_.top ()); i.ok  (); i++) 
+    i->OK ();
 #endif
 }
 
 void
 #endif
 }
 
 void
-Paper_score::print() const
+Paper_score::print () const
 {    
 #ifndef NPRINT
 {    
 #ifndef NPRINT
-  if ( !check_debug)
-       return ;
+  if (!check_debug)
+    return ;
   DOUT << "Paper_score { ";
   DOUT << "Paper_score { ";
-  paper_l_->print();
   DOUT << "\n elements: ";
   DOUT << "\n elements: ";
-  for (iter_top (elem_p_list_,cc); cc.ok(); cc++)      
-       cc->print();
+  for (iter_top (elem_p_list_,cc); cc.ok (); cc++)     
+    cc->print ();
   DOUT << "\n unbroken spanners: ";
   DOUT << "\n unbroken spanners: ";
-  for (iter (span_p_list_.top(), i); i.ok (); i++)
-       i->print();
-  DOUT << "\ncolumns: ";
-   for (iter_top (col_p_list_,cc); cc.ok(); cc++)
-       cc->print();
+  for (iter (span_p_list_.top (), i); i.ok  (); i++)
+    i->print ();
   
   DOUT << "}\n";
 #endif 
 }
 
 void
   
   DOUT << "}\n";
 #endif 
 }
 
 void
-Paper_score::preprocess()
+Paper_score::preprocess ()
 {
 {
-  super_elem_l_->breakable_col_processing();
-  super_elem_l_->pre_processing();
+  super_elem_l_->breakable_col_processing ();
+  super_elem_l_->pre_processing ();
 }
 
 void
 }
 
 void
-Paper_score::postprocess()
+Paper_score::postprocess ()
 {
 {
-  super_elem_l_->post_processing();
-  super_elem_l_->molecule_processing();
+  super_elem_l_->post_processing ();
+  super_elem_l_->molecule_processing ();
 }
 
 }
 
-PCursor<PCol *>
-Paper_score::find_col (PCol const *c)const
+PCursor<Paper_column *>
+Paper_score::find_col (Paper_column const *c) const
 {
 {
-  PCol const *what = c;
-  if (what->daddy_l_)
-       what = what->daddy_l_;
+  Paper_column const *what = c;
   
   
-  return col_p_list_.find ((PCol*)what);
+  return col_p_list_.find ((Paper_column*)what);
 }
 
 
 }
 
 
@@ -183,139 +134,158 @@ void
 Paper_score::set_breaking (Array<Col_hpositions> const &breaking)
 {
   super_elem_l_->line_of_score_l_->set_breaking (breaking);
 Paper_score::set_breaking (Array<Col_hpositions> const &breaking)
 {
   super_elem_l_->line_of_score_l_->set_breaking (breaking);
-  super_elem_l_->break_processing();
+  super_elem_l_->break_processing ();
 
 
 
 
-  for (iter (span_p_list_.top(),i); i.ok ();) 
+  for (iter (span_p_list_.top (),i); i.ok  ();) 
     {
     {
-       Spanner *span_p = i.remove_p();
-       if (span_p->broken_b()) 
-         {
-           span_p->unlink();
-           delete span_p;
+      Spanner *span_p = i.remove_p ();
+      if (span_p->broken_b ()) 
+       {
+         span_p->unlink ();
+         delete span_p;
        }else
          {
            typeset_broken_spanner (span_p);
          }
     }
        }else
          {
            typeset_broken_spanner (span_p);
          }
     }
-  for (iter (elem_p_list_.top(),i); i.ok () ;) 
+  for (iter (elem_p_list_.top (),i); i.ok  () ;) 
     {
     {
-       Item *i_l =i->item();
-       if ( i_l && !i_l->pcol_l_->line_l_
-         {
-           i_l->unlink();
-           delete i.remove_p();
-         }
-       else
-           i++;
+      Item *i_l =i->item ();
+      if (i_l && !i_l->line_l ()
+       {
+         i_l->unlink ();
+         delete i.remove_p ();
+       }
+      else
+       i++;
     }
     }
-
-  for (iter_top (col_p_list_, i); i.ok(); i++)
-       i->clean_breakable_items();
 }
 
 void
 }
 
 void
-Paper_score::calc_breaking()
+Paper_score::calc_breaking ()
 {
 {
-  Break_algorithm *algorithm_p;
+  Break_algorithm *algorithm_p=0;
   Array<Col_hpositions> sol;
   bool try_wrap = ! paper_l_->get_var ("castingalgorithm");
 
   if (!try_wrap) 
     {
   Array<Col_hpositions> sol;
   bool try_wrap = ! paper_l_->get_var ("castingalgorithm");
 
   if (!try_wrap) 
     {
-       algorithm_p = new Gourlay_breaking ;
-       algorithm_p->set_pscore (this);
-       sol = algorithm_p->solve();
-       delete algorithm_p;
-       if ( ! sol.size()) 
-         {
-            warning ("Can not solve this casting problem exactly; revert to Word_wrap");
-           try_wrap = true;
-         }
+      algorithm_p = new Gourlay_breaking ;
+      algorithm_p->set_pscore (this);
+      sol = algorithm_p->solve ();
+      delete algorithm_p;
+      if (! sol.size ()) 
+       {
+         warning ("Can not solve this casting problem exactly; revert to Word_wrap");
+         try_wrap = true;
+       }
     }
   if  (try_wrap) 
     {
     }
   if  (try_wrap) 
     {
-       algorithm_p = new Word_wrap;    
-       algorithm_p->set_pscore (this);
-       sol = algorithm_p->solve();
-       delete algorithm_p;
+      algorithm_p = new Word_wrap;    
+      algorithm_p->set_pscore (this);
+      sol = algorithm_p->solve ();
+      delete algorithm_p;
     }
   set_breaking (sol);
 }
 
 void
     }
   set_breaking (sol);
 }
 
 void
-Paper_score::process()
+Paper_score::process ()
 {
 {
-  clean_cols();
-  print();
+  clean_cols ();
+  print ();
   *mlog << "Preprocessing elements... " <<flush;
   *mlog << "Preprocessing elements... " <<flush;
-  preprocess();
+  preprocess ();
   *mlog << "\nCalculating column positions ... " <<flush;
   *mlog << "\nCalculating column positions ... " <<flush;
-  calc_breaking();
+  calc_breaking ();
   *mlog << "\nPostprocessing elements..." << endl;
   *mlog << "\nPostprocessing elements..." << endl;
-  postprocess();
+  postprocess ();
+
+  // output
+  String outname = paper_l_->outfile_str_ ;
+  if (outname == "")
+    outname = default_out_str_+ ".tex";
   
   
-#ifndef NDEBUGA
-  for (PCursor<Score_elem*> i (elem_p_list_.top()); i.ok (); i++) 
-       assert (i->status() >= 9);
-#endif
+  *mlog << "TeX output to " <<  outname << " ...\n";
+  
+  Tex_stream the_output (outname);
+  
+  the_output << "% outputting Score, defined at: " << origin_str_ << "\n";
+  if (header_l_) 
+    {
+      the_output << header_l_->TeX_string();
+    }
+  
+  the_output << "\n "<<  paper_l_->lookup_l ()->texsetting << "%(Tex id)\n";
+  the_output<< super_elem_l_->TeX_output_str ();
+  the_output << "\n\\EndLilyPondOutput";
 }
 
 /** Get all breakable columns between l and r, (not counting l and r).  */
 }
 
 /** Get all breakable columns between l and r, (not counting l and r).  */
-Link_array<PCol>
-Paper_score::breakable_col_range (PCol*l,PCol*r)const
+Link_array<Paper_column>
+Paper_score::breakable_col_range (Paper_column*l,Paper_column*r) const
 {
 {
-  Link_array<PCol> ret;
+  Link_array<Paper_column> ret;
 
 
-  PCursor<PCol*> start (l ? find_col (l)+1 : col_p_list_.top());
-  PCursor<PCol*> stop (r ? find_col (r) : col_p_list_.bottom());
+  PCursor<Paper_column*> start (l ? find_col (l)+1 : col_p_list_.top ());
+  PCursor<Paper_column*> stop (r ? find_col (r) : col_p_list_.bottom ());
 
   /*
     ugh! windows-suck-suck-suck.
 
   /*
     ugh! windows-suck-suck-suck.
-   */
-  while ( PCursor<PCol*>::compare (start,stop) < 0) 
+    */
+  while (PCursor<Paper_column*>::compare (start,stop) < 0) 
     {
     {
-       if (start->breakable_b())
-           ret.push (start);
-       start++;
+      if (start->breakable_b_)
+       ret.push (start);
+      start++;
     }
 
   return ret;
 }
     }
 
   return ret;
 }
-Link_array<PCol>
-Paper_score::col_range (PCol*l,PCol*r)const
+Link_array<Paper_column>
+Paper_score::col_range (Paper_column*l, Paper_column*r) const
 {
 {
-  Link_array<PCol> ret;
+  Link_array<Paper_column> ret;
   
   
-  PCursor<PCol*> start (l ? find_col (l)+1 : col_p_list_.top());
-  PCursor<PCol*> stop (r ? find_col (r) : col_p_list_.bottom());
+  PCursor<Paper_column*> start (l ? find_col (l)+1 : col_p_list_.top ());
+  PCursor<Paper_column*> stop (r ? find_col (r) : col_p_list_.bottom ());
   ret.push (l);
   
   /*
     ugh! windows-suck-suck-suck.
   ret.push (l);
   
   /*
     ugh! windows-suck-suck-suck.
-   */
-  while ( PCursor<PCol*>::compare (start,stop) < 0)
-       ret.push (start++);
+    */
+  while (PCursor<Paper_column*>::compare (start,stop) < 0)
+    ret.push (start++);
   ret.push (r);
   return ret;
 }
 
   ret.push (r);
   return ret;
 }
 
-Link_array<PCol>
-Paper_score::broken_col_range (PCol*l,PCol*r)const
+Link_array<Item>
+Paper_score::broken_col_range (Item const*l_item_l, Item const*r_item_l) const
 {
 {
-  Link_array<PCol> ret;
-
-  PCursor<PCol*> start (l ? find_col (l)+1 : col_p_list_.top());
-  PCursor<PCol*> stop (r ? find_col (r) : col_p_list_.bottom());
+  Link_array<Item> ret;
+  Item const*l=l_item_l;
+  Item const*r=r_item_l;
+  
+  while (! l->is_type_b(Paper_column::static_name ())) 
+    l = l->axis_group_l_a_[X_AXIS]->item ();
+  
+  while (! r->is_type_b(Paper_column::static_name ())) 
+    r = r->axis_group_l_a_[X_AXIS]->item ();
+   
+  PCursor<Paper_column*> start (l ? find_col ((Paper_column*)l)+1 : col_p_list_.top ());
+  PCursor<Paper_column*> stop (r ? find_col ((Paper_column*)r) : col_p_list_.bottom ());
   
   /*
     ugh! windows-suck-suck-suck.
     */
   
   /*
     ugh! windows-suck-suck-suck.
     */
-  while ( PCursor<PCol*>::compare (start,stop) < 0) 
+  while (PCursor<Paper_column*>::compare (start,stop) < 0) 
     {
     {
-       if (start->breakable_b() && !start->line_l_)
-           ret.push (start);
-       start++;
+      if (start->breakable_b_ && !start->line_l_)
+       ret.push (start);
+      start++;
     }
 
   return ret;
     }
 
   return ret;
index 8950d987232b80b2bd4c9a5aa94549ce08bf7403..8bf32b14905f0ac92654bb5dcaf9bdf54c0c89a9 100644 (file)
 #include "lookup.hh"
 #include "dimen.hh"
 #include "input-translator.hh"
 #include "lookup.hh"
 #include "dimen.hh"
 #include "input-translator.hh"
-#include "engraver-group.hh"
 #include "assoc-iter.hh"
 #include "assoc-iter.hh"
+#include "score-grav.hh"
+#include "p-score.hh"
+#include "main.hh"
 
 void
 Paper_def::set_var (String s, Real r)
 {
 
 void
 Paper_def::set_var (String s, Real r)
 {
-   real_vars_p_->elem (s) = r;
+  real_vars_p_->elem (s) = r;
 }
  
 Real
 }
  
 Real
-Paper_def::get_var (String s)const
+Paper_def::get_var (String s) const
 {
   if (! real_vars_p_->elt_b (s))
 {
   if (! real_vars_p_->elt_b (s))
-    error ( "unknown paper variable `"  + s+"'");
+    error ("unknown paper variable `"  + s+"'");
   return real_vars_p_->elem (s);
 }
 
   return real_vars_p_->elem (s);
 }
 
@@ -39,7 +41,7 @@ Paper_def::linewidth_f() const
 }
 
 Real
 }
 
 Real
-Paper_def::duration_to_dist (Moment d,Real k)const
+Paper_def::duration_to_dist (Moment d,Real k) const
 {
   if (get_var("geometric"))
     return geometric_spacing(d);
 {
   if (get_var("geometric"))
     return geometric_spacing(d);
@@ -63,9 +65,9 @@ Paper_def::arithmetic_constant(Moment d) const
 }
 
 Real
 }
 
 Real
-Paper_def::arithmetic_spacing(Moment d ,Real k)const
+Paper_def::arithmetic_spacing(Moment d ,Real k) const
 {
 {
-  return (log_2(d) + k)* get_var( "arithmetic_multiplier");
+  return (log_2(d) + k)* get_var("arithmetic_multiplier");
 }
 
 Real
 }
 
 Real
@@ -122,7 +124,7 @@ Paper_def::interline_f() const
 
 
 Real
 
 
 Real
-Paper_def::rule_thickness()const
+Paper_def::rule_thickness() const
 {
   return get_var ("rule_thickness");
 }
 {
   return get_var ("rule_thickness");
 }
@@ -139,7 +141,7 @@ Paper_def::internote_f() const
 }
 
 Real
 }
 
 Real
-Paper_def::note_width()const
+Paper_def::note_width() const
 {
   return get_var ("notewidth");
 }
 {
   return get_var ("notewidth");
 }
@@ -154,7 +156,7 @@ Paper_def::print() const
   itrans_p_->print();
   for (Assoc_iter<String,Real> i (*real_vars_p_); i.ok(); i++) 
     {
   itrans_p_->print();
   for (Assoc_iter<String,Real> i (*real_vars_p_); i.ok(); i++) 
     {
-       DOUT << i.key() << "= " << i.val () << "\n";
+      DOUT << i.key() << "= " << i.val () << "\n";
     }
   DOUT << "}\n";
 #endif
     }
   DOUT << "}\n";
 #endif
@@ -168,7 +170,19 @@ Paper_def::lookup_l()
 }
 
 Global_translator*
 }
 
 Global_translator*
-Paper_def::get_global_translator_p() const
+Paper_def::get_global_translator_p() 
 {
 {
-  return  itrans_p_->get_group_engraver_p()->global_l ();
+  if (only_midi) 
+    {
+      return 0;
+    }
+
+  Global_translator* g =  itrans_p_->get_group_engraver_p()->global_l ();
+  assert (g->is_type_b (Score_engraver::static_name()));
+  Score_engraver*grav = (Score_engraver*) g;
+  grav->pscore_p_ = new Paper_score;
+  grav->pscore_p_->paper_l_ = this;
+  return g;      
 }
 }
+
+IMPLEMENT_IS_TYPE_B1(Paper_def, Music_output_def);
index 288d1407f1219f2c62ef0de670f282bf4111f31f..a8612c44d41416ae975a989b6ba5fb6b088b565b 100644 (file)
@@ -59,7 +59,7 @@
     Box *box;
     Chord * chord;
     Duration *duration;
     Box *box;
     Chord * chord;
     Duration *duration;
-    Identifier *id;    
+    Identifier *id;
     Input_translator* itrans;
     Music *music;
     Music_list *musiclist;
     Input_translator* itrans;
     Music *music;
     Music_list *musiclist;
@@ -68,6 +68,7 @@
     Interval *interval;
     Lookup*lookup;
     Melodic_req * melreq;
     Interval *interval;
     Lookup*lookup;
     Melodic_req * melreq;
+    Music_output_def * outputdef;
     Midi_def* midi;
     Moment *moment;
     Note_req *notereq;
     Midi_def* midi;
     Moment *moment;
     Note_req *notereq;
 }
 %{
 
 }
 %{
 
-int 
+int
 yylex(YYSTYPE *s,  void * v_l)
 {
        My_lily_parser   *pars_l = (My_lily_parser*) v_l;
        My_lily_lexer * lex_l = pars_l->lexer_p_;
 yylex(YYSTYPE *s,  void * v_l)
 {
        My_lily_parser   *pars_l = (My_lily_parser*) v_l;
        My_lily_lexer * lex_l = pars_l->lexer_p_;
-       
+
        lex_l->lexval_l = (void*) s;
        return lex_l->yylex();
 }
        lex_l->lexval_l = (void*) s;
        return lex_l->yylex();
 }
@@ -163,7 +164,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token <melreq>        NOTENAME_ID
 %token <id>    DURATION_IDENTIFIER
 %token <id>    IDENTIFIER
 %token <melreq>        NOTENAME_ID
 %token <id>    DURATION_IDENTIFIER
 %token <id>    IDENTIFIER
-%token <id>    MELODIC_REQUEST_IDENTIFIER 
+%token <id>    MELODIC_REQUEST_IDENTIFIER
 %token <id>    MUSIC_IDENTIFIER
 %token <id>    VOICE_IDENTIFIER
 %token <id>    POST_REQUEST_IDENTIFIER
 %token <id>    MUSIC_IDENTIFIER
 %token <id>    VOICE_IDENTIFIER
 %token <id>    POST_REQUEST_IDENTIFIER
@@ -176,14 +177,14 @@ yylex(YYSTYPE *s,  void * v_l)
 %token <id>    MIDI_IDENTIFIER
 %token <id>    PAPER_IDENTIFIER
 %token <id>    REQUEST_IDENTIFIER
 %token <id>    MIDI_IDENTIFIER
 %token <id>    PAPER_IDENTIFIER
 %token <id>    REQUEST_IDENTIFIER
-%token <real>  REAL 
+%token <real>  REAL
 %token <string>        DURATION RESTNAME
 %token <string>        DURATION RESTNAME
-%token <string>        STRING 
+%token <string>        STRING
 %token <string> FIELDNAME RECORDLINE
 %token <string> FIELDNAME RECORDLINE
-%token <i>     POST_QUOTES 
+%token <i>     POST_QUOTES
 %token <i>     PRE_QUOTES
 
 %token <i>     PRE_QUOTES
 
-
+%type <outputdef> output_def
 %type <header>         mudela_header mudela_header_body
 %type <box>    box
 %type <c>      open_request_parens close_request_parens
 %type <header>         mudela_header mudela_header_body
 %type <box>    box
 %type <c>      open_request_parens close_request_parens
@@ -192,26 +193,26 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <i>      int
 %type <i>      script_dir
 %type <id>     identifier_init
 %type <i>      int
 %type <i>      script_dir
 %type <id>     identifier_init
-%type <duration> explicit_steno_duration notemode_duration 
+%type <duration> explicit_steno_duration notemode_duration
 %type <duration> entered_notemode_duration explicit_duration
 %type <interval>       dinterval
 %type <intvec> intastint_list
 %type <lookup> symtables symtables_body
 %type <melreq> melodic_request steno_melodic_req
 %type <notereq>        steno_note_req
 %type <duration> entered_notemode_duration explicit_duration
 %type <interval>       dinterval
 %type <intvec> intastint_list
 %type <lookup> symtables symtables_body
 %type <melreq> melodic_request steno_melodic_req
 %type <notereq>        steno_note_req
-%type <melreqvec>      pitch_list 
+%type <melreqvec>      pitch_list
 %type <midi>   midi_block midi_body
 %type <moment> duration_length
 
 %type <music>  Music transposed_music
 %type <midi>   midi_block midi_body
 %type <moment> duration_length
 
 %type <music>  Music transposed_music
-%type <musiclist> Voice Voice_body 
+%type <musiclist> Voice Voice_body
 %type <chord>  Chord Chord_body
 %type <paper>  paper_block paper_body
 %type <real>   dim real
 %type <real>   unit
 %type <chord>  Chord Chord_body
 %type <paper>  paper_block paper_body
 %type <real>   dim real
 %type <real>   unit
-%type <request>        post_request pre_request command_req verbose_command_req 
+%type <request>        post_request pre_request command_req verbose_command_req
 %type <request> abbrev_command_req
 %type <request> abbrev_command_req
-%type <request>        script_req  dynamic_req 
+%type <request>        script_req  dynamic_req
 %type <score>  score_block score_body
 %type <script> script_definition script_body mudela_script gen_script_def
 %type <textdef> text_def
 %type <score>  score_block score_body
 %type <script> script_definition script_body mudela_script gen_script_def
 %type <textdef> text_def
@@ -232,11 +233,11 @@ mudela:   /* empty */
                THIS->default_header_p_ = $2;
        }
        | mudela score_block {
                THIS->default_header_p_ = $2;
        }
        | mudela score_block {
-               add_score($2);          
+               add_score($2);
        }
        | mudela add_declaration { }
        | mudela error
        }
        | mudela add_declaration { }
        | mudela error
-       | mudela check_version { } 
+       | mudela check_version { }
        | mudela add_notenames { }
        ;
 
        | mudela add_notenames { }
        ;
 
@@ -283,7 +284,7 @@ mudela_header:
        HEADER  {
                THIS->lexer_p_->push_header_state();
        }
        HEADER  {
                THIS->lexer_p_->push_header_state();
        }
-       
+
        '{' mudela_header_body '}'      {
                $$ = $4;
                THIS->lexer_p_->pop_state();
        '{' mudela_header_body '}'      {
                $$ = $4;
                THIS->lexer_p_->pop_state();
@@ -318,43 +319,43 @@ add_declaration:
 identifier_init:
        score_block {
                $$ = new Score_id($1, SCORE_IDENTIFIER);
 identifier_init:
        score_block {
                $$ = new Score_id($1, SCORE_IDENTIFIER);
-               
+
        }
        | paper_block {
                $$ = new Paper_def_id($1, PAPER_IDENTIFIER);
        }
        | paper_block {
                $$ = new Paper_def_id($1, PAPER_IDENTIFIER);
-               
+
        }
        | midi_block {
                $$ = new Midi_def_id($1, MIDI_IDENTIFIER);
        }
        | midi_block {
                $$ = new Midi_def_id($1, MIDI_IDENTIFIER);
-               
+
        }
        | script_definition {
                $$ = new Script_id($1, SCRIPT_IDENTIFIER);
        }
        | script_definition {
                $$ = new Script_id($1, SCRIPT_IDENTIFIER);
-               
+
        }
        | Music  {
                $$ = new Music_id($1, MUSIC_IDENTIFIER);
        }
        | Music  {
                $$ = new Music_id($1, MUSIC_IDENTIFIER);
-               
+
        }
        | symtables {
                $$ = new Lookup_id($1, IDENTIFIER);
        }
        | symtables {
                $$ = new Lookup_id($1, IDENTIFIER);
-               
+
        }
        | real  {
                $$ = new Real_id(new Real($1), REAL_IDENTIFIER);
        }
        | real  {
                $$ = new Real_id(new Real($1), REAL_IDENTIFIER);
-               
+
        }
        | int   {
                $$ = new Int_id(new int($1), INT_IDENTIFIER);
        }
        | int   {
                $$ = new Int_id(new int($1), INT_IDENTIFIER);
-               
+
        }
        | post_request {
                $$ = new Request_id($1, POST_REQUEST_IDENTIFIER);
        }
        | post_request {
                $$ = new Request_id($1, POST_REQUEST_IDENTIFIER);
-               
+
        }
        | melodic_request {
                $$ = new Request_id($1, MELODIC_REQUEST_IDENTIFIER);
        }
        | melodic_request {
                $$ = new Request_id($1, MELODIC_REQUEST_IDENTIFIER);
-               
+
        }
        | input_translator_spec {
                $$ = new Input_translator_id ( $1, INPUT_TRANS_IDENTIFIER);
        }
        | input_translator_spec {
                $$ = new Input_translator_id ( $1, INPUT_TRANS_IDENTIFIER);
@@ -376,8 +377,8 @@ input_translator_spec_body:
                $$ = $1->input_translator();
                $$-> set_spot( THIS->here_input() );
        }
                $$ = $1->input_translator();
                $$-> set_spot( THIS->here_input() );
        }
-       | STRING STRING { 
-               $$ = new Input_translator; 
+       | STRING STRING {
+               $$ = new Input_translator;
                $$->base_str_ = *$1;
                $$->type_str_ =*$2;
                $$->set_spot ( THIS->here_input() );
                $$->base_str_ = *$1;
                $$->type_str_ =*$2;
                $$->set_spot ( THIS->here_input() );
@@ -411,8 +412,8 @@ score_block:
        /*cont*/ '{' score_body '}'     {
                $$ = $4;
                $$->set_spot(THIS->pop_spot());
        /*cont*/ '{' score_body '}'     {
                $$ = $4;
                $$->set_spot(THIS->pop_spot());
-               if (!$$->paper_p_ && ! $$->midi_p_)
-                       $$->paper_p_ = THIS->default_paper();
+               if (!$$->def_p_arr_.size ())
+                       $$->add ( THIS->default_paper());
 
                /* handle error levels. */
                $$->errorlevel_i_ = THIS->error_level_i_;
 
                /* handle error levels. */
                $$->errorlevel_i_ = THIS->error_level_i_;
@@ -422,8 +423,8 @@ score_block:
        }
        ;
 
        }
        ;
 
-score_body:            { 
-               $$ = new Score; 
+score_body:            {
+               $$ = new Score;
        }
        | SCORE_IDENTIFIER {
                $$ = $1->score();
        }
        | SCORE_IDENTIFIER {
                $$ = $1->score();
@@ -434,17 +435,23 @@ score_body:               {
        | score_body Music      {
                $$->music_p_ = $2;
        }
        | score_body Music      {
                $$->music_p_ = $2;
        }
-       | score_body paper_block                {
-               $$->paper_p_ = $2;      
-       }
-       | score_body midi_block         { 
-               $$->midi_p_ = $2;
+       | score_body output_def {
+               $$->add( $2);
        }
        | score_body error {
 
        }
        ;
 
        }
        | score_body error {
 
        }
        ;
 
+output_def:
+       paper_block {
+               $$ = $1;
+       }
+       |  midi_block           {
+               $$= $1;
+       }
+       ;
+
 intastint_list:
        /* */   { $$ =new Array<int>; }
        | intastint_list int '*' int    {
 intastint_list:
        /* */   { $$ =new Array<int>; }
        | intastint_list int '*' int    {
@@ -468,11 +475,12 @@ paper_body:
        | PAPER_IDENTIFIER      {
                $$ = $1->paperdef();
        }
        | PAPER_IDENTIFIER      {
                $$ = $1->paperdef();
        }
-       | paper_body OUTPUT STRING ';'  { $$->outfile_str_ = *$3;
+       | paper_body OUTPUT STRING ';'  { 
+               $$->outfile_str_ = *$3;
                delete $3;
        }
        | paper_body symtables          { $$->set($2); }
                delete $3;
        }
        | paper_body symtables          { $$->set($2); }
-       | paper_body STRING '=' dim ';'         { 
+       | paper_body STRING '=' dim ';'         {
                $$->set_var(*$2, $4);
        }
        | paper_body STRING '=' real ';' {
                $$->set_var(*$2, $4);
        }
        | paper_body STRING '=' real ';' {
@@ -498,9 +506,9 @@ midi_block:
 midi_body: /* empty */                 {
                $$ = THIS->default_midi();
        }
 midi_body: /* empty */                 {
                $$ = THIS->default_midi();
        }
-       | midi_body OUTPUT STRING ';'   { 
-               $$->outfile_str_ = *$3; 
-               delete $3; 
+       | midi_body OUTPUT STRING ';'   {
+               $$->outfile_str_ = *$3;
+               delete $3;
        }
        | midi_body tempo_request ';' {
                $$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
        }
        | midi_body tempo_request ';' {
                $$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
@@ -539,7 +547,7 @@ Voice_body:
        }
        | Voice_body ID STRING STRING ';'       {
                $$ = new Voice;
        }
        | Voice_body ID STRING STRING ';'       {
                $$ = new Voice;
-               $$->type_str_ = *$3;    
+               $$->type_str_ = *$3;
                $$->id_str_ = *$4;
                delete $3;
                delete $4;
                $$->id_str_ = *$4;
                delete $3;
                delete $4;
@@ -555,16 +563,16 @@ Music:
        | Chord                 { $$ = $1; }
        | transposed_music      { $$ = $1; }
        | MUSIC_IDENTIFIER      { $$ = $1->music(); }
        | Chord                 { $$ = $1; }
        | transposed_music      { $$ = $1; }
        | MUSIC_IDENTIFIER      { $$ = $1->music(); }
-       | MELODIC 
-               { THIS->lexer_p_->push_note_state(); } 
+       | MELODIC
+               { THIS->lexer_p_->push_note_state(); }
        Music
                { $$=$3; THIS->lexer_p_->pop_state(); }
 
        Music
                { $$=$3; THIS->lexer_p_->pop_state(); }
 
-       | LYRIC 
-               { THIS->lexer_p_->push_lyric_state(); } 
+       | LYRIC
+               { THIS->lexer_p_->push_lyric_state(); }
        Music
                { $$ = $3; THIS->lexer_p_->pop_state(); }
        Music
                { $$ = $3; THIS->lexer_p_->pop_state(); }
-       ; 
+       ;
 
 Chord:
        '<' Chord_body '>'      { $$  = $2; }
 
 Chord:
        '<' Chord_body '>'      { $$  = $2; }
@@ -579,9 +587,9 @@ Chord_body:
                $$->multi_level_i_=$3;
        }
        | Chord_body ID STRING STRING ';'       {
                $$->multi_level_i_=$3;
        }
        | Chord_body ID STRING STRING ';'       {
-               $$->type_str_ = *$3;    
+               $$->type_str_ = *$3;
                $$->id_str_ = *$4;
                $$->id_str_ = *$4;
-               delete $4; 
+               delete $4;
                delete $3;
        }
        | Chord_body Music {
                delete $3;
        }
        | Chord_body Music {
@@ -608,10 +616,10 @@ full_element:
        }
        | command_elt
        | voice_command ';'     { $$ = 0; }
        }
        | command_elt
        | voice_command ';'     { $$ = 0; }
-       ;       
+       ;
 
 simple_element:
 
 simple_element:
-       music_elt 
+       music_elt
        | lyrics_elt
        ;
 
        | lyrics_elt
        ;
 
@@ -626,12 +634,12 @@ command_elt:
        ;
 
 command_req:
        ;
 
 command_req:
-       abbrev_command_req      
+       abbrev_command_req
        | verbose_command_req ';'       { $$ = $1; }
        ;
 
 abbrev_command_req:
        | verbose_command_req ';'       { $$ = $1; }
        ;
 
 abbrev_command_req:
-        '|'                            { 
+        '|'                            {
                $$ = new Barcheck_req;
        }
        | COMMAND_IDENTIFIER    {
                $$ = new Barcheck_req;
        }
        | COMMAND_IDENTIFIER    {
@@ -650,16 +658,16 @@ verbose_command_req:
                // sorry hw, i need meter at output of track,
                // but don-t know where to get it... statics should go.
                // HW : default: 4/4, meterchange reqs may change it.
                // sorry hw, i need meter at output of track,
                // but don-t know where to get it... statics should go.
                // HW : default: 4/4, meterchange reqs may change it.
-               
+
                Midi_def::num_i_s = $2;
                Midi_def::den_i_s = $4;
                $$ = m;
        }
        | SKIP duration_length {
                Skip_req * skip_p = new Skip_req;
                Midi_def::num_i_s = $2;
                Midi_def::den_i_s = $4;
                $$ = m;
        }
        | SKIP duration_length {
                Skip_req * skip_p = new Skip_req;
-               skip_p->duration_.set_plet($2->numerator().as_long(), 
+               skip_p->duration_.set_plet($2->numerator().as_long(),
                        $2->denominator().as_long());
                        $2->denominator().as_long());
-               
+
                delete $2;
                $$ = skip_p;
        }
                delete $2;
                $$ = skip_p;
        }
@@ -683,7 +691,7 @@ verbose_command_req:
                $$ = new Clef_change_req(*$2);
                delete $2;
        }
                $$ = new Clef_change_req(*$2);
                delete $2;
        }
-       | KEY pitch_list        {       
+       | KEY pitch_list        {
                Key_change_req *key_p= new Key_change_req;
                key_p->melodic_p_arr_ = *$2;
                $$ = key_p;
                Key_change_req *key_p= new Key_change_req;
                key_p->melodic_p_arr_ = *$2;
                $$ = key_p;
@@ -709,8 +717,8 @@ post_request:
        POST_REQUEST_IDENTIFIER {
                $$ = (Request*)$1->request();
        }
        POST_REQUEST_IDENTIFIER {
                $$ = (Request*)$1->request();
        }
-       |close_request_parens   { 
-               $$ = THIS->get_parens_request($1); 
+       |close_request_parens   {
+               $$ = THIS->get_parens_request($1);
        }
        | script_req
        | dynamic_req
        }
        | script_req
        | dynamic_req
@@ -726,10 +734,10 @@ steno_melodic_req:
                $$ = $1->clone()->musical()->melodic();
                $$->octave_i_ += THIS->default_octave_i_;
        }
                $$ = $1->clone()->musical()->melodic();
                $$->octave_i_ += THIS->default_octave_i_;
        }
-       | steno_melodic_req POST_QUOTES         {  
+       | steno_melodic_req POST_QUOTES         {
                $$-> octave_i_ += $2;
        }
                $$-> octave_i_ += $2;
        }
-       | PRE_QUOTES steno_melodic_req   {  
+       | PRE_QUOTES steno_melodic_req   {
                $$ = $2;
                $2-> octave_i_ -= $1;
        }
                $$ = $2;
                $2-> octave_i_ -= $1;
        }
@@ -743,7 +751,7 @@ steno_note_req:
        }
        | steno_note_req   '!'          {
                $$->forceacc_b_ = ! $$->forceacc_b_;
        }
        | steno_note_req   '!'          {
                $$->forceacc_b_ = ! $$->forceacc_b_;
-       } 
+       }
        /* have to duration here. */
        ;
 
        /* have to duration here. */
        ;
 
@@ -773,7 +781,7 @@ dynamic_req:
        | SPANDYNAMIC '{' int int '}' {
                Span_dynamic_req * sp_p = new Span_dynamic_req;
                sp_p->spantype = $4;
        | SPANDYNAMIC '{' int int '}' {
                Span_dynamic_req * sp_p = new Span_dynamic_req;
                sp_p->spantype = $4;
-               sp_p-> dynamic_dir_i_  = $3;
+               sp_p-> dynamic_dir_  = $3;
                $$ = sp_p;
        }
        ;
                $$ = sp_p;
        }
        ;
@@ -790,10 +798,10 @@ close_request_parens:
        '~'     {
                $$ = '~';
        }
        '~'     {
                $$ = '~';
        }
-       | '('   { 
+       | '('   {
                $$='(';
        }
                $$='(';
        }
-       | ']'   { 
+       | ']'   {
                $$ = ']';
        }
        | close_plet_parens {
                $$ = ']';
        }
        | close_plet_parens {
@@ -819,7 +827,7 @@ open_request_parens:
        E_EXCLAMATION   {
                $$ = '!';
        }
        E_EXCLAMATION   {
                $$ = '!';
        }
-       | ')'   { 
+       | ')'   {
                $$=')';
        }
        | '['   {
                $$=')';
        }
        | '['   {
@@ -841,31 +849,31 @@ script_body:
                s->set_from_input(*$1,$2, $3,$4,$5, $6);
                $$  = s;
                delete $1;
                s->set_from_input(*$1,$2, $3,$4,$5, $6);
                $$  = s;
                delete $1;
-       }       
+       }
        ;
 
 script_req:
        ;
 
 script_req:
-       script_dir gen_script_def               { 
+       script_dir gen_script_def               {
                Musical_script_req *m = new Musical_script_req;
                Musical_script_req *m = new Musical_script_req;
-               $$ = m; 
+               $$ = m;
                m-> scriptdef_p_ = $2;
                m-> set_spot ( THIS->here_input() );
                m-> scriptdef_p_ = $2;
                m-> set_spot ( THIS->here_input() );
-               m-> dir_i_  = $1;
+               m-> dir_  = $1;
        }
        ;
 
 gen_script_def:
        text_def        { $$ = $1; }
        }
        ;
 
 gen_script_def:
        text_def        { $$ = $1; }
-       | mudela_script { $$ = $1; 
+       | mudela_script { $$ = $1;
                $$-> set_spot( THIS->here_input() );
        }
        ;
 
 text_def:
                $$-> set_spot( THIS->here_input() );
        }
        ;
 
 text_def:
-       STRING { 
+       STRING {
                Text_def *t  = new Text_def;
                $$ = t;
                Text_def *t  = new Text_def;
                $$ = t;
-               t->text_str_ = *$1; 
+               t->text_str_ = *$1;
                delete $1;
                t->style_str_ = THIS->textstyle_str_;
                $$->set_spot( THIS->here_input() );
                delete $1;
                t->style_str_ = THIS->textstyle_str_;
                $$->set_spot( THIS->here_input() );
@@ -883,11 +891,11 @@ script_abbreviation:
                $$ = get_scriptdef('.');
        }
        ;
                $$ = get_scriptdef('.');
        }
        ;
-       
+
 mudela_script:
        SCRIPT_IDENTIFIER               { $$ = $1->script(); }
        | script_definition             { $$ = $1; }
 mudela_script:
        SCRIPT_IDENTIFIER               { $$ = $1->script(); }
        | script_definition             { $$ = $1; }
-       | script_abbreviation           { 
+       | script_abbreviation           {
                $$ = THIS->lexer_p_->lookup_identifier(*$1)->script();
                delete $1;
        }
                $$ = THIS->lexer_p_->lookup_identifier(*$1)->script();
                delete $1;
        }
@@ -906,9 +914,9 @@ pre_requests:
        }
        ;
 
        }
        ;
 
-pre_request: 
-       open_request_parens     { 
-               $$ = THIS->get_parens_request($1); 
+pre_request:
+       open_request_parens     {
+               $$ = THIS->get_parens_request($1);
        }
        ;
 
        }
        ;
 
@@ -924,7 +932,7 @@ voice_command:
                THIS->set_default_duration($2);
                delete $2;
        }
                THIS->set_default_duration($2);
                delete $2;
        }
-       | OCTAVE { 
+       | OCTAVE {
                /*
                        This is weird, but default_octave_i_
                        is used in steno_note_req too
                /*
                        This is weird, but default_octave_i_
                        is used in steno_note_req too
@@ -944,11 +952,11 @@ voice_command:
        }
        ;
 
        }
        ;
 
-duration_length:       
+duration_length:
        {
                $$ = new Moment(0,1);
        }
        {
                $$ = new Moment(0,1);
        }
-       | duration_length explicit_steno_duration               {       
+       | duration_length explicit_steno_duration               {
                *$$ += $2->length();
        }
        ;
                *$$ += $2->length();
        }
        ;
@@ -959,11 +967,11 @@ dots:
        ;
 
 entered_notemode_duration:
        ;
 
 entered_notemode_duration:
-       /* */           { 
+       /* */           {
                $$ = new Duration(THIS->default_duration_);
        }
        | dots          {
                $$ = new Duration(THIS->default_duration_);
        }
        | dots          {
-               $$ = new Duration(THIS->default_duration_);             
+               $$ = new Duration(THIS->default_duration_);
                $$->dots_i_  = $1;
        }
        | explicit_steno_duration       {
                $$->dots_i_  = $1;
        }
        | explicit_steno_duration       {
@@ -996,10 +1004,10 @@ explicit_steno_duration:
                $$->dots_i_ ++;
        }
        | explicit_steno_duration '*' int  {
                $$->dots_i_ ++;
        }
        | explicit_steno_duration '*' int  {
-               $$->plet_.iso_i_ *= $3; 
+               $$->plet_.iso_i_ *= $3;
        }
        | explicit_steno_duration '/' int {
        }
        | explicit_steno_duration '/' int {
-               $$->plet_.type_i_ *= $3; 
+               $$->plet_.type_i_ *= $3;
        }
        ;
 
        }
        ;
 
@@ -1059,7 +1067,7 @@ real:
                delete r_p;
        }
        ;
                delete r_p;
        }
        ;
-       
+
 
 
 dim:
 
 
 dim:
@@ -1072,7 +1080,7 @@ unit:     CM_T            { $$ = 1 CM; }
        |MM_T           { $$ = 1 MM; }
        |PT_T           { $$ = 1 PT; }
        ;
        |MM_T           { $$ = 1 MM; }
        |PT_T           { $$ = 1 PT; }
        ;
-       
+
 /*
        symbol tables
 */
 /*
        symbol tables
 */
@@ -1132,13 +1140,13 @@ box:
        ;
 
 dinterval: dim dim             {
        ;
 
 dinterval: dim dim             {
-               $$ = new Interval($1, $2);      
+               $$ = new Interval($1, $2);
        }
        ;
 
 %%
 
        }
        ;
 
 %%
 
-void 
+void
 My_lily_parser::set_yydebug(bool b )
 {
 #ifdef YYDEBUG
 My_lily_parser::set_yydebug(bool b )
 {
 #ifdef YYDEBUG
index ea11129e2543602e1d9ea9deb98dd8b4b6765ff8..ae1e93dd6fc595a68f7ed7e8a4055c9adc6d644b 100644 (file)
@@ -53,17 +53,17 @@ Performer_group_performer::depth_i() const
 void
 Performer_group_performer::do_creation_processing()
 {
 void
 Performer_group_performer::do_creation_processing()
 {
-  for ( PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++ )
+  for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
        i->creation_processing();
 }
 
 void
        i->creation_processing();
 }
 
 void
-Performer_group_performer::do_print()const
+Performer_group_performer::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-  if ( !check_debug)
+  if (!check_debug)
        return ;
        return ;
-  for ( PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++ )
+  for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
        i->print();
 #endif
 }
        i->print();
 #endif
 }
@@ -71,7 +71,7 @@ Performer_group_performer::do_print()const
 void
 Performer_group_performer::do_removal_processing()
 {
 void
 Performer_group_performer::do_removal_processing()
 {
-  for ( PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++ )
+  for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
        i->do_removal_processing();
 }
 
        i->do_removal_processing();
 }
 
@@ -81,7 +81,7 @@ Performer_group_performer::do_try_request (Request* req_l)
   bool hebbes_b =false;
   for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
        hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
   bool hebbes_b =false;
   for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
        hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
-  if ( !hebbes_b && daddy_perf_l_)
+  if (!hebbes_b && daddy_perf_l_)
        hebbes_b = daddy_perf_l_->try_request (req_l);
   return hebbes_b ;
 }
        hebbes_b = daddy_perf_l_->try_request (req_l);
   return hebbes_b ;
 }
@@ -90,7 +90,7 @@ Translator*
 Performer_group_performer::find_get_translator_l (String n,String id)
 {
   Translator * ret=0;
 Performer_group_performer::find_get_translator_l (String n,String id)
 {
   Translator * ret=0;
-  Input_translator* itrans_l= itrans_l_-> recursive_find ( n);
+  Input_translator* itrans_l= itrans_l_-> recursive_find (n);
   if (itrans_l) 
     {
        ret = find_performer_l (n,id);
   if (itrans_l) 
     {
        ret = find_performer_l (n,id);
@@ -102,7 +102,7 @@ Performer_group_performer::find_get_translator_l (String n,String id)
            add (group);
            ret = group;
            
            add (group);
            ret = group;
            
-           if (group->itrans_l_->is_name_b (n) )
+           if (group->itrans_l_->is_name_b (n))
                ret ->id_str_ = id;
            else
                return ret->find_get_translator_l (n,id);
                ret ->id_str_ = id;
            else
                return ret->find_get_translator_l (n,id);
@@ -137,7 +137,7 @@ Translator*
 Performer_group_performer::get_default_interpreter()
 {
   // ? 
 Performer_group_performer::get_default_interpreter()
 {
   // ? 
-  if ( is_bottom_performer_b())
+  if (is_bottom_performer_b())
        return daddy_perf_l_->get_default_interpreter();
 
   Performer_group_performer *perf_p= itrans_l_->
        return daddy_perf_l_->get_default_interpreter();
 
   Performer_group_performer *perf_p= itrans_l_->
@@ -164,7 +164,7 @@ Performer_group_performer::print() const
 void
 Performer_group_performer::process_requests()
 {
 void
 Performer_group_performer::process_requests()
 {
-  for ( PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++ )
+  for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
        i->process_requests();
 }
 
        i->process_requests();
 }
 
index ad2f9805ed00e7057ba77f7d6df497e0c3f3eb17..ed72f2a2cee5f948f4f8dc00bb328189ad6d08d5 100644 (file)
@@ -36,7 +36,7 @@ Performer::play (Audio_element* p)
 }
 
 int
 }
 
 int
-Performer::get_tempo_i()const
+Performer::get_tempo_i() const
 {
   return daddy_perf_l_->get_tempo_i();
 }
 {
   return daddy_perf_l_->get_tempo_i();
 }
diff --git a/lily/request-iterator.cc b/lily/request-iterator.cc
new file mode 100644 (file)
index 0000000..8209317
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+  request-iterator.cc -- implement Request_chord_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "translator.hh"
+#include "debug.hh"
+#include "request-iterator.hh"
+#include "music-list.hh"
+#include "request.hh"
+
+IMPLEMENT_IS_TYPE_B1(Request_chord_iterator,Music_iterator);
+
+void
+Request_chord_iterator::construct_children()
+{
+  get_req_translator_l();
+}
+
+Request_chord_iterator::Request_chord_iterator (Request_chord*el_l)
+{
+  elt_l_ = el_l;
+  MInterval elt_dur =el_l->time_int();
+  elt_duration_ = elt_dur.length (); 
+  last_b_ = false;
+}
+
+
+bool
+Request_chord_iterator::ok() const
+{
+  return (elt_duration_ && !last_b_) || first_b_; 
+}
+
+
+
+Moment
+Request_chord_iterator::next_moment() const
+{
+  Moment m (0);
+  if  (!first_b_) 
+    m = elt_duration_;
+  return m;
+}
+
+void
+Request_chord_iterator::do_print() const
+{
+#ifndef NPRINT
+  DOUT << "duration: " << elt_duration_;
+#endif
+}
+void
+Request_chord_iterator::process_and_next (Moment mom)
+{
+  if (first_b_) 
+    {
+      for (PCursor<Music*> i (elt_l_->music_p_list_); 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 ("Junking request: " + String (req_l->name()));
+
+       }
+      first_b_ = false;
+    }
+
+  if (mom >= elt_duration_)
+    last_b_ = true;  
+}
index 1b431d2f2d270e51efdbb1d3e2384b1c3769131c..488b2cad953d6a6ecdf62167b0b78853f17a7010 100644 (file)
@@ -25,18 +25,18 @@ Request::time_int() const
 
 
 bool
 
 
 bool
-Request::equal_b (Request *r)const
+Request::equal_b (Request *r) const
 {
 {
-  if ( is_type_b ( r->name()) )
+  if (is_type_b (r->name()))
        return r->do_equal_b ((Request*)this);
        return r->do_equal_b ((Request*)this);
-  if ( r->is_type_b (name()))
+  if (r->is_type_b (name()))
        return do_equal_b (r);
         
   return false;
 }
 
 bool
        return do_equal_b (r);
         
   return false;
 }
 
 bool
-Request::do_equal_b (Request*)const
+Request::do_equal_b (Request*) const
 {
   return false;
 }
 {
   return false;
 }
index 86a4030bdfcd5ffdcca1d5d8d7ebfb32462903ba..fbd6d0ba5ed99ad04049b9750a8158ad51d7d228 100644 (file)
@@ -62,7 +62,7 @@ void
 Rest_collision_engraver::do_print() const
 {
 #ifndef NPRINT
 Rest_collision_engraver::do_print() const
 {
 #ifndef NPRINT
-  if ( rest_collision_p_)
+  if (rest_collision_p_)
        rest_collision_p_->print();
 #endif
 }
        rest_collision_p_->print();
 #endif
 }
index d5b4217f7eceabfc2ac45061fcb9bed79deb1fb0..3e66ec751300ef138689e08880c616324f6d2ce0 100644 (file)
@@ -56,13 +56,13 @@ Rest_collision::do_post_processing()
   if (!(stem_l->beams_left_i_ || stem_l->beams_right_i_))
        return;
 
   if (!(stem_l->beams_left_i_ || stem_l->beams_right_i_))
        return;
 
-  int dir_i = rest_l_arr_[0]->dir_i_;
+  int dir_i = rest_l_arr_[0]->dir_;
   int midpos = 4;
 #if 1
   // ugh
   int stem_length_i = 7 - 2;
   // ugh, Stem::stem_start vs Stem::stem_end
   int midpos = 4;
 #if 1
   // ugh
   int stem_length_i = 7 - 2;
   // ugh, Stem::stem_start vs Stem::stem_end
-  int pos = (stem_l->stem_end_f() - midpos) - dir_i * stem_length_i;
+  int pos = (int)(stem_l->stem_end_f() - midpos) - dir_i * stem_length_i;
 #else // nogo: stem_start not set for rests?
   int pos = (stem_l->stem_start_f() - midpos) + dir_i * 2;
 #endif
 #else // nogo: stem_start not set for rests?
   int pos = (stem_l->stem_start_f() - midpos) + dir_i * 2;
 #endif
@@ -92,9 +92,9 @@ Rest_collision::do_pre_processing()
     {
        int dy = rest_l_arr_.size() > 2 ? 6 : 4;
        
     {
        int dy = rest_l_arr_.size() > 2 ? 6 : 4;
        
-       rest_l_arr_[0]->translate_heads (rest_l_arr_[0]->dir_i_ *dy);   
+       rest_l_arr_[0]->translate_heads (rest_l_arr_[0]->dir_ *dy);     
        // top is last element...
        // top is last element...
-       rest_l_arr_.top()->translate_heads (rest_l_arr_.top ()->dir_i_* dy);    
+       rest_l_arr_.top()->translate_heads (rest_l_arr_.top ()->dir_* dy);      
     }
   // meisjes met jongetjes
   else 
     }
   // meisjes met jongetjes
   else 
@@ -104,8 +104,8 @@ Rest_collision::do_pre_processing()
        int dir_i = -1;
        rest_l_arr_[0]->translate_heads (dir_i * 3);    
 #else
        int dir_i = -1;
        rest_l_arr_[0]->translate_heads (dir_i * 3);    
 #else
-       // int dir_i = - ncol_l_arr_[0]->dir_i_;
-       int dir_i = rest_l_arr_[0]->dir_i_;
+       // int dir_i = - ncol_l_arr_[0]->dir_;
+       int dir_i = rest_l_arr_[0]->dir_;
        // hope it's 4: if it works->doco
        int midpos = 4;
        
        // hope it's 4: if it works->doco
        int midpos = 4;
        
@@ -121,7 +121,7 @@ Rest_collision::do_pre_processing()
          {
            // how to know whether to sort?
            ncol_l_arr_[i]->sort();
          {
            // how to know whether to sort?
            ncol_l_arr_[i]->sort();
-           for ( int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++)
+           for (int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++)
                minpos = minpos >? dir_i * 
                    (ncol_l_arr_[i]->head_l_arr_[j]->position_i_ -midpos) + sep_i;
          }
                minpos = minpos >? dir_i * 
                    (ncol_l_arr_[i]->head_l_arr_[j]->position_i_ -midpos) + sep_i;
          }
index d86903eb7bddd907ad5c19e7e842a792f0789647..7f8ee615e1b31be5c2fce593545f6b025bfc3ec2 100644 (file)
@@ -41,7 +41,7 @@ Score_align_engraver::acknowledge_element (Score_elem_info inf)
            announce_element (Score_elem_info (align_p_,0));
          }
        Score_elem * unbound_elem = inf.elem_l_;
            announce_element (Score_elem_info (align_p_,0));
          }
        Score_elem * unbound_elem = inf.elem_l_;
-       while ( unbound_elem->axis_group_l_a_[X_AXIS])
+       while (unbound_elem->axis_group_l_a_[X_AXIS])
            unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
        align_p_->add_element (unbound_elem);
     }
            unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
        align_p_->add_element (unbound_elem);
     }
index d6f4e739a5da518cbf77194882aba931e78121fb..1827c046393de0e10719120ea9078ec6b8d16928 100644 (file)
@@ -17,16 +17,15 @@ Score_column::Score_column (Moment w)
 }
 
 void
 }
 
 void
-Score_column::print() const
+Score_column::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-  DOUT << "Score_column { mus "<< musical_b_ <<" at " <<  when_<<'\n';
+  DOUT << "mus "<< musical_b_ <<" at " <<  when_<<'\n';
   DOUT << "durations: [";
   for (int i=0; i < durations.size(); i++)
   DOUT << "durations: [";
   for (int i=0; i < durations.size(); i++)
-       DOUT << durations[i] << " ";
+    DOUT << durations[i] << " ";
   DOUT << "]\n";
   DOUT << "]\n";
-  PCol::print();
-  DOUT << "}\n";
+  Paper_column::do_print();
 #endif
 }
 
 #endif
 }
 
@@ -48,21 +47,10 @@ Score_column::add_duration (Moment d)
   assert (d);
   for (int i = 0; i< durations.size(); i++) 
     {
   assert (d);
   for (int i = 0; i< durations.size(); i++) 
     {
-       if (d == durations[i])
-           return ;
+      if (d == durations[i])
+       return ;
     }
   durations.push (d);
 }
 
     }
   durations.push (d);
 }
 
-void
-Score_column::do_set_breakable()
-{
-  Score_column *c1 = new Score_column (when_);
-  Score_column *c2 = new Score_column (when_);
-  prebreak_p_ =c1;
-  postbreak_p_ = c2;
-  c1->durations = durations;
-  c2->durations = durations;
-  c1->musical_b_ 
-       = c2->musical_b_ = musical_b_;
-}
+IMPLEMENT_IS_TYPE_B1(Score_column, Paper_column);
index 5569e5bf8354685112d3a6ab789d008b2216ea18..9d7b090dafc733a31823c8cc7a9c5e893086da2d 100644 (file)
 #include "p-col.hh"
 
 Score_elem*
 #include "p-col.hh"
 
 Score_elem*
-Score_elem::dependency (int i)const
+Score_elem::dependency (int i) const
 {
 {
-  return (Score_elem*) get_out_edge_arr()[i];
+  return (Score_elem*) get_out_edge_arr ()[i];
 }
 
 int
 }
 
 int
-Score_elem::dependency_size() const
+Score_elem::dependency_size () const
 {
 {
-  return get_out_edge_arr().size ();
+  return get_out_edge_arr ().size ();
 }
 
 Score_elem*
 }
 
 Score_elem*
@@ -45,48 +45,37 @@ Score_elem::dependent_size() const
   return get_in_edge_arr().size ();
 }
 
   return get_in_edge_arr().size ();
 }
 
-
-
 String
 String
-Score_elem::TeX_string_without_offset (Offset o)const
+Score_elem::make_TeX_string (Offset o)const
 {
 {
-  if (transparent_b_)
-       return "";
   String s ("\\placebox{%}{%}{%}");
   Array<String> a;
   a.push (print_dimen (o.y()));
   a.push (print_dimen (o.x()));
   String t = output->TeX_string();
   if (t == "")
   String s ("\\placebox{%}{%}{%}");
   Array<String> a;
   a.push (print_dimen (o.y()));
   a.push (print_dimen (o.x()));
   String t = output->TeX_string();
   if (t == "")
-       return t;
+    return t;
 
   a.push (t);
   String r;
   if (check_debug)
 
   a.push (t);
   String r;
   if (check_debug)
-       r = String ("\n%start: ") + name() + "\n";
-  r += substitute_args (s, a);;
+    r = String ("\n%start: ") + name() + "\n";
+  r += substitute_args (s, a);
   return r;
 }
   return r;
 }
-
 String
 String
-Score_elem::TeX_string() const
+Score_elem::do_TeX_output_str () const
 {
 {
-  assert (status_ > POSTCALCED);
-  return TeX_string_without_offset (offset_);
+  return make_TeX_string(absolute_offset());
 }
 
 }
 
-void
-Score_elem::copy_dependencies (Score_elem const &s)
+Score_elem::Score_elem (Score_elem const&s)
 {
   /* called from derived ctor, so most info points to the same deps
 {
   /* called from derived ctor, so most info points to the same deps
-    as (Directed_graph_node&)s. Nobody points to us, so don't copy
-    dependents.      
+     as (Directed_graph_node&)s. Nobody points to us, so don't copy
+     dependents.      
    */
   copy_edges_out (s);
    */
   copy_edges_out (s);
-}
-
-Score_elem::Score_elem (Score_elem const&s)
-{
   transparent_b_ = s.transparent_b_;
   empty_b_ = s.empty_b_;
   axis_group_l_a_[0] = axis_group_l_a_[1] =0;
   transparent_b_ = s.transparent_b_;
   empty_b_ = s.empty_b_;
   axis_group_l_a_[0] = axis_group_l_a_[1] =0;
@@ -104,20 +93,19 @@ Score_elem::~Score_elem()
   delete output;
   status_ = DELETED;
   output = 0;
   delete output;
   status_ = DELETED;
   output = 0;
-
 }
 
 /*
   GEOMETRY
  */
 Real
 }
 
 /*
   GEOMETRY
  */
 Real
-Score_elem::absolute_coordinate (Axis a)const
+Score_elem::absolute_coordinate (Axis a) const
 {
   Real r = offset_[a];
 {
   Real r = offset_[a];
-  for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
-         axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
        
        
-       r += axis_group_l->offset_[a];
+    r += axis_group_l->offset_[a];
   return r;
 }
  
   return r;
 }
  
@@ -128,38 +116,38 @@ Score_elem::absolute_offset() const
   return Offset (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
 }
 
   return Offset (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
 }
 
- void
+void
 Score_elem::translate (Real y, Axis a)
 {
   offset_[a] += y;
 }
 
 Real
 Score_elem::translate (Real y, Axis a)
 {
   offset_[a] += y;
 }
 
 Real
-Score_elem::relative_coordinate (Axis_group_element*e, Axis a)const
+Score_elem::relative_coordinate (Axis_group_element*e, Axis a) const
 {
   Real r =0.0;
 {
   Real r =0.0;
-  for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
-         axis_group_l != e;
-         axis_group_l = axis_group_l->axis_group_l_a_[a])
-       r +=  axis_group_l->offset_[a];
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l != e;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    r +=  axis_group_l->offset_[a];
 
   return r;
 }
 
 Axis_group_element* 
 
   return r;
 }
 
 Axis_group_element* 
-Score_elem::common_group (Score_elem const* s, Axis a)const
+Score_elem::common_group (Score_elem const* s, Axis a) const
 {
   Link_array<Axis_group_element> my_groups;
 {
   Link_array<Axis_group_element> my_groups;
-  for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
-         axis_group_l;
-         axis_group_l = axis_group_l->axis_group_l_a_[a])
-       my_groups.push (axis_group_l);
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    my_groups.push (axis_group_l);
 
   Axis_group_element* common_l=0;
 
   Axis_group_element* common_l=0;
-  for ( Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
-         !common_l && axis_group_l;
-         axis_group_l = axis_group_l->axis_group_l_a_[a])
-       common_l = my_groups.find_l (axis_group_l);
+  for (Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
+       !common_l && axis_group_l;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    common_l = my_groups.find_l (axis_group_l);
 
   return common_l;
 }
 
   return common_l;
 }
@@ -179,12 +167,12 @@ Score_elem::do_width() const
 
   if (!output)
     {
 
   if (!output)
     {
-       Molecule*m = brew_molecule_p();
-       r = m->extent().x ();
-       delete m;
+      Molecule*m = brew_molecule_p();
+      r = m->extent().x ();
+      delete m;
     }
   else
     }
   else
-       r = output->extent().x ();
+    r = output->extent().x ();
   return r;
 }
 
   return r;
 }
 
@@ -195,17 +183,17 @@ Score_elem::width() const
 }
 
 Interval
 }
 
 Interval
-Score_elem::extent (Axis a)const
+Score_elem::extent (Axis a) const
 {
   Interval r;
 {
   Interval r;
-  if ( !empty_b_) 
+  if (!empty_b_) 
     {
        
     {
        
-       r = (a == X_AXIS)? do_width(): do_height ();
+      r = (a == X_AXIS)? do_width(): do_height ();
     }
   
   if (!r.empty_b()) // float exception on DEC Alpha
     }
   
   if (!r.empty_b()) // float exception on DEC Alpha
-       r+=offset_[a];
+    r+=offset_[a];
 
   return r;
 }
 
   return r;
 }
@@ -216,12 +204,12 @@ Score_elem::do_height() const
   Interval r;
   if (!output)
     {
   Interval r;
   if (!output)
     {
-       Molecule*m = brew_molecule_p();
-       r = m->extent().y ();
-       delete m;
+      Molecule*m = brew_molecule_p();
+      r = m->extent().y ();
+      delete m;
     }
   else
     }
   else
-       r = output->extent().y ();
+    r = output->extent().y ();
   return r;
 }
 
   return r;
 }
 
@@ -235,19 +223,19 @@ Score_elem::height() const
   STANDARD METHS
  */
 void
   STANDARD METHS
  */
 void
-Score_elem::print()const
+Score_elem::print() const
 {
 #ifndef NPRINT
   DOUT << name() << "{\n";
   DOUT << "dets: " << dependent_size() << "dependencies: " << 
 {
 #ifndef NPRINT
   DOUT << name() << "{\n";
   DOUT << "dets: " << dependent_size() << "dependencies: " << 
-       dependency_size();
+    dependency_size();
   if (offset_.x() || offset_.y ())
   if (offset_.x() || offset_.y ())
-       DOUT << "offset (" << offset_.x() << ", " << offset_.y () <<")";
+    DOUT << "offset (" << offset_.x() << ", " << offset_.y () <<")";
   DOUT << "\n";
 
   do_print();
   if (output)
   DOUT << "\n";
 
   do_print();
   if (output)
-       output->print();
+    output->print();
   
   DOUT <<  "}\n";
 #endif
   
   DOUT <<  "}\n";
 #endif
@@ -275,7 +263,7 @@ void
 Score_elem::add_processing()
 {
   if (status_ >= VIRGIN)
 Score_elem::add_processing()
 {
   if (status_ >= VIRGIN)
-       return;
+    return;
   status_ = VIRGIN;
   do_add_processing();
 }
   status_ = VIRGIN;
   do_add_processing();
 }
@@ -284,17 +272,17 @@ void
 Score_elem::pre_processing()
 {
   if (status_ >= PRECALCED)
 Score_elem::pre_processing()
 {
   if (status_ >= PRECALCED)
-       return;
+    return;
 
   assert (status_ != PRECALCING); // cyclic dependency
   status_ = PRECALCING;
 
   for (int i=0; i < dependency_size(); i++)
 
   assert (status_ != PRECALCING); // cyclic dependency
   status_ = PRECALCING;
 
   for (int i=0; i < dependency_size(); i++)
-       dependency (i)->pre_processing();
+    dependency (i)->pre_processing();
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-       extra[i]->pre_processing();
+    extra[i]->pre_processing();
   
   do_pre_processing();
   status_ = PRECALCED;
   
   do_pre_processing();
   status_ = PRECALCED;
@@ -304,21 +292,21 @@ void
 Score_elem::breakable_col_processing()
 {
   if (status_ >= PREBROKEN)
 Score_elem::breakable_col_processing()
 {
   if (status_ >= PREBROKEN)
-       return;
+    return;
 
   if (status_== PREBREAKING) 
     {
 
   if (status_== PREBREAKING) 
     {
-       status_ = PREBROKEN;
-       return ;
+      status_ = PREBROKEN;
+      return ;
     }
   status_ = PREBREAKING;
 
   for (int i=0; i < dependency_size(); i++)
     }
   status_ = PREBREAKING;
 
   for (int i=0; i < dependency_size(); i++)
-       dependency (i)->breakable_col_processing();
+    dependency (i)->breakable_col_processing();
 
 
-    Link_array<Score_elem> extra (get_extra_dependencies());
+  Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
   for (int i=0; i < extra.size(); i++)
-       extra[i]->breakable_col_processing();
+    extra[i]->breakable_col_processing();
   
   
   do_breakable_col_processing();
   
   
   do_breakable_col_processing();
@@ -329,21 +317,21 @@ void
 Score_elem::break_processing()
 {
   if (status_ >= BROKEN)
 Score_elem::break_processing()
 {
   if (status_ >= BROKEN)
-       return;
+    return;
 
   if (status_ == BREAKING) 
     {
 
   if (status_ == BREAKING) 
     {
-       status_ = BROKEN;
-       return;
+      status_ = BROKEN;
+      return;
     }
   status_ = BREAKING;
 
   for (int i=0; i < dependency_size(); i++)
     }
   status_ = BREAKING;
 
   for (int i=0; i < dependency_size(); i++)
-       dependency (i)->break_processing();
+    dependency (i)->break_processing();
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-       extra[i]->break_processing();
+    extra[i]->break_processing();
   
 
   
   
 
   
@@ -363,17 +351,17 @@ void
 Score_elem::post_processing()
 {
   if (status_ >= POSTCALCED)
 Score_elem::post_processing()
 {
   if (status_ >= POSTCALCED)
-       return;
+    return;
   assert (status_ != POSTCALCING);// cyclic dependency
   status_=POSTCALCING; 
 
   
   for (int i=0; i < dependency_size(); i++)
   assert (status_ != POSTCALCING);// cyclic dependency
   status_=POSTCALCING; 
 
   
   for (int i=0; i < dependency_size(); i++)
-       dependency (i)->post_processing();
+    dependency (i)->post_processing();
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-       extra[i]->post_processing();
+    extra[i]->post_processing();
   
 
   do_post_processing();
   
 
   do_post_processing();
@@ -381,7 +369,7 @@ Score_elem::post_processing()
 }
 
 Score_elem::Status
 }
 
 Score_elem::Status
-Score_elem::status()const
+Score_elem::status() const
 {
   return status_;
 }
 {
   return status_;
 }
@@ -389,23 +377,45 @@ Score_elem::status()const
 void 
 Score_elem::molecule_processing()
 {
 void 
 Score_elem::molecule_processing()
 {
-  if (status_ >= OUTPUT)
-       return;
-  status_ = OUTPUT;            // do it only once.
+  if (status_ >= BREWED)
+    return;
+  status_ = BREWED;            // do it only once.
   
   for (int i=0; i < dependency_size(); i++)
   
   for (int i=0; i < dependency_size(); i++)
-       dependency (i)->molecule_processing();
+    dependency (i)->molecule_processing();
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-       extra[i]->molecule_processing();
+    extra[i]->molecule_processing();
   
 
   if (transparent_b_)
   
 
   if (transparent_b_)
-       return ;
+    return ;
   output= brew_molecule_p();
 }
 
   output= brew_molecule_p();
 }
 
+String
+Score_elem::TeX_output_str() const
+{
+  String s;
+  if (status_ >= TEXOUTPUT)
+    return "";
+
+  ((Score_elem*)this)->status_ = TEXOUTPUT;
+
+  for (int i=0; i < dependency_size(); i++)
+    s += dependency (i)->TeX_output_str();
+
+  Link_array<Score_elem> extra (get_extra_dependencies());
+  for (int i=0; i < extra.size(); i++)
+    s += extra[i]->TeX_output_str ();
+  
+  if (!transparent_b_)
+    s+= do_TeX_output_str();
+
+  return s;
+}
+
 /*
   
   VIRTUAL STUBS
 /*
   
   VIRTUAL STUBS
@@ -443,12 +453,18 @@ Score_elem::do_substitute_dependent (Score_elem*,Score_elem*)
 
 void
 Score_elem::do_unlink()
 
 void
 Score_elem::do_unlink()
-{}
+{
+}
+
+void
+Score_elem::do_junk_links()
+{
+}
 
 IMPLEMENT_IS_TYPE_B(Score_elem);
 
 Molecule*
 
 IMPLEMENT_IS_TYPE_B(Score_elem);
 
 Molecule*
-Score_elem::brew_molecule_p()const
+Score_elem::brew_molecule_p() const
 {
   Atom a (paper()->lookup_l ()->fill (Box (Interval (0,0), Interval (0,0))));
   return new Molecule (a);
 {
   Atom a (paper()->lookup_l ()->fill (Box (Interval (0,0), Interval (0,0))));
   return new Molecule (a);
@@ -456,7 +472,7 @@ Score_elem::brew_molecule_p()const
 
 
 Line_of_score *
 
 
 Line_of_score *
-Score_elem::line_l()const
+Score_elem::line_l() const
 {
   return 0;
 }
 {
   return 0;
 }
@@ -486,52 +502,43 @@ Score_elem::substitute_dependency (Score_elem* old, Score_elem* new_l)
   old->do_substitute_dependent (this, 0);
 }
 
   old->do_substitute_dependent (this, 0);
 }
 
-void
-Score_elem::junk_dependencies()
-{
-  while ( dependency_size()) 
-    {
-       remove_edge_out (dependency (0));
-    }
-}
-
 void
 Score_elem::handle_broken_dependencies()
 {
   Line_of_score *line  = line_l();
   if (!line)
 void
 Score_elem::handle_broken_dependencies()
 {
   Line_of_score *line  = line_l();
   if (!line)
-       return;
+    return;
 
   Link_array<Score_elem> remove_us_arr;
   for (int i=0; i < dependency_size(); i++) 
     {
 
   Link_array<Score_elem> remove_us_arr;
   for (int i=0; i < dependency_size(); i++) 
     {
-       Score_elem * elt = dependency (i);
-       if (elt->line_l() != line)
-         {
-           if (elt->spanner()) 
-             {
-               Spanner * sp = elt->spanner();
-               Spanner * broken = sp->find_broken_piece (line);
-               substitute_dependency (sp, broken);
-
-               add_dependency (broken);
-             }
-           else if (elt->item() && elt->item ()->pcol_l_->breakpoint_b ()
-                      && elt->item()->break_status_i () == 0) 
-                        {
-               Item * my_item = elt->item()->find_prebroken_piece (line);
-               substitute_dependency (elt, my_item);
-               if (my_item)
-                   add_dependency (my_item);
-             }
-           remove_us_arr.push (elt);
-         }
+      Score_elem * elt = dependency (i);
+      if (elt->line_l() != line)
+       {
+         if (elt->spanner()) 
+           {
+             Spanner * sp = elt->spanner();
+             Spanner * broken = sp->find_broken_piece (line);
+             substitute_dependency (sp, broken);
+
+             add_dependency (broken);
+           }
+         else if (elt->item())
+           {
+             Item * my_item = elt->item()->find_prebroken_piece (line);
+               
+             substitute_dependency (elt, my_item);
+             if (my_item)
+               add_dependency (my_item);
+           }
+         remove_us_arr.push (elt);
+       }
     }
 
   remove_us_arr.default_sort();
   remove_us_arr.uniq();
   for (int i=0;  i <remove_us_arr.size(); i++)
     }
 
   remove_us_arr.default_sort();
   remove_us_arr.uniq();
   for (int i=0;  i <remove_us_arr.size(); i++)
-       remove_dependency (remove_us_arr[i]);
+    remove_dependency (remove_us_arr[i]);
 
   status_ = BROKEN;
 }
 
   status_ = BROKEN;
 }
@@ -556,29 +563,30 @@ Score_elem::handle_prebroken_dependencies()
   
   for (int i=0; i < dependency_size(); i++) 
     {
   
   for (int i=0; i < dependency_size(); i++) 
     {
-       Score_elem * elt = dependency (i);
-       Item *it_l = elt->item();
-       if (it_l && it_l->breakable_b_)
-           if (item()) 
-             {
-               Score_elem *new_l = it_l->find_prebroken_piece (item()->pcol_l_);
-               if (new_l != elt) 
-                 {
-                   new_arr.push (new_l);
-                   old_arr.push (elt);
-                 }
-           }else 
+      Score_elem * elt = dependency (i);
+      Item *it_l = elt->item();
+      if (it_l && it_l->breakable_b_)
+       if (item()) 
+         {
+           Score_elem *new_l = it_l->find_prebroken_piece (item()->break_status_i_);
+           if (new_l != elt) 
              {
              {
-               new_arr.push (it_l->broken_to_a_[0]);
-               old_arr.push (0);
-               old_arr.push (0);               
-               new_arr.push (it_l->broken_to_a_[1]);           
+               new_arr.push (new_l);
+               old_arr.push (elt);
              }
              }
+         }
+       else 
+         {
+           new_arr.push (it_l->broken_to_drul_[LEFT]);
+             old_arr.push (0);
+             old_arr.push (0);         
+             new_arr.push (it_l->broken_to_drul_[RIGHT]);              
+         }
     }
   
   for (int i=0;  i < old_arr.size(); i++)
     }
   
   for (int i=0;  i < old_arr.size(); i++)
-       if (old_arr[i])
-           substitute_dependency (old_arr[i], new_arr[i]);
+    if (old_arr[i])
+      substitute_dependency (old_arr[i], new_arr[i]);
        
        
   status_ = PREBROKEN;
        
        
   status_ = PREBROKEN;
@@ -590,48 +598,56 @@ void
 Score_elem::unlink_all()
 {
   for (int i=0; i < dependency_size(); i++) 
 Score_elem::unlink_all()
 {
   for (int i=0; i < dependency_size(); i++) 
-       dependency (i)->unlink_all();
+    dependency (i)->unlink_all();
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-       extra[i]->unlink_all();
+    extra[i]->unlink_all();
   
   junk_links();
   
   junk_links();
-  axis_group_l_a_[0] = axis_group_l_a_[1] =0;
+  axis_group_l_a_[X_AXIS] = axis_group_l_a_[Y_AXIS] =0;
+  do_unlink();
 }
 
 void
 Score_elem::unlink()
 {
   do_unlink();
 }
 
 void
 Score_elem::unlink()
 {
   do_unlink();
-  while ( dependency_size()) 
+  while (dependency_size()) 
     {
     {
-       do_substitute_dependency (dependency (0),0);
-       remove_edge_out_idx (0);
+      do_substitute_dependency (dependency (0),0);
+      remove_edge_out_idx (0);
     }
     }
-  while  ( dependent_size()) 
+  while  (dependent_size()) 
     {
     {
-       dependent (0)->remove_dependency (this);
+      dependent (0)->remove_dependency (this);
     }
   for (int j=0; j < 2; j++)
     }
   for (int j=0; j < 2; j++)
-       if ( axis_group_l_a_[j])
-           axis_group_l_a_[j]->remove_element (this);
+    if (axis_group_l_a_[j])
+      axis_group_l_a_[j]->remove_element (this);
 
 }
 
 void
 
 }
 
 void
-Score_elem::OK()const
+Score_elem::OK() const
 {
 #ifndef NDEBUG
   for (int i=0; i < dependency_size(); i++) 
     {
 {
 #ifndef NDEBUG
   for (int i=0; i < dependency_size(); i++) 
     {
-       dependency (i)->OK();
+      dependency (i)->OK();
     }
 #endif
 }
 
 Link_array<Score_elem>
     }
 #endif
 }
 
 Link_array<Score_elem>
-Score_elem::get_extra_dependencies()const
+Score_elem::get_extra_dependencies() const
 {
   Link_array<Score_elem> empty;
   return empty;
 }
 {
   Link_array<Score_elem> empty;
   return empty;
 }
+
+bool
+Score_elem::linked_b() const
+{
+  return get_extra_dependencies().size() || 
+    dependency_size();
+}
index 96192d66f99a5d51772b8d8ebc52225fc6c875f9..183d8e54fe72189eb390b1e118e696405691867d 100644 (file)
 #include "command-request.hh"
 
 
 #include "command-request.hh"
 
 
-void
-Score_engraver::set_score (Score *s)
-{
-  Global_translator::set_score (s);
-  scoreline_l_ = s->pscore_p_->super_elem_l_->line_of_score_l_;
-}
-
 Score_engraver::Score_engraver()
 {
   disallow_break_b_ = false;
 Score_engraver::Score_engraver()
 {
   disallow_break_b_ = false;
@@ -34,15 +27,14 @@ Score_engraver::Score_engraver()
   command_column_l_ =0;
   musical_column_l_ =0;
   breaks_i_ =0;
   command_column_l_ =0;
   musical_column_l_ =0;
   breaks_i_ =0;
+  pscore_p_ = 0;
 }
 }
-
  
 void
 Score_engraver::prepare (Moment w)
 {
   set_columns (new Score_column (w),  new Score_column (w));
   
  
 void
 Score_engraver::prepare (Moment w)
 {
   set_columns (new Score_column (w),  new Score_column (w));
   
-  
   disallow_break_b_ = false;
   post_move_processing();
 }
   disallow_break_b_ = false;
   post_move_processing();
 }
@@ -50,8 +42,8 @@ Score_engraver::prepare (Moment w)
 void
 Score_engraver::finish()
 {
 void
 Score_engraver::finish()
 {
-  if ( (breaks_i_%8))
-           *mlog << "[" << breaks_i_ << "]" << flush;
+  if ((breaks_i_%8))
+    *mlog << "[" << breaks_i_ << "]" << flush;
    
   check_removal();
   removal_processing();
    
   check_removal();
   removal_processing();
@@ -60,8 +52,9 @@ Score_engraver::finish()
 void
 Score_engraver::do_creation_processing()
 {
 void
 Score_engraver::do_creation_processing()
 {
-  scoreline_l_->left_col_l_ = get_staff_info().command_pcol_l ();
-  scoreline_l_->left_col_l_ ->set_breakable();
+  scoreline_l_ = pscore_p_->super_elem_l_->line_of_score_l_;
+  scoreline_l_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+  command_column_l_->breakable_b_ = true;
   Engraver_group_engraver::do_creation_processing();
 }
 
   Engraver_group_engraver::do_creation_processing();
 }
 
@@ -69,19 +62,20 @@ void
 Score_engraver::do_removal_processing()
 {
   Engraver_group_engraver::do_removal_processing();
 Score_engraver::do_removal_processing()
 {
   Engraver_group_engraver::do_removal_processing();
-  scoreline_l_->right_col_l_ = get_staff_info().command_pcol_l ();
-  scoreline_l_->right_col_l_ ->set_breakable();
-  typeset_all();
+  scoreline_l_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+  command_column_l_->breakable_b_ = true;
+
+  typeset_all ();
   set_columns (0,0);
 }
 
 void
 Score_engraver::process()
 {
   set_columns (0,0);
 }
 
 void
 Score_engraver::process()
 {
-       process_requests();
-       do_announces();
-       pre_move_processing();
-       check_removal();
+  process_requests();
+  do_announces();
+  pre_move_processing();
+  check_removal();
 }
 
 void
 }
 
 void
@@ -89,34 +83,34 @@ Score_engraver::announce_element (Score_elem_info info)
 {
   announce_info_arr_.push (info);
   info.origin_grav_l_arr_.push (this);
 {
   announce_info_arr_.push (info);
   info.origin_grav_l_arr_.push (this);
-      
 }
 }
+
 void
 Score_engraver::do_announces()
 {
   /* All elements are propagated to the top upon announcement. If
 void
 Score_engraver::do_announces()
 {
   /* All elements are propagated to the top upon announcement. If
-    something was created during one run of
-    Engraver_group_engraver::do_announces, then
-    announce_info_arr_.size() will be nonzero again
+     something was created during one run of
+     Engraver_group_engraver::do_announces, then
+     announce_info_arr_.size() will be nonzero again
 
 
-    */
+     */
   while (announce_info_arr_.size()) 
     {
   while (announce_info_arr_.size()) 
     {
-       for (int i=0; i <announce_info_arr_.size(); i++)
-           /*
-             TODO
+      for (int i=0; i < announce_info_arr_.size(); i++)
+       /*
+         TODO
 
 
-             More subtle spacing
-            */
-           if (announce_info_arr_[i].req_l_) 
+         More subtle spacing
+         */
+       if (announce_info_arr_[i].req_l_) 
+         {
+           Musical_req *m = announce_info_arr_[i].req_l_->musical();
+           if (m && m->rhythmic()) 
              {
              {
-               Musical_req *m = announce_info_arr_[i].req_l_->musical();
-               if (m && m->rhythmic()) 
-                 {
-                   musical_column_l_->add_duration (m->duration());
-                 }
+               musical_column_l_->add_duration (m->duration());
              }
              }
-       Engraver_group_engraver::do_announces();
+         }
+      Engraver_group_engraver::do_announces();
     }
 }
 
     }
 }
 
@@ -124,59 +118,42 @@ Score_engraver::do_announces()
 void
 Score_engraver::typeset_element (Score_elem *elem_p)
 {
 void
 Score_engraver::typeset_element (Score_elem *elem_p)
 {
-  if  ( elem_p->item() && elem_p->item ()->breakable_b_) 
-    {
-       nobreak_item_p_arr_.push (elem_p->item());
-    }
-  else
-       musical_item_p_arr_.push (elem_p);
+  elem_p_arr_.push(elem_p);
 }
 
 void
 Score_engraver::typeset_all()
 {
 }
 
 void
 Score_engraver::typeset_all()
 {
-  PCol * c= get_staff_info().command_pcol_l ();
-  Paper_score *ps_l = score_l_->pscore_p_;
-
-  for  (int i =0; i < nobreak_item_p_arr_.size(); i++) 
-    {
-       ps_l->typeset_item (nobreak_item_p_arr_[i], c);
-
-       // should get rid of this.. .
-       scoreline_l_->add_dependency (nobreak_item_p_arr_[i]);
-    }
-  nobreak_item_p_arr_.clear();
-  
-  for (int i=0; i < musical_item_p_arr_.size(); i++) 
+  for  (int i =0; i < elem_p_arr_.size(); i++) 
     {
     {
-       PCol* m = get_staff_info().musical_pcol_l ();
-       Score_elem *elem_p = musical_item_p_arr_[i];
-
-       scoreline_l_->add (elem_p);
-       if (elem_p->spanner()) 
-         {
-           ps_l->typeset_unbroken_spanner (elem_p->spanner());
-         }
-       else if (elem_p->item()) 
-         {
-           ps_l->typeset_item (elem_p->item(), m);
+      Score_elem * elem_p = elem_p_arr_[i];
+      if (elem_p->spanner()) 
+         pscore_p_->typeset_unbroken_spanner (elem_p->spanner());
+      else 
+       {
+         Item *item_p = elem_p->item();
+         pscore_p_->typeset_element (item_p);
+         if (!item_p->axis_group_l_a_[X_AXIS]) {
+           if (item_p->breakable_b_) 
+             command_column_l_->add_element(item_p);
+           else
+             musical_column_l_->add_element(item_p);
          }
          }
-       else
-           assert (false);
+       }
+      scoreline_l_->add (elem_p);
     }
     }
-  musical_item_p_arr_.clear();
+  elem_p_arr_.clear();
 }
 
 }
 
-
 void
 Score_engraver::do_pre_move_processing()
 {
 void
 Score_engraver::do_pre_move_processing()
 {
-  if ( !disallow_break_b_)
+  if (!disallow_break_b_)
     {
     {
-       get_staff_info().command_pcol_l ()->set_breakable ();
-       breaks_i_ ++;
-       if ( ! (breaks_i_%8))
-           *mlog << "[" << breaks_i_ << "]" << flush;
+      get_staff_info().command_pcol_l ()-> breakable_b_ = true;
+      breaks_i_ ++;
+      if (! (breaks_i_%8))
+       *mlog << "[" << breaks_i_ << "]" << flush;
     }
   // this generates all items.
   Engraver_group_engraver::do_pre_move_processing();
     }
   // this generates all items.
   Engraver_group_engraver::do_pre_move_processing();
@@ -186,63 +163,78 @@ Score_engraver::do_pre_move_processing()
 
 void
 Score_engraver::set_columns (Score_column *new_command_l, 
 
 void
 Score_engraver::set_columns (Score_column *new_command_l, 
-                           Score_column *new_musical_l)
+                            Score_column *new_musical_l)
 {
 {
-  if ( command_column_l_ && command_column_l_->used_b())
-       score_l_->pscore_p_->add (command_column_l_);
+  if (command_column_l_ && command_column_l_->linked_b()) 
+    {
+      pscore_p_->add_column (command_column_l_);
+      scoreline_l_->add (command_column_l_);
+    }
   else 
     {
   else 
     {
-       delete command_column_l_ ;
-       command_column_l_ =0;
+      delete command_column_l_ ;
+      command_column_l_ =0;
     }
   if (new_command_l) 
     {
     }
   if (new_command_l) 
     {
-       command_column_l_ = new_command_l;
-       command_column_l_->musical_b_ = false;
+      command_column_l_ = new_command_l;
+      command_column_l_->musical_b_ = false;
+    }
+  if (musical_column_l_ && musical_column_l_->linked_b()) 
+    {
+      pscore_p_->add_column (musical_column_l_);
+      scoreline_l_->add (musical_column_l_);
     }
     }
-  if ( musical_column_l_ && musical_column_l_->used_b())
-       score_l_->pscore_p_->add (musical_column_l_);
   else 
     {
   else 
     {
-       delete musical_column_l_;
-       musical_column_l_ = 0;
+      delete musical_column_l_;
+      musical_column_l_ = 0;
     }
   
   if (new_musical_l) 
     {
     }
   
   if (new_musical_l) 
     {
-       musical_column_l_ = new_musical_l;
-       musical_column_l_->musical_b_ = true;
+      musical_column_l_ = new_musical_l;
+      musical_column_l_->musical_b_ = true;
     }
 }
 
 
 Staff_info
     }
 }
 
 
 Staff_info
-Score_engraver::get_staff_info()const
+Score_engraver::get_staff_info() const
 {
 {
-  Staff_info inf;
+  Staff_info inf = Engraver_group_engraver::get_staff_info();
 
   inf.command_l_ = command_column_l_;
   inf.musical_l_ = musical_column_l_;
 
   inf.command_l_ = command_column_l_;
   inf.musical_l_ = musical_column_l_;
+  
   return inf;
 }
 
 Paper_def*
   return inf;
 }
 
 Paper_def*
-Score_engraver::paper()const
+Score_engraver::paper() const
 {
 {
-  return score_l_->paper_p_;
+  return pscore_p_->paper_l_;
 }
 
 
 }
 
 
+Music_output*
+Score_engraver::get_output_p ()
+{
+  Music_output * o = pscore_p_;
+  pscore_p_=0;
+  return o;
+}
 
 bool
 Score_engraver::do_try_request (Request*r)
 {
   bool gotcha = Engraver_group_engraver::do_try_request (r);  
 
 bool
 Score_engraver::do_try_request (Request*r)
 {
   bool gotcha = Engraver_group_engraver::do_try_request (r);  
-  if ( !gotcha && r->command() && r->command ()->disallowbreak ())
-           disallow_break_b_ = true;
+  if (!gotcha && r->command() && r->command ()->disallowbreak ())
+    disallow_break_b_ = true;
   return gotcha;
 }
 
 IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
 ADD_THIS_ENGRAVER(Score_engraver);
 
   return gotcha;
 }
 
 IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
 ADD_THIS_ENGRAVER(Score_engraver);
 
+  
index eabe40192609e0ff3a7576b0808d7782258fd9dd..647348928440f934d9647b2fe18717c3493967fa 100644 (file)
@@ -49,12 +49,6 @@ Score_performer::depth_i() const
 }
 
 
 }
 
 
-void
-Score_performer::finish()
-{
-  Performer_group_performer::do_removal_processing();
-}
-
 
 void
 Score_performer::play (Audio_element * p)
 
 void
 Score_performer::play (Audio_element * p)
@@ -65,9 +59,9 @@ Score_performer::play (Audio_element * p)
     }
   else if (p->is_type_b (Audio_staff::static_name())) 
     {
     }
   else if (p->is_type_b (Audio_staff::static_name())) 
     {
-       score_l_->audio_score_p_->add_staff ((Audio_staff*)p);
+      performance_p_->add_staff ((Audio_staff*)p);
     }
     }
-  score_l_->audio_score_p_->add (p);
+  performance_p_->add (p);
 }
 
 
 }
 
 
@@ -76,7 +70,7 @@ Score_performer::prepare (Moment m)
 {
   now_mom_ = m;
   audio_column_l_ = new Audio_column (m);
 {
   now_mom_ = m;
   audio_column_l_ = new Audio_column (m);
-  score_l_->audio_score_p_->add (audio_column_l_);
+  performance_p_->add (audio_column_l_);
 }
 
 
 }
 
 
@@ -87,21 +81,29 @@ Score_performer::process()
 }
 
 
 }
 
 
+
 void
 void
-Score_performer::set_score (Score* score_l)
+Score_performer::start()
 {
 {
-  Global_translator::set_score (score_l);
 }
 
 
 }
 
 
-void
-Score_performer::start()
+int
+Score_performer::get_tempo_i() const
 {
 {
+  return performance_p_->midi_l_->get_tempo_i (Moment (1, 4));
 }
 
 }
 
+void
+Score_performer::finish()
+{
+  Performer_group_performer::do_removal_processing();
+}
 
 
-int
-Score_performer::get_tempo_i()const
+Music_output *
+Score_performer::get_output_p ()
 {
 {
-  return score_l_->midi_p_->get_tempo_i (Moment (1, 4));
+  Music_output * o = performance_p_;
+  performance_p_ =0;
+  return o;
 }
 }
index 80057719c2c14d44bc519ba7e33b26f009ad4c07..04ed82576876e348ab067782c9fcc74b74b80d1c 100644 (file)
@@ -6,19 +6,13 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "tex-stream.hh"
 #include "score.hh"
 #include "score.hh"
-#include "score-column.hh"
-#include "p-score.hh"
 #include "debug.hh"
 #include "debug.hh"
-#include "paper-def.hh"
+#include "music-output-def.hh"
+#include "music-output.hh"
 #include "main.hh"
 #include "source.hh"
 #include "source-file.hh"
 #include "main.hh"
 #include "source.hh"
 #include "source-file.hh"
-#include "midi-def.hh"
-#include "midi-stream.hh"
-#include "audio-score.hh"
-#include "p-col.hh"
 #include "music-iterator.hh"
 #include "music.hh"
 #include "global-translator.hh"
 #include "music-iterator.hh"
 #include "music.hh"
 #include "global-translator.hh"
@@ -30,189 +24,117 @@ Score::Score()
 {
   header_p_ = 0;
   music_p_ = 0;
 {
   header_p_ = 0;
   music_p_ = 0;
-  pscore_p_ = 0;
-  audio_score_p_ = 0;
-  paper_p_ = 0;
-  midi_p_ = 0;
   errorlevel_i_ = 0;
 }
 
 Score::Score (Score const &s)
 {
   errorlevel_i_ = 0;
 }
 
 Score::Score (Score const &s)
 {
-  assert (!pscore_p_);
   music_p_ = s.music_p_->clone();
   music_p_ = s.music_p_->clone();
-  midi_p_ = new Midi_def (*s.midi_p_);
-  paper_p_ = new Paper_def (*s.paper_p_);
+  for (int i=0; i < s.def_p_arr_.size (); i++)
+    def_p_arr_.push(s.def_p_arr_[i]->clone());
   header_p_ = new Header (*s.header_p_);
 }
 
 Score::~Score()
 {
   delete header_p_;
   header_p_ = new Header (*s.header_p_);
 }
 
 Score::~Score()
 {
   delete header_p_;
+  for (int i=0; i < def_p_arr_.size (); i++)
+    delete def_p_arr_[i];
   delete music_p_;
   delete music_p_;
-  delete pscore_p_;
-  delete audio_score_p_;
-  delete paper_p_;
-  delete midi_p_;
 }
 
 void
 }
 
 void
-Score::run_translator (Global_translator * trans_l)
+Score::run_translator (Music_output_def *odef_l)
 {
 {
-  trans_l->set_score (this);
+  Global_translator * trans_p = odef_l->get_global_translator_p();
+  if (!trans_p)
+    return ;
+  
+  *mlog << "\nInterpreting music ...";
+  trans_p->last_mom_ = music_p_->time_int().max ();
+
   Music_iterator * iter = Music_iterator::static_get_iterator_p (music_p_, 
   Music_iterator * iter = Music_iterator::static_get_iterator_p (music_p_, 
-                                                                 trans_l);
+                                                                trans_p);
   iter->construct_children();
 
   iter->construct_children();
 
-  if ( ! iter->ok()) 
+  if (! iter->ok()) 
     {
     {
-       delete iter;
-       warning ("Need music in a score");
-       errorlevel_i_ =1;
-       return ;
+      delete iter;
+      warning ("Need music in a score");
+      errorlevel_i_ =1;
+      return ;
     }
   
     }
   
-  trans_l->start();
+  trans_p->start();
   
   
-  while ( iter->ok() || trans_l->moments_left_i ()) 
+  while (iter->ok() || trans_p->moments_left_i ()) 
     {
     {
-       Moment w = infinity_mom;
-       if (iter->ok()) 
-         {
-           w = iter->next_moment();
-           DOUT << w;
-           iter->print();
-         }
-       trans_l->modify_next (w);
-       trans_l->prepare (w);
-       trans_l->print();
-
-       iter->process_and_next (w);
-       trans_l->process();
+      Moment w = infinity_mom;
+      if (iter->ok()) 
+       {
+         w = iter->next_moment();
+         DOUT << "proccing: " << w <<"\n";
+         iter->print();
+       }
+      trans_p->modify_next (w);
+      trans_p->prepare (w);
+      trans_p->print();
+
+      iter->process_and_next (w);
+      trans_p->process();
     }
   delete iter;
     }
   delete iter;
-  trans_l->finish();
-}
+  trans_p->finish();
 
 
-void
-Score::process()
-{
-  print();
-  paper();
-  midi();
-}
-
-void
-Score::midi()
-{
-  if ( !midi_p_)
-       return;
-  
-  *mlog << "\nCreating MIDI elements ..." << flush;
-  audio_score_p_ = new Audio_score (this);
-  
-  Global_translator* score_trans=  midi_p_->get_global_translator_p();
-  run_translator (score_trans);
-  delete score_trans;
-  
-  if (errorlevel_i_)
-    {
-       // should we? hampers debugging. 
-       warning ("Errors found, /*not processing score*/");
-    }
-  *mlog << endl;
-
-  midi_output();
-}
-  
-void
-Score::paper()
-{
-  if (!paper_p_)
-       return;
-  
-  *mlog << "\nCreating elements ..." << flush;
-  pscore_p_ = new Paper_score (paper_p_);
-  
-  Global_translator * score_trans=  paper_p_->get_global_translator_p();
-  run_translator (score_trans);
-  delete score_trans;
   
   if (errorlevel_i_) 
     {
   
   if (errorlevel_i_) 
     {
-       // should we? hampers debugging. 
-       warning ("Errors found, /*not processing score*/");
+      // should we? hampers debugging. 
+      warning ("Errors found, /*not processing score*/");
     }
     }
+    
+  Music_output * output = trans_p->get_output_p();
+  delete trans_p;
+
+  output->header_l_ = header_p_;
+  output->default_out_str_ = default_out_fn;
+  output->origin_str_ =  location_str();
   
   *mlog << endl;
   
   *mlog << endl;
-  pscore_p_->process();
-
-  // output
-  paper_output();
+  output->process();
+  delete output ;
 }
 
 void
 }
 
 void
-Score::midi_output()
+Score::process()
 {
 {
-  if ( midi_p_->outfile_str_ == "")
-       midi_p_->outfile_str_ = default_out_fn + ".midi";
-
-  Midi_stream midi_stream (midi_p_->outfile_str_);    
-  *mlog << "MIDI output to " << midi_p_->outfile_str_ << " ..." << endl;    
+  if (!music_p_)
+    return;
 
 
-  audio_score_p_->output (midi_stream);
-  *mlog << endl;
+  print();
+  for (int i=0; i < def_p_arr_.size (); i++)
+    run_translator (def_p_arr_[i]);
 }
 
 }
 
-void
-Score::paper_output()
-{
-  if (paper_p_->outfile_str_=="")
-       paper_p_->outfile_str_ = default_out_fn + ".tex";
 
 
-  if ( errorlevel_i_) 
-    {
-       *mlog << "lilypond: warning: no output to: " << paper_p_->outfile_str_ 
-       << " (errorlevel=" << errorlevel_i_ << ")" << endl;
-      return;
-    }
 
 
-  *mlog << "TeX output to " << paper_p_->outfile_str_ << " ...\n";
-  
-  Tex_stream the_output (paper_p_->outfile_str_);
-  
-  the_output << "% outputting Score, defined at: " <<
-       location_str() << "\n";
-  if (header_p_) {
-    the_output << header_p_->TeX_string();
-  }
-  pscore_p_->output (the_output);
-}
 
 void
 Score::print() const
 {
 #ifndef NPRINT
   DOUT << "score {\n"; 
 
 void
 Score::print() const
 {
 #ifndef NPRINT
   DOUT << "score {\n"; 
-  music_p_->print();
-  if (midi_p_)
-       midi_p_->print();
-  
+  for (int i=0; i < def_p_arr_.size (); i++)
+    def_p_arr_[i]->print();
   DOUT << "}\n";
 #endif
 }
 
 void
   DOUT << "}\n";
 #endif
 }
 
 void
-Score::set (Paper_def *pap_p)
+Score::add (Music_output_def *pap_p)
 {
 {
-  delete paper_p_;
-  paper_p_ = pap_p;
+  def_p_arr_.push(pap_p);
 }
 
 }
 
-void
-Score::set (Midi_def* midi_p)
-{    
-  delete midi_p_;
-  midi_p_ = midi_p;
-}
+
 
 
index 7bb391211a21ac9f7ec6cd8b249fe28a440ec50b..f3324091527ee8bc34753d749d4050003068de87 100644 (file)
    take out hard coded TeX stuff.
    */
 String
    take out hard coded TeX stuff.
    */
 String
-Line_of_score::TeX_string() const
+Line_of_score::TeX_output_str () const
 {
 {
-   String s ("\\hbox{%<- line of score\n");
-   if (error_mark_b_)
-        s+= "\\scorelineerrormark";
-   
-   
-   Real lastpos = cols[0]->hpos_f_;
-   for (int i=0; i < cols.size();  i++)
-     {
-        PCol* col_l= cols[i];
-        // all items in the current line & staff.
-        String chunk_str;
-
-           
-        Link_array<Score_elem> elems;
-           
-        if (col_l->error_mark_b_) 
-          {
-            chunk_str += String ("\\columnerrormark");
-          }
-        
-        // now output the items.
-        for (iter_top (col_l->its,j); j.ok(); j++) 
-          {
-            elems.push (j);
-          }
-
-        // spanners.
-        for (iter_top (col_l->starters,j); j.ok(); j++) 
-          {
-            if (j->name() != name ())
-               elems.push (j);
-          }
-        
-        for (int j =0; j< elems.size(); j++) 
-          {
-            Offset o = elems[j]->absolute_offset();
-            o[X_AXIS] += cols[i]->hpos_f_;
-            s += elems[j]->TeX_string_without_offset (o);
-          }
-     }
-   s += "}";
-   return s;
+  String s ("\\hbox{%<- line of score\n");
+  if (error_mark_b_)
+    s+= "\\scorelineerrormark";
+  
+  s+= Score_elem::TeX_output_str();
+  s += "}";
+  return s;
 }
 
 
 }
 
 
@@ -73,23 +38,20 @@ Line_of_score::Line_of_score()
 }
 
 
 }
 
 
-
-
-
 IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner);
 
 void
 Line_of_score::add (Score_elem*e)
 {
   // avoid excess dependencies.
 IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner);
 
 void
 Line_of_score::add (Score_elem*e)
 {
   // avoid excess dependencies.
-  if (!( e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
-       add_dependency (e);
+  if (!(e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
+    add_dependency (e);
 }
 
 bool
 }
 
 bool
-Line_of_score::contains_b (PCol const* c)const
+Line_of_score::contains_b (Paper_column const* c) const
 {
 {
-  return cols.find_l ((PCol*)c);
+  return cols.find_l ((Paper_column*)c);
 }
 
 void
 }
 
 void
@@ -97,72 +59,82 @@ Line_of_score::set_breaking (Array<Col_hpositions> const &breaking)
 {
   for (int j=0; j < breaking.size(); j++) 
     {
 {
   for (int j=0; j < breaking.size(); j++) 
     {
-       const Array<PCol*> &curline (breaking[j].cols);
-       const Array<PCol*> &errors (breaking[j].error_col_l_arr_);
-       const Array<Real> &config (breaking[j].config);
+      const Array<Paper_column*> &curline (breaking[j].cols);
+      const Array<Paper_column*> &errors (breaking[j].error_col_l_arr_);
+      const Array<Real> &config (breaking[j].config);
        
        
-       for (int i=0; i < errors.size(); i++)
-           errors[i]->error_mark_b_ = true;
+      for (int i=0; i < errors.size(); i++)
+       errors[i]->error_mark_b_ = true;
 
 
-       Line_of_score *line_l=0;
-       Line_of_score *line_p =0;
-       
-       if (breaking.size() >1) 
-         {
-           line_p = (Line_of_score*)clone()->spanner ();
-           line_p->copy_dependencies (*this);
-           line_l = line_p;
-         }
-       else 
-           line_l =  this;
+      Line_of_score *line_l=0;
+      Line_of_score *line_p =0;
        
        
-       ((Array<PCol*> &)line_l->cols) = curline;
-       line_l->left_col_l_ =  curline[0];
-       line_l->right_col_l_= curline.top();
+      if (breaking.size() >1) 
+       {
+         line_p = (Line_of_score*)clone()->spanner ();
+         line_l = line_p;
+       }
+      else 
+       line_l =  this;
        
        
-       if (line_p) 
-         {
-           pscore_l_->typeset_broken_spanner (line_p);
-           broken_into_l_arr_.push (line_p);
-         }
+      ((Array<Paper_column*> &)line_l->cols) = curline;
+      line_l->set_bounds(LEFT,curline[0]);
+      
+      line_l->set_bounds(RIGHT,curline.top());
        
        
-       for (int i=0; i < curline.size(); i++)
-         {
-           curline[i]->hpos_f_ = config[i];
-           curline[i]->line_l_ = (Line_of_score*)line_l;
-         }
+      if (line_p) 
+       {
+         pscore_l_->typeset_broken_spanner (line_p);
+         broken_into_l_arr_.push (line_p);
+       }
+
+      for (int i=0; i < curline.size(); i++)
+       {
+         curline[i]->translate(config[i],X_AXIS);
+         curline[i]->line_l_ = (Line_of_score*)line_l;
+       }
     }
 }
 
     }
 }
 
+
 void
 Line_of_score::break_into_pieces (bool)
 {
 void
 Line_of_score::break_into_pieces (bool)
 {
+  
 }
 
 Link_array<Line_of_score>
 }
 
 Link_array<Line_of_score>
-Line_of_score::get_lines()const
+Line_of_score::get_lines() const
 {
   Link_array<Line_of_score> ret;
 
   if (broken_into_l_arr_.size())
 {
   Link_array<Line_of_score> ret;
 
   if (broken_into_l_arr_.size())
-       for (int i=0; i < broken_into_l_arr_.size(); i++) 
-         {
-           ret.push ((Line_of_score*)broken_into_l_arr_[i]);
-         }
+    for (int i=0; i < broken_into_l_arr_.size(); i++) 
+      {
+       ret.push ((Line_of_score*)broken_into_l_arr_[i]);
+      }
   else 
   else 
-       ret.push ((Line_of_score*)this);        // ugh
+    ret.push ((Line_of_score*)this);   // ugh
   
   return ret;
 }
 
 void
   
   return ret;
 }
 
 void
-Line_of_score::do_print()const
+Line_of_score::do_print() const
 {
   Spanner::do_print();
 }
 
 Interval
 {
   Spanner::do_print();
 }
 
 Interval
-Line_of_score::do_width()const
+Line_of_score::do_width() const
 { 
   return Spanner::do_width();
 }
 { 
   return Spanner::do_width();
 }
+
+void
+Line_of_score::do_breakable_col_processing() 
+{
+  for (int i=0; i < cols.size (); i++)
+    cols[i]->breakable_col_processing();
+  Spanner::do_breakable_col_processing();
+}
index 446e419a3da25b783eb0c13a233b0287148d0ed2..a1cb0830a1e403d70072b8f3f6df00490407249d 100644 (file)
@@ -22,11 +22,6 @@ do_scores()
     {
        Score *&is_p = score_array_global[i];
        
     {
        Score *&is_p = score_array_global[i];
        
-       if (only_midi) 
-         {
-           delete is_p->paper_p_;
-           is_p->paper_p_ = 0;
-         }
        
        if (is_p->errorlevel_i_) 
          {
        
        if (is_p->errorlevel_i_) 
          {
index 836541ce16c9726950321c21b589abad779a66be..6f9359aef7c46fce45dd5b706746c304097dc62a 100644 (file)
@@ -26,7 +26,7 @@ Script_column::add (Script*s_l)
 
 
 void
 
 
 void
-Script_column::do_print()const
+Script_column::do_print() const
 {
 #ifndef NPRINT
   DOUT << "scripts: " << script_l_arr_.size() << '\n'; 
 {
 #ifndef NPRINT
   DOUT << "scripts: " << script_l_arr_.size() << '\n'; 
@@ -37,8 +37,8 @@ static int
 idx (bool inside, int dir)
 {
   int j = (dir+1);
 idx (bool inside, int dir)
 {
   int j = (dir+1);
-  if ( !inside)
-       j ++;
+  if (!inside)
+    j ++;
   return j;
 }
 
   return j;
 }
 
@@ -46,49 +46,49 @@ void
 Script_column::do_pre_processing()
 {
   if (!script_l_arr_.size()) 
 Script_column::do_pre_processing()
 {
   if (!script_l_arr_.size()) 
-       return;
+    return;
   
   /* up+inside, up+outside, down+inside, down+outside */
   Array<Script*> placed_l_arr_a[4];
   for (int i=0; i < script_l_arr_.size(); i++) 
     {
   
   /* up+inside, up+outside, down+inside, down+outside */
   Array<Script*> placed_l_arr_a[4];
   for (int i=0; i < script_l_arr_.size(); i++) 
     {
-       Script*s_l = script_l_arr_[i];
-       placed_l_arr_a[idx (s_l->inside_staff_b_ , s_l->dir_i_) ].push (s_l);
+      Script*s_l = script_l_arr_[i];
+      placed_l_arr_a[idx (s_l->inside_staff_b_ , s_l->dir_) ].push (s_l);
     }
   
   for (int j =0; j <4; j++) 
     {
     }
   
   for (int j =0; j <4; j++) 
     {
-       placed_l_arr_a[j].sort (Script::compare);
+      placed_l_arr_a[j].sort (Script::compare);
     }
 
 
   for (int j =0; j < 4; j++) 
     {
     }
 
 
   for (int j =0; j < 4; j++) 
     {
-       if (placed_l_arr_a[j].size())
-           for (int i=0; i  < support_l_arr_.size(); i++)
-               placed_l_arr_a[j][0]->add_support (support_l_arr_[i]);
+      if (placed_l_arr_a[j].size())
+       for (int i=0; i  < support_l_arr_.size(); i++)
+         placed_l_arr_a[j][0]->add_support (support_l_arr_[i]);
     }
   
   Item * support_l=0;
   int j = 0;
   for (; j < 2; j++) 
     {
     }
   
   Item * support_l=0;
   int j = 0;
   for (; j < 2; j++) 
     {
-       for (int i=0; i < placed_l_arr_a[j].size(); i++) 
-         {
-           if (support_l)
-               placed_l_arr_a[j][i]->add_support (support_l);
-           support_l = placed_l_arr_a[j][i];
-         }
+      for (int i=0; i < placed_l_arr_a[j].size(); i++) 
+       {
+         if (support_l)
+           placed_l_arr_a[j][i]->add_support (support_l);
+         support_l = placed_l_arr_a[j][i];
+       }
     }
   support_l = 0;
   for (; j < 4; j++) 
     {
     }
   support_l = 0;
   for (; j < 4; j++) 
     {
-       for (int i=0; i < placed_l_arr_a[j].size(); i++) 
-         {
-           if (support_l)
-               placed_l_arr_a[j][i]->add_support (support_l);
-           support_l = placed_l_arr_a[j][i];
-         }
+      for (int i=0; i < placed_l_arr_a[j].size(); i++) 
+       {
+         if (support_l)
+           placed_l_arr_a[j][i]->add_support (support_l);
+         support_l = placed_l_arr_a[j][i];
+       }
     }
 }
 
     }
 }
 
@@ -106,7 +106,7 @@ Script_column::do_substitute_dependency (Score_elem*o,Score_elem*n)
 {
   if (o->item()) 
     {
 {
   if (o->item()) 
     {
-       script_l_arr_.substitute ((Script*)o->item(),(Script*) (n?n->item ():0));
-       support_l_arr_.substitute (o->item(), (n?n->item ():0));
+      script_l_arr_.substitute ((Script*)o->item(),(Script*) (n?n->item ():0));
+      support_l_arr_.substitute (o->item(), (n?n->item ():0));
     }
 }
     }
 }
index 6a53aba9827bb4f781b8779f9d83927dfe036823..6ece2874f582880172417783ebea320048fc17f1 100644 (file)
@@ -16,8 +16,8 @@ Script_def::Script_def()
 {
   inside_staff_b_ = false;
   symidx_str_ = "unknown" ;
 {
   inside_staff_b_ = false;
   symidx_str_ = "unknown" ;
-  rel_stem_dir_i_ =0;
-  staff_dir_i_ = -1;
+  rel_stem_dir_ =CENTER;
+  staff_dir_ = DOWN;
   invertsym_b_ = 0;
   priority_i_ =0;
 }
   invertsym_b_ = 0;
   priority_i_ =0;
 }
@@ -27,8 +27,8 @@ Script_def::set_from_input (String idx,  bool follow, int stem, int staff ,bool
 {
   inside_staff_b_ = follow;
   symidx_str_ = idx ;
 {
   inside_staff_b_ = follow;
   symidx_str_ = idx ;
-  rel_stem_dir_i_ =stem;
-  staff_dir_i_ = staff;
+  rel_stem_dir_ =Direction(stem);
+  staff_dir_ = Direction(staff);
   invertsym_b_ = invert;
   priority_i_ =priority_i;
 }
   invertsym_b_ = invert;
   priority_i_ =priority_i;
 }
@@ -39,30 +39,30 @@ Script_def::do_print() const
 {
 #ifndef NPRINT
   DOUT << "Script_def{ idx: " << symidx_str_ 
 {
 #ifndef NPRINT
   DOUT << "Script_def{ idx: " << symidx_str_ 
-        << " direction, stem: " << rel_stem_dir_i_ << " staff : " << staff_dir_i_ << "}\n";
+       << " direction, stem: " << rel_stem_dir_ << " staff : " << staff_dir_ << "}\n";
 #endif
 }
 
 bool
 #endif
 }
 
 bool
-Script_def::do_equal_b (General_script_def const *g)const 
+Script_def::do_equal_b (General_script_def const *g) const 
 {
   Script_def const * c = (Script_def const*) g;
   return (symidx_str_ == c->symidx_str_ &&
 {
   Script_def const * c = (Script_def const*) g;
   return (symidx_str_ == c->symidx_str_ &&
-            rel_stem_dir_i_ == c->rel_stem_dir_i_&&
-            staff_dir_i_ == c->staff_dir_i_&&
-            invertsym_b_ == c->invertsym_b_);
+         rel_stem_dir_ == c->rel_stem_dir_&&
+         staff_dir_ == c->staff_dir_&&
+         invertsym_b_ == c->invertsym_b_);
 }
 
 }
 
-int
-Script_def::staff_dir_i() const
+Direction
+Script_def::staff_dir() const
 {
 {
-  return staff_dir_i_
+  return staff_dir_; 
 }
 
 }
 
-int
-Script_def::rel_stem_dir_i() const
+Direction
+Script_def::rel_stem_dir() const
 {
 {
-  return rel_stem_dir_i_
+  return rel_stem_dir_; 
 }
 
 bool
 }
 
 bool
@@ -72,11 +72,11 @@ Script_def::inside_b() const
 }
 
 Atom
 }
 
 Atom
-Script_def::get_atom (Paper_def *p , int d)const
+Script_def::get_atom (Paper_def *p , Direction d) const
 {
   String preidx_str ="";
   if (invertsym_b_&& d < 0) 
 {
   String preidx_str ="";
   if (invertsym_b_&& d < 0) 
-       preidx_str = "-";
+    preidx_str = "-";
 
   return p->lookup_l()->script (preidx_str + symidx_str_);
 }
 
   return p->lookup_l()->script (preidx_str + symidx_str_);
 }
@@ -85,7 +85,7 @@ Script_def::get_atom (Paper_def *p , int d)const
 IMPLEMENT_IS_TYPE_B1(Script_def,General_script_def);
 
 int
 IMPLEMENT_IS_TYPE_B1(Script_def,General_script_def);
 
 int
-Script_def::priority_i()const
+Script_def::priority_i() const
 {
   return priority_i_;
 }
 {
   return priority_i_;
 }
index f66b2eb3b168e55e606bb7644639020405eb44bb..c9c1585612c6a97bc24e1cade0de10b5517615d0 100644 (file)
@@ -19,12 +19,12 @@ bool
 Script_engraver::do_try_request (Request *r_l)
 {
   if (!r_l->musical() || ! r_l->musical ()->musicalscript ())
 Script_engraver::do_try_request (Request *r_l)
 {
   if (!r_l->musical() || ! r_l->musical ()->musicalscript ())
-       return false ;
+    return false ;
   
   for (int i=0; i < script_req_l_arr_.size(); i++) 
     {
   
   for (int i=0; i < script_req_l_arr_.size(); i++) 
     {
-       if ( r_l->equal_b (script_req_l_arr_[i]))
-           return true;
+      if (r_l->equal_b (script_req_l_arr_[i]))
+       return true;
        
     }
   script_req_l_arr_.push (r_l->script());
        
     }
   script_req_l_arr_.push (r_l->script());
@@ -37,12 +37,12 @@ Script_engraver::do_process_requests()
 {
   for (int i=0; i < script_req_l_arr_.size(); i++)
     {
 {
   for (int i=0; i < script_req_l_arr_.size(); i++)
     {
-       Script_req* l=script_req_l_arr_[i];
-       Script *p =new Script;
-       p->dir_i_ = l->dir_i_;
-       p->specs_l_ = l->scriptdef_p_;
-       script_p_arr_.push (p);
-       announce_element (Score_elem_info (p, l));
+      Script_req* l=script_req_l_arr_[i];
+      Script *p =new Script;
+      p->dir_ = l->dir_;
+      p->specs_l_ = l->scriptdef_p_;
+      script_p_arr_.push (p);
+      announce_element (Score_elem_info (p, l));
     }
 }
 
     }
 }
 
@@ -52,9 +52,9 @@ Script_engraver::do_pre_move_processing()
   Staff_symbol* s_l = get_staff_info().staff_sym_l_;
   for (int i=0; i < script_p_arr_.size(); i++) 
     {
   Staff_symbol* s_l = get_staff_info().staff_sym_l_;
   for (int i=0; i < script_p_arr_.size(); i++) 
     {
-       Script*script_p = script_p_arr_[i];
-       script_p->set_staffsym (s_l);
-       typeset_element (script_p);
+      Script*script_p = script_p_arr_[i];
+      script_p->set_staffsym (s_l);
+      typeset_element (script_p);
     }
   script_p_arr_.clear();
 }
     }
   script_p_arr_.clear();
 }
index e27086c40d5702679572037b5892c81815beafc4..ea3bfbef204031221eb9a3a073292a3f24a17651 100644 (file)
@@ -27,7 +27,7 @@ Script::do_substitute_dependency (Score_elem*o,Score_elem*n)
   Staff_side::do_substitute_dependency (o,n);
   if (o == stem_l_) 
     {
   Staff_side::do_substitute_dependency (o,n);
   if (o == stem_l_) 
     {
-       stem_l_ = n ? (Stem*)n->item() : 0;
+      stem_l_ = n ? (Stem*)n->item() : 0;
     }
 }
 
     }
 }
 
@@ -44,35 +44,35 @@ Script::Script()
   specs_l_ = 0;
   inside_staff_b_ = false;
   stem_l_ = 0;
   specs_l_ = 0;
   inside_staff_b_ = false;
   stem_l_ = 0;
-  dir_i_ =  0;
+  dir_ =  CENTER;
 }
 
 void
 Script::set_default_dir()
 {
 }
 
 void
 Script::set_default_dir()
 {
-  int s_i=specs_l_->rel_stem_dir_i();
+  int s_i=specs_l_->rel_stem_dir();
   if (s_i) 
     {
   if (s_i) 
     {
-       if (stem_l_)
-           dir_i_ = stem_l_->dir_i_ * s_i;
-       else
-         {
-           specs_l_->warning ("Script needs stem direction");
-           dir_i_ = -1;
-         }
+      if (stem_l_)
+       dir_ = stem_l_->dir_ * s_i;
+      else
+       {
+         specs_l_->warning ("Script needs stem direction");
+         dir_ = DOWN;
+       }
     }
   else 
     {
     }
   else 
     {
-       dir_i_ =specs_l_->staff_dir_i();
+      dir_ =specs_l_->staff_dir();
     }
     }
-  assert (dir_i_);
+  assert (dir_);
 }
 
 
 Interval
 Script::do_width() const
 {
 }
 
 
 Interval
 Script::do_width() const
 {
-  return specs_l_->get_atom (paper(), dir_i_).extent ().x ();
+  return specs_l_->get_atom (paper(), dir_).extent ().x ();
 }
 
 void
 }
 
 void
@@ -80,18 +80,18 @@ Script::do_pre_processing()
 {
   if  (breakable_b_ && break_status_i() != 1) 
     {
 {
   if  (breakable_b_ && break_status_i() != 1) 
     {
-       transparent_b_ = empty_b_ = true;
+      transparent_b_ = empty_b_ = true;
     }
   
     }
   
-  if (!dir_i_)
-       set_default_dir();
+  if (!dir_)
+    set_default_dir();
   inside_staff_b_ = specs_l_->inside_b();
 }
 
 Interval
   inside_staff_b_ = specs_l_->inside_b();
 }
 
 Interval
-Script::symbol_height()const
+Script::symbol_height() const
 {
 {
-  return specs_l_->get_atom (paper(), dir_i_).extent ().y ();
+  return specs_l_->get_atom (paper(), dir_).extent ().y ();
 }
 
 Molecule*
 }
 
 Molecule*
@@ -99,7 +99,7 @@ Script::brew_molecule_p() const
 {
   Real dy = paper()->internote_f ();
   
 {
   Real dy = paper()->internote_f ();
   
-  Molecule*out = new Molecule (specs_l_->get_atom (paper(), dir_i_));
+  Molecule*out = new Molecule (specs_l_->get_atom (paper(), dir_));
   out->translate (dy * pos_i_, Y_AXIS);
   return out;
 }
   out->translate (dy * pos_i_, Y_AXIS);
   return out;
 }
index 1657e2e12a5bbad2021757b5fae6398b4a01a5d5..a96eae70cbaee85010221bc1221581b10e3b457e 100644 (file)
@@ -17,7 +17,7 @@ Slur_engraver::do_try_request (Request *req_l)
 {
   Musical_req *mus_l = req_l->musical();
   if (!mus_l || !mus_l->slur())
 {
   Musical_req *mus_l = req_l->musical();
   if (!mus_l || !mus_l->slur())
-       return false;
+    return false;
 
   new_slur_req_l_arr_.push (mus_l->slur());
   return true;
 
   new_slur_req_l_arr_.push (mus_l->slur());
   return true;
@@ -28,11 +28,11 @@ Slur_engraver::acknowledge_element (Score_elem_info info)
 {
   if (info.elem_l_->name() == Note_column::static_name ()) 
     {
 {
   if (info.elem_l_->name() == Note_column::static_name ()) 
     {
-       Note_column *col_l =(Note_column*) info.elem_l_->item() ;// ugh
-       for (int i = 0; i < slur_l_stack_.size(); i++)
-           slur_l_stack_[i]->add (col_l);
-       for (int i = 0; i < end_slur_l_arr_.size(); i++)
-           end_slur_l_arr_[i]->add (col_l);
+      Note_column *col_l =(Note_column*) info.elem_l_->item() ;// ugh
+      for (int i = 0; i < slur_l_stack_.size(); i++)
+       slur_l_stack_[i]->add (col_l);
+      for (int i = 0; i < end_slur_l_arr_.size(); i++)
+       end_slur_l_arr_[i]->add (col_l);
     }
 }
 
     }
 }
 
@@ -40,7 +40,7 @@ void
 Slur_engraver::set_feature (Feature f)
 {
   if (f.type_ == "vdir")
 Slur_engraver::set_feature (Feature f)
 {
   if (f.type_ == "vdir")
-       dir_i_ = f.value_ ;
+    dir_ = (Direction)int(f.value_);
 }
 
 /*
 }
 
 /*
@@ -48,7 +48,7 @@ Slur_engraver::set_feature (Feature f)
   */
 Slur_engraver::Slur_engraver()
 {
   */
 Slur_engraver::Slur_engraver()
 {
-  dir_i_ =0;
+  dir_ =CENTER;
 }
 void
 Slur_engraver::do_process_requests()
 }
 void
 Slur_engraver::do_process_requests()
@@ -56,31 +56,31 @@ Slur_engraver::do_process_requests()
   Array<Slur*> start_slur_l_arr_;
   for (int i=0; i< new_slur_req_l_arr_.size(); i++) 
     {
   Array<Slur*> start_slur_l_arr_;
   for (int i=0; i< new_slur_req_l_arr_.size(); i++) 
     {
-       Slur_req* slur_req_l = new_slur_req_l_arr_[i];
-       // end slur: move the slur to other array
-       if (slur_req_l->spantype == Span_req::STOP) 
-         {
-           if (slur_l_stack_.empty())
+      Slur_req* slur_req_l = new_slur_req_l_arr_[i];
+      // end slur: move the slur to other array
+      if (slur_req_l->spantype == Span_req::STOP) 
+       {
+         if (slur_l_stack_.empty())
                
                
-                     slur_req_l->warning ("can't find slur to end");
-           else 
-             {
-               end_slur_l_arr_.push (slur_l_stack_.pop());
-               requests_arr_.pop();
-             }
-         }
-       else  if (slur_req_l->spantype == Span_req::START) 
-         {
-           // push a new slur onto stack.
-           //(use temp. array to wait for all slur STOPs)
-           Slur * s_p =new Slur;
-           requests_arr_.push (slur_req_l);
-           start_slur_l_arr_.push (s_p);
-           announce_element (Score_elem_info (s_p, slur_req_l));
-         }
+           slur_req_l->warning ("can't find slur to end");
+         else 
+           {
+             end_slur_l_arr_.push (slur_l_stack_.pop());
+             requests_arr_.pop();
+           }
+       }
+      else  if (slur_req_l->spantype == Span_req::START) 
+       {
+         // push a new slur onto stack.
+         //(use temp. array to wait for all slur STOPs)
+         Slur * s_p =new Slur;
+         requests_arr_.push (slur_req_l);
+         start_slur_l_arr_.push (s_p);
+         announce_element (Score_elem_info (s_p, slur_req_l));
+       }
     }
   for (int i=0; i < start_slur_l_arr_.size(); i++)
     }
   for (int i=0; i < start_slur_l_arr_.size(); i++)
-       slur_l_stack_.push (start_slur_l_arr_[i]);
+    slur_l_stack_.push (start_slur_l_arr_[i]);
 }
 
 void
 }
 
 void
@@ -88,9 +88,9 @@ Slur_engraver::do_pre_move_processing()
 {
   for (int i = 0; i < end_slur_l_arr_.size(); i++) 
     {
 {
   for (int i = 0; i < end_slur_l_arr_.size(); i++) 
     {
-       if (dir_i_)
-           end_slur_l_arr_[i]->dir_i_ = dir_i_;
-       typeset_element (end_slur_l_arr_[i]);
+      if (dir_)
+       end_slur_l_arr_[i]->dir_ = dir_;
+      typeset_element (end_slur_l_arr_[i]);
     }
   end_slur_l_arr_.clear();
 }
     }
   end_slur_l_arr_.clear();
 }
@@ -104,7 +104,7 @@ Slur_engraver::~Slur_engraver()
 {
   for (int i=0; i < requests_arr_.size(); i++) 
     {
 {
   for (int i=0; i < requests_arr_.size(); i++) 
     {
-       requests_arr_[i]->warning ("unterminated slur");
+      requests_arr_[i]->warning ("unterminated slur");
     }
 }
 
     }
 }
 
index 54c5b5009dd16cbd1dc35671890815619158e5c5..87dea00618ae29386171ec4c19e56771beb5e24f 100644 (file)
@@ -7,12 +7,10 @@
 */
 
 /*
 */
 
 /*
-
   TODO:
   
   think about crossing stems.
   Begin and end should be treated as a Script.
   TODO:
   
   think about crossing stems.
   Begin and end should be treated as a Script.
-  
  */
 #include "slur.hh"
 #include "scalar.hh"
  */
 #include "slur.hh"
 #include "scalar.hh"
@@ -37,22 +35,22 @@ Slur::add (Note_column*n)
 void
 Slur::set_default_dir()
 {
 void
 Slur::set_default_dir()
 {
-  dir_i_ = -1;
+  dir_ = DOWN;
   for (int i=0; i < encompass_arr_.size(); i ++) 
     {
   for (int i=0; i < encompass_arr_.size(); i ++) 
     {
-       if (encompass_arr_[i]->dir_i_ < 0) 
-         {
-           dir_i_ =1;
-           break;
-         }
+      if (encompass_arr_[i]->dir_ < 0) 
+       {
+         dir_ =UP;
+         break;
+       }
     }
 }
 
 void
 Slur::do_pre_processing()
 {
     }
 }
 
 void
 Slur::do_pre_processing()
 {
-  right_col_l_  = encompass_arr_.top()->pcol_l_;
-  left_col_l_ = encompass_arr_[0]->pcol_l_;    
+  set_bounds(LEFT, encompass_arr_[0]);    
+  set_bounds(RIGHT, encompass_arr_.top());
 }
 
 
 }
 
 
@@ -62,10 +60,10 @@ Slur::do_substitute_dependency (Score_elem*o, Score_elem*n)
   int i;
   while ((i = encompass_arr_.find_i ((Note_column*)o->item())) >=0) 
     {
   int i;
   while ((i = encompass_arr_.find_i ((Note_column*)o->item())) >=0) 
     {
-       if (n)
-           encompass_arr_[i] = (Note_column*)n->item();
-       else
-           encompass_arr_.del (i);
+      if (n)
+       encompass_arr_[i] = (Note_column*)n->item();
+      else
+       encompass_arr_.del (i);
     }
 }
 
     }
 }
 
@@ -73,29 +71,31 @@ Slur::do_substitute_dependency (Score_elem*o, Score_elem*n)
 static int 
 Note_column_compare (Note_column *const&n1 , Note_column* const&n2)
 {
 static int 
 Note_column_compare (Note_column *const&n1 , Note_column* const&n2)
 {
-  return n1->pcol_l_->rank_i() - n2->pcol_l_->rank_i ();
+  return Item::left_right_compare(n1, n2);
 }
 
 void
 Slur::do_post_processing()
 {
   encompass_arr_.sort (Note_column_compare);
 }
 
 void
 Slur::do_post_processing()
 {
   encompass_arr_.sort (Note_column_compare);
-  if (!dir_i_)
-       set_default_dir();
+  if (!dir_)
+    set_default_dir();
   Real inter_f = paper()->internote_f ();
   
   Real inter_f = paper()->internote_f ();
   
-  if (encompass_arr_[0]->stem_l_) 
-      left_pos_i_ = rint (encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f);
-  else 
-      left_pos_i_ = rint ( encompass_arr_[0]->head_positions_interval()[dir_i_]);
-  
-  if (encompass_arr_.top()->stem_l_)
-      right_pos_i_ = rint (encompass_arr_.top()->stem_l_->height ()[dir_i_]/inter_f);
-  else 
-      right_pos_i_ = rint (encompass_arr_.top()->head_positions_interval ()[dir_i_]);
+  Drul_array<Note_column*> extrema;
+  extrema[LEFT] = encompass_arr_[0];
+  extrema[RIGHT] = encompass_arr_.top();
 
 
-  left_pos_i_ += dir_i_;
-  right_pos_i_ += dir_i_;
+  Direction d=LEFT;
+  do 
+    {
+      if (extrema[d]->stem_l_ && !extrema[d]->stem_l_->transparent_b_) 
+       pos_i_drul_[d] = (int)rint (extrema[d]->stem_l_->height()[dir_]/inter_f);
+      else 
+       pos_i_drul_[d] = (int)rint (extrema[d]->head_positions_interval()[dir_]);
+      pos_i_drul_[d] += dir_;
+    }
+  while ((d *= -1) != LEFT);
 }
 
 IMPLEMENT_IS_TYPE_B1(Slur,Spanner);
 }
 
 IMPLEMENT_IS_TYPE_B1(Slur,Spanner);
index cb7a592cf328187a9876501d4fcde8cb9102c9db..7d51fbe78cc8d1a1791d3fa93ba1e67f942e197d 100644 (file)
@@ -17,7 +17,7 @@ Span_bar_engraver::Span_bar_engraver()
 }
 
 Span_bar*
 }
 
 Span_bar*
-Span_bar_engraver::get_span_bar_p()const
+Span_bar_engraver::get_span_bar_p() const
 {
   return  new Span_bar;
 }
 {
   return  new Span_bar;
 }
@@ -26,21 +26,21 @@ void
 Span_bar_engraver::acknowledge_element (Score_elem_info i)
 {
   int depth = i.origin_grav_l_arr_.size();
 Span_bar_engraver::acknowledge_element (Score_elem_info i)
 {
   int depth = i.origin_grav_l_arr_.size();
-  if ( depth > 1
-        && i.elem_l_->is_type_b (Bar::static_name()) 
-  {
-       bar_l_arr_.push ((Bar*)i.elem_l_->item());
+  if (depth > 1
+      && i.elem_l_->is_type_b (Bar::static_name())
+    {
+      bar_l_arr_.push ((Bar*)i.elem_l_->item());
        
        
-       if (bar_l_arr_.size() >= 2 && !spanbar_p_) 
-         {
-           spanbar_p_ = get_span_bar_p();
-           announce_element (Score_elem_info (spanbar_p_,0));
-         }
+      if (bar_l_arr_.size() >= 2 && !spanbar_p_) 
+       {
+         spanbar_p_ = get_span_bar_p();
+         announce_element (Score_elem_info (spanbar_p_,0));
+       }
     }
   else if  (i.elem_l_->is_type_b (Vertical_align_spanner::static_name()) 
     }
   else if  (i.elem_l_->is_type_b (Vertical_align_spanner::static_name()) 
-               && i.origin_grav_l_arr_.size() <= 2) 
-                 {
-       valign_l_ = (Vertical_align_spanner*)i.elem_l_->spanner();
+           && i.origin_grav_l_arr_.size() <= 2) 
+    {
+      valign_l_ = (Vertical_align_spanner*)i.elem_l_->spanner();
     }
 }
 
     }
 }
 
@@ -49,11 +49,11 @@ Span_bar_engraver::do_pre_move_processing()
 {
   if (spanbar_p_) 
     {
 {
   if (spanbar_p_) 
     {
-       for (int i=0; i < bar_l_arr_.size() ; i++)
-           spanbar_p_->add (bar_l_arr_[i]);
-       spanbar_p_->set (valign_l_);
-       typeset_element (spanbar_p_);
-       spanbar_p_ =0;
+      for (int i=0; i < bar_l_arr_.size() ; i++)
+       spanbar_p_->add (bar_l_arr_[i]);
+      spanbar_p_->set (valign_l_);
+      typeset_element (spanbar_p_);
+      spanbar_p_ =0;
     }
   bar_l_arr_.set_size (0);
        
     }
   bar_l_arr_.set_size (0);
        
index 152e9a7cd8f3d961f79804ebf36184d14ccc01de..5f19f84177b93538ac1e13d3c2f89d86efcb698c 100644 (file)
@@ -60,7 +60,7 @@ Span_bar::do_width() const
 void
 Span_bar::do_pre_processing()
 {
 void
 Span_bar::do_pre_processing()
 {
-  if ( spanning_l_arr_.size() < 1) 
+  if (spanning_l_arr_.size() < 1) 
     {
        transparent_b_ = true;
        empty_b_ =true;
     {
        transparent_b_ = true;
        empty_b_ =true;
@@ -74,11 +74,11 @@ Span_bar::do_pre_processing()
            transparent_b_=true;
            empty_b_ = true;
          }
            transparent_b_=true;
            empty_b_ = true;
          }
-       else if ( type_str_ == "|:") 
+       else if (type_str_ == "|:") 
          {
            type_str_ = ".|";
          }
          {
            type_str_ = ".|";
          }
-       else if ( type_str_ == ":|")
+       else if (type_str_ == ":|")
          {
            type_str_ = "|.";
          }
          {
            type_str_ = "|.";
          }
@@ -93,7 +93,7 @@ Span_bar::get_bar_sym (Real dy) const
 
 
 Molecule*
 
 
 Molecule*
-Span_bar::brew_molecule_p()const
+Span_bar::brew_molecule_p() const
 {
   Interval y_int;
   for (int i=0; i < spanning_l_arr_.size(); i++) 
 {
   Interval y_int;
   for (int i=0; i < spanning_l_arr_.size(); i++) 
@@ -109,7 +109,7 @@ Span_bar::brew_molecule_p()const
 
   Symbol s = get_bar_sym (y_int.length());
   Molecule*output = new Molecule (Atom (s));
 
   Symbol s = get_bar_sym (y_int.length());
   Molecule*output = new Molecule (Atom (s));
-  output->translate (  y_int[-1], Y_AXIS);
+  output->translate (y_int[-1], Y_AXIS);
   return output;
 }
 
   return output;
 }
 
index a7592d532056ce3711d9d7d0f347a134359e7f6c..96c73a9d1dfa553d8eabc90e854e295287dac5f6 100644 (file)
@@ -21,7 +21,7 @@ Span_score_bar::do_pre_processing()
 {
   Span_bar::do_pre_processing();
   
 {
   Span_bar::do_pre_processing();
   
-  if ( break_status_i() != 1) 
+  if (break_status_i() != 1) 
     {
        empty_b_ = transparent_b_ = true;
     }
     {
        empty_b_ = transparent_b_ = true;
     }
@@ -29,12 +29,12 @@ Span_score_bar::do_pre_processing()
 
 
 Symbol
 
 
 Symbol
-Piano_brace::get_bar_sym (Real dy)const
+Piano_brace::get_bar_sym (Real dy) const
 {
   return paper()->lookup_l ()->vbrace (dy);
 }
 Interval
 {
   return paper()->lookup_l ()->vbrace (dy);
 }
 Interval
-Piano_brace::do_width()const
+Piano_brace::do_width() const
 {
   return Interval (0,0);
 }
 {
   return Interval (0,0);
 }
diff --git a/lily/spanner-elem-group.cc b/lily/spanner-elem-group.cc
deleted file mode 100644 (file)
index 3eb1f94..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  spanner-elem-group.cc -- implement Spanner_elem_group
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "p-col.hh"
-#include "spanner-elem-group.hh"
-
-
-
-IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group_element);
-
-Interval
-Spanner_elem_group::do_width() const
-{
-  return Spanner::do_width();
-}
-
-void
-Spanner_elem_group::do_print() const
-{
-#ifndef NPRINT
-  Spanner::do_print();
-  Horizontal_vertical_group_element::do_print();
-#endif
-}
-
index eac107ba8dc113e7c4d51a2c529cc9feb2edd5c4..397cfdb6c5fbf37c9bd8fd20a4f3c2230460d6ea 100644 (file)
 IMPLEMENT_IS_TYPE_B1(Spanner,Score_elem);
 
 void
 IMPLEMENT_IS_TYPE_B1(Spanner,Score_elem);
 
 void
-Spanner::do_print()const
+Spanner::do_print() const
 {
 #ifndef NPRINT
   DOUT << "Between col ";
 {
 #ifndef NPRINT
   DOUT << "Between col ";
-  if ( left_col_l_)
-       DOUT << left_col_l_->rank_i();
-  else 
-       DOUT << "nop";
-  DOUT << ", ";
-  if ( right_col_l_)
-       DOUT << right_col_l_->rank_i();
-  else 
-       DOUT << "nop";
   if (broken_into_l_arr_.size())
   if (broken_into_l_arr_.size())
-       DOUT << "with broken pieces\n";
+    DOUT << "with broken pieces\n";
 #endif
 }
 
 void
 #endif
 }
 
 void
-Spanner::break_into_pieces (bool copy_deps_b)
+Spanner::break_into_pieces ()
 {
 {
-  if (  broken_into_l_arr_.size())
-       return; 
+  if (broken_into_l_arr_.size())
+    return; 
         
         
-  PCol * left = left_col_l_;
-  PCol * right = right_col_l_;
-  if (left->daddy_l_) left = left->daddy_l_;
-  if (right->daddy_l_) right = right->daddy_l_;
+  Item * left = spanned_drul_[LEFT];
+  Item * right = spanned_drul_[RIGHT];
   
   
   
   
-  Link_array<PCol> break_cols = pscore_l_->broken_col_range (left,right);
+  Link_array<Item> break_cols = pscore_l_->broken_col_range (left,right);
   Link_array<Spanner> broken_into_l_arr;
 
   break_cols.insert (left,0);
   Link_array<Spanner> broken_into_l_arr;
 
   break_cols.insert (left,0);
@@ -53,23 +42,21 @@ Spanner::break_into_pieces (bool copy_deps_b)
 
   for (int i=1; i < break_cols.size(); i++) 
     {
 
   for (int i=1; i < break_cols.size(); i++) 
     {
-       Spanner* span_p = clone()->spanner ();
-       if (copy_deps_b)
-           span_p->copy_dependencies (*this);
-       left = break_cols[i-1];
-       right = break_cols[i];
-       if (!right->line_l_)
-           right = right->prebreak_p_;
-       if (!left->line_l_)
-           left = left->postbreak_p_;
-
-       assert (left&&right && left->line_l_ == right->line_l_);
-
-       span_p->left_col_l_  = left;
-       span_p->right_col_l_ = right;
+      Spanner* span_p = clone()->spanner ();
+      left = break_cols[i-1];
+      right = break_cols[i];
+      if (!right->line_l())
+       right = right->find_prebroken_piece(-1);
+      if (!left->line_l())
+       left = left->find_prebroken_piece(1);
+
+            assert (left&&right && left->line_l() == right->line_l());
+
+      span_p->set_bounds(LEFT,left);
+      span_p->set_bounds(RIGHT,right);
        
        
-       pscore_l_->typeset_broken_spanner (span_p);
-       broken_into_l_arr.push (span_p);
+      pscore_l_->typeset_broken_spanner (span_p);
+      broken_into_l_arr.push (span_p);
     }
    
   broken_into_l_arr_ = broken_into_l_arr;
     }
    
   broken_into_l_arr_ = broken_into_l_arr;
@@ -78,68 +65,110 @@ Spanner::break_into_pieces (bool copy_deps_b)
 void
 Spanner::set_my_columns()
 {
 void
 Spanner::set_my_columns()
 {
-  if (!left_col_l_->line_l_)
-       left_col_l_ = left_col_l_->postbreak_p_;
-  if (!right_col_l_->line_l_)
-       right_col_l_ = right_col_l_->prebreak_p_;
+  Direction i = (Direction)1;
+  do 
+    {
+      if (!spanned_drul_[i]->line_l())
+       set_bounds(i,spanned_drul_[i]->find_prebroken_piece(-i));
+    } 
+  while ((i*=-1) != 1);
 }       
 
 }       
 
+
 void
 void
-Spanner::do_break_processing()
+Spanner::set_bounds(Direction d, Item*i)
 {
 {
-  set_my_columns();
+  if (spanned_drul_[d])
+    spanned_drul_[d]->attached_span_l_arr_.substitute(this,0);
   
   
-  if (!line_l()) 
+  spanned_drul_[d] =i;
+  if (i)
+    i->attached_span_l_arr_.push(this);
+}
+
+void
+Spanner::do_break_processing()
+{
+  if (!line_l())
     {
     {
-       break_into_pieces (true);
-       for (int i=0; i < broken_into_l_arr_.size(); i++)
-           broken_into_l_arr_[i]->handle_broken_dependencies();
+      break_into_pieces ();
+      for (int i=0; i < broken_into_l_arr_.size(); i++)
+       broken_into_l_arr_[i]->handle_broken_dependencies();
     }
   else 
     {
     }
   else 
     {
-       handle_broken_dependencies();
+      handle_broken_dependencies();
     }
 }
 
 
 Spanner::Spanner()
 {
     }
 }
 
 
 Spanner::Spanner()
 {
-  left_col_l_ = right_col_l_ = 0;
+  spanned_drul_[LEFT]=0;
+  spanned_drul_[RIGHT]=0;
 }
 
 }
 
+String
+Spanner::do_TeX_output_str () const
+{
+  Offset left_off (spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), 0);
+  return make_TeX_string (absolute_offset() + left_off);
+}
 
 Interval
 
 Interval
-Spanner::do_width()const
+Spanner::do_width() const
 {
 {
-  Real r = right_col_l_->hpos_f_;
-  Real l = left_col_l_->hpos_f_;
-  assert (*left_col_l_ < *right_col_l_);
+  Real l = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS);
+  Real r = spanned_drul_[RIGHT]->absolute_coordinate (X_AXIS);
   assert (r>=l);
        
   return Interval (0, r-l);
 }
 
 Line_of_score *
   assert (r>=l);
        
   return Interval (0, r-l);
 }
 
 Line_of_score *
-Spanner::line_l()const
+Spanner::line_l() const
 {
 {
-  if ( left_col_l_->line_l_ != right_col_l_->line_l_)
-       return 0;
-  return left_col_l_->line_l_;
+  if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT])
+    return 0;
+  if (spanned_drul_[LEFT]->line_l() != spanned_drul_[RIGHT]->line_l())
+    return 0;
+  return spanned_drul_[LEFT]->line_l();
 }
 
 
 Spanner*
 }
 
 
 Spanner*
-Spanner::find_broken_piece (Line_of_score*l)const
+Spanner::find_broken_piece (Line_of_score*l) const
 {
   for (int i=0; i < broken_into_l_arr_.size(); i++)
 {
   for (int i=0; i < broken_into_l_arr_.size(); i++)
-       if (broken_into_l_arr_[i]->line_l() == l)
-           return broken_into_l_arr_[i];
+    if (broken_into_l_arr_[i]->line_l() == l)
+      return broken_into_l_arr_[i];
   return 0;                               
          
 }
 
 bool
   return 0;                               
          
 }
 
 bool
-Spanner::broken_b()const
+Spanner::broken_b() const
 {
   return broken_into_l_arr_.size();
 }
 {
   return broken_into_l_arr_.size();
 }
+
+void
+Spanner::do_unlink() 
+{
+  if (spanned_drul_[LEFT]) 
+    {
+      spanned_drul_[LEFT]->attached_span_l_arr_.substitute (this,0);
+      spanned_drul_[LEFT] =0;
+    }
+  if (spanned_drul_[RIGHT]) 
+    {
+      spanned_drul_[RIGHT]->attached_span_l_arr_.substitute (this,0);
+      spanned_drul_[RIGHT] = 0;
+    }
+}
+
+void
+Spanner::do_junk_links()
+{
+  spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
+}
index 64059065dd6c7166800b798684eb377699c7fc18..4a366304e6bb79f981749806d46ed0253391c85e 100644 (file)
@@ -23,9 +23,9 @@
 
 
 Vector
 
 
 Vector
-Spring_spacer::default_solution()const
+Spring_spacer::default_solution() const
 {
 {
-       return try_initial_solution() ; 
+  return try_initial_solution() ; 
 }
 
 Score_column*
 }
 
 Score_column*
@@ -38,11 +38,11 @@ const Real COLFUDGE=1e-3;
 template class P<Real>;                // ugh.
 
 bool
 template class P<Real>;                // ugh.
 
 bool
-Spring_spacer::contains (PCol const *w)
+Spring_spacer::contains (Paper_column const *w)
 {
   for (int i=0; i< cols.size(); i++)
 {
   for (int i=0; i< cols.size(); i++)
-       if (cols[i].pcol_l_ == w)
-           return true;
+    if (cols[i].pcol_l_ == w)
+      return true;
   return false;
 }
 
   return false;
 }
 
@@ -52,9 +52,9 @@ Spring_spacer::OK() const
 {
 #ifndef NDEBUG
   for (int i = 1; i < cols.size(); i++)
 {
 #ifndef NDEBUG
   for (int i = 1; i < cols.size(); i++)
-       assert (cols[i].rank_i_ > cols[i-1].rank_i_);
+    assert (cols[i].rank_i_ > cols[i-1].rank_i_);
   for (int i = 1; i < loose_col_arr_.size(); i++)
   for (int i = 1; i < loose_col_arr_.size(); i++)
-       assert (loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_);
+    assert (loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_);
 #endif 
 }
 
 #endif 
 }
 
@@ -68,21 +68,21 @@ Spring_spacer::handle_loose_cols()
   Array<int> fixed;
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
     {
   Array<int> fixed;
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
     {
-       connected.connect (i->left_i_,i->right_i_);             
+      connected.connect (i->left_i_,i->right_i_);              
     }
   for (int i = 0; i < cols.size(); i++)
     }
   for (int i = 0; i < cols.size(); i++)
-       if (cols[i].fixed())
-           fixed.push (i);
+    if (cols[i].fixed())
+      fixed.push (i);
   for (int i=1; i < fixed.size(); i++)
   for (int i=1; i < fixed.size(); i++)
-       connected.connect (fixed[i-1], fixed[i]);
+    connected.connect (fixed[i-1], fixed[i]);
 
   for (int i = cols.size(); i--;) 
     {
 
   for (int i = cols.size(); i--;) 
     {
-       if (! connected.equiv (fixed[0], i)) 
-         {
-           warning ("unconnected column: " + String (i));
-           loosen_column (i);
-         }
+      if (! connected.equiv (fixed[0], i)) 
+       {
+         warning ("unconnected column: " + String (i));
+         loosen_column (i);
+       }
     }
   OK();
 }
     }
   OK();
 }
@@ -93,10 +93,10 @@ Spring_spacer::handle_loose_cols()
   regular distances from enclosing calced columns 
   */
 void
   regular distances from enclosing calced columns 
   */
 void
-Spring_spacer::position_loose_cols (Vector &sol_vec)const
+Spring_spacer::position_loose_cols (Vector &sol_vec) const
 {
   if (!loose_col_arr_.size())
 {
   if (!loose_col_arr_.size())
-       return ; 
+    return ; 
   assert (sol_vec.dim());
   Array<bool> fix_b_arr;
   fix_b_arr.set_size (cols.size() + loose_col_arr_.size ());
   assert (sol_vec.dim());
   Array<bool> fix_b_arr;
   fix_b_arr.set_size (cols.size() + loose_col_arr_.size ());
@@ -104,42 +104,42 @@ Spring_spacer::position_loose_cols (Vector &sol_vec)const
   Real utter_left_f =infinity_f;
   for (int i=0; i < loose_col_arr_.size(); i++) 
     {
   Real utter_left_f =infinity_f;
   for (int i=0; i < loose_col_arr_.size(); i++) 
     {
-       fix_b_arr[loose_col_arr_[i].rank_i_] = false;
+      fix_b_arr[loose_col_arr_[i].rank_i_] = false;
     }
   for (int i=0; i < cols.size(); i++) 
     {
     }
   for (int i=0; i < cols.size(); i++) 
     {
-       int r= cols[i].rank_i_;
-       fix_b_arr[r] = true;
-       utter_right_f = utter_right_f >? sol_vec (i);
-       utter_left_f = utter_left_f <? sol_vec (i);
+      int r= cols[i].rank_i_;
+      fix_b_arr[r] = true;
+      utter_right_f = utter_right_f >? sol_vec (i);
+      utter_left_f = utter_left_f <? sol_vec (i);
     }
   Vector v (fix_b_arr.size());
   int j =0;
   int k =0;
   for (int i=0; i < v.dim(); i++) 
     {
     }
   Vector v (fix_b_arr.size());
   int j =0;
   int k =0;
   for (int i=0; i < v.dim(); i++) 
     {
-       if (fix_b_arr[i]) 
-         {
-           assert (cols[j].rank_i_ == i);
-           v (i) = sol_vec (j++);
-         }
-       else 
-         {
-           Real left_pos_f = 
-               (j>0) ?sol_vec (j-1) : utter_left_f;
-           Real right_pos_f = 
-               (j < sol_vec.dim()) ? sol_vec (j) : utter_right_f;
-           int left_rank = (j>0) ? cols[j-1].rank_i_ : 0;
-           int right_rank = (j<sol_vec.dim()) ? cols[j].rank_i_ : sol_vec.dim ();
-
-           int d_r = right_rank - left_rank;
-           Colinfo loose=loose_col_arr_[k++];
-           int r = loose.rank_i_ ;
-           assert (r > left_rank && r < right_rank);
-
-           v (i) =  (r - left_rank)*left_pos_f/ d_r + 
-               (right_rank - r) *right_pos_f /d_r;
-         }
+      if (fix_b_arr[i]) 
+       {
+         assert (cols[j].rank_i_ == i);
+         v (i) = sol_vec (j++);
+       }
+      else 
+       {
+         Real left_pos_f = 
+           (j>0) ?sol_vec (j-1) : utter_left_f;
+         Real right_pos_f = 
+           (j < sol_vec.dim()) ? sol_vec (j) : utter_right_f;
+         int left_rank = (j>0) ? cols[j-1].rank_i_ : 0;
+         int right_rank = (j<sol_vec.dim()) ? cols[j].rank_i_ : sol_vec.dim ();
+
+         int d_r = right_rank - left_rank;
+         Colinfo loose=loose_col_arr_[k++];
+         int r = loose.rank_i_ ;
+         assert (r > left_rank && r < right_rank);
+
+         v (i) =  (r - left_rank)*left_pos_f/ d_r + 
+           (right_rank - r) *right_pos_f /d_r;
+       }
     }
   sol_vec = v;
 }
     }
   sol_vec = v;
 }
@@ -153,23 +153,23 @@ Spring_spacer::check_constraints (Vector v) const
   for (int i=0; i < dim; i++) 
     {
 
   for (int i=0; i < dim; i++) 
     {
 
-       if (cols[i].fixed()&&
-           abs (cols[i].fixed_position() - v (i)) > COLFUDGE) 
-           return false;
+      if (cols[i].fixed()&&
+         abs (cols[i].fixed_position() - v (i)) > COLFUDGE) 
+       return false;
        
        
-       if (!i) 
-           continue;
+      if (!i) 
+       continue;
        
        
-       Real mindist=cols[i-1].minright()
-           +cols[i].minleft();
+      Real mindist=cols[i-1].minright()
+       +cols[i].minleft();
 
 
-       // ugh... compares
-       Real dif =v (i) - v (i-1)- mindist;
-       bool b = (dif > - COLFUDGE);
+      // ugh... compares
+      Real dif =v (i) - v (i-1)- mindist;
+      bool b = (dif > - COLFUDGE);
        
 
        
 
-       if (!b)
-           return false;
+      if (!b)
+       return false;
 
     }
   return true;
 
     }
   return true;
@@ -190,28 +190,28 @@ Spring_spacer::try_initial_solution() const
   Vector initsol (dim);
   for (int i=0; i < dim; i++) 
     {
   Vector initsol (dim);
   for (int i=0; i < dim; i++) 
     {
-       if (cols[i].fixed()) 
-         {
-           initsol (i)=cols[i].fixed_position();       
-
-           if (i > 0) 
-             {
-               Real r =initsol (i-1)  + cols[i-1].minright();
-               if (initsol (i) < r) 
-                 {
-                   warning ("overriding fixed position");
-                   initsol (i) =r;
-                 }
-             }
+      if (cols[i].fixed()) 
+       {
+         initsol (i)=cols[i].fixed_position(); 
+
+         if (i > 0) 
+           {
+             Real r =initsol (i-1)  + cols[i-1].minright();
+             if (initsol (i) < r) 
+               {
+                 warning ("overriding fixed position");
+                 initsol (i) =r;
+               }
+           }
                
                
-         }
-       else 
-         {
-           Real mindist=cols[i-1].minright()
-               +cols[i].minleft();
-           if (mindist < 0.0)
-               warning ("Excentric column");
-           initsol (i)=initsol (i-1)+mindist;
+       }
+      else 
+       {
+         Real mindist=cols[i-1].minright()
+           +cols[i].minleft();
+         if (mindist < 0.0)
+           warning ("Excentric column");
+         initsol (i)=initsol (i-1)+mindist;
        }       
     }
 
        }       
     }
 
@@ -238,27 +238,27 @@ Spring_spacer::make_matrices (Matrix &quad, Vector &lin, Real &c) const
   
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++) 
     {
   
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++) 
     {
-       int l = i->left_i_;
-       int r = i->right_i_;
+      int l = i->left_i_;
+      int r = i->right_i_;
 
 
-       quad (r,r) += i->hooke_f_;
-       quad (r,l) -= i->hooke_f_;
-       quad (l,r) -= i->hooke_f_;
-       quad (l,l) += i->hooke_f_;
+      quad (r,r) += i->hooke_f_;
+      quad (r,l) -= i->hooke_f_;
+      quad (l,r) -= i->hooke_f_;
+      quad (l,l) += i->hooke_f_;
 
 
-       lin (r) -= i->space_f_*i->hooke_f_;
-       lin (l) += i->space_f_*i->hooke_f_;
+      lin (r) -= i->space_f_*i->hooke_f_;
+      lin (l) += i->space_f_*i->hooke_f_;
 
 
-       c += sqr (i->space_f_);
+      c += sqr (i->space_f_);
     }
 }
 
 void
     }
 }
 
 void
-Spring_spacer::set_fixed_cols (Mixed_qp &qp)const
+Spring_spacer::set_fixed_cols (Mixed_qp &qp) const
 {
   for (int j=0; j < cols.size(); j++) 
 {
   for (int j=0; j < cols.size(); j++) 
-       if (cols[j].fixed()) 
-           qp.add_fixed_var (j,cols[j].fixed_position());          
+    if (cols[j].fixed()) 
+      qp.add_fixed_var (j,cols[j].fixed_position());       
        
   
 }
        
   
 }
@@ -270,21 +270,21 @@ Spring_spacer::make_constraints (Mixed_qp& lp) const
   int dim=cols.size();
   for (int j=0; j < dim; j++) 
     {
   int dim=cols.size();
   for (int j=0; j < dim; j++) 
     {
-       Colinfo c=cols[j];
-       if (j > 0)
-         {
-           Vector c1(dim);
+      Colinfo c=cols[j];
+      if (j > 0)
+       {
+         Vector c1(dim);
            
            
-           c1(j)=1.0 ;
-           c1(j-1)=-1.0 ;
-           lp.add_inequality_cons (c1, cols[j-1].minright() +
-                                  cols[j].minleft());
-         }
+         c1(j)=1.0 ;
+         c1(j-1)=-1.0 ;
+         lp.add_inequality_cons (c1, cols[j-1].minright() +
+                                 cols[j].minleft());
+       }
     }
 }
 
 void
     }
 }
 
 void
-Spring_spacer::lower_bound_solution (Col_hpositions*positions)const
+Spring_spacer::lower_bound_solution (Col_hpositions*positions) const
 {
   Mixed_qp lp (cols.size());
   make_matrices (lp.quad,lp.lin, lp.const_term);
 {
   Mixed_qp lp (cols.size());
   make_matrices (lp.quad,lp.lin, lp.const_term);
@@ -315,7 +315,7 @@ Spring_spacer::solve (Col_hpositions*positions) const
   positions->satisfies_constraints_b_ = check_constraints (solution_vec);
   if (!positions->satisfies_constraints_b_) 
     {
   positions->satisfies_constraints_b_ = check_constraints (solution_vec);
   if (!positions->satisfies_constraints_b_) 
     {
-       WARN << "solution doesn't satisfy constraints.\n" ;
+      WARN << "solution doesn't satisfy constraints.\n" ;
     }
   position_loose_cols (solution_vec); 
   positions->energy_f_ = lp.eval (solution_vec);
     }
   position_loose_cols (solution_vec); 
   positions->energy_f_ = lp.eval (solution_vec);
@@ -328,26 +328,26 @@ Spring_spacer::solve (Col_hpositions*positions) const
   add one column to the problem.
 */    
 void
   add one column to the problem.
 */    
 void
-Spring_spacer::add_column (PCol  *col, bool fixed, Real fixpos)
+Spring_spacer::add_column (Paper_column  *col, bool fixed, Real fixpos)
 {
   Colinfo c (col,(fixed)? &fixpos :  0);
   if (cols.size())
 {
   Colinfo c (col,(fixed)? &fixpos :  0);
   if (cols.size())
-       c.rank_i_ = cols.top().rank_i_+1;
+    c.rank_i_ = cols.top().rank_i_+1;
   else
   else
-       c.rank_i_ = 0;
+    c.rank_i_ = 0;
   cols.push (c);
 }
 
 Line_of_cols
   cols.push (c);
 }
 
 Line_of_cols
-Spring_spacer::error_pcol_l_arr()const
+Spring_spacer::error_pcol_l_arr() const
 {
 {
-  Array<PCol*> retval;
+  Array<Paper_column*> retval;
   for (int i=0; i< cols.size(); i++)
   for (int i=0; i< cols.size(); i++)
-       if (cols[i].ugh_b_)
-           retval.push (cols[i].pcol_l_);
+    if (cols[i].ugh_b_)
+      retval.push (cols[i].pcol_l_);
   for (int i=0;  i < loose_col_arr_.size(); i++) 
     {
   for (int i=0;  i < loose_col_arr_.size(); i++) 
     {
-       retval.push (loose_col_arr_[i].pcol_l_);
+      retval.push (loose_col_arr_[i].pcol_l_);
     }
   return retval;
 }
     }
   return retval;
 }
@@ -358,18 +358,18 @@ Spring_spacer::loosen_column (int i)
   Colinfo c=cols.get (i);
   for (PCursor<Idealspacing*> j (ideal_p_list_.top()); j.ok (); j++)
     {
   Colinfo c=cols.get (i);
   for (PCursor<Idealspacing*> j (ideal_p_list_.top()); j.ok (); j++)
     {
-       if (j->left_i_ == i|| j->right_i_ == i)
-           j.del();
-       else
-           j++;
+      if (j->left_i_ == i|| j->right_i_ == i)
+       j.del();
+      else
+       j++;
     }
   c.ugh_b_ = true;
   
   int j=0;
   for (; j < loose_col_arr_.size(); j++) 
     {
     }
   c.ugh_b_ = true;
   
   int j=0;
   for (; j < loose_col_arr_.size(); j++) 
     {
-       if (loose_col_arr_[j].rank_i_ > c.rank_i_)
-           break;
+      if (loose_col_arr_[j].rank_i_ > c.rank_i_)
+       break;
     }
   loose_col_arr_.insert (c,j);
 }
     }
   loose_col_arr_.insert (c,j);
 }
@@ -381,12 +381,12 @@ Spring_spacer::print() const
 #ifndef NPRINT
   for (int i=0; i < cols.size(); i++) 
     {
 #ifndef NPRINT
   for (int i=0; i < cols.size(); i++) 
     {
-       DOUT << "col " << i<<' ';
-       cols[i].print();
+      DOUT << "col " << i<<' ';
+      cols[i].print();
     }
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
     {
     }
   for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
     {
-       i->print();
+      i->print();
     }
 #endif
 }
     }
 #endif
 }
@@ -395,8 +395,8 @@ Spring_spacer::print() const
 void
 Spring_spacer::connect (int i, int j, Real d, Real h)
 {
 void
 Spring_spacer::connect (int i, int j, Real d, Real h)
 {
-  assert( d >= 0 && d <= 100 CM);
-  assert( h >=0);
+  assert(d >= 0 && d <= 100 CM);
+  assert(h >=0);
   
   Idealspacing * s = new Idealspacing;
   s->left_i_ = i;
   
   Idealspacing * s = new Idealspacing;
   s->left_i_ = i;
@@ -444,19 +444,19 @@ Spring_spacer::get_ruling_durations(Array<Moment> &shortest_playing_arr,
       Moment now = scol_l (i)->when();
       Moment shortest_playing = infinity_mom;
 
       Moment now = scol_l (i)->when();
       Moment shortest_playing = infinity_mom;
 
-      if (scol_l(i)->breakable_b())
+      if (scol_l (i)->breakable_b_)
        {
          for (int ji=i; ji >= start_context_i; ji--) 
            context_shortest_arr[ji] = context_shortest;
          start_context_i = i;
          context_shortest = infinity_mom;
        }
        {
          for (int ji=i; ji >= start_context_i; ji--) 
            context_shortest_arr[ji] = context_shortest;
          start_context_i = i;
          context_shortest = infinity_mom;
        }
-      if (scol_l(i)->durations.size())
+      if (scol_l (i)->durations.size())
        {
          context_shortest = context_shortest <? scol_l(i)->durations[0];
        }
       // ji was j, but triggered ICE
        {
          context_shortest = context_shortest <? scol_l(i)->durations[0];
        }
       // ji was j, but triggered ICE
-      for (int ji=i+1; ji --; )
+      for (int ji=i+1; ji --;)
        {
          if (scol_l(ji)->durations.size() &&
              now - scol_l(ji)->when() >= shortest_playing)
        {
          if (scol_l(ji)->durations.size() &&
              now - scol_l(ji)->when() >= shortest_playing)
@@ -515,7 +515,7 @@ Spring_spacer::calc_idealspacing()
     
   for (int i=0; i < cols.size(); i++)
     {
     
   for (int i=0; i < cols.size(); i++)
     {
-      if ( !scol_l (i)->musical_b())
+      if (!scol_l (i)->musical_b())
        {
          Real symbol_distance =cols[i].minright() + 2 PT;
          Real durational_distance = 0;
        {
          Real symbol_distance =cols[i].minright() + 2 PT;
          Real durational_distance = 0;
@@ -543,13 +543,13 @@ Spring_spacer::calc_idealspacing()
        {
          Moment shortest_playing_len = shortest_playing_arr[i];
          Moment context_shortest = context_shortest_arr[i];
        {
          Moment shortest_playing_len = shortest_playing_arr[i];
          Moment context_shortest = context_shortest_arr[i];
-         if ( ! shortest_playing_len)
+         if (! shortest_playing_len)
            {
              warning ("Can't find a ruling note at " 
                       +String (scol_l (i)->when()));
              shortest_playing_len = 1;
            }
            {
              warning ("Can't find a ruling note at " 
                       +String (scol_l (i)->when()));
              shortest_playing_len = 1;
            }
-         if ( ! context_shortest )
+         if (! context_shortest)
            {
              warning("No minimum in measure at "
                      + String (scol_l (i)->when()));
            {
              warning("No minimum in measure at "
                      + String (scol_l (i)->when()));
index 0857fb9b55742f87610232700313de51cbef7f5f..75854b82a92c966bb4f1042930a9521fb2d78ef8 100644 (file)
@@ -38,13 +38,13 @@ Staff_info::command_l()
   return command_l_;
 }
 
   return command_l_;
 }
 
-PCol*
+Paper_column*
 Staff_info::command_pcol_l()
 {
   return command_l();
 }
 
 Staff_info::command_pcol_l()
 {
   return command_l();
 }
 
-PCol*
+Paper_column*
 Staff_info::musical_pcol_l()
 {
   return musical_l();
 Staff_info::musical_pcol_l()
 {
   return musical_l();
index 80bbf00a30fb5052ea154df654f0be79f90712ab..72b1ef6840339ae3b2aa0a007de0a4e88091ff04 100644 (file)
@@ -35,7 +35,7 @@ Staff_performer::do_creation_processing()
   if (instrument_str().length_i()) 
     {
        // staff name
   if (instrument_str().length_i()) 
     {
        // staff name
-       play (new Audio_text ( Audio_text::TRACK_NAME, instrument_str ()));
+       play (new Audio_text (Audio_text::TRACK_NAME, instrument_str ()));
        // instrument description
        play (new Audio_text (Audio_text::INSTRUMENT_NAME, instrument_str ()));
     }
        // instrument description
        play (new Audio_text (Audio_text::INSTRUMENT_NAME, instrument_str ()));
     }
index 5d9bd748ab3e2a1276e4975694e127a698185503..a58d2f2828ad3bcf84f69873af8368fddc9458ca 100644 (file)
@@ -25,16 +25,16 @@ Staff_side::Staff_side()
   pos_i_ =0;
   sym_int_ = Interval (0,0);
   staff_size_i_ = 0;
   pos_i_ =0;
   sym_int_ = Interval (0,0);
   staff_size_i_ = 0;
-  staff_sym_l_=0;
-  dir_i_ =0;
-  inside_staff_b_ =false;
+  staff_sym_l_ = 0;
+  dir_ = CENTER;
+  inside_staff_b_ = false;
 }
 
 void
 Staff_side::read_staff_sym()
 {
   if (! staff_sym_l_)
 }
 
 void
 Staff_side::read_staff_sym()
 {
   if (! staff_sym_l_)
-       return ;
+    return ;
   staff_size_i_ = staff_sym_l_->steps_i();
 }
 
   staff_size_i_ = staff_sym_l_->steps_i();
 }
 
@@ -45,10 +45,10 @@ Staff_side::support_height() const
   Interval r;
   
   for (int i=0; i < support_l_arr_.size(); i++)
   Interval r;
   
   for (int i=0; i < support_l_arr_.size(); i++)
-       r.unite (support_l_arr_[i]->height());
+    r.unite (support_l_arr_[i]->height());
   if (r.empty_b()) 
     {
   if (r.empty_b()) 
     {
-       r = Interval (0,0);
+      r = Interval (0,0);
     }
   return r;
 }
     }
   return r;
 }
@@ -61,13 +61,13 @@ Staff_side::add_support (Score_elem*i)
 }
 
 int
 }
 
 int
-Staff_side::get_position_i()const
+Staff_side::get_position_i() const
 {
 {
-  if (!dir_i_
+  if (!dir_) 
     {
     {
-       warning ("Staff_side::get_position_i(): " 
-               "somebody forgot to set my vertical direction, returning -20");
-       return -20;
+      warning ("Staff_side::get_position_i(): " 
+              "somebody forgot to set my vertical direction, returning -20");
+      return -20;
     }
   
 
     }
   
 
@@ -75,23 +75,23 @@ Staff_side::get_position_i()const
   Real inter_f = paper()-> internote_f ();
   if (!inside_staff_b_) 
     {
   Real inter_f = paper()-> internote_f ();
   if (!inside_staff_b_) 
     {
-       y  = (dir_i_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2; 
-       y *=inter_f;
-       Interval v= support_height();
-
-       if (dir_i_ > 0) 
-         {
-           y = y >? (v.max() + 2*inter_f);
-         }
-       else if (dir_i_ < 0) 
-         {
-           y = y <? (v.min() - 2*inter_f);
-         }
+      y  = (dir_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2; 
+      y *=inter_f;
+      Interval v= support_height();
+
+      if (dir_ > 0) 
+       {
+         y = y >? (v.max() + 2*inter_f);
+       }
+      else if (dir_ < 0) 
+       {
+         y = y <? (v.min() - 2*inter_f);
+       }
     }
   else 
     {
     }
   else 
     {
-       Interval v= support_height();
-       y = v[dir_i_]  + 2*dir_i_*inter_f;      // ugh
+      Interval v= support_height();
+      y = v[dir_]  + 2*dir_*inter_f;   // ugh
     }
   return int (rint (Real (y)/inter_f)); // should ret a float?
 }
     }
   return int (rint (Real (y)/inter_f)); // should ret a float?
 }
@@ -107,8 +107,8 @@ Staff_side::do_post_processing()
 {
   sym_int_ = symbol_height();
   pos_i_ = get_position_i();
 {
   sym_int_ = symbol_height();
   pos_i_ = get_position_i();
-  if (dir_i_)
-       pos_i_ += int (rint (- sym_int_[-dir_i_] / paper()->internote_f ()));
+  if (dir_)
+    pos_i_ += int (rint (- sym_int_[-dir_] / paper()->internote_f ()));
 }
 
 void
 }
 
 void
@@ -116,7 +116,7 @@ Staff_side::do_substitute_dependency (Score_elem*o, Score_elem*n)
 { 
   support_l_arr_.unordered_substitute (o,n);
   if (staff_sym_l_ == o)
 { 
   support_l_arr_.unordered_substitute (o,n);
   if (staff_sym_l_ == o)
-       staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
+    staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }
 
 
 }
 
 
index 6adfae18269039cca7e76e48be5c0480518cba73..f2dfad4d32e91234b7c0ebedf62b5f5a83c8c1ce 100644 (file)
@@ -12,6 +12,7 @@
 #include "p-col.hh"
 
 const NO_LINES = 5;
 #include "p-col.hh"
 
 const NO_LINES = 5;
+
 void
 Staff_sym_engraver::fill_staff_info (Staff_info&i)
 {
 void
 Staff_sym_engraver::fill_staff_info (Staff_info&i)
 {
@@ -32,14 +33,14 @@ void
 Staff_sym_engraver::do_creation_processing()
 {
   span_p_ = new Staff_symbol (NO_LINES);
 Staff_sym_engraver::do_creation_processing()
 {
   span_p_ = new Staff_symbol (NO_LINES);
-  span_p_->left_col_l_ = get_staff_info().command_pcol_l (); // ugh
+  span_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_elem_info (span_p_, 0));
 }
 
 void
 Staff_sym_engraver::do_removal_processing()
 {
   announce_element (Score_elem_info (span_p_, 0));
 }
 
 void
 Staff_sym_engraver::do_removal_processing()
 {
-  span_p_->right_col_l_ = get_staff_info().command_pcol_l ();
+  span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (span_p_);
   span_p_ =0;
 }
   typeset_element (span_p_);
   span_p_ =0;
 }
index 4542d2e3dcfc0acb8aceb5ce7f2546b79786e412..6b9b288aba0e2cf1968d30350bfa69a4183bc54b 100644 (file)
@@ -22,7 +22,7 @@ Staff_symbol::Staff_symbol (int l)
 IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner);
 
 void
 IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner);
 
 void
-Staff_symbol::do_print()const
+Staff_symbol::do_print() const
 {
 #ifndef NPRINT
   Spanner::do_print();
 {
 #ifndef NPRINT
   Spanner::do_print();
@@ -37,16 +37,8 @@ Staff_symbol::brew_molecule_p() const
   return new Molecule (a);
 }
 
   return new Molecule (a);
 }
 
-void
-Staff_symbol::set_extent (PCol*p1, PCol*p2)
-{
-  assert (p1&&p2);
-  left_col_l_ = p1;
-  right_col_l_ = p2;
-}
-
 Real
 Real
-Staff_symbol::inter_note_f()const
+Staff_symbol::inter_note_f() const
 {
   return paper()->internote_f ();
 }
 {
   return paper()->internote_f ();
 }
diff --git a/lily/stem-beam-grav.cc b/lily/stem-beam-grav.cc
deleted file mode 100644 (file)
index 01564cd..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-  stem-beam-reg.cc -- part of GNU LilyPond
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "musical-request.hh"
-#include "stem-beam-grav.hh"
-#include "beam.hh"
-#include "stem.hh"
-#include "grouping.hh"
-#include "text-spanner.hh"
-#include "debug.hh"
-#include "grouping.hh"
-#include "note-head.hh"
-#include "time-description.hh"
-#include "duration-convert.hh"
-
-Stem_beam_engraver::Stem_beam_engraver()
-{
-  do_post_move_processing();
-
-  current_grouping = 0;
-  beam_p_ = 0;
-  default_dir_i_ =0;
-  start_req_l_ = 0;
-}
-
-bool
-Stem_beam_engraver::do_try_request (Request*req_l)
-{
-  
-  Musical_req* mus_l = req_l->musical();
-  /* Debiele puntkomma's. Laat je er eentje per ongeluk achter een
-   if (..) staan, lijkt het net op een luis in gcc.
-
-   (ofwel Python rules)
-   */
-  if (!mus_l)
-  return false;
-
-
-  if ( mus_l->beam()) 
-  {
-    if (bool (beam_p_) == bool (mus_l->beam()->spantype == Span_req::START))
-       return false;
-       
-    if (beam_req_l_ && beam_req_l_ ->equal_b (mus_l))
-       return false;
-       
-    beam_req_l_ = mus_l->beam();
-    return true;
-  }
-  
-  if ( mus_l->stem()) 
-  {
-    if (current_grouping && !current_grouping->child_fit_b (
-                                                             get_staff_info().time_C_->whole_in_measure_))
-       return false;
-
-    if (stem_req_l_ && !stem_req_l_->equal_b (mus_l) )
-       return false;
-
-    stem_req_l_ = mus_l->stem();
-    return true;
-  }
-  return false;
-}
-
-void
-Stem_beam_engraver::do_process_requests()
-{
-  if (beam_req_l_) 
-  {
-    if (beam_req_l_->spantype == Span_req::STOP) 
-       {
-         end_beam_b_ = true;
-         start_req_l_ = 0;
-       }
-    else 
-       {
-         beam_p_ = new Beam;
-         start_req_l_ = beam_req_l_;
-         beam_p_->left_col_l_ = get_staff_info().musical_pcol_l ();
-         current_grouping = new Rhythmic_grouping;
-         if (beam_req_l_->nplet) 
-           {
-             Text_spanner* t = new Text_spanner();
-             Text_def *defp = new Text_def;
-             t->set_support (beam_p_);
-             defp->align_i_ = 0;
-             defp->text_str_ = beam_req_l_->nplet;
-             defp->style_str_="italic";
-             t->spec_p_  = defp;
-             announce_element (Score_elem_info (t,0));
-             typeset_element (t);
-           }
-         announce_element ( Score_elem_info (beam_p_, 0));
-            
-       }
-  }
-
-  if (stem_req_l_) 
-  {
-    stem_p_ = new Stem (8);
-    if (current_grouping)
-       current_grouping->add_child (
-                                    get_staff_info().time_C_->whole_in_measure_,
-                                    stem_req_l_->duration());
-
-    stem_p_->flag_i_ = Duration_convert::type2_i
-      (stem_req_l_->duration_.durlog_i_);      // should change rep. of flags too.
-
-    if (beam_p_) 
-       {
-         if (stem_req_l_->duration_.durlog_i_<= 2)
-           stem_req_l_->warning ("stem doesn't fit in Beam");
-         else
-           beam_p_->add (stem_p_);
-         stem_p_->print_flag_b_ = false;
-       }
-    else 
-       {
-         stem_p_->print_flag_b_ = true;
-       }
-       
-    announce_element (Score_elem_info (stem_p_, stem_req_l_));
-  }
-}
-
-void
-Stem_beam_engraver::acknowledge_element (Score_elem_info info)
-{
-  if (!stem_p_)
-  return;
-
-  if (info.elem_l_->name() == Note_head::static_name () &&
-    stem_req_l_->duration() 
-    == info.req_l_->musical()->rhythmic ()->duration ())
-  {
-    Note_head * n_l= (Note_head*)info.elem_l_->item();
-    stem_p_->add (n_l);
-  }
-}
-void
-Stem_beam_engraver::do_pre_move_processing()
-{
-  if (stem_p_) 
-  {
-    if (default_dir_i_)
-       stem_p_->dir_i_ = default_dir_i_;
-       
-    typeset_element (stem_p_);
-    stem_p_ = 0;
-  }
-  if (beam_p_ && end_beam_b_) 
-  {
-    Rhythmic_grouping const * rg_C = get_staff_info().rhythmic_C_;
-    rg_C->extend (current_grouping->interval());
-    beam_p_->set_grouping (*rg_C, *current_grouping);
-    beam_p_->right_col_l_ = get_staff_info().musical_pcol_l ();
-    typeset_element (beam_p_);
-    delete current_grouping;
-    current_grouping = 0;
-    beam_p_ = 0;
-  }
-  end_beam_b_ = false;
-}
-void
-Stem_beam_engraver::do_post_move_processing()
-{
-  stem_p_ = 0;
-  beam_req_l_ = 0;
-  stem_req_l_ = 0;
-  end_beam_b_ = false;
-}
-
-Stem_beam_engraver::~Stem_beam_engraver()
-{
-  if (beam_p_)
-  start_req_l_->warning ("unterminated beam");
-}
-
-void
-Stem_beam_engraver::set_feature (Feature i)
-{
-  if (i.type_ == "vdir")       
-  default_dir_i_ = i.value_;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Stem_beam_engraver,Engraver);
-ADD_THIS_ENGRAVER(Stem_beam_engraver);
diff --git a/lily/stem-grav.cc b/lily/stem-grav.cc
new file mode 100644 (file)
index 0000000..c5d825c
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+  stem-grav.cc -- implement Stem_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "stem-grav.hh"
+#include "note-head.hh"
+#include "stem.hh"
+#include "musical-request.hh"
+#include "duration-convert.hh"
+
+Stem_engraver::Stem_engraver()
+{
+  stem_p_ =0;
+  dir_ =CENTER;
+}
+
+void
+Stem_engraver::acknowledge_element(Score_elem_info i)
+{
+  if (i.elem_l_->is_type_b (Note_head::static_name()))
+    {
+      Note_head *h  = (Note_head*) i.elem_l_->item();
+      if (!stem_p_) 
+       {
+         Rhythmic_req * r = i.req_l_->musical()->rhythmic();
+         stem_p_ = new Stem;
+         stem_p_->flag_i_ = Duration_convert::type2_i(r->duration_.durlog_i_);
+         announce_element (Score_elem_info (stem_p_, r));
+       }
+      stem_p_->add (h);
+    }
+}
+
+void
+Stem_engraver::do_pre_move_processing()
+{
+  if (stem_p_)
+    {
+      if (dir_)
+       stem_p_->dir_ = dir_;
+      
+      typeset_element(stem_p_);
+      stem_p_ =0;
+    }
+}
+
+void
+Stem_engraver::set_feature (Feature i)
+{
+  if (i.type_ == "vdir")       
+    dir_ = (Direction) int(i.value_);
+}
+
+IMPLEMENT_IS_TYPE_B1(Stem_engraver, Engraver);
+ADD_THIS_ENGRAVER(Stem_engraver);
index 633a0e3252dba8426f08e1354410ea0bb8f8d2b9..62e1a8753776dd069935e5f30194895e7319a44b 100644 (file)
 const int STEMLEN=7;
 
 int
 const int STEMLEN=7;
 
 int
-Stem::min_head_i()const
+Stem::min_head_i() const
 {
   int m = 1000;
   for (int i =0; i < head_l_arr_.size(); i++)
 {
   int m = 1000;
   for (int i =0; i < head_l_arr_.size(); i++)
-       m = m <? head_l_arr_[i]->position_i_;
+    m = m <? head_l_arr_[i]->position_i_;
   return m;
 }
 
   return m;
 }
 
@@ -32,20 +32,22 @@ Stem::max_head_i() const
 {
   int m = -1000;
   for (int i =0; i < head_l_arr_.size(); i++)
 {
   int m = -1000;
   for (int i =0; i < head_l_arr_.size(); i++)
-       m = m >? head_l_arr_[i]->position_i_;
+    m = m >? head_l_arr_[i]->position_i_;
   return m;
   
 }
   return m;
   
 }
-
-Stem::Stem (int c) 
+/*
+  TODO: staff-size
+ */
+Stem::Stem () 
 {
   beams_left_i_ = 0;
   beams_right_i_ = 0;
 
   stem_bottom_f_ = stem_top_f_ = 0;
   flag_i_ = 4;
 {
   beams_left_i_ = 0;
   beams_right_i_ = 0;
 
   stem_bottom_f_ = stem_top_f_ = 0;
   flag_i_ = 4;
-  dir_i_ =0;
-  staff_size_i_ = c;
+  dir_ =CENTER;
+  staff_size_i_ = 8;
 
   print_flag_b_=true;
   stem_xoffset_f_ =0;
 
   print_flag_b_=true;
   stem_xoffset_f_ =0;
@@ -63,21 +65,21 @@ Stem::do_print() const
 }
 
 Real 
 }
 
 Real 
-Stem::stem_length_f()const
+Stem::stem_length_f() const
 {
   return stem_top_f_-stem_bottom_f_ ;
 }
 
 Real
 {
   return stem_top_f_-stem_bottom_f_ ;
 }
 
 Real
-Stem::stem_start_f()const
+Stem::stem_start_f() const
 {
 {
-  return (dir_i_ < 0)? stem_top_f_ : stem_bottom_f_;
+  return (dir_ < 0)? stem_top_f_ : stem_bottom_f_;
 }
 
 Real
 Stem::stem_end_f() const
 {
 }
 
 Real
 Stem::stem_end_f() const
 {
-  return (dir_i_ < 0)? stem_bottom_f_ : stem_top_f_;
+  return (dir_ < 0)? stem_bottom_f_ : stem_top_f_;
 }
 
 
 }
 
 
@@ -85,12 +87,12 @@ void
 Stem::set_stemend (Real se)
 {
   // todo: margins
 Stem::set_stemend (Real se)
 {
   // todo: margins
-  if (!  ((dir_i_ > 0 && se >= max_head_i()) || 
-           (se <= min_head_i() && dir_i_ <0)) )        
-       warning ("Weird stem size; check for narrow beams");
+  if (!  ((dir_ > 0 && se >= max_head_i()) || 
+         (se <= min_head_i() && dir_ <0)))     
+    warning ("Weird stem size; check for narrow beams");
 
 
-  stem_top_f_  = (dir_i_ < 0) ? max_head_i()           : se;
-  stem_bottom_f_  = (dir_i_ < 0) ? se  : min_head_i();
+  stem_top_f_  = (dir_ < 0) ? max_head_i()           : se;
+  stem_bottom_f_  = (dir_ < 0) ? se  : min_head_i();
 }
 
 void
 }
 
 void
@@ -99,83 +101,83 @@ Stem::add (Note_head *n)
   n->add_dependency (this);
   if (n->rest_b_) 
     {
   n->add_dependency (this);
   if (n->rest_b_) 
     {
-       rest_l_arr_.push (n);
+      rest_l_arr_.push (n);
     }
   else if (n->balltype_i_ == 0) 
     {
     }
   else if (n->balltype_i_ == 0) 
     {
-       whole_l_arr_.push (n);
-       return;
+      whole_l_arr_.push (n);
+      return;
     }
   else
     {
     }
   else
     {
-       head_l_arr_.push (n);
+      head_l_arr_.push (n);
     }
 }
 
 bool
     }
 }
 
 bool
-Stem::invisible_b()const
+Stem::invisible_b() const
 {
   return !head_l_arr_.size();
 }
 
 {
   return !head_l_arr_.size();
 }
 
-// if dir_i_ is set we return fake values.
+// if dir_ is set we return fake values.
 
 int
 Stem::get_center_distance_from_top()
 {
 
 int
 Stem::get_center_distance_from_top()
 {
-  if (dir_i_)
-       return (dir_i_ > 0) ? 0 : 1;
+  if (dir_)
+    return (dir_ > 0) ? 0 : 1;
 
   int staff_center = staff_size_i_ / 2;
   int max = max_head_i() - staff_center;
   return max >? 0;
 }
 
 
   int staff_center = staff_size_i_ / 2;
   int max = max_head_i() - staff_center;
   return max >? 0;
 }
 
-// if dir_i_ is set we return fake values.
+// if dir_ is set we return fake values.
 int
 Stem::get_center_distance_from_bottom()
 {
 int
 Stem::get_center_distance_from_bottom()
 {
-  if (dir_i_)
-       return (dir_i_ > 0) ? 1 : 0;
+  if (dir_)
+    return (dir_ > 0) ? 1 : 0;
 
   int staff_center = staff_size_i_ / 2;
   int min = staff_center - min_head_i();
   return min >? 0;
 }
 
 
   int staff_center = staff_size_i_ / 2;
   int min = staff_center - min_head_i();
   return min >? 0;
 }
 
-int
+Direction
 Stem::get_default_dir()
 {
 Stem::get_default_dir()
 {
-  if (dir_i_)
-       return dir_i_;
+  if (dir_)
+    return dir_;
   return (get_center_distance_from_top() >=
   return (get_center_distance_from_top() >=
-       get_center_distance_from_bottom()) ? -1 : 1;
+         get_center_distance_from_bottom()) ? -1 : 1;
 }
 
 
 void
 Stem::set_default_dir()
 {
 }
 
 
 void
 Stem::set_default_dir()
 {
-  dir_i_ = get_default_dir();
+  dir_ = get_default_dir();
 }
 
 void
 Stem::set_default_stemlen()
 {
 }
 
 void
 Stem::set_default_stemlen()
 {
-  if (!dir_i_)
-       set_default_dir();
+  if (!dir_)
+    set_default_dir();
 
   
   // ugh... how about non 5-line staffs?
 
   
   // ugh... how about non 5-line staffs?
-  if ((max_head_i() < -2 && dir_i_ == 1)
-       ||(min_head_i() > staff_size_i_ && dir_i_ == -1))
-         {
-       set_stemend (staff_size_i_ /2 -1);
+  if ((max_head_i() < -2 && dir_ == 1)
+      ||(min_head_i() > staff_size_i_ && dir_ == -1))
+    {
+      set_stemend (staff_size_i_ /2 -1);
     }
   else 
     {
     }
   else 
     {
-       set_stemend ((dir_i_ > 0) ? max_head_i() + STEMLEN : 
-                                    min_head_i() - STEMLEN);
+      set_stemend ((dir_ > 0) ? max_head_i() + STEMLEN : 
+                  min_head_i() - STEMLEN);
 
     }
 }
 
     }
 }
@@ -185,15 +187,15 @@ void
 Stem::set_default_extents()
 {
   if (!stem_length_f())
 Stem::set_default_extents()
 {
   if (!stem_length_f())
-       set_default_stemlen();
+    set_default_stemlen();
 
 
-  set_stemend ((dir_i_< 0) ? 
-               max_head_i()-stem_length_f (): min_head_i () +stem_length_f ());
-  if (dir_i_ > 0){     
-       stem_xoffset_f_ = paper()->note_width ()-paper ()->rule_thickness ();
-    }
+  set_stemend ((dir_< 0) ? 
+              max_head_i()-stem_length_f (): min_head_i () +stem_length_f ());
+  if (dir_ > 0){       
+    stem_xoffset_f_ = paper()->note_width ()-paper ()->rule_thickness ();
+  }
   else
   else
-       stem_xoffset_f_ = 0;
+    stem_xoffset_f_ = 0;
 }
 
 /*
 }
 
 /*
@@ -206,10 +208,10 @@ void
 Stem::set_noteheads()
 {
   if (!head_l_arr_.size())
 Stem::set_noteheads()
 {
   if (!head_l_arr_.size())
-       return;
+    return;
   head_l_arr_.sort (Note_head::compare);
   head_l_arr_.sort (Note_head::compare);
-  if (dir_i_ < 0) 
-       head_l_arr_.reverse();
+  if (dir_ < 0) 
+    head_l_arr_.reverse();
   
   head_l_arr_[0]->extremal_i_ = -1;
   head_l_arr_.top()->extremal_i_ = 1;
   
   head_l_arr_[0]->extremal_i_ = -1;
   head_l_arr_.top()->extremal_i_ = 1;
@@ -217,17 +219,17 @@ Stem::set_noteheads()
   int lastpos = head_l_arr_[0]->position_i_;
   for (int i=1; i < head_l_arr_.size(); i ++) 
     {
   int lastpos = head_l_arr_[0]->position_i_;
   for (int i=1; i < head_l_arr_.size(); i ++) 
     {
-       int dy =abs (lastpos- head_l_arr_[i]->position_i_);
+      int dy =abs (lastpos- head_l_arr_[i]->position_i_);
        
        
-       if (dy <= 1) 
-         {
-           if (parity)
-               head_l_arr_[i]->x_dir_i_ = (stem_xoffset_f_>0) ? 1:-1;
-           parity = !parity;
-         }
-       else
-           parity = 0;
-       lastpos = head_l_arr_[i]->position_i_;
+      if (dy <= 1) 
+       {
+         if (parity)
+           head_l_arr_[i]->x_dir_ = (stem_xoffset_f_>0) ? UP:DOWN;
+         parity = !parity;
+       }
+      else
+       parity = 0;
+      lastpos = head_l_arr_[i]->position_i_;
     }
 }
 
     }
 }
 
@@ -235,19 +237,19 @@ void
 Stem::do_pre_processing()
 {
   if (stem_bottom_f_== stem_top_f_)
 Stem::do_pre_processing()
 {
   if (stem_bottom_f_== stem_top_f_)
-       set_default_extents();
+    set_default_extents();
   set_noteheads();
   set_noteheads();
-  flag_i_ = dir_i_*abs (flag_i_);
+  flag_i_ = dir_*abs (flag_i_);
   transparent_b_ = invisible_b();
   empty_b_ = invisible_b();
 }
 
 
 Interval
   transparent_b_ = invisible_b();
   empty_b_ = invisible_b();
 }
 
 
 Interval
-Stem::do_width()const
+Stem::do_width() const
 {
   if (!print_flag_b_ || abs (flag_i_) <= 4)
 {
   if (!print_flag_b_ || abs (flag_i_) <= 4)
-       return Interval (0,0);  // TODO!
+    return Interval (0,0);     // TODO!
   Paper_def*p= paper();
   Interval r (p->lookup_l()->flag (flag_i_).dim.x ());
   r+= stem_xoffset_f_;
   Paper_def*p= paper();
   Interval r (p->lookup_l()->flag (flag_i_).dim.x ());
   r+= stem_xoffset_f_;
@@ -255,7 +257,7 @@ Stem::do_width()const
 }
 
 Molecule*
 }
 
 Molecule*
-Stem::brew_molecule_p()const 
+Stem::brew_molecule_p() const 
 {
   Molecule *out =0;
       
 {
   Molecule *out =0;
       
@@ -273,17 +275,17 @@ Stem::brew_molecule_p()const
 
   if (print_flag_b_&&abs (flag_i_) > 4)
     {
 
   if (print_flag_b_&&abs (flag_i_) > 4)
     {
-       Symbol fl = p->lookup_l()->flag (flag_i_);
-       Molecule m (fl);
-       if (flag_i_ < -4){              
-           out->add_bottom (m);
-         }
-       else if (flag_i_ > 4) 
-         {
-           out->add_top (m);
-         }
-       else
-           assert (false); 
+      Symbol fl = p->lookup_l()->flag (flag_i_);
+      Molecule m (fl);
+      if (flag_i_ < -4){               
+       out->add_bottom (m);
+      }
+      else if (flag_i_ > 4) 
+       {
+         out->add_top (m);
+       }
+      else
+       assert (false); 
     }
 
   out->translate (stem_xoffset_f_, X_AXIS);
     }
 
   out->translate (stem_xoffset_f_, X_AXIS);
@@ -291,7 +293,7 @@ Stem::brew_molecule_p()const
 }
 
 Real
 }
 
 Real
-Stem::hpos_f()const
+Stem::hpos_f() const
 {
   return Item::hpos_f() + stem_xoffset_f_;
 }
 {
   return Item::hpos_f() + stem_xoffset_f_;
 }
index 7ee2db3b9af5dc8c1761801dda60f28cb21aa52d..ef162d0a0b78b333392fe061e930ce5a2df54034 100644 (file)
 #include "string.hh"
 
 String
 #include "string.hh"
 
 String
-Super_elem::TeX_string()const
+Super_elem::TeX_output_str() const
 {
   String s;
   for (int i=0; i < lines_arr_.size(); i++)
     {
 {
   String s;
   for (int i=0; i < lines_arr_.size(); i++)
     {
-       s += lines_arr_[i]->TeX_string();
-       if (i + 1<lines_arr_.size())
-           s += "\\interscoreline"; // TODO
+      s += lines_arr_[i]->TeX_output_str();
+      if (i + 1<lines_arr_.size())
+       s += "\\interscoreline"; // TODO
     }
   return s;
 }
     }
   return s;
 }
@@ -29,7 +29,7 @@ Super_elem::handle_broken_dependencies()
 {
   lines_arr_ = line_of_score_l_->get_lines();
   for (int i =0; i < lines_arr_.size(); i++) 
 {
   lines_arr_ = line_of_score_l_->get_lines();
   for (int i =0; i < lines_arr_.size(); i++) 
-       add_dependency (lines_arr_[i]);
+    add_dependency (lines_arr_[i]);
 }
   
 
 }
   
 
@@ -37,7 +37,7 @@ void
 Super_elem::do_substitute_dependency (Score_elem*o,Score_elem* n)
 {
   if (line_of_score_l_ == o->spanner())
 Super_elem::do_substitute_dependency (Score_elem*o,Score_elem* n)
 {
   if (line_of_score_l_ == o->spanner())
-       line_of_score_l_ = n?(Line_of_score*)n->spanner():0;
+    line_of_score_l_ = n? (Line_of_score*) n->spanner() : 0;
 }
 
 Super_elem::Super_elem()
 }
 
 Super_elem::Super_elem()
@@ -52,7 +52,4 @@ Super_elem::do_add_processing()
   add_dependency (line_of_score_l_);
 }
 
   add_dependency (line_of_score_l_);
 }
 
-
-
-
 IMPLEMENT_IS_TYPE_B1(Super_elem,Score_elem);
 IMPLEMENT_IS_TYPE_B1(Super_elem,Score_elem);
index 2f7834b89cef24a205073c9074a25496d26d088d..9ba3d45f589b912f97dd16ab9f79ed3764d4ca5b 100644 (file)
@@ -15,7 +15,7 @@ Symbol::Symbol (String s, Box b)
 
 
 String
 
 
 String
-Symbol::str()const 
+Symbol::str() const 
 {
   return  "symbol (\'"+tex+"\', (" + dim.x().str () + ", " + dim.y ().str () + "))";
 }
 {
   return  "symbol (\'"+tex+"\', (" + dim.x().str () + ", " + dim.y ().str () + "))";
 }
index 92ef19852f66496c41bc5f7ede37991dfbe5cb98..25e4ff8ce735eaf19ab5ee48d928d8947fe89c94 100644 (file)
@@ -23,7 +23,7 @@ Symtables::Symtables (Symtables const &s)
 {
   for (Assoc_iter<String, Symtable*>  i (s); i.ok(); i++) 
     {
 {
   for (Assoc_iter<String, Symtable*>  i (s); i.ok(); i++) 
     {
-       add (i.key(), new Symtable (*i.val ()));
+      add (i.key(), new Symtable (*i.val ()));
     }
 }
 
     }
 }
 
@@ -31,7 +31,7 @@ Symtables::~Symtables()
 {
   for (Assoc_iter<String, Symtable*>  i (*this); i.ok(); i++) 
     {
 {
   for (Assoc_iter<String, Symtable*>  i (*this); i.ok(); i++) 
     {
-       delete i.val();
+      delete i.val();
     }
 }
 
     }
 }
 
@@ -39,12 +39,12 @@ Symbol
 Symtable::lookup (String s) const
 {
   if (elt_b (s))
 Symtable::lookup (String s) const
 {
   if (elt_b (s))
-       return (*this)[s];
+    return (*this)[s];
   else 
     {
   else 
     {
-       warning ("Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
-       Symbol sy;      
-       return sy;
+      warning ("Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
+      Symbol sy;       
+      return sy;
     }
 }
 
     }
 }
 
@@ -58,9 +58,9 @@ Symtables::print() const
 {
   for (Assoc_iter<String, Symtable*>  i (*this); i.ok(); i++) 
     {
 {
   for (Assoc_iter<String, Symtable*>  i (*this); i.ok(); i++) 
     {
-       DOUT << "table \'" << i.key() << "\' {\n";
-       i.val()->print ();
-       DOUT << "}\n";
+      DOUT << "table \'" << i.key() << "\' {\n";
+      i.val()->print ();
+      DOUT << "}\n";
     }
 }
 void
     }
 }
 void
@@ -68,7 +68,7 @@ Symtable::print() const
 {
   for (Assoc_iter<String, Symbol>  i (*this); i.ok(); i++) 
     {
 {
   for (Assoc_iter<String, Symbol>  i (*this); i.ok(); i++) 
     {
-       DOUT << "\'" << i.key() << "\'->" << i.val ().str () << "\n";
+      DOUT << "\'" << i.key() << "\'->" << i.val ().str () << "\n";
     }
 }
        
     }
 }
        
index 8fbefa72a7c94a6141642044f9b9123da1d0c0ff..d22b1e11a3d4726a3cf1a0004268328537f71923 100644 (file)
 #include "plist.tcc"
 
 
 #include "plist.tcc"
 
 
-#define IPLC_INSTANTIATE(a) IPL_INSTANTIATE(a); template PL_INSTANTIATE(const a)
+#define IPLC_INSTANTIATE(a) POINTERLIST_INSTANTIATE(a)
 
 
 template IPLC_INSTANTIATE(Score_elem);
 template IPLC_INSTANTIATE(Spanner);
 template IPLC_INSTANTIATE(Idealspacing);
 
 
 template IPLC_INSTANTIATE(Score_elem);
 template IPLC_INSTANTIATE(Spanner);
 template IPLC_INSTANTIATE(Idealspacing);
-template IPLC_INSTANTIATE(PCol);
 
 
index 67c24f5a58a719bd6f02de65e7afd2e680aa9da4..e6961b4ac721e50f89e10d74c65c0b261806c35e 100644 (file)
@@ -10,4 +10,4 @@
 #include "plist.tcc"
 #include "pcursor.tcc"
 
 #include "plist.tcc"
 #include "pcursor.tcc"
 
- template IPL_INSTANTIATE(Line_spacer);
+template POINTERLIST_INSTANTIATE(Line_spacer);
index 2e368d5219ecb2dc453b450e5a393bf183843803..9e6e7e6dcebd3ad524c7070483d607b7854d144e 100644 (file)
@@ -13,5 +13,5 @@
 #include "plist.tcc"
 #include "pcursor.tcc"
 
 #include "plist.tcc"
 #include "pcursor.tcc"
 
-template IPL_INSTANTIATE(Atom);
-template IPL_INSTANTIATE(Input_translator);
+template POINTERLIST_INSTANTIATE(Atom);
+template POINTERLIST_INSTANTIATE(Input_translator);
index e8f04f81224345d6b1b6acfd38e7211477553057..dd7bf02997752ce741ece68639e66ac964c287e5 100644 (file)
@@ -3,5 +3,5 @@
 #include "engraver.hh"
 #include "performer.hh"
 
 #include "engraver.hh"
 #include "performer.hh"
 
-template IPL_INSTANTIATE(Engraver);
-template IPL_INSTANTIATE(Performer);
+template POINTERLIST_INSTANTIATE(Engraver);
+template POINTERLIST_INSTANTIATE(Performer);
index b36c23275373da1581f1ae217a5355cb8ecd72ca..b288b4c289974001e8474bd754036f97ae07f3c2 100644 (file)
@@ -14,5 +14,5 @@
 #include "music-list.hh"
 #include "music-iterator.hh"
 
 #include "music-list.hh"
 #include "music-iterator.hh"
 
-template IPL_INSTANTIATE(Music);
-template IPL_INSTANTIATE(Music_iterator);
+template POINTERLIST_INSTANTIATE(Music);
+template POINTERLIST_INSTANTIATE(Music_iterator);
index de2fa8af8e13f4c371e70f927bedadc4c024d89d..301e86f3f754fd79219355de053abf18439406d3 100644 (file)
@@ -15,7 +15,6 @@
 #include "plist.tcc"
 
 
 #include "plist.tcc"
 
 
-template IPL_INSTANTIATE(Audio_element);
-template IPL_INSTANTIATE(Audio_column);
-
+template POINTERLIST_INSTANTIATE(Audio_element);
+template POINTERLIST_INSTANTIATE(Audio_column);
 
 
index f20ded05e4c4b27fe30fd781c2d0001cc488a499..c16a0e9c02a722e0b65da52327b4072a75926be1 100644 (file)
@@ -1,7 +1,13 @@
 /*
 /*
+  tex-beam.cc -- implement Lookup::{beam_element, beam, rule_symbol}
 
 
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+/*
   Code to generate beams for TeX
   Code to generate beams for TeX
-  
   */
 
 #include <math.h>
   */
 
 #include <math.h>
@@ -35,17 +41,17 @@ slope_index (Real &s)
 {
   if (abs (s) > 0.5) 
     {
 {
   if (abs (s) > 0.5) 
     {
-       WARN << "beam steeper than 0.5 (" << s << ")\n";
-       s = sign (s) * 0.5;
+      WARN << "beam steeper than 0.5 (" << s << ")\n";
+      s = sign (s) * 0.5;
     }
 
   int i = int (rint (s *  20.0));
 
   s = i/20.0;
   if (s>0)
     }
 
   int i = int (rint (s *  20.0));
 
   s = i/20.0;
   if (s>0)
-       return 6*i +122;
+    return 6*i +122;
   else
   else
-       return -6 * i+ 186;
+    return -6 * i+ 186;
 }
 
 Symbol
 }
 
 Symbol
@@ -66,11 +72,11 @@ Lookup::beam (Real &slope, Real width) const
 {        
   int sidx = slope_index (slope);
   if (!slope)
 {        
   int sidx = slope_index (slope);
   if (!slope)
-       return rule_symbol (2 PT, width);
+    return rule_symbol (2 PT, width);
   if (width < 2 PT) 
     {
   if (width < 2 PT) 
     {
-       WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n";
-       width = 2 PT;
+      WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n";
+      width = 2 PT;
     }
   Real elemwidth = 64 PT;
   int widx = 5;
     }
   Real elemwidth = 64 PT;
   int widx = 5;
@@ -79,8 +85,8 @@ Lookup::beam (Real &slope, Real width) const
   
   while (elemwidth > width) 
     {
   
   while (elemwidth > width) 
     {
-       widx --;
-       elemwidth /= 2.0;
+      widx --;
+      elemwidth /= 2.0;
     }
   Real overlap = elemwidth/4;
   Real last_x = width - elemwidth;
     }
   Real overlap = elemwidth/4;
   Real last_x = width - elemwidth;
@@ -90,10 +96,10 @@ Lookup::beam (Real &slope, Real width) const
   m.add (a);
   while (x < last_x) 
     {
   m.add (a);
   while (x < last_x) 
     {
-       a=elem;
-       a.translate (Offset (x-overlap, (x-overlap)*slope));
-       m.add (a);
-       x += elemwidth - overlap;
+      a=elem;
+      a.translate (Offset (x-overlap, (x-overlap)*slope));
+      m.add (a);
+      x += elemwidth - overlap;
     }
   a=elem;
   a.translate (Offset (last_x, (last_x) * slope));
     }
   a=elem;
   a.translate (Offset (last_x, (last_x) * slope));
index b494ec5c1a813601b20f34cfe149da86723b30ae..3463d38494eb53dc3b6dd1236342513de5a05e62 100644 (file)
@@ -22,17 +22,17 @@ char direction_char (int y_sign)
   char c='#';
   switch (y_sign)
     {
   char c='#';
   switch (y_sign)
     {
-  case -1:
-       c = 'd';
-       break;
-  case 0:
-       c = 'h';
-       break;
-  case 1:
-       c = 'u';
-       break;
-  default:
-       assert (false);
+    case -1:
+      c = 'd';
+      break;
+    case 0:
+      c = 'h';
+      break;
+    case 1:
+      c = 'u';
+      break;
+    default:
+      assert (false);
     }
   return c;
 }
     }
   return c;
 }
@@ -41,15 +41,15 @@ Symbol
 Lookup::half_slur_middlepart (Real &dx, int dir) const
 {
   if (dx >= 400 PT) {// todo
 Lookup::half_slur_middlepart (Real &dx, int dir) const
 {
   if (dx >= 400 PT) {// todo
-       WARN<<"halfslur too large" <<print_dimen (dx)<< "shrinking (ugh)\n";
-       dx = 400 PT;
-    }
+    WARN<<"halfslur too large" <<print_dimen (dx)<< "shrinking (ugh)\n";
+    dx = 400 PT;
+  }
   int widx = int (floor (dx / 4.0));
   dx = widx * 4.0;
   if (widx) widx --;
   else 
     {
   int widx = int (floor (dx / 4.0));
   dx = widx * 4.0;
   if (widx) widx --;
   else 
     {
-       WARN <<  "slur too narrow\n";
+      WARN <<  "slur too narrow\n";
     }
 
   Symbol s;
     }
 
   Symbol s;
@@ -62,11 +62,11 @@ Lookup::half_slur_middlepart (Real &dx, int dir) const
 
   int idx = widx;
   if (dir < 0)
 
   int idx = widx;
   if (dir < 0)
-       idx += 128;
+    idx += 128;
 
   assert (idx < 256);
 
 
   assert (idx < 256);
 
-  f+=String ("{") + String (idx ) + "}";
+  f+=String ("{") + String (idx) + "}";
   s.tex = f;
   Atom a (s);
   a.translate (dx/2, X_AXIS);
   s.tex = f;
   Atom a (s);
   a.translate (dx/2, X_AXIS);
@@ -79,23 +79,23 @@ Lookup::half_slur (int dy, Real &dx, int dir, int xpart) const
 {
   Real orig_dx = dx;
   if (!xpart)
 {
   Real orig_dx = dx;
   if (!xpart)
-       return half_slur_middlepart (dx, dir);
+    return half_slur_middlepart (dx, dir);
 
   int widx;
                
   if (dx >= 96 PT) 
     {
 
   int widx;
                
   if (dx >= 96 PT) 
     {
-       WARN << "Slur half too wide." << print_dimen (orig_dx) << " shrinking (ugh)\n";
-       dx =  96 PT;
+      WARN << "Slur half too wide." << print_dimen (orig_dx) << " shrinking (ugh)\n";
+      dx =  96 PT;
     }
 
   widx = int (rint (dx/12.0));
   dx = widx*12.0;
   if (widx)
     }
 
   widx = int (rint (dx/12.0));
   dx = widx*12.0;
   if (widx)
-       widx --;
+    widx --;
   else 
     {
   else 
     {
-       WARN <<  "slur too narrow " << print_dimen (orig_dx)<<"\n";
+      WARN <<  "slur too narrow " << print_dimen (orig_dx)<<"\n";
     }
        
   Symbol s;
     }
        
   Symbol s;
@@ -109,16 +109,16 @@ Lookup::half_slur (int dy, Real &dx, int dir, int xpart) const
 
   int hidx = dy;
   if (hidx <0)
 
   int hidx = dy;
   if (hidx <0)
-       hidx = -hidx;
+    hidx = -hidx;
   hidx --;
   int idx =-1;
 
   idx = widx * 16 + hidx;
   if (xpart < 0)
   hidx --;
   int idx =-1;
 
   idx = widx * 16 + hidx;
   if (xpart < 0)
-       idx += 128;
+    idx += 128;
   
   assert (idx < 256);
   
   assert (idx < 256);
-  f+=String ("{") + String (idx ) + "}";
+  f+=String ("{") + String (idx) + "}";
 
   
   s.tex = f;
 
   
   s.tex = f;
@@ -136,32 +136,32 @@ Lookup::slur (int dy , Real &dx, int dir) const
 
   if (y_sign) 
     {
 
   if (y_sign) 
     {
-       large |= dx>= 4*16 PT;
+      large |= dx>= 4*16 PT;
     }
   else
     }
   else
-       large |= dx>= 4*54 PT;
+    large |= dx>= 4*54 PT;
   
   if (large) 
     {
   
   if (large) 
     {
-       return big_slur (dy, dx, dir);
+      return big_slur (dy, dx, dir);
     }
   Real orig_dx = dx;
   int widx = int (floor (dx/4.0)); // slurs better too small..
   dx = 4.0 * widx;
   if (widx)
     }
   Real orig_dx = dx;
   int widx = int (floor (dx/4.0)); // slurs better too small..
   dx = 4.0 * widx;
   if (widx)
-       widx --;
+    widx --;
   else 
     {
   else 
     {
-       WARN <<  "slur too narrow: " << print_dimen (orig_dx) << "\n";
+      WARN <<  "slur too narrow: " << print_dimen (orig_dx) << "\n";
     }
 
   int hidx = dy;
   if (hidx <0)
     }
 
   int hidx = dy;
   if (hidx <0)
-       hidx = -hidx;
+    hidx = -hidx;
   hidx --; 
   if (hidx > 8) 
     {
   hidx --; 
   if (hidx > 8) 
     {
-       WARN<<"slur to steep: " << dy << " shrinking (ugh)\n";
+      WARN<<"slur to steep: " << dy << " shrinking (ugh)\n";
     }
   
   Symbol s;
     }
   
   Symbol s;
@@ -172,25 +172,25 @@ Lookup::slur (int dy , Real &dx, int dir) const
 
   int idx=-1;
   if (y_sign) {        
 
   int idx=-1;
   if (y_sign) {        
-       idx = hidx * 16 + widx;
-       if (dir < 0)
-           idx += 128;
-    }
+    idx = hidx * 16 + widx;
+    if (dir < 0)
+      idx += 128;
+  }
   else 
     {
   else 
     {
-       if (dx >= 4*54 PT) 
-         {
-           WARN << "slur too wide: " << print_dimen (dx) <<
-               " shrinking (ugh)\n";
-           dx = 4*54 PT;
-         }
-       idx = widx;
-       if (dir < 0)
-           idx += 54;          
+      if (dx >= 4*54 PT) 
+       {
+         WARN << "slur too wide: " << print_dimen (dx) <<
+           " shrinking (ugh)\n";
+         dx = 4*54 PT;
+       }
+      idx = widx;
+      if (dir < 0)
+       idx += 54;              
     }
   
   assert (idx < 256);
     }
   
   assert (idx < 256);
-  f+=String ("{") + String (idx ) + "}";
+  f+=String ("{") + String (idx) + "}";
   s.tex = f;
 
   Atom a (s);
   s.tex = f;
 
   Atom a (s);
index fb0348a05127d3dbd118462d53de17b9dfad6d4f..6e7bb4732b9b282cc5dd88b898980e44817c9ba9 100644 (file)
@@ -35,10 +35,6 @@ substitute_args (String source, Array<String> args)
   String retval (source);
   for (int i = 0 ; i < args.size(); i++)
       substitute_arg (retval, args[i]);
   String retval (source);
   for (int i = 0 ; i < args.size(); i++)
       substitute_arg (retval, args[i]);
-  /*
-  while (retval.index_i ('%') >= 0)
-      substitute_arg (retval, "");
-       */
   return retval;
 }
 
   return retval;
 }
 
index a2ce8730cfcc34fe19622133413892cb05ad65d0..ead696b073629faacfc3b4c783bcbcdc5a743d00 100644 (file)
@@ -16,7 +16,7 @@
 Interval
 Text_def::width (Paper_def * p) const
 {
 Interval
 Text_def::width (Paper_def * p) const
 {
-  Atom a = get_atom (p,0);
+  Atom a = get_atom (p,CENTER);
 
   Real guess_width_f = text_str_.length_i() * a.sym_.dim.x ().length (); // ugh
   Interval i (0, guess_width_f);
 
   Real guess_width_f = text_str_.length_i() * a.sym_.dim.x ().length (); // ugh
   Interval i (0, guess_width_f);
@@ -47,7 +47,7 @@ Text_def::do_equal_b (General_script_def const *gdef) const
 }
 
 Atom
 }
 
 Atom
-Text_def::get_atom (Paper_def *p, int) const
+Text_def::get_atom (Paper_def *p, Direction) const
 {
   return p->lookup_l()->text (style_str_, text_str_, -align_i_);
 }
 {
   return p->lookup_l()->text (style_str_, text_str_, -align_i_);
 }
diff --git a/lily/text-grav.cc b/lily/text-grav.cc
deleted file mode 100644 (file)
index 4abff4f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  text-reg.cc -- implement Text_engraver
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-
-  Obsolete.
-*/
-#include "note-column.hh"
-#include "musical-request.hh"
-#include "text-grav.hh"
-#include "text-item.hh"
-
-Text_engraver::Text_engraver()
-{
-  text_p_ = 0;
-  dir_i_ =0;
-  do_post_move_processing();
-}
-
-bool
-Text_engraver::do_try_request (Request*req_l)
-{
-  Musical_req *m = req_l->musical();
-  if (!m || ! m->text())
-       return false;
-  if (text_req_l_ && text_req_l_->equal_b (m))
-       return false;
-
-  text_req_l_ = m->text();
-  return true;
-}
-void
-Text_engraver::acknowledge_element (Score_elem_info i)
-{
-  if (text_p_ && i.elem_l_->name() == Note_column::static_name ()) 
-    {
-       text_p_->add_support (i.elem_l_);
-    }
-}
-void
-Text_engraver::do_process_requests()
-{
-  if (text_req_l_) 
-    {
-       text_p_ = new Text_item (text_req_l_->tdef_p_, text_req_l_->dir_i_); // ugh
-       announce_element (Score_elem_info (text_p_, text_req_l_));
-    }
-}
-void
-Text_engraver::do_pre_move_processing()
-{
-  if (text_p_) 
-    {
-       if (dir_i_ && !text_p_->dir_i_)
-           text_p_->dir_i_ = dir_i_;
-       Staff_symbol* s_l = get_staff_info().staff_sym_l_;
-       text_p_->set_staffsym (s_l);
-       typeset_element (text_p_);
-           
-       text_p_ = 0;
-    }
-}
-void
-Text_engraver::set_feature (Feature i)
-{
-  if (i.type_ == "vdir")       
-       dir_i_ = i.value_;
-}
-void
-Text_engraver::do_post_move_processing()
-{
-  text_req_l_ = 0;
-}
-
-IMPLEMENT_IS_TYPE_B1(Text_engraver,Engraver);
-ADD_THIS_ENGRAVER(Text_engraver);
index db87a8d152c7fc6e6365df5382ab9fa8ee4ff03d..876acfde39f0b0133970dd94aedf4fbb8fbc94fc 100644 (file)
@@ -14,9 +14,9 @@
 #include "molecule.hh"
 #include "lookup.hh"
 
 #include "molecule.hh"
 #include "lookup.hh"
 
-Text_item::Text_item (General_script_def*tdef_l, int d)
+Text_item::Text_item (General_script_def*tdef_l, Direction d) 
 {
 {
-  dir_i_ = d;
+  dir_ = d;
   fat_b_ = false;
   tdef_p_ = tdef_l->clone();
 }
   fat_b_ = false;
   tdef_p_ = tdef_l->clone();
 }
@@ -29,29 +29,29 @@ Text_item::~Text_item()
 void
 Text_item::do_pre_processing()
 {
 void
 Text_item::do_pre_processing()
 {
-  if (!dir_i_)
-       dir_i_ = -1;
+  if (!dir_)
+    dir_ = DOWN;
 }
 
 Interval
 }
 
 Interval
-Text_item::symbol_height()const
+Text_item::symbol_height() const
 {
 {
-  return tdef_p_->get_atom (paper(), dir_i_).sym_.dim.y ();
+  return tdef_p_->get_atom (paper(), dir_).sym_.dim.y ();
 }
   
 Molecule*
 Text_item::brew_molecule_p() const
 {
 }
   
 Molecule*
 Text_item::brew_molecule_p() const
 {
-  Atom a (tdef_p_->get_atom (paper(), dir_i_));
+  Atom a (tdef_p_->get_atom (paper(), dir_));
 
 
-/*
-  if ( fat_b_)
-       a.sym.dim.x = tdef_p_->width (paper());
-       */
+  /*
+    if (fat_b_)
+    a.sym.dim.x = tdef_p_->width (paper());
+    */
   Molecule* mol_p = new Molecule (a);
 
   Molecule* mol_p = new Molecule (a);
 
-  if (dir_i_<0)                // should do something better anyway.
-       mol_p->translate (-mol_p->extent().y ().left , Y_AXIS);
+  if (dir_<0)          // should do something better anyway.
+    mol_p->translate (-mol_p->extent().y ().left , Y_AXIS);
   mol_p->translate (pos_i_ * paper()->internote_f (), Y_AXIS);
   
   return mol_p;
   mol_p->translate (pos_i_ * paper()->internote_f (), Y_AXIS);
   
   return mol_p;
index 1ab46bbb62936350febad8e53f16cf1b31d872e8..edf430aa139de4973efeb92a00908e31fcb32566 100644 (file)
@@ -44,13 +44,13 @@ void
 Text_spanner::do_post_processing()
 {
   text_off_ = support_span_l_->center() +
 Text_spanner::do_post_processing()
 {
   text_off_ = support_span_l_->center() +
-       Offset (0,support_span_l_->dir_i_ * paper()->internote_f () * 4); // todo
+       Offset (0,support_span_l_->dir_ * paper()->internote_f () * 4); // todo
 }
 
 Molecule*
 Text_spanner::brew_molecule_p() const
 {
 }
 
 Molecule*
 Text_spanner::brew_molecule_p() const
 {
-  Atom tsym (spec_p_->get_atom (paper(),0));
+  Atom tsym (spec_p_->get_atom (paper(),CENTER));
   tsym.translate (text_off_);
 
   Molecule*output = new Molecule;
   tsym.translate (text_off_);
 
   Molecule*output = new Molecule;
@@ -61,13 +61,11 @@ Text_spanner::brew_molecule_p() const
 void
 Text_spanner::do_pre_processing()
 {
 void
 Text_spanner::do_pre_processing()
 {
-  right_col_l_ = support_span_l_->right_col_l_;
-  left_col_l_ = support_span_l_->left_col_l_;
-  assert (left_col_l_ && right_col_l_);
+  spanned_drul_ = support_span_l_->spanned_drul_;
 }
 
 Interval
 }
 
 Interval
-Text_spanner::height()const
+Text_spanner::height() const
 {
   return brew_molecule_p()->extent ().y ();
 }
 {
   return brew_molecule_p()->extent ().y ();
 }
index 660d1da9488fa05a8ec8c518e956e4e5c5876587..f1b3463c3111ba86023a819548b926d30e561973 100644 (file)
@@ -21,13 +21,13 @@ Tie_engraver::Tie_engraver()
   end_mom_ = -1;
   melodic_req_l_ = 0;
   end_melodic_req_l_ =0;
   end_mom_ = -1;
   melodic_req_l_ = 0;
   end_melodic_req_l_ =0;
-  dir_i_ = 0;
+  dir_ = CENTER;
 }
 
 void
 Tie_engraver::sync_features()
 {
 }
 
 void
 Tie_engraver::sync_features()
 {
-  dir_i_ = get_feature ("vdir");
+  dir_ = Direction (int (get_feature ("vdir")));
 }
   
 
 }
   
 
@@ -82,14 +82,14 @@ Tie_engraver::acknowledge_element (Score_elem_info i)
     {
        if (tie_p_) 
          {
     {
        if (tie_p_) 
          {
-           tie_p_->set_head (-1, (Note_head*)i.elem_l_->item());
+           tie_p_->set_head (LEFT, (Note_head*)i.elem_l_->item());
            melodic_req_l_ = i.req_l_->musical()->melodic ();
          }
 
        if (end_tie_p_) 
          {
            melodic_req_l_ = i.req_l_->musical()->melodic ();
          }
 
        if (end_tie_p_) 
          {
-           end_tie_p_->set_head (1, (Note_head*)i.elem_l_->item());
-           if (!Melodic_req::compare ( *end_melodic_req_l_, *melodic_req_l_))
+           end_tie_p_->set_head (RIGHT, (Note_head*)i.elem_l_->item());
+           if (!Melodic_req::compare (*end_melodic_req_l_, *melodic_req_l_))
                end_tie_p_->same_pitch_b_ = true;
            announce_element (Score_elem_info (end_tie_p_,end_req_l_));
          }
                end_tie_p_->same_pitch_b_ = true;
            announce_element (Score_elem_info (end_tie_p_,end_req_l_));
          }
@@ -101,8 +101,8 @@ Tie_engraver::do_pre_move_processing()
 {
   if (end_tie_p_) 
     {
 {
   if (end_tie_p_) 
     {
-       if (dir_i_)
-           end_tie_p_->dir_i_ =  dir_i_;
+       if (dir_)
+           end_tie_p_->dir_ =  dir_;
        
        typeset_element (end_tie_p_);
        end_tie_p_ =0;
        
        typeset_element (end_tie_p_);
        end_tie_p_ =0;
@@ -124,7 +124,7 @@ void
 Tie_engraver::set_feature (Feature f)
 {
   if (f.type_ == "vdir")
 Tie_engraver::set_feature (Feature f)
 {
   if (f.type_ == "vdir")
-       dir_i_ = f.value_;
+       dir_ = Direction (int (f.value_));
 }
 
 
 }
 
 
index ba7d75a3b8fcc523428a61eec775e122f1152bff..190618869bdfcb7f9fdfbeb2606c08253c554061 100644 (file)
 
 
 void
 
 
 void
-Tie::set_head (int x_pos, Note_head * head_l)
+Tie::set_head (Direction d, Note_head * head_l)
 {
 {
-  if (x_pos >0) 
-    {
-       assert (!right_head_l_);
-       right_head_l_ = head_l;
-    }
-  else 
-    {
-       assert (!left_head_l_);
-       left_head_l_ = head_l;
-    }
+  assert (!head_l_drul_[d]);
+  head_l_drul_[d] = head_l;
+
   add_dependency (head_l);
 }
 
 Tie::Tie()
 {
   add_dependency (head_l);
 }
 
 Tie::Tie()
 {
-  right_head_l_ =0;
-  left_head_l_ =0;
+  head_l_drul_[RIGHT] =0;
+  head_l_drul_[LEFT] =0;
   same_pitch_b_ =false;
 }
 
 void
 Tie::set_default_dir()
 {
   same_pitch_b_ =false;
 }
 
 void
 Tie::set_default_dir()
 {
-  int m= (left_head_l_->position_i_ + right_head_l_->position_i_) /2 ;
-  dir_i_ =  (m < 5)? -1:1;                     // ugh
+  int m= (head_l_drul_[LEFT]->position_i_ + head_l_drul_[RIGHT]->position_i_) /2 ;
+  dir_ =  (m < 5)? DOWN : UP;  // UGH
 }
   
 
 void
 Tie::do_add_processing()
 {
 }
   
 
 void
 Tie::do_add_processing()
 {
-  assert (left_head_l_ && right_head_l_);
-  left_col_l_ = left_head_l_ -> pcol_l_;
-  right_col_l_ = right_head_l_ -> pcol_l_;
+  assert (head_l_drul_[LEFT] && head_l_drul_[RIGHT]);
+  set_bounds(LEFT,head_l_drul_[LEFT]);
+  set_bounds(RIGHT,head_l_drul_[RIGHT]);
 }
 
 }
 
-/**
-  This is already getting hairy. Should use Note_head *heads[2]
- */
 void
 Tie::do_post_processing()
 {
 void
 Tie::do_post_processing()
 {
-  assert (left_head_l_ || right_head_l_);
-  left_pos_i_ =  (left_head_l_)? 
-       left_head_l_->position_i_ : right_head_l_->position_i_;
-  right_pos_i_ = (right_head_l_) ? 
-       right_head_l_->position_i_ : left_head_l_->position_i_;
-  if ( right_head_l_ && right_head_l_->extremal_i_) 
+  assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
+
+  Direction d = LEFT;
+  do 
     {
     {
-       right_pos_i_ += 2*dir_i_;
-       right_dx_f_ -= 0.25;
+      pos_i_drul_[d] =  (head_l_drul_[d])? 
+       head_l_drul_[d]->position_i_ : head_l_drul_[(Direction)-d]->position_i_;
     }
     }
-  else
-       right_dx_f_ -= 0.5;
+  while ((d *= -1) != LEFT);
 
 
-  if (left_head_l_ && left_head_l_->extremal_i_) 
+  do 
     {
     {
-       left_pos_i_ += 2*dir_i_;
-       left_dx_f_ += 0.25;
+      if (head_l_drul_[d] && head_l_drul_[d]->extremal_i_) 
+       {
+         pos_i_drul_[d] += 2*dir_;
+         dx_f_drul_[d] += d * 0.25;
+       }
+      else
+       dx_f_drul_[d] += d*0.5;
     }
     }
-  else
-       left_dx_f_ += 0.5;
-  
-  if (!right_head_l_)
-       right_pos_i_ = left_pos_i_;
-  if (! left_head_l_)
-       left_pos_i_ = right_pos_i_;
+  while ((d *= -1) != LEFT);
+
+  do 
+    {
+      if (!head_l_drul_[d])
+       pos_i_drul_[d] = pos_i_drul_[(Direction)-d];
+    } 
+  while ((d *= -1) != LEFT);
 }
 
 
 }
 
 
@@ -91,10 +83,10 @@ void
 Tie::do_substitute_dependency (Score_elem*o, Score_elem*n)
 {
   Note_head *new_l =n?(Note_head*)n->item():0;
 Tie::do_substitute_dependency (Score_elem*o, Score_elem*n)
 {
   Note_head *new_l =n?(Note_head*)n->item():0;
-  if (o->item() == left_head_l_)
-       left_head_l_ = new_l;
-  else if (o->item() == right_head_l_)
-       right_head_l_ = new_l;
+  if (o->item() == head_l_drul_[LEFT])
+    head_l_drul_[LEFT] = new_l;
+  else if (o->item() == head_l_drul_[RIGHT])
+    head_l_drul_[RIGHT] = new_l;
 }
 
 
 }
 
 
index b60d007ede28e403b3b1bdcf33e6ca4155b85591..76e05b5f202d970f1187e565d629eb4e264816ed 100644 (file)
@@ -10,7 +10,7 @@
 #include "debug.hh"
 
 String
 #include "debug.hh"
 
 String
-Time_description::str()const
+Time_description::str() const
 {
   String s ("Time_description { ");
   if (cadenza_b_)
 {
   String s ("Time_description { ");
   if (cadenza_b_)
@@ -62,7 +62,7 @@ Time_description::Time_description()
   whole_in_measure_ =0;
   one_beat_ = Moment (1,4);
   when_ = 0;
   whole_in_measure_ =0;
   one_beat_ = Moment (1,4);
   when_ = 0;
-  bars_i_ = 0;
+  bars_i_ = 1;                 // musician start counting at 1
   cadenza_b_ = false;
 }
 
   cadenza_b_ = false;
 }
 
@@ -73,7 +73,7 @@ Time_description::add (Moment dt)
   when_ +=  dt;
   whole_in_measure_ += dt;
        
   when_ +=  dt;
   whole_in_measure_ += dt;
        
-  while ( !cadenza_b_ && whole_in_measure_ >= whole_per_measure_) 
+  while (!cadenza_b_ && whole_in_measure_ >= whole_per_measure_) 
     {
        whole_in_measure_ -= whole_per_measure_;
        bars_i_ ++;
     {
        whole_in_measure_ -= whole_per_measure_;
        bars_i_ ++;
@@ -100,7 +100,7 @@ Time_description::allow_meter_change_b()
   error messages if not possible, "" if possible
   */
 String
   error messages if not possible, "" if possible
   */
 String
-Time_description::try_set_partial_str (Moment p)const
+Time_description::try_set_partial_str (Moment p) const
 {
   if (p<Rational (0))
        return ("Partial must be non-negative");
 {
   if (p<Rational (0))
        return ("Partial must be non-negative");
@@ -116,7 +116,7 @@ Time_description::setpartial (Moment p)
 }
 
 Moment
 }
 
 Moment
-Time_description::barleft()const
+Time_description::barleft() const
 {
   assert (!cadenza_b_);
   return whole_per_measure_-whole_in_measure_;
 {
   assert (!cadenza_b_);
   return whole_per_measure_-whole_in_measure_;
index 251c8065364562b16242cd7a87db3aa15a1ba1f5..f27e9f92befb02db8014ac3fb7f887886e05c796 100644 (file)
@@ -5,8 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-#if 0
-
+#include "score-grav.hh"
 #include "timing-grav.hh"
 #include "command-request.hh"
 
 #include "timing-grav.hh"
 #include "command-request.hh"
 
@@ -23,5 +22,123 @@ Timing_engraver::fill_staff_info (Staff_info &inf)
   inf.rhythmic_C_ = &default_grouping_;
 }
 
   inf.rhythmic_C_ = &default_grouping_;
 }
 
+bool
+Timing_engraver::do_try_request(Request*r)
+{
+  Command_req * c = r->command();
+  if (!(c && c->timing()))
+    return false;
+  for (int i=0; i < timing_req_l_arr_.size (); i++) 
+    {
+      if (timing_req_l_arr_[i]->equal_b(r))
+       return true;
+      if (timing_req_l_arr_[i]->name() == r->name()) 
+       {
+         r->warning ("conflicting timing request");
+         return false;
+       }
+    }
+  
+  timing_req_l_arr_.push(c->timing());
+  return true;
+}
+
+Meter_change_req*
+Timing_engraver::meter_req_l() const
+{
+  Meter_change_req *m_l=0;
+  for (int i=0; !m_l && i < timing_req_l_arr_.size (); i++) 
+    {
+      m_l=timing_req_l_arr_[i]->meterchange();
+    }
+  return m_l;  
+}
+
+void
+Timing_engraver::do_process_requests()
+{
+  for (int i=0; i < timing_req_l_arr_.size (); i++) 
+    {
+      Timing_req * tr_l = timing_req_l_arr_[i];
+      Meter_change_req *m_l = tr_l->meterchange();
+      if (m_l) 
+       {
+         int b_i= m_l->beats_i_;
+         int o_i = m_l->one_beat_i_;
+         if (! time_.allow_meter_change_b())
+           tr_l->warning ("Meter change not allowed here");
+         else
+           {
+             time_.set_meter (b_i, o_i);
+             default_grouping_ = 
+               Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i);
+           }
+       }
+      else if (tr_l->partial()) 
+       {
+         Moment m = tr_l->partial()->duration_;
+         String error = time_.try_set_partial_str (m);
+         if (error != "") 
+           {
+             tr_l->warning (error);
+           }
+         else 
+           time_.setpartial (m);
+       }
+      else if (tr_l->barcheck()) 
+       {
+         if (time_.whole_in_measure_) 
+           {
+             tr_l ->warning ("Barcheck failed");
+           
+             time_.whole_in_measure_ = 0; // resync
+             time_.error_b_ = true;
+           }
+
+       }
+      else if (tr_l->cadenza()) 
+       {
+         time_.set_cadenza (tr_l->cadenza()->on_b_);
+
+       }
+      else if (tr_l->measuregrouping()) 
+       {
+         default_grouping_ = 
+           parse_grouping (tr_l->measuregrouping()->beat_i_arr_,
+                           tr_l->measuregrouping()->elt_length_arr_);
+
+       }
+    }
+}
+
+
+void
+Timing_engraver::do_pre_move_processing()
+{
+  timing_req_l_arr_.set_size (0);
+  Engraver_group_engraver * grav_l = daddy_grav_l_;
+  while (grav_l->daddy_grav_l_) 
+    {
+      grav_l = grav_l->daddy_grav_l_;
+    }
+  
+  assert (grav_l->name() == Score_engraver::static_name ());
+  if (!time_.cadenza_b_)
+    ((Score_engraver*)grav_l)->add_moment_to_process (time_.next_bar_moment());
+}
+
+IMPLEMENT_IS_TYPE_B1(Timing_engraver, Engraver);
+ADD_THIS_ENGRAVER(Timing_engraver);
+
+void
+Timing_engraver::do_creation_processing()
+{
+  time_.when_ = get_staff_info().when ();
+}
+
+void
+Timing_engraver::do_post_move_processing()
+{
+  time_.add (get_staff_info().when ()  - time_.when_);
+}
 
 
-#endif
index b902387529c5c0bd43db60d284304f3a3e580967..642c9b94012a5b3630fee15b514956929e4cad1f 100644 (file)
@@ -24,7 +24,7 @@ Translator::try_request (Request*)
 
 
 void
 
 
 void
-Translator::print()const
+Translator::print() const
 {
 
 }
 {
 
 }
index 2ddc1a29c6961a59b7ec43ad604010202af227fc..02d1823b25b71621aa14732001f151472ac670cc 100644 (file)
@@ -48,7 +48,7 @@ Vertical_align_element::do_post_processing()
     }
 
   Real where_f=0;
     }
 
   Real where_f=0;
-  for ( int i=0 ;  i < elem_l_arr_.size(); i++) 
+  for (int i=0 ;  i < elem_l_arr_.size(); i++) 
     {
        elem_l_arr_[i]->translate (- dims[i][1] - where_f, Y_AXIS);
        where_f += dims[i].length();
     {
        elem_l_arr_[i]->translate (- dims[i][1] - where_f, Y_AXIS);
        where_f += dims[i].length();
@@ -56,7 +56,7 @@ Vertical_align_element::do_post_processing()
 }
 
 bool
 }
 
 bool
-Vertical_align_element::contains_b (Score_elem const *e)const
+Vertical_align_element::contains_b (Score_elem const *e) const
 {
   return elem_l_arr_.find_l (e);
 }
 {
   return elem_l_arr_.find_l (e);
 }
index dcaaf028bd7a677c1f934143afdf739a7afaf151..65fcceec2dfedbc5954876cc540c6deee2cda894 100644 (file)
@@ -6,7 +6,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-
+#include "p-col.hh"
 #include "vertical-align-grav.hh"
 #include "vertical-align-spanner.hh"
 
 #include "vertical-align-grav.hh"
 #include "vertical-align-spanner.hh"
 
@@ -19,14 +19,14 @@ void
 Vertical_align_engraver::do_creation_processing()
 {
   valign_p_ =new Vertical_align_spanner;
 Vertical_align_engraver::do_creation_processing()
 {
   valign_p_ =new Vertical_align_spanner;
-  valign_p_->left_col_l_ = get_staff_info().command_pcol_l () ;
+  valign_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_elem_info (valign_p_ , 0));
 }
 
 void
 Vertical_align_engraver::do_removal_processing()
 {
   announce_element (Score_elem_info (valign_p_ , 0));
 }
 
 void
 Vertical_align_engraver::do_removal_processing()
 {
-  valign_p_->right_col_l_ = get_staff_info().command_pcol_l ();
+  valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (valign_p_);
   valign_p_ =0;
 }
   typeset_element (valign_p_);
   valign_p_ =0;
 }
@@ -34,13 +34,13 @@ Vertical_align_engraver::do_removal_processing()
 void
 Vertical_align_engraver::acknowledge_element (Score_elem_info i)
 {
 void
 Vertical_align_engraver::acknowledge_element (Score_elem_info i)
 {
-  if ( i.origin_grav_l_arr_.size() == 2 && 
-        i.elem_l_->is_type_b (Vertical_group_element::static_name()) &&
-        !i.elem_l_->axis_group_l_a_[Y_AXIS]  
-          {
-       assert (!valign_p_->contains_b (i.elem_l_));
+  if (i.origin_grav_l_arr_.size() == 2 && 
+       i.elem_l_->is_type_b (Vertical_group_element::static_name()) &&
+       !i.elem_l_->axis_group_l_a_[Y_AXIS]
+    {
+      assert (!valign_p_->contains_b (i.elem_l_));
 
 
-       valign_p_->add ( i.elem_l_);
+      valign_p_->add (i.elem_l_);
     }
 }
 
     }
 }
 
index 66235afb14c13dcaf43796fc4d610cf9faef2981..927d9983e791c77ee94e7f9c37d217cd202a933a 100644 (file)
@@ -16,7 +16,7 @@
 
 Voice_group_engravers::Voice_group_engravers()
 {
 
 Voice_group_engravers::Voice_group_engravers()
 {
-  dir_i_ =0;
+  dir_ =CENTER;
 }
 
 bool
 }
 
 bool
@@ -25,11 +25,11 @@ Voice_group_engravers::do_try_request (Request*r_l)
   Command_req* c_l = r_l->command();
   if (c_l&& c_l->groupfeature()) 
     {
   Command_req* c_l = r_l->command();
   if (c_l&& c_l->groupfeature()) 
     {
-       Feature f;
-       f.type_ = c_l->groupfeature()->type_str_;
-       f.value_ = c_l->groupfeature()->value_str_;
-       set_feature (f);
-       return true;
+      Feature f;
+      f.type_ = c_l->groupfeature()->type_str_;
+      f.value_ = c_l->groupfeature()->value_str_;
+      set_feature (f);
+      return true;
     }
   return Engraver_group_engraver::do_try_request (r_l);
 }
     }
   return Engraver_group_engraver::do_try_request (r_l);
 }
@@ -52,7 +52,7 @@ Scalar
 Voice_group_engravers::get_feature (String f)
 {
   if (f == "vdir")
 Voice_group_engravers::get_feature (String f)
 {
   if (f == "vdir")
-       return dir_i_;
+    return dir_;
   Engraver_group_engraver::get_feature (f);
 }
 
   Engraver_group_engraver::get_feature (f);
 }
 
diff --git a/lily/voice-iterator.cc b/lily/voice-iterator.cc
new file mode 100644 (file)
index 0000000..b8318e2
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+  voice-iter.cc -- implement Voice_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "translator.hh"
+#include "debug.hh"
+#include "voice-iterator.hh"
+#include "music-list.hh"
+
+
+void
+Voice_iterator::do_print() const
+{
+  if (iter_p_)
+    iter_p_->print();
+}
+
+Voice_iterator::Voice_iterator (Voice const*v)
+  : PCursor<Music*> (v->music_p_list_)
+{
+  here_mom_ = v->offset_mom_;
+  voice_C_ = v;
+  iter_p_ =0;
+}
+
+void
+Voice_iterator::construct_children()
+{
+  while (PCursor<Music*>::ok()) 
+    {
+      start_next_element();
+      if (!iter_p_->ok()) 
+       {
+         leave_element();
+       }
+      else 
+       {
+         set_voice_translator();
+         break;
+       }
+    }
+}
+
+void 
+Voice_iterator::leave_element()
+{
+  delete iter_p_;
+  iter_p_ =0;
+  MInterval elt_time = ptr()->time_int ();
+  if (!elt_time.empty_b())
+    here_mom_ += elt_time.length();
+  PCursor<Music*>::next();
+}
+
+void
+Voice_iterator::start_next_element()
+{
+  assert (!iter_p_);
+  iter_p_ = get_iterator_p (ptr());
+}
+
+void
+Voice_iterator::set_voice_translator()
+{
+  if (iter_p_->report_to_l()->depth_i () > report_to_l ()->depth_i ())
+    set_translator (iter_p_->report_to_l());
+}
+
+Voice_iterator::~Voice_iterator()
+{
+  assert (! iter_p_);
+}
+
+
+IMPLEMENT_IS_TYPE_B1(Voice_iterator,Music_iterator);
+
+void
+Voice_iterator::process_and_next (Moment until)
+{
+  while (1) 
+    {
+      Moment local_until = until - here_mom_;
+      while (iter_p_->ok()) 
+       {
+         Moment here = iter_p_->next_moment();
+         if (here != local_until)
+           goto loopexit;
+           
+         iter_p_->process_and_next (local_until);
+       }
+
+      if (!iter_p_->ok()) 
+       {
+         leave_element();
+         
+         if (PCursor<Music*>::ok()) 
+           {
+             start_next_element();
+             set_voice_translator();
+           }
+         else 
+           {
+             goto loopexit;
+           }
+       }
+    }
+
+loopexit:
+
+  Music_iterator::process_and_next (until);
+}
+
+Moment
+Voice_iterator::next_moment() const
+{
+  return iter_p_->next_moment() + here_mom_;
+}
+
+bool
+Voice_iterator::ok() const
+{
+  return iter_p_;
+}
+
+
index beddf0d7531b1b3a658b8b6bcb143933f6172525..5814012ca0b7f1de924335e30571e52b93f7568f 100644 (file)
 
    */
 Array<Col_hpositions>
 
    */
 Array<Col_hpositions>
-Word_wrap::do_solve()const
+Word_wrap::do_solve() const
 {
   problem_OK();
   
 {
   problem_OK();
   
-  PCursor<PCol*> curcol (pscore_l_->col_p_list_.top());
+  PCursor<Paper_column*> curcol (pscore_l_->col_p_list_.top());
   Array<Col_hpositions> breaking;
   Line_of_cols breakpoints (find_breaks());
   assert (breakpoints.size()>=2);
 
   int break_idx_i=0;                   
   Array<Col_hpositions> breaking;
   Line_of_cols breakpoints (find_breaks());
   assert (breakpoints.size()>=2);
 
   int break_idx_i=0;                   
-  while ( break_idx_i < breakpoints.size() -1) 
+  while (break_idx_i < breakpoints.size() -1) 
     {
     {
-       Col_hpositions minimum;
-       Col_hpositions current;
+      Col_hpositions minimum;
+      Col_hpositions current;
 
       // do  another line
 
       // do  another line
-       PCol *post = breakpoints[break_idx_i]->postbreak_p_;
-       current.add (post);
-       curcol++;               // skip the breakable.
-       break_idx_i++;
+      Paper_column *post = breakpoints[break_idx_i]->postbreak_l();
+      current.add (post);
+      curcol++;                // skip the breakable.
+      break_idx_i++;
 
 
-       while (break_idx_i < breakpoints.size()) 
-         {
+      while (break_idx_i < breakpoints.size()) 
+       {
        
        
-           // add another measure.
-           while (breakpoints[break_idx_i] != curcol.ptr())
-             {
-               current.add (curcol);
-               curcol++;
-             }
-           current.add (breakpoints[break_idx_i]->prebreak_p_);
-
-           current.spacer_l_ = generate_spacing_problem (current.cols);
-
-           // try to solve
-           if (!feasible (current.cols)) 
-             {
-               if (!minimum.cols.size()) 
-                 {
-                   warning ("Ugh, this measure is too long, breakpoint: "
-                         + String (break_idx_i) +
-                       " (generating stupido solution)");
-                   current.stupid_solution();
-                   current.energy_f_ = - 1; // make sure we break out.
-                 }
-               else
-                   current.energy_f_ = infinity_f;     // make sure we go back
-             }
-           else 
-             {
+         // add another measure.
+         while (breakpoints[break_idx_i] != curcol.ptr())
+           {
+             current.add (curcol);
+             curcol++;
+           }
+         current.add (breakpoints[break_idx_i]->prebreak_l());
+
+         current.spacer_l_ = generate_spacing_problem (current.cols);
+
+         // try to solve
+         if (!feasible (current.cols)) 
+           {
+             if (!minimum.cols.size()) 
+               {
+                 warning ("Ugh, this measure is too long, breakpoint: "
+                          + String (break_idx_i) +
+                          " (generating stupido solution)");
+                 current.stupid_solution();
+                 current.energy_f_ = - 1; // make sure we break out.
+               }
+             else
+               current.energy_f_ = infinity_f; // make sure we go back
+           }
+         else 
+           {
                
                
-               current.solve_line();
-               current.print();
-             }
-
-           delete current.spacer_l_;
-           current.spacer_l_ =0;
-
-           // update minimum, or backup.
-           if (current.energy_f_ < minimum.energy_f_ || current.energy_f_ < 0) 
-             {
-               minimum = current;
-             }
-           else {              // we're one col too far.
-               break_idx_i--;
-               while (curcol.ptr() != breakpoints[break_idx_i])
-                   curcol --;
-               break;          // do the next line.
-             }
-
-
-           // add nobreak version of breakable column
-           current.cols.top()=breakpoints[break_idx_i];
-           curcol ++;
-           break_idx_i++;
+             current.solve_line();
+             current.print();
+           }
+
+         delete current.spacer_l_;
+         current.spacer_l_ =0;
+
+         // update minimum, or backup.
+         if (current.energy_f_ < minimum.energy_f_ || current.energy_f_ < 0) 
+           {
+             minimum = current;
+           }
+         else {                // we're one col too far.
+           break_idx_i--;
+           while (curcol.ptr() != breakpoints[break_idx_i])
+             curcol --;
+           break;              // do the next line.
          }
 
          }
 
-       *mlog << "[" <<break_idx_i<<"]"<<flush;
-       breaking.push (minimum);
+
+         // add nobreak version of breakable column
+         current.cols.top()=breakpoints[break_idx_i];
+         curcol ++;
+         break_idx_i++;
+       }
+
+      *mlog << "[" <<break_idx_i<<"]"<<flush;
+      breaking.push (minimum);
     }
   print_stats();
   return breaking;
     }
   print_stats();
   return breaking;
index edf3e37143ee6f0e160c22caeaa7c54401d37ef3..c5943874c70e8b22855523dcff29d1773a4557c9 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title: LilyPond
 Begin3
 Title: LilyPond
-Version: 0.1.10
-Entered-date: 20AUG97
+Version: 0.1.11
+Entered-date: 30AUG97
 Description:   GNU LilyPond is a program which converts music
                definition files into visual or auditive output: it can
                typeset formatted sheet music to a TeX file and and
 Description:   GNU LilyPond is a program which converts music
                definition files into visual or auditive output: it can
                typeset formatted sheet music to a TeX file and and
@@ -14,8 +14,8 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps
-       340k lilypond-0.1.10.tar.gz 
+       340k lilypond-0.1.11.tar.gz 
 Original-site: pcnov095.win.tue.nl /pub/lilypond/
 Original-site: pcnov095.win.tue.nl /pub/lilypond/
-       340k lilypond-0.1.10.tar.gz 
+       340k lilypond-0.1.11.tar.gz 
 Copying-policy: GPL
 End
 Copying-policy: GPL
 End
index 54021e87451c1619a6d335767c840eb0d3a7249e..d9993b4a8778baeabd4d53d7986e7300a9b5531e 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
 Name: lilypond
-Version: 0.1.10
+Version: 0.1.11
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.10.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.11.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
@@ -29,7 +29,7 @@ make -C Documentation gifs
 make prefix="$RPM_BUILD_ROOT/usr" install
 %files
 %doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README 
 make prefix="$RPM_BUILD_ROOT/usr" install
 %files
 %doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README 
-%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/gallina.ly input/gallina.tex input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen-16.ly input/standchen-20.ly input/standchen-20.tex input/standchen-part.ly input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wohltemperirt.ly Documentation/mudela-course.doc Documentation/mudela-man.doc 
+%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/fugue1.ly input/gallina.ly input/gallina.tex input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/prelude1.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen-16.ly input/standchen-16.tex input/standchen-20.ly input/standchen-20.tex input/standchen-part.ly input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wohltemperirt.ly Documentation/mudela-course.doc Documentation/mudela-man.doc 
 %doc Documentation/out/lelie_logo.gif
 /usr/bin/convert-mudela
 /usr/bin/mudela-book
 %doc Documentation/out/lelie_logo.gif
 /usr/bin/convert-mudela
 /usr/bin/mudela-book
index 7aa8c8ce8be3d921beb312b74c9ced9810aa5a09..5b951dac39e8478efceec89703c960b7f8f7c7a3 100644 (file)
@@ -25,7 +25,7 @@ Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i)
   tracks_i_ = tracks_i;
   tempo_i_ = tempo_i;
   column_l_array_.push (new Mudela_column (this, Moment (0)));
   tracks_i_ = tracks_i;
   tempo_i_ = tempo_i;
   column_l_array_.push (new Mudela_column (this, Moment (0)));
-//  mudela_key_l_ = &key_c;
+  //  mudela_key_l_ = &key_c;
   mudela_key_l_ = 0;
   mudela_meter_l_ = &meter_4;
   mudela_tempo_l_ = &tempo_60;
   mudela_key_l_ = 0;
   mudela_meter_l_ = &meter_4;
   mudela_tempo_l_ = &tempo_60;
@@ -54,7 +54,7 @@ Mudela_score::find_column_l (Moment mom)
   // should do binary search
   for (int i = 0; i < column_l_array_.size (); i++ )
     if ( column_l_array_[i]->at_mom () == mom )
   // should do binary search
   for (int i = 0; i < column_l_array_.size (); i++ )
     if ( column_l_array_[i]->at_mom () == mom )
-        return column_l_array_[i];
+      return column_l_array_[i];
   return 0;
 #else
   int upper_i = max (0, column_l_array_.size () - 1);
   return 0;
 #else
   int upper_i = max (0, column_l_array_.size () - 1);
@@ -105,38 +105,38 @@ Mudela_score::output (String filename_str)
   
   // ugh, ugly midi type 1 fix
   if  ( (mudela_staff_p_list_.size() == 1) && !mudela_staff_p_list_.top()->number_i_)
   
   // ugh, ugly midi type 1 fix
   if  ( (mudela_staff_p_list_.size() == 1) && !mudela_staff_p_list_.top()->number_i_)
-       mudela_staff_p_list_.top()->number_i_ = 1;
+    mudela_staff_p_list_.top()->number_i_ = 1;
 
   int track_i = 0;
   Mudela_stream mudela_stream (filename_str);
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++) 
     {
 
   int track_i = 0;
   Mudela_stream mudela_stream (filename_str);
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++) 
     {
-       LOGOUT(NORMAL_ver) << "track " << track_i++ << ": " << flush;
-       i->output (mudela_stream);
-       mudela_stream << "\n";
-       LOGOUT(NORMAL_ver) << endl;
+      LOGOUT(NORMAL_ver) << "track " << track_i++ << ": " << flush;
+      i->output (mudela_stream);
+      mudela_stream << "\n";
+      LOGOUT(NORMAL_ver) << endl;
     }
 
   mudela_stream << "\\score{\n";
   if  (mudela_staff_p_list_.size() > 1)
     }
 
   mudela_stream << "\\score{\n";
   if  (mudela_staff_p_list_.size() > 1)
-       mudela_stream << "<\n\\multi 3;\n";
+    mudela_stream << "<\n\\multi 3;\n";
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++) 
     {
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++) 
     {
-       if  ( (mudela_staff_p_list_.size() != 1) 
+      if  ( (mudela_staff_p_list_.size() != 1) 
            &&  (i == mudela_staff_p_list_.top()))
            &&  (i == mudela_staff_p_list_.top()))
-           continue;
-       mudela_stream << "\\melodic{ ";
-       mudela_stream << "\\$" << i->id_str();
-       mudela_stream << " }\n";
+       continue;
+      mudela_stream << "\\melodic{ ";
+      mudela_stream << "\\$" << i->id_str();
+      mudela_stream << " }\n";
     }
   if  (mudela_staff_p_list_.size() > 1)
     }
   if  (mudela_staff_p_list_.size() > 1)
-       mudela_stream << ">\n";
+    mudela_stream << ">\n";
 
   mudela_stream << "\\paper{}\n";
 
   mudela_stream << "\\midi{\n";
 
   mudela_stream << "\\paper{}\n";
 
   mudela_stream << "\\midi{\n";
-       // let's not use silly 0 track
-       mudela_staff_p_list_.bottom()->mudela_tempo_p_->output (mudela_stream);
+  // let's not use silly 0 track
+  mudela_staff_p_list_.bottom()->mudela_tempo_p_->output (mudela_stream);
   mudela_stream << "}\n";
 
   mudela_stream << "}\n";
   mudela_stream << "}\n";
 
   mudela_stream << "}\n";
@@ -148,8 +148,8 @@ Mudela_score::process()
   LOGOUT(NORMAL_ver) << "\nProcessing..." << endl;
        
   LOGOUT(DEBUG_ver) << "columns\n";
   LOGOUT(NORMAL_ver) << "\nProcessing..." << endl;
        
   LOGOUT(DEBUG_ver) << "columns\n";
-//  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-//     LOGOUT(DEBUG_ver) << "At: " << i->at_mom() << "\n";
+  //  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
+  //   LOGOUT(DEBUG_ver) << "At: " << i->at_mom() << "\n";
 
   settle_columns();
   filter_tempo();
 
   settle_columns();
   filter_tempo();
@@ -160,9 +160,9 @@ Mudela_score::process()
   int track_i = 0;
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)  
     {
   int track_i = 0;
   for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)  
     {
-       LOGOUT(NORMAL_ver) << "track " << track_i++ << ": " << flush;
-       i->process();
-       LOGOUT(NORMAL_ver) << endl;
+      LOGOUT(NORMAL_ver) << "track " << track_i++ << ": " << flush;
+      i->process();
+      LOGOUT(NORMAL_ver) << endl;
     }
 }
 
     }
 }
 
@@ -178,8 +178,8 @@ Mudela_score::quantify_columns()
   // ugh
   if  (Duration_convert::no_quantify_b_s) 
     {
   // ugh
   if  (Duration_convert::no_quantify_b_s) 
     {
-       LOGOUT(NORMAL_ver) << "\nNOT Quantifying columns..." << endl;
-       return;
+      LOGOUT(NORMAL_ver) << "\nNOT Quantifying columns..." << endl;
+      return;
     }
 
   LOGOUT(NORMAL_ver) << "\nQuantifying columns..." << endl;
     }
 
   LOGOUT(NORMAL_ver) << "\nQuantifying columns..." << endl;
@@ -194,7 +194,7 @@ Mudela_score::quantify_columns()
   for  (int i = 0; i < column_l_array_.size(); i++) 
     {
       column_l_array_ [i]->at_mom_ =
   for  (int i = 0; i < column_l_array_.size(); i++) 
     {
       column_l_array_ [i]->at_mom_ =
-       s * Moment((int) ((column_l_array_ [i]->at_mom()) / s));
+       s * Moment( (int) ( (column_l_array_ [i]->at_mom()) / s));
 
       int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1;
       if (bar_i > current_bar_i) 
 
       int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1;
       if (bar_i > current_bar_i) 
@@ -209,23 +209,23 @@ Mudela_score::quantify_columns()
 void
 Mudela_score::quantify_durations()
 {
 void
 Mudela_score::quantify_durations()
 {
-//    LOGOUT(NORMAL_ver) << "\nQuantifying durations..." << endl;
+  //    LOGOUT(NORMAL_ver) << "\nQuantifying durations..." << endl;
 }
 
 void
 Mudela_score::settle_columns()
 {
 }
 
 void
 Mudela_score::settle_columns()
 {
-//    LOGOUT(NORMAL_ver) << "\nNOT Settling columns..." << endl;
-//    return;
+  //    LOGOUT(NORMAL_ver) << "\nNOT Settling columns..." << endl;
+  //    return;
   LOGOUT(NORMAL_ver) << "\nSettling columns..." << endl;
 
 #if 0
   assert (!column_l_array_.size());
   int n = mudela_column_p_list_.size();
   LOGOUT(NORMAL_ver) << "\nSettling columns..." << endl;
 
 #if 0
   assert (!column_l_array_.size());
   int n = mudela_column_p_list_.size();
-// huh?
-//    column_l_array_.set_size (n);
+  // huh?
+  //    column_l_array_.set_size (n);
   for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
   for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-       column_l_array_.push (*i);
+    column_l_array_.push (*i);
 #endif
 
   int n = column_l_array_.size();
 #endif
 
   int n = column_l_array_.size();
@@ -236,26 +236,26 @@ Mudela_score::settle_columns()
   Duration smallest_dur;
   smallest_dur.durlog_i_ =  6;
   Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur)
   Duration smallest_dur;
   smallest_dur.durlog_i_ =  6;
   Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur)
-       / Moment (2);
+    / Moment (2);
   for  (int i = 0; i < n; i++) 
     {
   for  (int i = 0; i < n; i++) 
     {
-       if  (!start_i) 
-         {
-           start_i = end_i = i;
-           start_mom = column_l_array_ [i]->at_mom();
-           continue;
-         }
-
-       // find all columns within noise's distance
-       while  ( (i < n)
-           &&  (column_l_array_ [i]->at_mom() - start_mom < noise_mom))
-           end_i = ++i;
-
-       // bluntly set all to time of first in group
-       for  (int j = start_i; j < end_i; j++)
-           column_l_array_ [j]->at_mom_ = start_mom;
-
-       start_i = end_i = 0;
+      if  (!start_i) 
+       {
+         start_i = end_i = i;
+         start_mom = column_l_array_ [i]->at_mom();
+         continue;
+       }
+
+      // find all columns within noise's distance
+      while  ( (i < n)
+              &&  (column_l_array_ [i]->at_mom() - start_mom < noise_mom))
+       end_i = ++i;
+
+      // bluntly set all to time of first in group
+      for  (int j = start_i; j < end_i; j++)
+       column_l_array_ [j]->at_mom_ = start_mom;
+
+      start_i = end_i = 0;
     }
 }
 
     }
 }
 
index 7de70076c35e764b4d5874332df6a89cc67e921b..6b2f4fc8fce4aa24df641f7a5b1ae10e1fe5a6e2 100644 (file)
@@ -18,9 +18,9 @@ class ostream;
 #include "plist.hh"
 #include "plist.tcc"
 
 #include "plist.hh"
 #include "plist.tcc"
 
-template IPL_INSTANTIATE(Mudela_item);
-template IPL_INSTANTIATE(Mudela_staff);
-template PL_INSTANTIATE(Mudela_voice);
-template IPL_INSTANTIATE(Mudela_voice);
-template IPL_INSTANTIATE(Mudela_column);
+template POINTERLIST_INSTANTIATE(Mudela_item);
+template POINTERLIST_INSTANTIATE(Mudela_staff);
+template POINTERLIST_INSTANTIATE(Mudela_voice);
+template POINTERLIST_INSTANTIATE(Mudela_voice);
+template POINTERLIST_INSTANTIATE(Mudela_column);