]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.68pre release/0.0.68pre
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 26 Jun 1997 16:22:36 +0000 (18:22 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 26 Jun 1997 16:22:36 +0000 (18:22 +0200)
257 files changed:
.dstreamrc
.version
ANNOUNCE
AUTHORS.text
Documentation/CodingStyle.pod
Documentation/MANIFESTO.pod
Documentation/Makefile
Documentation/faq.pod
Documentation/gnu-music.pod
Documentation/index.pod
Documentation/lilyliterature.pod
Documentation/mudela.pod
Documentation/other-packages.pod [new file with mode: 0644]
INSTALL.text
NEWS
TODO
bin/convert-mudela
bin/make_patch
bin/release
configure
configure.in
flower/full-storage.cc
flower/include/cursor.hh
flower/include/cursor.icc
flower/include/pcursor.hh
flower/include/virtual-methods.hh
init/register.ini
init/symbol.ini
init/table_sixteen.ini
input/cadenza.ly
input/collisions.ly
input/coriolan-alto.ly
input/kortjakje.ly
input/multi.ly [new file with mode: 0644]
input/scales.ly
input/scsii-menuetto.ly
input/toccata-fuga-E.ly
input/wohltemperirt.ly
lib/includable-lexer.cc
lib/include/moment.hh
lib/moment.cc
lily/.version
lily/Stable.make
lily/atom.cc
lily/bar-reg.cc
lily/bar.cc
lily/beam.cc
lily/bow.cc
lily/break-align-item.cc [new file with mode: 0644]
lily/clef-item.cc
lily/clef-reg.cc
lily/collision-reg.cc
lily/collision.cc
lily/command-request.cc
lily/complex-walker.cc [deleted file]
lily/crescendo.cc
lily/debug.cc
lily/dynamic-reg.cc
lily/elem-group-item.cc [new file with mode: 0644]
lily/elem-group.cc
lily/general-script-def.cc
lily/global-regs.cc
lily/head-reg.cc
lily/horizontal-align-item.cc [new file with mode: 0644]
lily/identifier.cc
lily/include/atom.hh [deleted file]
lily/include/bar-align-reg.hh [new file with mode: 0644]
lily/include/bar-reg.hh
lily/include/bar.hh
lily/include/beam.hh
lily/include/break-align-item.hh [new file with mode: 0644]
lily/include/clef-item.hh
lily/include/clef-reg.hh
lily/include/collision-reg.hh
lily/include/command-request.hh
lily/include/complex-walker.hh [deleted file]
lily/include/crescendo.hh
lily/include/dimen.hh
lily/include/dynamic-reg.hh
lily/include/elem-group-item.hh [new file with mode: 0644]
lily/include/elem-group.hh
lily/include/head-reg.hh
lily/include/horizontal-align-item.hh [new file with mode: 0644]
lily/include/identifier.hh
lily/include/input-music.hh [deleted file]
lily/include/input-register.hh
lily/include/input-score.hh [deleted file]
lily/include/input-staff.hh [deleted file]
lily/include/interpreter.hh [new file with mode: 0644]
lily/include/interpretor.hh [new file with mode: 0644]
lily/include/item.hh
lily/include/key-item.hh
lily/include/key-reg.hh
lily/include/lily-proto.hh
lily/include/local-key-reg.hh
lily/include/lyric-register.hh
lily/include/main.hh
lily/include/meter-reg.hh
lily/include/meter.hh
lily/include/midi-output.hh
lily/include/midi-walker.hh
lily/include/molecule.hh
lily/include/music-iterator.hh [new file with mode: 0644]
lily/include/music-list.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-reg.hh
lily/include/p-col.hh
lily/include/p-score.hh
lily/include/paper-def.hh
lily/include/pulk-voice.hh [deleted file]
lily/include/pulk-voices.hh [deleted file]
lily/include/register-group.hh
lily/include/register.hh
lily/include/request-column.hh [deleted file]
lily/include/request.hh
lily/include/rest-collision-reg.hh
lily/include/score-align-reg.hh [new file with mode: 0644]
lily/include/score-column.hh
lily/include/score-elem.hh
lily/include/score-halign-reg.hh [new file with mode: 0644]
lily/include/score-reg.hh [new file with mode: 0644]
lily/include/score-walker.hh [deleted file]
lily/include/score.hh
lily/include/scoreline.hh
lily/include/script-column.hh
lily/include/script-reg.hh
lily/include/slur-reg.hh
lily/include/slur.hh
lily/include/spanner-elem-group.hh
lily/include/spanner.hh
lily/include/staff-column.hh [deleted file]
lily/include/staff-info.hh
lily/include/staff-regs.hh
lily/include/staff-side.hh
lily/include/staff-sym-reg.hh
lily/include/staff-sym.hh
lily/include/staff-walker.hh [deleted file]
lily/include/staff.hh [deleted file]
lily/include/staffeleminfo.hh [deleted file]
lily/include/staffline.hh
lily/include/stem-beam-reg.hh
lily/include/stem.hh
lily/include/swallow-reg.hh
lily/include/symbol.hh
lily/include/text-reg.hh
lily/include/text-spanner.hh
lily/include/tie-reg.hh
lily/include/tie.hh
lily/include/vertical-align-elem.hh [new file with mode: 0644]
lily/include/voice-element.hh [deleted file]
lily/include/voice-group-regs.hh
lily/include/voice-regs.hh
lily/include/voice.hh [deleted file]
lily/include/walk-regs.hh [deleted file]
lily/input-music.cc [deleted file]
lily/input-register.cc
lily/input-score.cc [deleted file]
lily/input-staff.cc [deleted file]
lily/item.cc
lily/key-item.cc
lily/key-reg.cc
lily/lexer.l
lily/lily-version.cc
lily/local-key-item.cc
lily/local-key-reg.cc
lily/lyric-register.cc
lily/main.cc
lily/meter-reg.cc
lily/meter.cc
lily/midi-item.cc
lily/midi-output.cc
lily/midi-walker.cc
lily/molecule.cc
lily/music-iterator.cc [new file with mode: 0644]
lily/music-list.cc
lily/music.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-column-reg.cc
lily/note-column.cc
lily/note.cc
lily/notehead.cc
lily/p-col.cc
lily/p-score.cc
lily/paper-def.cc
lily/parser.y
lily/pulk-voice.cc [deleted file]
lily/pulk-voices.cc [deleted file]
lily/register-group.cc
lily/register.cc
lily/request-column.cc [deleted file]
lily/request.cc [new file with mode: 0644]
lily/rest-collision-reg.cc
lily/rest-collision.cc
lily/rest-column.cc
lily/score-align-reg.cc [new file with mode: 0644]
lily/score-align-regs.cc [new file with mode: 0644]
lily/score-elem.cc
lily/score-halign-reg.cc [new file with mode: 0644]
lily/score-reg.cc [new file with mode: 0644]
lily/score-walker.cc [deleted file]
lily/score.cc
lily/scoreline.cc
lily/scores.cc
lily/script-column.cc
lily/script-def.cc
lily/script-reg.cc
lily/script.cc
lily/slur-reg.cc
lily/slur.cc
lily/spanner-elem-group.cc
lily/spanner.cc
lily/staff-column.cc [deleted file]
lily/staff-info.cc
lily/staff-regs.cc
lily/staff-side.cc
lily/staff-sym-reg.cc
lily/staff-sym.cc
lily/staff-walker.cc [deleted file]
lily/staff.cc [deleted file]
lily/staffline.cc
lily/stem-beam-reg.cc
lily/stem.cc
lily/super-elem.cc
lily/swallow-reg.cc
lily/template1.cc
lily/template2.cc
lily/template3.cc
lily/template6.cc
lily/template7.cc
lily/template8.cc
lily/tex-slur.cc
lily/text-def.cc
lily/text-item.cc
lily/text-reg.cc
lily/text-spanner.cc
lily/tie-reg.cc
lily/tie.cc
lily/vertical-align-elem.cc [new file with mode: 0644]
lily/voice-element.cc [deleted file]
lily/voice-group-regs.cc
lily/voice-regs.cc
lily/voice.cc [deleted file]
lily/walk-regs.cc [deleted file]
make/Configure_variables.make.in
make/Targets.make
make/lilypond.lsm
make/lilypond.spec
mf/Makefile
tex/Makefile
tex/dimen.tex
tex/eglerdefs.tex [new file with mode: 0644]
tex/lilyponddefs.tex
tex/taupindefs.tex

index 7fd7b97e0a5054e9ab96769883fd89e9d72860ad..8087569c36d6b747db23e9792a23fd96f2f71587 100644 (file)
@@ -4,13 +4,13 @@ Dstream                       1
 File_path              1
 My_lily_lexer          1
 PCol                   0
-Score_column           1
-Ineq_constrained_qp    1
-Spacing_problem        1
-Colinfo                        1
-Mixed_qp               1
+Score_column           0
+Ineq_constrained_qp    0
+Spacing_problem        0
+Colinfo                        0
+Mixed_qp               0
 PScore                 0
-Idealspacing           1
+Idealspacing           0
 
 # yydebug
 InitParser             1
@@ -21,35 +21,35 @@ Declarations                1
 InitLexer              1
 Lexer                  1
 
-parse_duration         1
-parse_pitchmod         1
-Col_configuration      1
+parse_duration         0
+parse_pitchmod         0
+Col_configuration      0
 Request                        0
 Note_req               0
 Rhythmic_req           0
-Rest_req               1
-delete_identifiers     1
-Command                        1
-Staff_commands         1
-Stem                   1
-Staff                  1
-Score                  1
+Rest_req               0
+delete_identifiers     0
+Command                        0
+Staff_commands         0
+Stem                   0
+Staff                  0
+Score                  0
 Voice                  0
 Voice_element          0
-Input_cursor           1
-Commands_at            1
-Input_command          1
-Time_description       1
+Input_cursor           0
+Commands_at            0
+Input_command          0
+Time_description       0
 Melodic_req            0
-Midi_walker            1
-Stem_req               1
+Midi_walker            0
+Stem_req               0
 Group_change_req       0
-Script_req             1
-Colinfo                        1
-Word_wrap              1
+Script_req             0
+Colinfo                        0
+Word_wrap              0
 Text_req               0
-Script_def             1
+Script_def             0
 Text_def               0
-Paperdef               1
+Paperdef               0
 Symtable               1
 Symtables              1
index 7d6ac5a0ec425cd84b1468bdb35734a0451fe099..f39dbaa0d93f88a125d75afaa6b23f145f57a55a 100644 (file)
--- a/.version
+++ b/.version
@@ -1,7 +1,7 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 67
+TOPLEVEL_PATCH_LEVEL = 68
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL = pre
index 09c2e51cc13d8dc3d10dabd2a5d110e1f50a69eb..003b4845c9a1c593be0c63347174307c2df7fd0d 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,33 @@
 [DRAFT]
 
+       Born  .. 1997,
+
+               Lily
+
+       GNU LilyPond 0.1, daughter to 
+
+       Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
+
+Lily is a health baby weighing 330 kilobyte
+
+Visiting hours: 24hrs a day at ftp://, pictures & droppings at http://
+
+Congratulations to janneke & wendy, hanwen@stack.nl, jan@digicash.com
+
+**************************
+
+       I would like to dedicate this program to all friends that
+music got me. Those deserving special mention (In no particular order)
+Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn,
+Maartje, Suzanne, Ilse (gee, again?), and last (but certainly not
+least) Janneke!
+
+       HW
+
+[misschien wat monieks invoegen?]
+
+**************************
+
        Announcing
                        
        GNU LilyPond
index 8a086d315e25519c28cc0873265e22db4246dfc6..7187b9e4394747d9733ee318d3ccd100ec75c457 100644 (file)
@@ -61,6 +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
 
 
 
-19/May/97                LilyPond 0.0.67                        1
+19/May/97                LilyPond 0.0.68                        1
 
 
index 418575cd396f1b57dbefb3518e797c964d9a98f6..334cbbde63b94f73f3d1d1617c67226a99e9564f 100644 (file)
@@ -421,4 +421,14 @@ files, doing a release.
 
 Use them.
 
+The following generic identifications are used:
+
+       up == 1
+       left == -1
+       right == 1
+       down == -1
+
+Intervals are pictured lying on a horizontal numberline (Interval[-1]
+is the minimum)
+
 
index 04d220e96ea4ad3570ba920c0bb458258b192121..e15a09d517605036803712c210fc80856d9c6f27 100644 (file)
@@ -51,7 +51,6 @@ GNU LilyPond uses MusiXTeX fonts and TeX for its output. This is not a key
 issue: in a future version, GNU LilyPond might bypass TeX, but at the moment
 TeX is very convenient for producing output.
 
-
 =item *
 
 GNU LilyPond does not display notes directly, nor will it be rehacked to be
@@ -84,16 +83,22 @@ ongoing process, the most important criteria being:
 
 =item *
 
-define the (musical) message of the composer as unambiguously as possible,
+define the (musical) message of the composer as unambiguously as possible.
+
+This means that, given a piece Mudela, it should be possible for a
+program to play a reasonable interpretation of the piece.
+
+It also means that, given a piece of Mudela, it should be possible for a
+program to print a score of the piece.
 
 =item *
 
-be intuitive, and easily readable 
-(compared to, say, Musi*TeX input, or MIDI :-),
+be intuitive, and easily readable (compared to, say, Musi*TeX input,
+or MIDI :-),
 
 =item *
 
-be writable in ASCII with a simple texteditor, yfte(TM).
+be easily writable in ASCII with a simple texteditor, yfte(TM).
 
 =back
 
@@ -159,6 +164,6 @@ Bach multivoice organ pieces,
 
 =item *
 
-short excerpts to be used in musicological publications.
+Short excerpts to be used in musicological publications.
 
 =back
index 542425ec77452aa95b838f750d9b90d52d334cc0..d703adfd1adcd3ae6dd7f6a927a8e1eaacf45a62 100644 (file)
@@ -67,3 +67,5 @@ localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5
 localuninstall:
        rm -f $(mandir)/man1/lilypond.1
        rm -f $(mandir)/man1/convert-mudela.1
+
+xpms:
index 873b66b85053a0832671b2c1ab03022bc4eb0037..6be7d7d618a05d90d436b25165857264102eba37 100644 (file)
@@ -20,14 +20,22 @@ Q: Some of your neat scripts fail, what directories do you use:
 
 A:
        
-       ~/something
-         lilypond      # the directory as unpacked from the tarball
-         releases      # directory for .tar.gz releases
-         patches       # directory for patches between different releases
+       ~/something/
 
+which contains:
+
+         lilypond/     # the directory as unpacked from the tarball
+         releases/     # directory for .tar.gz releases
+         patches/      # directory for patches between different releases
+         test/
+       
 ~/something/lilypond/bin is in the PATH, and contains symlinks to the
 compiled executables.
 
+If you don't use patches, you'd probably want to symlink
+
+       lilypond -> lilypond-x.y.z
+
 =head2 Language: mudela
 
 Q: Why can't you type C<#c> in stead of C<cis> ?
@@ -49,6 +57,20 @@ in stead of:
        cis cis
        #c #c
 
+Why, you might ask? Because independently of how it was written, you
+would say that you are playing and reading "two C-sharp" notes.
+
+
+Q: What is C<cis> anyway
+
+A: C<cis> is the dutch naming for C-sharp. The notes are named
+a, b,.., g. The suffix -is means sharp, and -es flat. This system is
+common in a number of languages (such as swedish, dutch, german.)
+Certain other languages (such as English, French and Italian) just add
+the word for "sharp" to the notename.
+
+We chose the Dutch system, because we're dutch. You are free to chose
+whatever names you like; they are user definable.
 
 Q: I can type
 
index f0fe5fc7e5db2db6e93fb9209f31ef3955b4867e..977933a1a6be8eef42e804d1ce8dc9c285472860 100644 (file)
@@ -75,10 +75,8 @@ of use and power.
 
 =item A set of music fonts
 
-Preferably in Metafont, suited to both screen display and use on paper
-
-The copyright heritage of Musixtex is unclear.
-
+Preferably in Metafont, suited to both screen display and use on
+paper;  This is because the copyright heritage of {Opus,Musix}tex is unclear.
 
 =item A typesetting engine. 
 
index 93ba7ed85760c1cb1fd3fb65e0e5599df408e09d..c308cf944718d23cbed0ea1d92ae1ddf40afeeaa 100644 (file)
@@ -63,6 +63,13 @@ resources on music typesetting
 </a
 >
 
+=item *
+<a href=other-packages.html
+>
+Other packages for printing music.
+</a
+>
+
 =item *
 <a href=mi2mu.html
 >
index 1d88a768757c75f5f2c2b34bee8e0e20c08694b2..5293ff394525526a21ab4195dc37a2d733e7e159 100644 (file)
@@ -1,35 +1,40 @@
 =head1 NAME 
 
-Lily literature -- reading on music engraving
+Lily literature -- reading on music engraving/typesetting/etc.
 
 =head1 DESCRIPTION
 
 A list of resources on music printing/writing and engraving.  Please
-note that don't have access to most material (except Wanske and a 
-library copy of Chlapik)
+note that don't have access to most material. 
 
+[What I do know, I've commented inside brackets. They are just
+my personal comments, not to be taken too seriously]
 
 More on GNU Music: http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
 
+Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
 
 =head2 References
 
-[partly by Mark Basinski <basinski@arizona.edu>]
-
-Chlapik, Herbert. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
-ISBN 3-9000 035-96-2.
-
 Wanske, Helene.  ``Musiknotation --- Von der Syntax des Notenstichs
-zum EDV-gesteuerten-1 Notensatz'', Schott-Verlag, Mainz 1988.  ISBN
-3-7957-2886-x. 1) e(lektronischen) D(aten)v(erarbeitung).
+zum EDV-gesteuerten Notensatz'', Schott-Verlag, Mainz 1988.  ISBN
+3-7957-2886-x. 
+
+[I. A very thorough overview of engraving practices of various
+craftsmen. It includes detailed specs of characters, dimensions etc.
+II. a thorough overview of a (by now antiquated) automated system
+called Ikarus; EDV Means e(lektronischen) D(aten)v(erarbeitung),
+electronic data processing]
 
 Maxwell Weaner and Walter Boelke, Standard Music Notation Practice,
 revised edition by Arnold Broido and Daniel Dorff. Music Publisher's
 Association of the United States Inc., 1993.
+
 W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
 ``Document Manipulation and Typography'', J.C. van Vliet (ed) 1988.
 
+[This generalizes TeX's breaking algorithm to music]
+
 Ross, Ted. ``Teach yourself the art of music engraving and
 processing'' (3rd edition). Hansen House, Miami Beach, FL.
 
@@ -45,15 +50,88 @@ Read, Gardner. ``Modern Rhythmic Notation.'' Indiana University Press, 1978.
 
 Read, Gardner. ``Music Notation'' (2nd edition). Taplinger Publishing,
 New York.
+
 [This is as close to the ``standard'' reference work for music notation issues
 as one is likely to get.]
 
-The University of Colorado Music Engraving page.
-http://www.cc.colorado.edu/cgi-bin/mfs/01/Dept/MU/Musicpress/Welcome.html
+=head2 Related papers
+
+David A.  Gomberg; A Computer-oriented System for Music Printing.
+Computers and the Humanities, Vol.11, pp 63-80.
+
+J. Gourlay, ``Spacing a Line of Music,'' Technical Report
+OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+The Ohio State University, 1987.
+
+J. Gourlay, A. Parrish, D. Roush, F. Sola, Y. Tien, ``Computer
+Formatting of Music,'' Technical Report OSU-CISRC-2/87-TR3,
+Department of Computer and Information Science, The Ohio State
+University, 1987.
+
+W. Hegazy, ``On the Implementation of the MusiCopy Language
+Processor,'' Technical Report OSU-CISRC-10/87-TR34, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+A. Parrish and J. Gourlay, ``Computer Formatting of Musical
+Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department
+of Computer and Information Science, The Ohio State University, 1987.
+
+D. Roush, ``Music Formatting Guidelines,'' Technical Report
+OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
+The Ohio State University, 1988.
+
+F. Sola, ``Computer Design of Musical Slurs, Ties and Phrase
+Marks,'' Technical Report OSU-CISRC-10/87-TR32, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+F. Sola and D. Roush, ``Design of Musical Beams,'' Technical
+Report OSU-CISRC-10/87-TR30, Department of Computer and Information
+Science, The Ohio State University, 1987.
+
+J. S. Gourlay. A language for music printing. In ``Communications of
+the ACM''. Vol. 29(5), 388--401, 1986.
+
+[This paper describes a vapourware music setting system and an input
+language to go with it. ]
+
+D. Blostein and L. Haken, The Lime Music Editor:  A Diagram Editor
+Involving Complex Translations, Software Practice and Experience,
+Vol. 24, No. 3, March 1994, pp. 289-306. 
+
+[A description of various conversions, decisions and issues relating
+to this interactive editor]
+
+L. Haken and D. Blostein, The Tilia Music Representation:
+Extensibility, Abstraction, and Notation Contexts for the Lime Music
+Editor, Computer Music Journal, Vol. 17, No. 3, 1993, pp. 43-58 
+
+[A description of Lime internals (which resemble LilyPond pre 0.0.68
+data structures somewhat)]
+
+L. Haken and D. Blostein, A New Algorithm for Horizontal Spacing of
+Printed Music, International Computer Music Conference, Banff,
+Sept. 1995, pp. 118-119. 
+
+[This describes an algorithm which uses springs between adjacent
+columns. This algorithm is a "subclass" of the LilyPond algorithm.]
+
+D. Blostein and L. Haken, Justification of Printed Music,
+Communications of the ACM, VolJ34, No. 3, March 1991, pp. 88-99. 
+
+[This paper provides a shallow overview of the algorithm used in LIME
+for spacing individual lines.]
 
 =head2  Further reading
 
+Chlapik, Herbert. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
+ISBN 3-9000 035-96-2.
+
+[An clearly written book for the casually interested reader. It shows
+some of the conventions and difficulties in printing music]
+
+The University of Colorado Music Engraving page.
+http://obenamots.cc.colorado.edu/cgi-bin/Musicpress/engraving.html
+
 (of varying usefulness):
 
 Donato, Anthony. Preparing Music Manuscript. Englewood Cliffs:
@@ -70,7 +148,10 @@ Praeger    Publishers, 1972.  Out of print.
 Roelofs, Ren\'e. ``Een Geautomatiseerd Systeem voor het Afdrukken van
 Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
 universiteit Rotterdam, 1991.  (``An automated system for printing
-music'' Master's Thesis Management and Computer Science.)
+music'' Master's Thesis Managerial Computer Science.)
+
+[This thesis describes a simplistic (monophonic) typesetting system,
+and focuses on the breaking algorithm, which is taken from Hegazy & Gourlay]
 
 C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
 (CA), 1973.
@@ -79,76 +160,41 @@ Rosecrans, Glen. Music Notation Primer. New York: Passantino, 1979.
  
 Stone, Kurt. Music Notation in the Twentieth Century. New York: Norton, 1980.
 
-
-=head2 On typesettig programs
-
-From: Miguel Filgueiras <mig@ncc.up.pt>
-
-... as well as other systems. I contribute with some references:
-
-
-D. Blostein, L. Haken, The Lime Music Editor: a Diagram Editor
-Involving Complex Translations. {\em
-Software --- Practice and Experience}, Vol. 24(3), 289--306, 1994.
-
-Alexander Brinkman, {\em PASCAL Programming for Music Research}.
-The University of Chicago Press, 1990.
-
-Miguel Filgueiras, Implementing a Symbolic Music Processing
-System. LIACC, Universidade do Porto, 1996; submitted.
-
-Miguel Filgueiras, Some Music Typesetting Algorithms. LIACC,
-Universidade do Porto, {\em forthcoming}.
-
- Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of
-\SceX, a Music Typesetting System. Centro de Inform\'atica da
-Universidade do Porto, 1993.
-
-Miguel Filgueiras and Jos\'e Paulo Leal. Representation and
-manipulation of music documents in \SceX. {\em Electronic Publishing},
-vol. 6 (4), 507--518, 1993.
-
-Eric Foxley, Music --- A language for typesetting music scores. {\em
-Software --- Practice and Experience}, Vol. 17(8), 485--502, 1987.
-
-John S. Gourlay, A language for music printing. {\em Communications of
-the ACM}, Vol. 29(5), 388--401, 1986.
-
-Cindy Grande, NIFF6a Notation Interchange File Format.
-Grande Software Inc., 1995. {\tt ftp:blackbox.cartah.washington.edu}
-
-Fran\c{c}ois Jalbert, Mu\TeX\  User's Guide (Version $1.1$). Computer
-Science Department, University of British Columbia, 1989.
-
-Peter S. Langston, Unix music tools at Bellcore. {\em
-Software --- Practice and Experience}, Vol. 20(S1), S1/47--S1/61, 1990.
+=head2 other stuff
 
 Andreas Mahling, J. Herczeg, M. Herczeg and S<H.-D.> B\"ocker, Beyond
 visualization: knowing and understanding. In P.~Gorny, M.~J. Tauber
-(eds.), {\em Visualization in Human-Computer Interaction}, Lecture
+(eds.),  Visualization in Human-Computer Interaction, Lecture
 Notes in Computer Science, 439, 16--26, Springer-Verlag, 1990.
 
-Jan Nieuwenhuizen, Using \TeX\ and the MusiX\TeX\  macro package to
-write parts and scores of music. Department of Physics, Eindhoven
-University of Technology, 1995.
+Peter S. Langston, Unix music tools at Bellcore. 
+Software --- Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
 
-Don Simons, PMX, A Preprocessor for MusiX\TeX\  (Version 1.04).
-dsimons@logicon.com.
+[This paper deals with some command-line tools for music editing and
+playback. It doesn't mention notation issues, but does come with the
+grand idea (not) of using music to monitor complex systems. Imagine your
+nuclear plant supervisor to use AC/DC for checking the reactor]
 
-Daniel Taupin. Music\TeX: Using \TeX\  to Write Polyphonic or
-Instrumental Music (Version 5.17). Laboratoire de Physique des
-Solides, Centre Universitaire, Orsay, 1996.
+Cindy Grande, NIFF6a Notation Interchange File Format.
+Grande Software Inc., 1995.  ftp://blackbox.cartah.washington.edu/pub/
+
+[Specs for NIFF, a comprehensive but binary (yuk) format for notation]
 
-Daniel Taupin, Ross Mitchell and Andreas Egler, Musix\TeX: Using \TeX\
-to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire
-de Physique des Solides, Centre Universitaire, Orsay, 1993.
+Miguel Filgueiras and Jos\'e Paulo Leal. Representation and
+manipulation of music documents in SceX.  Electronic Publishing,
+vol. 6 (4), 507--518, 1993.
 
-Barry Vercoe, Csound --- A Manual for the Audio Processing System and
-Supporting Programs with Tutorials. Media Lab, M.I.T., Cambridge,
-Massachusetts, 1986 (rev. 1992).
+Eric Foxley, Music --- A language for typesetting music scores. 
+Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
 
-Chris Walshaw, {\tt ABC2M\TeX} --- An easy way of transcribing folk
-and traditional music. School of Maths, University of Greenwich, 1993.
+[A paper on a TROFF preprocessor to typeset music. The output shown is
+not very sophisticated, and contains some typographical atrocities]
 
+Alexander Brinkman,  PASCAL Programming for Music Research.
+The University of Chicago Press, 1990.
 
+Miguel Filgueiras, Implementing a Symbolic Music Processing
+System. LIACC, Universidade do Porto, 1996; submitted.
 
+Miguel Filgueiras, Some Music Typesetting Algorithms. LIACC,
+Universidade do Porto,  forthcoming.
index cc82896924e7e7c57508eeb5f5c7f9222e58501b..633c9b588db9411d1bf38b07fe6532b597625d3b 100644 (file)
@@ -8,6 +8,10 @@ This document describes the the GNU LilyPond input format, which is an
 effective language for defining music.  We call this language
 (rather arrogantly) The Musical Definition Language (S<Mudela 0.1>).
 
+[If anybody comes up with a better name, we'd gladly take this Gourlay
+already uses Musical Description Language, GSharp Score Definition
+Language. We're not being original here]
+
 The first aim of Mudela is to define a piece of music, 
 being complete from both from a musical typesetting, 
 as from a musical performing point of view.
@@ -24,7 +28,7 @@ The below included for explanatory purposes only (i.e., for a complete
 and up-to-date definition, see F<lily/parser.y> and F<lily/lexer.l>):
 
 As a related note, you should take a look at the examples and the init
-file, as this document does not cover every aspect of mudela yet, and
+files, as this document does not cover every aspect of mudela yet, and
 may be out of date.
 
 =head2 Files
diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod
new file mode 100644 (file)
index 0000000..72d3a2b
--- /dev/null
@@ -0,0 +1,90 @@
+=head1 NAME 
+
+Other-packages -- related packages 
+
+=head1 DESCRIPTION 
+
+A (not-at-all complete) overview of other music-typesetting/notation
+packages. Feel free to add info (and mail it to me).  Partly based on
+a reflist by Miguel Filgueiras <mig@ncc.up.pt>.
+
+=head2 Free packages (with source)
+
+G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+
+Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html
+
+Common Music/Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp
+
+Vivace
+
+MPP, http://www.stack.nl/~hanwen/mpp-english.html
+
+Jan Nieuwenhuizen, Using TeX and the MusiXTeX macro package to
+write parts and scores of music. Department of Physics, Eindhoven
+University of Technology, 1995.
+
+
+MusE
+
+A-R Editions, Inc.
+
+Mup, http://www.arkkra.com/
+
+A program which creates PS from a script input. Although it comes with
+C source code, it is Shareware ($29).
+
+PMX
+
+Don Simons, PMX, A Preprocessor for MusiXTeX (Version 1.04).
+dsimons@logicon.com.
+
+Musi*TeX, http://www.gmd.de/misc/music
+
+Daniel Taupin, Ross Mitchell and Andreas Egler, MusixTeX: Using TeX
+to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire
+de Physique des Solides, Centre Universitaire, Orsay, 1993.
+
+ABC2MTeX
+
+Chris Walshaw,  ABC2MTeX --- An easy way of transcribing folk
+and traditional music. School of Maths, University of Greenwich, 1993.
+
+SceX
+
+Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of
+SceX, a Music Typesetting System. Centro de Inform\'atica da
+Universidade do Porto, 1993.
+
+MUTEX
+
+Fran\ccois Jalbert, MuTeX User's Guide (Version 1.1). Computer
+Science Department, University of British Columbia, 1989.
+
+
+=head2 Free (zero cents)
+
+Calliope, http://www.cl.cam.ac.uk/users/wfc/
+
+A NeXT package
+
+Mozart
+
+A windows package
+
+=head2 Proprietary
+
+LIME, http://datura.cerl.uiuc.edu/
+
+Sibelius, http://www.acorn.co.uk/developers/sibelius
+
+Finale
+
+Score
+
+Musicator
+
+=head2 Unknown
+
+Berlioz, http://www.bsi.fr/~montel/
+
index 5f6c2a4ece7c079c14a2e7ee3129287b3e6abcff..128c028facb9af0f57f471eabfc94fc42b1edc00 100644 (file)
@@ -61,7 +61,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
 
 
 
-28/May/97                LilyPond 0.0.67                        1
+28/May/97                LilyPond 0.0.68                        1
 
 
 
@@ -127,7 +127,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
-28/May/97                LilyPond 0.0.67                        2
+28/May/97                LilyPond 0.0.68                        2
 
 
 
@@ -193,7 +193,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-28/May/97                LilyPond 0.0.67                        3
+28/May/97                LilyPond 0.0.68                        3
 
 
 
@@ -259,7 +259,7 @@ W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOZ\bZ\bZ\bZE\bE\bE\bE
 
 
 
-28/May/97                LilyPond 0.0.67                        4
+28/May/97                LilyPond 0.0.68                        4
 
 
 
@@ -325,6 +325,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-28/May/97                LilyPond 0.0.67                        5
+28/May/97                LilyPond 0.0.68                        5
 
 
diff --git a/NEWS b/NEWS
index d514afe7b5e7c5cafdd88f14ef0a40da72266e1a..fe3edf293f0cdc2d8c9454ebae436a0e692c4682 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,33 @@
+pl 68
+       - doco: other-packages.pod, lots of lilyliterature.pod
+       - last duration mode now is default.
+       - some OpusTeX stuff.
+       - bf Y2K in convert-mudela
+       - Grand rewrite of Music/Register stuff:
+         * separation of Y and X-elt-groups
+         * Registers: info up: broadcasts, info down: get_xxx_info()
+         * Registers: try_request works from bottom to top of tree.
+         * Score_elem invisible_b_ flag
+         * Junk Staff_column, and find the requests while walking the
+         Voices.
+         * Score_register
+         * Staff_group, Score_request_register.
+         * align key/Meters/bar across staffs
+         * junked Staff, Staff_column, Staff_walker, Complex_walker,
+           Request_column Pulk_voice, Pulk_voices, Walker_registers,
+           Voice_element, 
+           Input_score, Input_staff, Input_music and a lot of
+           parserjunk.
+         * mudela: lots of structure changes : now much simpler
+         * generation of pre/postbreak items now in Score_elem with deps.
+       
+       - bf: make_patch explanation
+       - bf: make install TeX stuff
+       - new Beam/Stem code (WL)
+       - mudela: . mandatory for REALs
+
+******
+june 3
 pl 67
        - sketch of Music classes
        - General_script_def as baseclass for Text_def and Script_def
diff --git a/TODO b/TODO
index 8d3e7c344fa67c2dc615fdd66114552b7162435f..f7a191fe75190bbf0888d9aa1ce5da489b12c9dc 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,6 +6,13 @@ 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
 
+bugs introduced in pl68:
+       
+       * lyrics broken,
+
+       * midi broken
+
+       * scripts broken
 
 IMPORTANT
 
@@ -26,6 +33,9 @@ IMPORTANT
        * a Hands on tutorial [HKN]
 
 PROJECTS
+
+       * Convert all ref/bib stuff into BibTeX.
+
        * Output class, handles : (smallish)
        - help text /(c) notice?
        - version line
@@ -44,12 +54,14 @@ PROJECTS
        - poor man's ascii output possible?
        - MusixTeX output possible? (would have to be done before break calc.)
        - NIFF ?
+       - Common Music Notation
        - PostScript output (esp. Beams, Slurs, etc)
        - Move PScore, Items, Spanners etc. into libmutype.a
 
 
        * separate Score_elem settings in user-settable (properties
-       .. ) and non-user-settable part.
+       .. ) and non-user-settable part. Maybe use something like X-resources:
+       "Staff=oboe*dir: 0", "Staff=*.Voice_group=solo*dir: 1"
 
        * TeX spanners , use texbeam.cc as an example (smallish)
        - Glissando
@@ -124,6 +136,8 @@ BUGS
 
        * stacked scripts.
 
+       * should adjust stemlength for flag number.
+
        * lilypond - -> crash
 
        * standchen triool beam up/down
@@ -147,8 +161,25 @@ FURTHER FOR ORCHESTRAL SCORE:
 
 INPUTLANGUAGE
 
+       * c4 4 4 4 for c4 c4 c4 c4?
+
+       * neatly (and readably) expressing concurrent
+       voices
+
+       * <c f a>4 ?
+
        * should have \require{package.ly} to read req'd packages.
 
+       * Viola mode?
+
+               @c c g e g 
+       for
+               c g es g, 
+
+               @A c g e g
+       for
+               cis gis e gis
+
        * relative mode for pitch entering
 
        * bracket (bracketplets)
@@ -169,14 +200,14 @@ PROJECTS
 
        * Do RTTI i.s.o. static_name(), name() and request-junk.
 
-       * add remove() methods to all items/spanners.
-
 SMALLISH PROJECTS
 
        * A range for context errors (eg. mark both { and }. )
 
        * text in staff  (sharpsharp in staff, text below)
 
+       * fix Egler definitions ( see tex/eglerdefs.tex )
+
        * replace Score_elem member access by get()/set() methods, to enable
        future embedded code.
 
@@ -193,14 +224,14 @@ SMALLISH PROJECTS
        * bugreport to doc++ devel: struct not in class hier; public
        virtual baseclasses
 
+       * get rid of init_end;
+
        * cleanup lily-proto.hh and proto.hh
 
        * half-sharps, half-flats
 
        * adaptive accidental spacing.
 
-       * Score_elem invisible_b_ flag
-       
        * unix style paths for LILYINCLUDE env
 
        * indentable stream as baseclass for TeX stream, lily stream, Dstream.
@@ -243,8 +274,7 @@ SMALLISH PROJECTS
 
        * Brackets
 
-       * caching of Register_group_register hierarchies.
-
+       
        * use (char *) iso. String for communication between lexer and
        parser.
 
@@ -279,9 +309,6 @@ FUTURE
 
        * guitar chord
 
-       * Junk Staff_column, and find the requests while walking the
-       Voices.?
-
        * better beamslope calculation: QLP for beams?
 
        * Text_crescendo
@@ -319,13 +346,7 @@ IDEAS
 
        * Spacing_request for manually adjusting spacing
 
-       * Staff_group, Score_request_register.
-
-       * Meters/bars should be aligned, which is difficult if
-       we get different keychanges in different staffs.
-
-       * Horizontal_align item for meter,bar etc.
-
+       
        * caching breakpoints
 
        * #c <-> cis
@@ -337,10 +358,6 @@ IDEAS
        * default convert mudela-file.ly -> mudela-file.tex
          - rename {standchen,scsii-menuetto,...}.tex
 
-       * (related with above) --simple-mudela option for lily,
-         to lily input files with one-voice simple mudela 
-         (no red tape)
-
        * stack scripts in chords:
          % fingering:        footing:
            < a-4 c-2 g-1 >   < c-\ltoe e-\lheel >
@@ -356,3 +373,4 @@ IDEAS
           (where "to" is a tiny bow)
 
        * move towards incremental algorithms.
+
index 00ad900cd52bf5437aaa6404585a2450423b20d6..4ae7f6f57c761186814e377a197d859b09c4984d 100755 (executable)
@@ -3,6 +3,7 @@
 =head1 TODO
 
     detect \lyrics and \melodic, and do substitution accordingly.
+    count <> and {} ?
     
 =cut    
 
 
 
 
-$convert_mudela_version = "0.1";
+$convert_mudela_version = "0.1.1";
 
 use Getopt::Long;
 
 
 
+sub  cmpver 
+{      
+
+       my(@a)= split /\./,$a;
+       my(@b)= split /\./,$b;
+       
+       for $i (0,1,2) {
+           return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
+       }
+       return $a cmp $b;
+}
+
 sub version_string_conv
 {
     my ($from_version, $to_version) = @_;
-    s/\version \"0.0.$from_version\"/\version \"0.0.$to_version\"/g;
+    s/\version \"$from_version\"/\version \"$to_version\"/g;
 }
 
 ################################################################
@@ -67,6 +80,10 @@ sub convert_0_0_57_to_0_0_58
     s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g;
 }
 
+sub convert_0_0_58_to_0_0_58
+{
+    die "Not smart enough to convert 0.0.58 to 0.0.59\n";
+}
 ###############################################################
 
 sub    last_conversion
@@ -78,7 +95,7 @@ sub identify
 {
     
     print STDERR "This is convert-mudela " . $convert_mudela_version . 
-       " (up to mudela version 0.0.", last_conversion, ")\n";
+       " (up to mudela version ", last_conversion,     ")\n";
 }
   
   
@@ -92,24 +109,25 @@ sub identify
      . "  -h, --help             print this help\n"
      . "  -o, --output=FILE      name output file\n"
      . "  -s, --show-rules       print all known conversion rules\n"
-     . "  -t, --to=PATCHLEVEL    convert to version 0.0.PATCHLEVEL\n"
+     . "  -t, --to=VERSION    convert to version VERSION\n"
   }
       
-# beware of the year 2000
-my %minor_conversions = (50 => \&no_conv,
-                        52 => \&convert_0_0_50_to_0_0_52,
-                        53 => \&convert_0_0_52_to_0_0_53,
-                        54 => \&convert_0_0_53_to_0_0_54,
-                        55 => \&convert_0_0_54_to_0_0_55,
-                        56 => \&convert_0_0_55_to_0_0_56,
-                        57 => \&convert_0_0_56_to_0_0_57,
-                        58 => \&convert_0_0_57_to_0_0_58
+
+my %minor_conversions = ("0.0.50" => \&no_conv,
+                        "0.0.52" => \&convert_0_0_50_to_0_0_52,
+                        "0.0.53" => \&convert_0_0_52_to_0_0_53,
+                        "0.0.54" => \&convert_0_0_53_to_0_0_54,
+                        "0.0.55" => \&convert_0_0_54_to_0_0_55,
+                        "0.0.56" => \&convert_0_0_55_to_0_0_56,
+                        "0.0.57" => \&convert_0_0_56_to_0_0_57,
+                        "0.0.58" => \&convert_0_0_57_to_0_0_58,
+                        "0.0.59" => \&convert_0_0_58_to_0_0_59
                         );
  
 
 sub versions 
 {
-    return  (sort keys %minor_conversions);
+    return (sort keys %minor_conversions);
 }
     
 
@@ -167,7 +185,6 @@ sub get_auto_from
        my $u;
        return $u;
     }
-    $ver =~ s/0\.0\.// ;
     close INLY;
     return $ver;
 }   
index a70faaeea5e14058852d745c9db1635e7460e83f..4c98e9f35afa1249d6d49d53ec7edec5643aea84 100755 (executable)
@@ -40,7 +40,18 @@ for a in lilypond.lsm INSTALL.text AUTHORS.text lilypond.spec configure; do
     rm `find  $nm$old $nm$new  -name $a`
 done    
 
-echo 'use cd source-dir; patch -E -p0 < this_patch'> patch-$new
+cat <<EOF > patch-$new
+Generated with 
+
+       make_patch $1 $2 $3
+
+usage 
+
+       cd lilypond-source-dir; patch -E -p0 < patch-$new
+       
+Patches do not contain automatically generated files, 
+i.e. you should rerun configure
+EOF
 
 (cd $nm$new; diff -urN  ../$nm$old . >> ../patch-$new)
 rm -rf $nm$old $nm$new
index a52951ec32cee8c2c9ccf6527cb9e2e8d16b69c9..be52176b4ef18c4ab716d838719b27760e66b3d9 100755 (executable)
@@ -16,7 +16,7 @@ MI=$TOPLEVEL_MINOR_VERSION
 PA=$TOPLEVEL_PATCH_LEVEL 
 MP=$TOPLEVEL_MY_PATCH_LEVEL
 NEWVER=$MJ.$MI.$PA$MP
-if [ -z $MP ]
+if [ -z $MP -o x$MP = xpre ]
 then
     LASTVER=$MJ.$MI.`expr $PA - 1`
 else
index c333bafab2212ee58651d53d70465de4c7540602..50aaf0d634ad7621691e3344b0d456b05bb370db 100755 (executable)
--- a/configure
+++ b/configure
@@ -642,7 +642,7 @@ if test $checking_b = no; then
 fi
 
 # however, C++ support in mingw32 v 0.1.4 is still flaky
-if test $MINGWPREFIX != no; then // huh?
+if test x$MINGWPREFIX != xno; then 
     ICFLAGS="-I$MINGWPREFIX/include"
     ILDFLAGS="-$MINGWPREFIX/lib"
 fi
@@ -941,12 +941,14 @@ fi
 
 
 
+
+
 for ac_prog in bison
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:950: checking for $ac_word" >&5
+echo "configure:952: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -980,7 +982,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:984: checking for $ac_word" >&5
+echo "configure:986: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1014,7 +1016,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1018: checking for $ac_word" >&5
+echo "configure:1020: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1048,7 +1050,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1052: checking for $ac_word" >&5
+echo "configure:1054: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1084,7 +1086,7 @@ if test "x$TEXPREFIX" = xauto ; then
     
 
     echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6
-echo "configure:1088: checking TeX/MF root dir directory" >&5    
+echo "configure:1090: checking TeX/MF root dir directory" >&5    
 
     find_root_prefix="$prefix"
     
@@ -1122,7 +1124,7 @@ if test "x$TEXDIR" = xauto ; then
     
     
     echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1126: checking TeX input directory" >&5    
+echo "configure:1128: checking TeX input directory" >&5    
     find_dirdir=`(cd $find_texprefix; 
       $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
     
@@ -1144,7 +1146,7 @@ if test "x$MFDIR" = xauto; then
     
     
     echo $ac_n "checking MF input directory""... $ac_c" 1>&6
-echo "configure:1148: checking MF input directory" >&5    
+echo "configure:1150: checking MF input directory" >&5    
     find_dirdir=`(cd $find_texprefix; 
       $FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')`
     
@@ -1200,7 +1202,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1204: checking how to run the C++ preprocessor" >&5
+echo "configure:1206: checking how to run the C++ preprocessor" >&5
 if test -z "$CXXCPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1213,12 +1215,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
   CXXCPP="${CXX-g++} -E"
   cat > conftest.$ac_ext <<EOF
-#line 1217 "configure"
+#line 1219 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1238,17 +1240,17 @@ echo "$ac_t""$CXXCPP" 1>&6
 
 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1242: checking for FlexLexer.h" >&5
+echo "configure:1244: checking for FlexLexer.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1249 "configure"
 #include "confdefs.h"
 #include <FlexLexer.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1650,7 +1652,7 @@ fi
 eval "DIR_DATADIR=$datadir"
 DIR_DATADIR="$DIR_DATADIR/lilypond"
 echo $ac_n "checking ""... $ac_c" 1>&6
-echo "configure:1654: checking " >&5
+echo "configure:1656: checking " >&5
 
 cat << EOF > lib/out/config.hh
 
index 570f8866d2d53345905f5d5901794967b561dcca..dbaf1cd095151361a7b3ac8651c373fab6add44d 100644 (file)
@@ -141,7 +141,7 @@ if test $checking_b = no; then
 fi
 
 # however, C++ support in mingw32 v 0.1.4 is still flaky
-if test $MINGWPREFIX != no; then // huh?
+if test x$MINGWPREFIX != xno; then 
     ICFLAGS="-I$MINGWPREFIX/include"
     ILDFLAGS="-$MINGWPREFIX/lib"
 fi
@@ -165,6 +165,8 @@ if test FIND = error; then
    AC_MSG_WARN(Couldn't find \`find'.  Please use --enable-tex-dir)
 fi
     
+AC_SUBST(CXXFLAGS)
+AC_SUBST(CPPFLAGS)
 AC_SUBST(CXX)
 AC_SUBST(ICFLAGS)
 AC_SUBST(ILDFLAGS)
index e9fb1f3ca527ff8bf6ffe12d475773e72b461d49..0a7bf4efbe508967cc771153e8057243855a9b49 100644 (file)
@@ -213,3 +213,5 @@ Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * r
 }
 IMPLEMENT_STATIC_NAME(Full_storage);
 IMPLEMENT_STATIC_NAME(Matrix_storage);
+IMPLEMENT_IS_TYPE_B(Matrix_storage);
+IMPLEMENT_IS_TYPE_B1(Full_storage,Matrix_storage);
index c1fb23c1839686786babe0efa84b7ddd9c096405..05a3e897c4aac5553d787bec045290c590bf8c70 100644 (file)
@@ -42,7 +42,10 @@ class Cursor
     int operator -(Cursor<T> op) const;
     Cursor<T> operator -=(int);
     Cursor<T> operator +=(int);
-    
+    /// move one down
+    void next();
+    /// move one up.
+    void previous();
     /// return current and move one down
     Cursor<T> operator ++( int );
     
index 3390d69026499526aa1ceaed1abb1cbc0dc62563..6a2ae6c538c7344c1d0877426763df36a8b5f57d 100644 (file)
@@ -108,25 +108,37 @@ Cursor<T>::ok()const
 {
     return ( pointer_ != 0 );
 }
-
+template<class T>
+inline void
+Cursor<T>::next() 
+{
+    assert( pointer_ );
+    pointer_ = pointer_->next();
+}
 
 template<class T>
 inline Cursor<T> 
 Cursor<T>::operator ++( int )    
 {
     Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->next();
+    next();
     return r;
 }
 
+template<class T>
+inline void
+Cursor<T>::previous() 
+{
+    assert( pointer_ );
+    pointer_ = pointer_->previous();
+}
+
 template<class T>
 inline Cursor<T>
 Cursor<T>::operator --( int )
 {
     Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->previous();
+    previous();
     return r;
 }
 
index 6144152614324e12d6b68872b2a4d242fe875804..6c9ceff0d77207846dd9e28f3300f5953db085bd 100644 (file)
@@ -25,6 +25,9 @@ public:
     Cursor<void*>::ok;
     Cursor<void*>::del;
     Cursor<void*>::backspace;
+    Cursor<void*>::next;
+    Cursor<void*>::previous;
+
     T remove_p() {
        T p = ptr();
        Cursor<void*>::del();
index fa6b5df9d448131f0bc1ef71c4c2cfe05a465742..f38d85293410fbabf017f9f03037b8885ce824ce 100644 (file)
@@ -16,6 +16,7 @@
  */
 #define NAME_MEMBERS() \
 static char const *static_name();\
+virtual bool is_type_b(const char *)const; \
 virtual char const *name() const{ return static_name(); } \
 int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
 
@@ -25,5 +26,21 @@ int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
 #define VIRTUAL_COPY_CONS(T, R)\
   virtual R *clone() const { return  new T(*this); } \
 
-    
+#define IMPLEMENT_IS_TYPE_B(D)                                                            \
+  bool D::is_type_b(const char *s)     const                                      \
+{                                                                                 \
+    return s == static_name();                                                    \
+}                                                                                 
+                                                                                  
+#define IMPLEMENT_IS_TYPE_B1(D,B)                                                 \
+  bool D::is_type_b(const char *s)const                                                   \
+{                                                                                 \
+    return s == static_name() || B::is_type_b(s);                                 \
+}                                                                                 
+#define IMPLEMENT_IS_TYPE_B2(D, BA, BB)                                                   \
+  bool D::is_type_b(const char *s)     const                                      \
+{                                                                                 \
+    return s == static_name() || BA::is_type_b(s) || BB::is_type_b(s); \
+}
+
 #endif // CLASS-NAME_HH
index 703b092e658ea772860df62254c5f1eafbd26cad..4b8d324fa914d4b5fb2640aeecf4e2dd5873c0cd 100644 (file)
@@ -1,33 +1,44 @@
 %
 
-melodicregs = \inputregister {
-       Staff_registers
-       \inputregister {Bar_register}
-       \inputregister {Clef_register}
-       \inputregister {Key_register}
-       \inputregister {Meter_register}
-       \inputregister {Local_key_register}
-       \inputregister { Staff_sym_register }
-       \inputregister { Collision_register }
-       \inputregister { Rest_collision_register }
-       \inputregister {
-               Voice_group_registers
-               \inputregister { Dynamic_register }
-               \inputregister { Stem_beam_register }
-               \inputregister { Text_register }
-               \inputregister { Script_register }
-               \inputregister { Note_column_register }
-               \inputregister { Slur_register }
-               \inputregister { Voice_registers
-                       \inputregister { Note_head_register }
-                       \inputregister { Tie_register }
+\requestregister {
+        "Score_register"
+       \alias "Score";
+%      \consists "Score_bar_register";
+       \consists "Bar_align_register";
+       \consists "Clef_align_register";
+       \consists "Key_align_register";
+       \consists "Meter_align_register";
+       \consists "Score_horizontal_align_register";
+
+       \contains\requestregister {
+                "Staff_registers"
+               
+               \consists "Bar_register";
+               \consists "Clef_register";
+               \consists "Key_register";
+               \consists "Meter_register";
+               \consists "Local_key_register";
+               \consists "Staff_sym_register";
+               \consists "Collision_register";
+               \consists "Rest_collision_register";
+               \contains \requestregister {
+                        "Voice_group_registers"
+                       \alias "Voice_group";
+                       \consists "Dynamic_register";
+                       \consists "Stem_beam_register";
+                       \consists "Text_register";
+                       \consists "Script_register";
+                       \consists "Note_column_register";
+                       \consists "Slur_register";
+                       \contains \requestregister {
+                                "Voice_registers"
+                               \alias "Voice";
+                               \consists "Note_head_register" ;
+                               \consists "Tie_register";
+                       }
                }
        }
 }
 
-lyricregs = \inputregister {
-       Lyric_register % ugh.
-       \inputregister { Lyric_register }       
-       \inputregister { Swallow_register }
-       
-}
+
+
index 9bab84d8af97ad432d33b00aaa8913316e2e96f5..adea1560288bbb1a1799575e1eb1cf91ba54d88b 100644 (file)
@@ -1,4 +1,4 @@
-\version "0.0.58";
+\version "0.0.59";
 
 \include "register.ini"
 \include "dynamic.ini"
@@ -7,4 +7,5 @@
 \include "table_sixteen.ini"
 
 
+%% Fix Me. This sux.
 \init_end ;
index 58f2ef25a7010cb07ceb62a629cad50067a52251..b331826f55928916b0dea0d10dadcc47a5f9f0da 100644 (file)
@@ -12,36 +12,36 @@ table_sixteen=
    % index TeXstring,  xmin xmax ymin ymax
 
     "scripts" = \table {
-           "fermata" "\fermata"                0\pt 0\pt       0\pt 6\pt
-           "-fermata" "\ifermata"              0\pt 0\pt       -6\pt 0\pt
-           "portato" "\portato"                0\pt 4.8\pt     0\pt 2\pt
-           "-portato" "\iportato"              0\pt 4.8\pt     -2\pt 0\pt
-           "tenuto" "\tenuto"                  0\pt 4.8\pt     0\pt 1\pt
-           "-tenuto" "\itenuto"                0\pt 4.8\pt     -1\pt 0\pt
+           "fermata" "\fermata"                0.0\pt 0.0\pt   0.0\pt 6.0\pt
+           "-fermata" "\ifermata"              0.0\pt 0.0\pt   -6.0\pt 0.0\pt
+           "portato" "\portato"                0.0\pt 4.8\pt   0.0\pt  2.0\pt
+           "-portato" "\iportato"              0.0\pt 4.8\pt   -2.0\pt 0.0\pt
+           "tenuto" "\tenuto"                  0.0\pt 4.8\pt   0.0\pt  1.0\pt
+           "-tenuto" "\itenuto"                0.0\pt 4.8\pt   -1.0\pt 0.0\pt
            "sforzato" "\sforzato"              -0.8\pt 4.8\pt  -1.92\pt 1.92\pt
-           "marcato" "\marcato"                0\pt 4.8\pt     0\pt 4\pt
-           "-marcato" "\imarcato"              0\pt 4.8\pt     -4\pt 0\pt
-           "staccato" "\staccato"              0\pt 0\pt        0\pt 5\pt
-           "staccatissimo" "\staccatissimo"    0\pt 0\pt       0\pt 1\pt
-           "-staccatissimo" "\istaccatissimo"  0\pt 0\pt       0\pt 1\pt
-           "upbow" "\upbow"                    -1\pt 6\pt      0\pt 5\pt
-           "downbow" "\downbow"                0\pt 5\pt       0\pt 7.5\pt
-           "back" "\backorfront"               0\pt 6\pt       0\pt 3\pt
-           "-front" "\backorfront"             0\pt 6\pt       0\pt 3\pt
-           "heel" "\heel"                      0\pt 6\pt       -1\pt 5\pt
-           "toe" "\toe"                        0\pt 6\pt       -1\pt 5\pt
-           "bheel" "\bheel"                    0\pt 6\pt       -1\pt 5\pt
-           "btoe" "\btoe"                      0\pt 6\pt       -1\pt 5\pt
-           "fheel" "\fheel"                    0\pt 6\pt       -1\pt 5\pt
-           "ftoe" "\ftoe"                      0\pt 6\pt       -1\pt 5\pt
-           "-back" "\backorfront"              0\pt 6\pt       0\pt 3\pt
-           "front" "\backorfront"              0\pt 6\pt       0\pt 3\pt
+           "marcato" "\marcato"                0.0\pt 4.8\pt   0.0\pt  4.0\pt
+           "-marcato" "\imarcato"              0.0\pt 4.8\pt   -4.0\pt 0.0\pt
+           "staccato" "\staccato"              0.0\pt  0.0\pt          0.0\pt  5.0\pt
+           "staccatissimo" "\staccatissimo"    0.0\pt  0.0\pt  0.0\pt  1.0\pt
+           "-staccatissimo" "\istaccatissimo"  0.0\pt  0.0\pt  0.0\pt  1.0\pt
+           "upbow" "\upbow"                    -1.0\pt 6.0\pt  0.0\pt  5.0\pt
+           "downbow" "\downbow"                0.0\pt  5.0\pt  0.0\pt 7.5\pt
+           "back" "\backorfront"               0.0\pt  6.0\pt  0.0\pt  3.0\pt
+           "-front" "\backorfront"             0.0\pt  6.0\pt  0.0\pt  3.0\pt
+           "heel" "\heel"                      0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "toe" "\toe"                        0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "bheel" "\bheel"                    0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "btoe" "\btoe"                      0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "fheel" "\fheel"                    0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "ftoe" "\ftoe"                      0.0\pt  6.0\pt  -1.0\pt 5.0\pt
+           "-back" "\backorfront"              0.0\pt  6.0\pt  0.0\pt  3.0\pt
+           "front" "\backorfront"              0.0\pt  6.0\pt  0.0\pt  3.0\pt
        }
 
      "style" = \table {
-               "roman" "\settext{%}" 0\pt 5\pt 0\pt 8\pt
-               "italic"        "\setitalic{%}" 0\pt 0\pt 0\pt 8\pt
-               "dynamic"       "\setdynamic{%}" 0\pt 0\pt 0\pt 8\pt
+               "roman" "\settext{%}"   0.0\pt  5.0\pt  0.0\pt  8.0\pt
+               "italic"        "\setitalic{%}" 0.0\pt  0.0\pt  0.0\pt  8.0\pt
+               "dynamic"       "\setdynamic{%}"        0.0\pt  0.0\pt  0.0\pt  8.0\pt
      }
      "dynamics" = \table {
 
@@ -62,20 +62,20 @@ table_sixteen=
        }
 
      "clefs" = \table {
-            "violin"   "\violinclef"           0\pt    12.8\pt -10\pt  18\pt
-            "bass"     "\bassclef"             0\pt    12.8\pt 0\pt    16\pt
-            "alto"     "\altoclef"             0\pt    12.8\pt 0\pt    16\pt
-            "tenor"    "\altoclef"             0\pt    12.8\pt 0\pt    16\pt
-            "violin_change"    "\cviolinclef"  0\pt    11.2\pt -12\pt  12\pt
-            "bass_change"      "\cbassclef"    0\pt    11.2\pt 0\pt    16\pt
-            "alto_change"      "\caltoclef"    0\pt    11.2\pt 0\pt    16\pt
-            "tenor_change"     "\caltoclef"    0\pt    11.2\pt 0\pt    16\pt
+            "violin"   "\violinclef"           0.0\pt  12.8\pt -10.0\pt        18.0\pt
+            "bass"     "\bassclef"             0.0\pt  12.8\pt 0.0\pt  16.0\pt
+            "alto"     "\altoclef"             0.0\pt  12.8\pt 0.0\pt  16.0\pt
+            "tenor"    "\altoclef"             0.0\pt  12.8\pt 0.0\pt  16.0\pt
+            "violin_change"    "\cviolinclef"  0.0\pt  11.2\pt -12.0\pt        12.0\pt
+            "bass_change"      "\cbassclef"    0.0\pt  11.2\pt 0.0\pt  16.0\pt
+            "alto_change"      "\caltoclef"    0.0\pt  11.2\pt 0.0\pt  16.0\pt
+            "tenor_change"     "\caltoclef"    0.0\pt  11.2\pt 0.0\pt  16.0\pt
      }
 
      "balls" = \table {
-            "1"        "\wholeball"    0\pt    6\pt    -2 \pt  2\pt
-            "2"        "\halfball"     0\pt    5\pt    -2 \pt  2\pt
-            "4"        "\quartball"    0\pt    5\pt    -2 \pt  2\pt
+            "1"        "\wholeball"    0.0\pt  6.0\pt  -2.0\pt 2.0\pt
+            "2"        "\halfball"     0.0\pt  5.0\pt  -2.0\pt 2.0\pt
+            "4"        "\quartball"    0.0\pt  5.0\pt  -2.0\pt 2.0\pt
      }
 
      "slur" = \table {
@@ -83,73 +83,73 @@ table_sixteen=
             "half"     "\hslurchar%{%}"
      }
      "accidentals" = \table {
-            "-2"       "\flatflat"     0\pt    8.16\pt -2.5\pt 7.5\pt
-            "-1"       "\flat"         0\pt    4.8\pt  -2.5\pt 7.5\pt
-            "0"        "\natural"      0\pt    4.8\pt  -7.5\pt 7.5\pt
-            "1"        "\sharp"        0\pt    3.6\pt  -7.5\pt 7.5\pt
-            "2"        "\sharpsharp"   0\pt    4.8\pt  -2.5\pt 7.5\pt
+            "-2"       "\flatflat"     0.0\pt  8.16\pt -2.5\pt 7.5\pt
+            "-1"       "\flat"         0.0\pt  4.8\pt  -2.5\pt 7.5\pt
+            "0"        "\natural"      0.0\pt  4.8\pt  -7.5\pt 7.5\pt
+            "1"        "\sharp"        0.0\pt  3.6\pt  -7.5\pt 7.5\pt
+            "2"        "\sharpsharp"   0.0\pt  4.8\pt  -2.5\pt 7.5\pt
      }
 
      "streepjes" = \table {
-            "toplines" "\toplines{%}"  -1\pt   7\pt 0\pt       0\pt
-            "botlines" "\botlines{%}"  -1\pt   7\pt 0\pt       0\pt
+            "toplines" "\toplines{%}"  -1.0\pt 7.0\pt  0.0\pt  0.0\pt
+            "botlines" "\botlines{%}"  -1.0\pt 7.0\pt  0.0\pt  0.0\pt
      }
 
      "bars" = \table {
        "empty" "\emptybar"
-       "|"     "\maatstreep"           0\pt    0.4\pt  -8\pt   8\pt
-       "||"    "\doublebar"            0\pt    4\pt    -8\pt   8\pt
-       "|."    "\finishbar"            -4\pt   0\pt    -8\pt   8\pt
-       ":|"    "\repeatbar"            -4\pt   0\pt    -8\pt   8\pt
-       "|:"    "\startrepeat"          0\pt    4\pt    -8\pt   8\pt
-       ":|:"   "\repeatbarstartrepeat" 0\pt    16\pt   -8\pt   8\pt
+       "|"     "\maatstreep"           0.0\pt  0.4\pt  -8.0\pt 8.0\pt
+       "||"    "\doublebar"            0.0\pt  4.0\pt  -8.0\pt 8.0\pt
+       "|."    "\finishbar"            -4.0\pt 0.0\pt  -8.0\pt 8.0\pt
+       ":|"    "\repeatbar"            -4.0\pt 0.0\pt  -8.0\pt 8.0\pt
+       "|:"    "\startrepeat"          0.0\pt  4.0\pt  -8.0\pt 8.0\pt
+       ":|:"   "\repeatbarstartrepeat" 0.0\pt  16.0\pt -8.0\pt 8.0\pt
 
      }
 
      "rests" = \table {
-            "1"        "\wholerest"            0\pt    6\pt    0\pt    2\pt
-            "2"        "\halfrest"             0\pt    6\pt    -2\pt   0\pt
-            "4"        "\quartrest"            -5\pt   2\pt    -5\pt   5\pt
-            "8"        "\eighthrest"           0\pt    5\pt    0\pt    8\pt
-            "16"       "\sixteenthrest"                0\pt    6\pt    0\pt    12\pt
-            "32"       "\thirtysecondrest"     0\pt    6\pt    0\pt    16\pt
-            "64"       "\sixtyfourthrest"      0\pt    6\pt    0\pt    16\pt
-            "128"      "\hundredtwentyeighthrest"      0\pt    6\pt    0\pt    16\pt
+            "1"        "\wholerest"            0.0\pt  6.0\pt  0.0\pt  2.0\pt
+            "2"        "\halfrest"             0.0\pt  6.0\pt  -2.0\pt 0.0\pt
+            "4"        "\quartrest"            -5.0\pt 2.0\pt  -5.0\pt 5.0\pt
+            "8"        "\eighthrest"           0.0\pt  5.0\pt  0.0\pt  8.0\pt
+            "16"       "\sixteenthrest"                0.0\pt  6.0\pt  0.0\pt  12.0\pt
+            "32"       "\thirtysecondrest"     0.0\pt  6.0\pt  0.0\pt  16.0\pt
+            "64"       "\sixtyfourthrest"      0.0\pt  6.0\pt  0.0\pt  16.0\pt
+            "128"      "\hundredtwentyeighthrest"      0.0\pt  6.0\pt  0.0\pt  16.0\pt
      }
 
      "meters" = \table {
-            "C"        "\fourfourmeter"                0\pt    10\pt   -5\pt   5\pt
-            "C2"       "\allabreve"            0\pt    10\pt   -5\pt   5\pt
+            "C"        "\fourfourmeter"                0.0\pt  10.0\pt -5.0\pt 5.0\pt
+            "C2"       "\allabreve"            0.0\pt  10.0\pt -5.0\pt 5.0\pt
      }
 
      % dims ignored for this table
      "param" = \table {
-            "meter"    "\generalmeter{%}{%}"   0\pt    10\pt   -5\pt   5\pt
+            "meter"    "\generalmeter{%}{%}"   0.0\pt  10.0\pt -5.0\pt 5.0\pt
             "linestaf" "\linestafsym{%}{%}"
             "stem"     "\stem{%}{%}"
             "fill"     "\hbox{}"
        % ugh. 8pt
-            "crescendosym" "\crescendosym{%}"  0\pt    0\pt    -3\pt   3\pt
-            "decrescendosym" "\decrescendosym{%}"      0\pt    0\pt    -3\pt   3\pt
+            "crescendosym" "\crescendosym{%}"  0.0\pt  0.0\pt  -3.0\pt 3.0\pt
+            "decrescendosym" "\decrescendosym{%}"      0.0\pt  0.0\pt  -3.0\pt 3.0\pt
      }
 
      "dots" = \table {
-            "1"        "\lsingledot"           0\pt    2\pt    -1\pt   1\pt
-            "2"        "\ldoubledot"           0\pt    5\pt    -1\pt   1\pt
-            "3"        "\ltripledot"           0\pt    8\pt    -1\pt   1\pt
+            "1"        "\lsingledot"           0.0\pt  2.0\pt  -1.0\pt 1.0\pt
+            "2"        "\ldoubledot"           0.0\pt  5.0\pt  -1.0\pt 1.0\pt
+            "3"        "\ltripledot"           0.0\pt  8.0\pt  -1.0\pt 1.0\pt
      }
 
      "flags" = \table {
-            "8"        "\eighthflag"           0\pt    4\pt    0\pt    0\pt
-            "16"       "\sixteenthflag"                0\pt    4\pt    0\pt    0\pt
-            "32"       "\thirtysecondflag"     0\pt    4\pt    0\pt    0\pt
-            "64"       "\sixtyfourthflag"      0\pt    4\pt    0\pt    0\pt
-            "128"      "\hundredtwentyeighthflag"      0\pt    4\pt    0\pt    0\pt
-            "-8"       "\deighthflag"          0\pt    4\pt    0\pt    0\pt
-            "-16"      "\dsixteenthflag"               0\pt    4\pt    0\pt    0\pt
-            "-32"      "\dthirtysecondflag"    0\pt    4\pt    0\pt    0\pt
-            "-64"      "\dsixtyfourthflag"     0\pt    4\pt    0\pt    0\pt
-            "-128"     "\dhundredtwentyeighthflag"     0\pt    4\pt    0\pt    0\pt
+            "8"        "\eighthflag"           0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "16"       "\sixteenthflag"                0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "32"       "\thirtysecondflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "64"       "\sixtyfourthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "128"      "\hundredtwentyeighthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "-8"       "\deighthflag"          0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "-16"      "\dsixteenthflag"               0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "-32"      "\dthirtysecondflag"    0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "-64"      "\dsixtyfourthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
+            "-128"     "\dhundredtwentyeighthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
      }
 
      "beamslopes" = \table {
index d8d758be8bf520f91dfda6520acf1f8437a9643e..bcee0b0eb7af84464be39be4ca5c11a87cb18db1 100644 (file)
@@ -10,7 +10,7 @@
 EndMudelaHeader
 %}
 
-\version "0.0.58";
+\version "0.0.59";
 
 
 cad = \melodic  {
@@ -56,10 +56,10 @@ cad = \melodic  {
        }
 
 \score {
-       \staff { melodicregs cad }
+       \melodic{ \cad }
        \paper {
        
-               \unitspace 14\mm
+               \unitspace 14.0\mm
                \geometric 1.4}
        \midi { \tempo 4:90 }
 }
index 65057eb7849322b37032cf32040a299e98e0babe..d021f6e2787787d62e469e49dec467915ebc0e71 100644 (file)
  Tested Features:test the Collision resolution 
 EndMudelaHeader
 %}
-\version "0.0.58";
+\version "0.0.59";
 
 
 
-two_voice = \melodic 
-       < \multivoice 
-         {     \octave c'; \stem -1;\duration "last";
+two_voice = \melodic 
+       < \multi 2; 
+         {     \octave c'; \stem -1;
                c4 d e f g2~  g4 a [c8 d e f] c2| }
          { \stem 1;
                g4 f e g ~ g2 g2  c4 g4 g2 } 
 
        >
-}      
 
-two_voice_steminvert = \melodic 
-       < \multivoice  
+two_voice_steminvert = \melodic 
+       < \multi 2;  
          {     \octave c'; \stem 1;
 % the f and g on 4th beat are exceptionally ugh.
                c4 d e f g2 g4 a | }
@@ -33,9 +32,9 @@ two_voice_steminvert = \melodic {
                g4 f e g  g2 g2 } 
 
        >
-}      
-three_voice = \melodic {
-       < \multivoice
+
+three_voice = \melodic 
+       < \multi 2;
        { \stem 1; 
                g4 f e f g a g2 }
        { \hshift 1; \stem 1; 
@@ -43,10 +42,10 @@ three_voice = \melodic {
        { \stem -1;
                c4 d e d c d es }
        >
-}
 
-rests = \melodic  {
-       < \multivoice
+
+rests = \melodic  
+       < \multi 2;
        { \stem 1;
                | r8 r r r  r r r r 
                [c' b a g] [f e d c]
@@ -56,13 +55,13 @@ rests = \melodic  {
                r r r r r r r r r 
        }
        >
-}
+
 \score{
-       \staff{ melodicregs 
-               \melodic {  \$two_voice ++  \$two_voice_steminvert 
-                       ++ \$three_voice ++ \rests
+
+               \melodic {  \$two_voice  \$two_voice_steminvert 
+                       \$three_voice  \rests
                }
-       }
+
        \paper {}
 %      \midi { \tempo 4:80 }
 }
index 87b22fc1bafed637af624b373ddb9e779c548a34..439ccfb0f6db72eff61a7faf604ed9e0adeffd87 100644 (file)
@@ -21,7 +21,6 @@ EndMudelaHeader
 alto = \melodic{ 
        
        \meter 4/4; 
-       \duration  8 ;
        \key bes es as;
                
        \clef "alto";
@@ -31,13 +30,13 @@ alto = \melodic{
        <       
                { \octave  c ;
                        
-                       [ c c-. ] c2.( | 
+                       [ c8 c-. ] c2.( | 
 %31
-                       [ ) c c-. ] c2.( | 
+                       [ ) c8 c-. ] c2.( | 
 %32
-                       [ ) c c-. ] c4. c-. c4( |
+                       [ ) c8 c-. ] c4. c-. c4( |
 %33
-                       [ ) c c-. ] c4. c-. c4 
+                       [ ) c8 c-. ] c4. c-. c4 
                \group "+bla";
                 \stem  1 ;[ c16^"div." c16 c16 c16 ] c4 c2 
                \group "-";
@@ -53,11 +52,11 @@ alto = \melodic{
                                - \ \ \ \ - \ \ \ \ -" ] c2.( |  
                        \textstyle "roman";
 %31:2
-                       [ ) c c-. ] c2.( | 
+                       [ ) c8 c-. ] c2.( | 
 %32:2
-                       [ ) c c-. ] c4. c-. c4( | 
+                       [ ) c8 c-. ] c4. c-. c4( | 
 %33:2
-                       [ ) c c-. ] c4. c-. c4 |
+                       [ ) c8 c-. ] c4. c-. c4 |
                        \octave c ;
 
 %34            
index 409fe49ebae43e81970f22509131473ffe1e8e10..95e8187dd921e4a7b2483f6c8687c7e493e0fa5d 100644 (file)
@@ -3,14 +3,14 @@
  filename: kortjakje.ly
  title: Ah,  vous dirais-je, maman (variations)
  description:  bare bones version. (written down from memory :-)
- composers:Mozart, KV 265
+ composers: Mozart, KV 265
  entered-by: HWN
  copyright: none
 
  Tested Features: example file with comments
 EndMudelaHeader
 %}
-\version "0.0.58";
+\version "0.0.59";
 
 
 % the % is a comment.
@@ -24,20 +24,20 @@ melodie = \melodic {
        \octave  c';            % set the default octave
        % the default note duratino is 4
        %%% theme
-       c c |                   % the '|' checks if there is a new measure here.
+       c4 c |                  % the '|' checks if there is a new measure here.
        g g|
        a a|
 
        g2|     % g2 means a "g-1" pitched half-note 
-       f f|    e e|    d d|  c2
-       g g|    f f|    e e|    d d|    g g|    f f|    e e|    d d|
+       f4 f|   e e|    d d|  c2
+       g4 g|   f f|    e e|    d d|    g g|    f f|    e e|    d d|
        %%% var 1
-         c r8 c8               % r8 means an 8th rest.
+         c4 r8 c               % r8 means an 8th rest.
                  (|            % start a slur
                                % NOTE: the slurstart should be directly after the note
                        )       % end a slur.
-                         g r8 g8 ()     a r8 a8 ()      g r4 
-         f r8 f8 ()     e4 r8 e8 (|)  d4 r8 d8 ()       c4 r4 
+                         g4 r8 g8 ()    a4 r8 a8 ()     g4 r4 
+         f4 r8 f8 ()    e4 r8 e8 (|)  d4 r8 d8 ()       c4 r4 
 }
 
                                % more of this.
@@ -47,19 +47,22 @@ begeleiding = \melodic{
        \octave  c';            % default octave: 1 below the first octave.
 
        %%% theme
-       'c                      % ' before note means one octave lower.
+       'c4                     % ' before note means one octave lower.
                                % Similarly: ' after means one higher.
-          c    e c     f c     e c     d 'b    c 'a    'f 'g   'c2
+          c    e c     f c     e c     d 'b    c 'a    'f 'g   'c2 |
        \octave  'c ;
-       e 'g    d 'g    c 'g    'b 'g   e 'g    d 'g    c 'g    'b 'g
+       e4 'g   d 'g    c 'g    'b 'g   e 'g    d 'g    c 'g    'b 'g
        %%%% var 1
-       r8 e8()  c      r8 e8()  c      r8 f8() c       r8 e8() c
-       r8 d8() 'b      r8 c8() 'a      r8 'a8() 'f     r8 'e8() 'c
+       r8 e8()  c4     r8 e8()  c4     r8 f8() c4      r8 e8() c4
+       r8 d8() 'b4     r8 c8() 'a4     r8 'a8() 'f4    r8 'e8() 'c4
 }
 
 \score{
-       \staff{ melodicregs melodie }
-       \staff{ melodicregs begeleiding }
+       \melodic < \multi 3;
+       
+        \melodie
+        \begeleiding 
+       >
        \paper{
                \unitspace 2.5\cm       % a whole note takes 2.5 \cm ideally.
        }
diff --git a/input/multi.ly b/input/multi.ly
new file mode 100644 (file)
index 0000000..bb0fd59
--- /dev/null
@@ -0,0 +1,13 @@
+
+% stupid testfile for pl68 features.
+
+\score{
+       \melodic 
+               { \octave c'; c4 c4 
+                       < \multi 1;  { c2 c2 } { c'2 c'2 } > 
+                       < \multi 2;  { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } > 
+                       < \multi 3;  { \clef "bass"; c2 c2 } { \bar "||"; \key cis ; c'2 c'2 } > 
+       %                       c1 c1 % bug
+
+               }
+}
index 2ccad6c895d534f2be97b5ada1cc3ec9b174cbab..35815153382c87871214daa93af39246ef8e22fc 100644 (file)
@@ -2,21 +2,19 @@
 % scales with accents.
 %
 
-\version "0.0.58";
-blah = \staff{  melodicregs
-       \melodic {
+\version "0.0.59";
+blah =         \melodic {
                \meter 6/8;     
-               \duration 4.;
                \octave  'c ;
-       \clef "bass";
-                       c d
+               \clef "bass";
+                       c4. d
                \octave  c ;
                        c d 
                \clef "violin" ;
                \octave  c' ;
-               ++ \transpose { d { e f } } ++
+               \transpose  d { e f } 
                \octave  c'' ;
-                       c d 
+               c d 
                \duration  8 ;
        %ugr
                 |[6/9 a \< a a a a a a  \! a a \ff \> ]1/1 
@@ -66,7 +64,7 @@ c1
 }
 
 \score{
-       blah
+       \melodic {\blah}
        \paper{
                \symboltables {table_sixteen}
                \unitspace 1.5 \cm
index 9ff18deb972d4938fab51001a3cba315bffaee88..f52ea765c6416ebedf68441133f152f68d2fc58f 100644 (file)
@@ -12,7 +12,8 @@
 
 EndMudelaHeader
 %}
-\version "0.0.58";
+\version "0.0.59";
+
 %% Stuff from MPP version
 % \lefttitle{Menuetto}
 % \tempo{Moderato}
@@ -24,7 +25,7 @@ EndMudelaHeader
 % \stemlength3         % shorter \stemlength
 %              % because piece is set very tightly
 
-ii_menuetto = \melodic{
+IImenuetto = \melodic{
        \clef"alto";
        \meter 3/4;
        \key bes;
@@ -58,14 +59,14 @@ ii_menuetto = \melodic{
 %%10
        < [ e' g > d' cis'_"2" e' a~  g ] |
 %%11
-       < \multivoice  
+       < \multi 2;  
                {\stem 1; a4~  d'4 cis'4-. }
                { \stem -1; f2 e4 } > |
 %%12
        < [ g'^"4" d > f' e' f' d'^"3"~   c' ] |
 %%13
        \clef "alto";
-       < \multivoice
+       < \multi 2;
                 { \stem 1; bes2 c'4 }
                 { \stem -1; g4~  f4 e4 }% ugh
        > |
@@ -84,7 +85,7 @@ ii_menuetto = \melodic{
 %%20
        < { [ c'( bes a )bes g~  bes ] } { [ d ] } { [ g ] } > |
 %%21
-       < \multivoice  
+       < \multi 2;  
                {\stem 1;  d'4 (\stem 1; ) cis'4 d'4 }  
                { \stem -1; g2 f4 } 
        > |
@@ -100,11 +101,11 @@ ii_menuetto = \melodic{
 }
 
 \score{
-       \staff{ melodicregs ii_menuetto }
+       \melodic { \IImenuetto }
        \paper{
-               \width 195\mm
-               \unitspace 9\mm  % to get lily to use only three lines
-               \geometric 1.4
+               \width 195.0\mm
+               \unitspace 9.0\mm  % to get lily to use only three lines
+               \geometric 1.40
                \output "scsii-menuetto.out"
        }
        \midi{ 
index 19c862d90e48dad59b875db9d2041c7f22d73274..ab665b4e85176811fc369782a86a0e38eb4bf127 100644 (file)
@@ -20,19 +20,18 @@ EndMudelaHeader
 %}
 
 
-\version "0.0.58";
+\version "0.0.59";
 
 toccata_commands = \melodic{
        \meter 4/4;
        \key fis cis gis dis; % E-major
 }
 
-%toccata_right = \melodic \$toccata_commands { 
 toccata_right = \melodic{ 
-       \$toccata_commands ++
+       \$toccata_commands 
        % 13 -- how to type -- where to split -- this more neatly ?
        \octave c';
-       <\multivoice 
+       <\multi 2;
                { \stem 1; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~  [fis'8 e'16 dis'16] e'4 r8 e'8 }
                { \stem 1; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~  [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~  [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
                { \stem -1; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
@@ -41,11 +40,11 @@ toccata_right = \melodic{
 }
 
 toccata_left = \melodic{ 
-       \$toccata_commands ++
+       \$toccata_commands  
        \octave c;
        \clef bass;
        % 13
-       <\multivoice
+       <\multi 2;
                { \stem 1; bis2 cis'4-. cis'4~  [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
                { \stem 1; \hshift 1; r4 gis4. gis8~  gis4 | \stem -1; \hshift 0; a4. fis8 gis4. a8~  a4 gis4-. gis4 r8 gis8 }
                { \stem -1; r4 < dis4 fis4 > < cis4 e4 > }
@@ -54,7 +53,7 @@ toccata_left = \melodic{
 }
 
 toccata_pedal = \melodic{
-       \$toccata_commands ++
+       \$toccata_commands  
        \octave c;
        \clef bass;
        % 13
@@ -72,10 +71,10 @@ fuga2_commands = \melodic{
 }
 
 fuga2_right = \melodic{
-       \$fuga2_commands ++
+       \$fuga2_commands  
        % 15
        \octave c';
-       <\multivoice
+       <\multi 2;
                { \stem 1; [b8 fis8] b4 }
                { \stem -1; fis2 }
        >
@@ -87,14 +86,14 @@ fuga2_right = \melodic{
            |x
            |
        %}
-       < \multivoice
+       < \multi 2;
                { \stem 1; \hshift 0; e'4 }
                { \stem 1; \hshift 1; cis'4 }
                { \stem 1; \hshift 2; ais4 }
                { \stem -1; fis4 }
        > |
        % 16
-       <\multivoice
+       <\multi 2;
                { \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4~  [b8 cis'8 dis'8 e'8] }
                { \stem 1; \hshift 1; [b8 fis8] b2~  [b8 a16 g16] a2 | a4 gis2 }
                { \stem -1; fis2.~  fis2.~  fis4 e2 }
@@ -103,12 +102,12 @@ fuga2_right = \melodic{
 }
 
 fuga2_left = \melodic{
-       \$fuga2_commands ++
+       \$fuga2_commands  
        \octave c;
        \clef bass;
        % 15
        b2 
-       <\multivoice 
+       <\multi 2; 
                { \stem 1; ais4 | bes2. }
                { \stem -1; e4  | fis2 fis4 }
        >
@@ -119,7 +118,7 @@ fuga2_left = \melodic{
 }
 
 fuga2_pedal = \melodic{
-       \$fuga2_commands ++
+       \$fuga2_commands  
        \octave c;
        \clef bass;
        % 15
@@ -136,28 +135,13 @@ break = \melodic{ \meter 4/4; r1 }
 
 % these should be two separate scores...
 \score{
-       \staff{ melodicregs 
-               % why the extra "\melodic" (silly)
-               % let "[ x ]" be "dimension of x":
-               %     [ melodic ++ melodic ] == [ simple-mudela ]
-               %     [ \melodic{ melodic ++ melodic } ] == [ melodic ]
-               % ?
-               \melodic{ 
-                       \$toccata_right ++ \break ++ \$fuga2_right 
-               }
-       }
-       \staff{ melodicregs 
-               \melodic{ 
-                       \$toccata_left ++ \break ++ \$fuga2_left 
-               }
-       }
-       \staff{ melodicregs 
-               \melodic{ 
-                       \$toccata_pedal 
-                       ++ \break 
-                       ++ \$fuga2_pedal 
-               }
-       }
+       \melodic < \multi 3;
+               { \$toccata_right   \break   \$fuga2_right }
+               {       \$toccata_left   \break   \$fuga2_left }
+       
+               { \$toccata_pedal   \break   \$fuga2_pedal }
+               
+       >
        \paper{}
        \midi{
                \tempo 4:96
index eb6b0278f6d73379a060b63cfe932b684eadd1b4..0e91713bcf498e4a19ec8a0448a415e1457f6cd4 100644 (file)
@@ -14,7 +14,7 @@
 
 %}
 
-\version "0.0.58";
+\version "0.0.59";
 
                                     % should add \need{dutch.ini} for
                                     % correct parsing of note names
@@ -29,7 +29,7 @@ dux =
     \melodic {
         \clef "violin";
         \octave c';
-        \duration \last;
+
         \stem -1;
         r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
         [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
@@ -131,7 +131,6 @@ comes =
 bassdux =
     \melodic {
         \clef "bass";
-
         \octave c';
         r1 |
         r |
@@ -175,27 +174,28 @@ bassdux =
         [F16 G] As4 [G16 F] Es4 r8 es |
         [d c g G]
 %% 30
-        < \multivoice 
+        < \multi 2;
         { \stem 1; c2~ | c1~ | c1 }
         { \stem -1; C2~ | C1~ | C1 }
         >
     }
 
 
-% every "melody" declared in a staff has its own "voicegroup"
-trebstaf =
-    \staff { 
-        \inputregister{melodicregs}
-        global dux comes 
-    }
 
         
 \score {
-    trebstaf
-    \staff {
-        \inputregister{melodicregs}
-        global bassdux
-    }
+       \melodic < \multi 1;
+               < \multi 2; 
+                       \global 
+                       \dux
+                       \comes 
+               >
+               < \multi 2;
+                       \global
+                       \bassdux
+               >
+               
+       >
     \paper{}
     \midi {
         \tempo 4:84
index 61f1c1b613d3aa779857a10da93a3be256cb530a..792cbc46aeba693fd42e14401b3d7bdb84333ab5 100644 (file)
@@ -23,7 +23,7 @@ Includable_lexer::new_input(String s, Sources  * global_sources)
     if (!sl) {
        LexerError("Can't find file `" + s+ "'");
        return; 
-    } else
+    }
 
     
     char_count_stack_.push(0);
@@ -45,8 +45,8 @@ Includable_lexer::close_input()
     char_count_stack_.pop();
     cout << "]"<<flush;
     yy_delete_buffer(yy_current_buffer );
+    yy_current_buffer = 0;
     if (state_stack_.empty()) {
-       yy_current_buffer = 0;
        return false;
     }else {
        yy_switch_to_buffer(state_stack_.pop());
index e742bee900f7afec08bcbd6fed600b72681bae35..4f44c07fd965c9b92af0aadfe54abba14702a9c6 100644 (file)
@@ -8,7 +8,7 @@
 #include "rational.hh"
 class String;
 typedef Rational Moment;
-void print(Moment);
+void printm(Moment const&);
 
 
 #endif // 
index 46ed554d500dadd80625bef318d4c0b20146af4e..2557acb2a5af4361eccb35f12c336a97e650fe87 100644 (file)
@@ -1,9 +1,17 @@
+/*
+  moment.cc -- implement Moment
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include <iostream.h>
 #include "string.hh"
 #include "moment.hh"
 
 void
-print(Moment m)
+printm(Moment const &m)
 {
     cout << String(m) << flush;
 }
index 1f39e39a1d1e192381df5ccc6206aeafe1dafb22..779974957f9061a58992188e3d7caa8018cda294 100644 (file)
@@ -1,7 +1,7 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 67
+PATCH_LEVEL = 68
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-MY_PATCH_LEVEL =
+MY_PATCH_LEVEL = pre
index f32586508f3d3d57ff3a1a3e2741d24a170d2276..1e9ca02e60f999cf6af81f4cd453aa1a156ff3b2 100644 (file)
@@ -1,11 +1,10 @@
 # kept in dist bo stripping stable stuff, still to copy...
 
 # a bit of a hack to keep exec size under control.
-stablecc=command-request.cc musical-request.cc bar.cc boxes.cc \
-       item.cc keyword.cc leastsquares.cc \
+stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \
+       keyword.cc leastsquares.cc \
        lookup.cc molecule.cc meter.cc\
        paper-def.cc parser.cc lexer.cc qlp.cc qlpsolve.cc\
        template1.cc template2.cc template3.cc template4.cc\
        template5.cc template6.cc version.cc tex-stream.cc  tex.cc\
-       voice.cc \
-       voice-element.cc identifier.cc note.cc\
+       identifier.cc note.cc\
index 0ca9649b35c04fde9981f4328feb0760b182955e..f90625a25f46e610bb53ed5870f301458ca086af 100644 (file)
 void
 Atom::print() const
 {
-    mtor << "texstring: " <<sym.tex<<"\n";    
+    mtor << "texstring: " <<sym_.tex<<"\n";    
 }
 
 Box
 Atom::extent() const
 {
-    Box b( sym.dim);
-    b.translate(off);
+    Box b( sym_.dim);
+    b.translate(off_);
     return b;
 }
 
 Atom::Atom(Symbol s)
 {
-    sym=s;
+    sym_=s;
 }
 
 
@@ -39,14 +39,14 @@ String
 Atom::TeX_string() const
 {
     /* infinity checks. */
-    assert( abs(off.x) < 100 CM);
-    assert( abs(off.y) < 100 CM);
+    assert( abs(off_.x) < 100 CM);
+    assert( abs(off_.y) < 100 CM);
     
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
-    a.push(print_dimen(off.y));
-    a.push(print_dimen(off.x));
-    a.push(sym.tex);
+    a.push(print_dimen(off_.y));
+    a.push(print_dimen(off_.x));
+    a.push(sym_.tex);
     return substitute_args(s, a);
 }
index c66a33bdb4cab77d877adfe4b79dd76083b76d2c..46f7bf3b82f3b0903690fbf332c75f4f2157703b 100644 (file)
 
 Bar_register::Bar_register()
 {
-    post_move_processing();
+    do_post_move_processing();
 }
 
 bool
-Bar_register::try_request(Request*r_l)
+Bar_register::do_try_request(Request*r_l)
 {
     Command_req* c_l = r_l->command();
     if (!c_l|| !c_l->bar()) 
@@ -32,12 +32,13 @@ Bar_register::try_request(Request*r_l)
 }
 
 void
-Bar_register::process_requests()
+Bar_register::do_process_requests()
 {
     if (bar_req_l_ ) {
-       bar_p_ = new Bar(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_) {
-       bar_p_ = new Bar("|");
+       bar_p_ = new Bar;
     }
     
     if (bar_p_){
@@ -46,42 +47,24 @@ Bar_register::process_requests()
 }
 
 
-
-void
-Bar_register::split_bar(Bar *& pre, Bar * no, Bar * &post)
-{
-    String s= no->type;
-    if (s == ":|:") {
-       pre = new Bar(":|");
-       post = new Bar("|:");
-    }else if (s=="|:") {
-       post = new Bar(s);
-    } else {
-       pre = new Bar(*no);
-    }
-}
-
 void 
-Bar_register::pre_move_processing()
+Bar_register::do_pre_move_processing()
 {
       if (bar_p_) {
-         Bar * post_p =0;
-         Bar * pre_p =0;
-         split_bar(pre_p, bar_p_, post_p);
-         
-         typeset_breakable_item(pre_p, bar_p_, post_p);
+         typeset_breakable_item(bar_p_);
          bar_p_ =0;
       }
 }
 
 void
-Bar_register::post_move_processing()
+Bar_register::do_post_move_processing()
 {
     bar_req_l_ = 0;
     bar_p_ =0;
 }
 
 IMPLEMENT_STATIC_NAME(Bar_register);
+IMPLEMENT_IS_TYPE_B1(Bar_register,Request_register);
 ADD_THIS_REGISTER(Bar_register);
 
 
index 8a6891b330bab5ac50a075e6dc59e588e47d60e8..cf8d15bef287151dea74c8974f0f3e698b3243e3 100644 (file)
 #include "lookup.hh"
 #include "debug.hh"
 
-Bar::Bar( String t)
+Bar::Bar()
 {
-    type = t;
+    type_str_ = "|";
 }
 
+
 IMPLEMENT_STATIC_NAME(Bar);
+IMPLEMENT_IS_TYPE_B1(Bar,Item);
 
 void
 Bar::do_print()const
 {
-    mtor << type;
+    mtor << type_str_;
 }
 
 Molecule*
 Bar::brew_molecule_p()const
 {    
-    Symbol s = paper()->lookup_l()->bar(type);
+    Symbol s = paper()->lookup_l()->bar(type_str_);
     Molecule*output = new Molecule(Atom(s));
     return output;
 }
+
+/**
+  TODO: parametrise this (input-settable)
+ */
+char const *bar_breaks[][3] ={
+    {":|", ":|:", "|:"},
+    {"|", "|", ""},
+    {"", "|:", "|:"},
+    {"||.", "||.", ""},
+    {0,0,0}
+};
+
+void
+Bar::do_pre_processing()
+{
+    for (int i=0; bar_breaks[i][0]; i++) {
+       if (bar_breaks[i][1] == type_str_)
+           type_str_ = bar_breaks[i][break_status_i()+1];
+    }
+    
+    transparent_b_ = empty_b_ = (type_str_ == "");
+}
     
index 3d16d96518d54b2d0416a069e46324c4880d6d01..cf2eb652a846f9924cbeec122519387198890f9a 100644 (file)
@@ -12,6 +12,9 @@
   
 */
 
+#include <math.h>
+
+#include "p-col.hh"
 #include "varray.hh"
 #include "proto.hh"
 #include "dimen.hh"
@@ -21,7 +24,6 @@
 #include "symbol.hh"
 #include "molecule.hh"
 #include "leastsquares.hh"
-#include "p-col.hh"
 #include "stem.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -79,16 +81,30 @@ Beam::add(Stem*s)
 void
 Beam::set_default_dir()
 {
-    int dirs_single = 0, dirs_chord = 0;
+    int up = 0, down = 0;
+    int up_count = 0, down_count = 0;
+
     for (int i=0; i <stems.size(); i++) {
        Stem *sl = stems[i];
-       if (sl->chord_b())
-           dirs_chord += sl->get_default_dir();
-       else
-           dirs_single += sl->get_center_distance();
+       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++;
+       }
     }
-    dirs_single = -sign(dirs_single);
-    dir_i_ = (dirs_single + dirs_chord > 0) ? 1 : -1;
+    if (!down)
+       down_count = 1;
+    if (!up)
+       up_count = 1;
+
+    // the following relation is equal to
+    //        up / up_count > down / down_count
+    dir_i_ = (up * down_count > down * up_count) ? 1 : -1;
 
    for (int i=0; i <stems.size(); i++) {
        Stem *sl = stems[i];
@@ -103,7 +119,7 @@ void
 Beam::solve_slope()
 {
     Array<Stem_info> sinfo;
-  for (int j=0; j <stems.size(); j++) {
+    for (int j=0; j <stems.size(); j++) {
        Stem *i = stems[j];
 
        i->set_default_extents();
@@ -131,7 +147,9 @@ Beam::solve_slope()
     }
     left_pos += dy;
     left_pos *= dir_i_;    
+
     slope *= dir_i_;
+    slope = 0.6 * tanh(slope);  // damping
 
                                // ugh
     Real sl = slope*paper()->internote_f();
@@ -195,8 +213,6 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
 void
 Beam::do_pre_processing()
 {
-    left_col_l_ = stems[0]   ->pcol_l_;
-    right_col_l_ = stems.top()->pcol_l_;    
     assert(stems.size()>1);
     if (!dir_i_)
        set_default_dir();
@@ -239,7 +255,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        a.translate(Offset (-w, -w * sl));
        for (int j = 0; j  < lhalfs; j++) {
            Atom b(a);
-           b.translate(Offset(0, -dir_i_ * dy * (lwholebeams+j)));
+           b.translate_y( -dir_i_ * dy * (lwholebeams+j));
            leftbeams.add( b );
        }
     }
@@ -254,7 +270,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        int j = 0;
        for (; j  < rwholebeams; j++) {
            Atom b(a);
-           b.translate(Offset(0, -dir_i_ * dy * j));
+           b.translate_y( -dir_i_ * dy * j);
            rightbeams.add( b ); 
        }
 
@@ -264,7 +280,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        
        for (; j  < rwholebeams + rhalfs; j++) {
            Atom b(a);
-           b.translate(Offset(0, -dir_i_ * dy * j));
+           b.translate_y( -dir_i_ * dy * j);
            rightbeams.add(b ); 
        }
        
@@ -291,11 +307,12 @@ Beam::brew_molecule_p() const
        sb.translate(Offset(x, (x * slope  + left_pos)* inter));
        out->add(sb);
     }
-    out->translate(Offset(x0 - left_col_l_->hpos,0));
+    out->translate_x(x0 - left_col_l_->hpos);
     return out;
 }
 
 IMPLEMENT_STATIC_NAME(Beam);
+IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
 
 void
 Beam::do_print()const
index e24f79d067c16ccd46d52bd6816b2d084a03c87e..de9269b2e45fb8085e3d6ebdf1cdb750a9ca25e1 100644 (file)
@@ -56,3 +56,4 @@ Bow::brew_molecule_p() const
 }
 
 IMPLEMENT_STATIC_NAME(Bow);
+IMPLEMENT_IS_TYPE_B1(Bow,Directional_spanner);
diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc
new file mode 100644 (file)
index 0000000..808a781
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+  break-align-item.cc -- implement Break_align_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "break-align-item.hh"
+
+void
+Break_align_item::do_pre_processing()
+{
+
+    align_i_ = break_status_i();
+    Horizontal_align_item::do_pre_processing();
+}
+IMPLEMENT_STATIC_NAME(Break_align_item);
+IMPLEMENT_IS_TYPE_B1(Break_align_item, Horizontal_align_item);
index 055b282b2ef59806f90a8280abbd44ad2cc8afaf..626cfe64becdadeac6d4c37d55cafd251fe2df17 100644 (file)
 #include "clef-reg.hh"
 
 
+void
+Clef_item::do_pre_processing()
+{
+    change_b_ = ! (break_status_i() == 1);
+
+    if (default_b_){
+       empty_b_ = (break_status_i() != 1);
+       transparent_b_ = (break_status_i() != 1);
+    }
+}
 
 Clef_item::Clef_item()
 {
-    change = true;
+    default_b_ = false;
+    change_b_ = true;
     read("violin");
 }
 
@@ -44,12 +55,13 @@ Molecule*
 Clef_item::brew_molecule_p()const
 {
     String t = type_;
-    if  (change)
+    if  (change_b_)
        t += "_change";
     Symbol s = paper()->lookup_l()->clef(t);
     Molecule*output = new Molecule(Atom(s));
-    output->translate(Offset(0, paper()->internote_f() * y_off));
+    output->translate_y( paper()->internote_f() * y_off);
     return output;
 }
 
 IMPLEMENT_STATIC_NAME(Clef_item);
+IMPLEMENT_IS_TYPE_B1(Clef_item,Item);
index 9f1d5fa9c7bed8c2311eda5691119a10ec1031d2..4e3d25eb401dd986497da0431b54bdc73df99dd9 100644 (file)
@@ -6,20 +6,20 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>,
   Mats Bengtsson <matsb@s3.kth.se>
 */
+
 #include "bar.hh"
 #include "clef-reg.hh"
 #include "clef-item.hh"
 #include "debug.hh"
 #include "command-request.hh"
 #include "time-description.hh"
-#include "staff-column.hh"
 
 Clef_register::Clef_register()
 {
     clef_p_ = 0;
+    clef_req_l_ =0;
     
-    /* ugly hack to prevent segfault (daddy_reg_l_ == 0 at construction) */
-    clef_type_str_ = "";       
+    set_type("violin");
 }
 
 bool
@@ -34,13 +34,18 @@ Clef_register::set_type(String s)
        c0_position_i_= 6;
     } else if (clef_type_str_ == "bass") {
        c0_position_i_= 10;
-    }else 
+    } else 
        return false;
-    *get_staff_info().c0_position_i_l_ = c0_position_i_;
     
     return true;
 }
 
+void
+Clef_register::fill_staff_info(Staff_info &i)
+{
+    i.c0_position_i_l_ = &c0_position_i_;
+}
+
 void 
 Clef_register::read_req(Clef_change_req*c_l)
 {
@@ -50,15 +55,23 @@ Clef_register::read_req(Clef_change_req*c_l)
 void
 Clef_register::acknowledge_element(Score_elem_info info)
 {
-    if (info.elem_l_->name() == Bar::static_name()) {
+    if (info.elem_l_->name() == Bar::static_name() ) {
        if (!clef_p_){
            create_clef();
-           clef_p_->change = false;
+           clef_p_->default_b_ = true;
        }
     }
 }
+
+void
+Clef_register::do_creation_processing()
+{
+    create_clef();
+    clef_p_->default_b_ = false;
+}
+
 bool
-Clef_register::try_request(Request * r_l)
+Clef_register::do_try_request(Request * r_l)
 {
     Command_req* creq_l= r_l->command();
     if (!creq_l || !creq_l->clefchange())
@@ -74,45 +87,46 @@ Clef_register::try_request(Request * r_l)
 void 
 Clef_register::create_clef()
 {
-    clef_p_ = new Clef_item;
-    clef_p_->read(*this);
-    announce_element(Score_elem_info(clef_p_,
-                                        clef_req_l_));
-}
+    if (!clef_p_) {
+       clef_p_ = new Clef_item;
+        announce_element(Score_elem_info(clef_p_,
+                                    clef_req_l_));
+    
+       clef_p_->read(*this);
+    }
 
+}
 void
-Clef_register::process_requests()
+Clef_register::do_process_requests()
 {
     if (clef_req_l_) {
        create_clef();
-       clef_p_->change = true;
+       clef_p_->default_b_ = false;
     }
 }
 
 void
-Clef_register::pre_move_processing()
+Clef_register::do_pre_move_processing()
 {
     if (!clef_p_)
        return;
-    if (clef_p_->change) {
-       Clef_item* post_p = new Clef_item(*clef_p_);
-       post_p->change = false;
-       typeset_breakable_item(new Clef_item(*clef_p_),
-                              clef_p_,  post_p);
-    } else {
-       typeset_breakable_item(0, 0, clef_p_);
-    }
+    typeset_breakable_item(clef_p_);
     clef_p_ = 0;
 }
     
 void
-Clef_register::post_move_processing()
+Clef_register::do_post_move_processing()
 {
     clef_req_l_ = 0;
-    /* not in ctor, since the reg might not be linked in.*/
-    if (clef_type_str_ == "") {        
-       set_type("violin");
-    }
 }
+
+void
+Clef_register::do_removal_processing()
+{
+    delete clef_p_;
+    clef_p_ =0;
+}
+
 IMPLEMENT_STATIC_NAME(Clef_register);
+IMPLEMENT_IS_TYPE_B1(Clef_register,Request_register);
 ADD_THIS_REGISTER(Clef_register);
index 73582d5d9072f36d44a704d61f985d47d15a7e6c..8a895d79c80e32a4fd7c1157f406c48c8c8068de 100644 (file)
@@ -23,7 +23,7 @@ Collision_register::acknowledge_element(Score_elem_info i)
 }
 
 void
-Collision_register::pre_move_processing()
+Collision_register::do_pre_move_processing()
 {
     if (col_p_) {
        typeset_element(col_p_);
@@ -36,4 +36,5 @@ Collision_register::Collision_register()
 }
 
 IMPLEMENT_STATIC_NAME(Collision_register);
+IMPLEMENT_IS_TYPE_B1(Collision_register,Request_register);
 ADD_THIS_REGISTER(Collision_register);
index 8f43ee4233b86f180dff743d78c4ca80638420dd..554d54ac60bb45666769125b9fdfbce011c85a81 100644 (file)
@@ -120,7 +120,8 @@ Collision::do_pre_processing()
 // reproduction of bugfix at 3am ?
        Note_head * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
        Note_head * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
-       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_  && middle.length() == 0 )) {
+       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ 
+              && nu_l->dots_i_ == nd_l->dots_i_  && middle.length() == 0 )) {
            x_off[idx(1,0)] -= 0.5;
            x_off[idx(1,1)] -= 0.5;
            x_off[idx(-1,1)] += 0.5;
@@ -139,6 +140,7 @@ Collision::do_pre_processing()
 }
 
 IMPLEMENT_STATIC_NAME(Collision);
+IMPLEMENT_IS_TYPE_B1(Collision, Item);
 
 void
 Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l)
index 7a70fced2eeceb43564bbf9f2a6dcb14afa92f9e..1d4b35dadf3c56c12b69fa37326ae0123dcb10db 100644 (file)
@@ -14,7 +14,10 @@ void
 Command_script_req::do_print() const
 {}
 IMPLEMENT_STATIC_NAME(Command_script_req);
+IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
+
 IMPLEMENT_STATIC_NAME(Cadenza_req);
+IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
 
 void
 Cadenza_req::do_print()const
@@ -36,6 +39,7 @@ Bar_req::compare(Bar_req const &c1)const
 }
 
 IMPLEMENT_STATIC_NAME(Bar_req);
+IMPLEMENT_IS_TYPE_B1(Bar_req,Command_req);
 
 void
 Bar_req::do_print() const
@@ -55,22 +59,26 @@ Partial_measure_req::Partial_measure_req(Moment m)
 /* *************** */
 
 IMPLEMENT_STATIC_NAME(Timing_req);
+IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
 
 void
 Timing_req::do_print()const{}
 
 IMPLEMENT_STATIC_NAME(Command_req);
+IMPLEMENT_IS_TYPE_B1(Command_req,Request);
 
 void
 Command_req::do_print()const{}
 /* *************** */
 IMPLEMENT_STATIC_NAME(Barcheck_req);
+IMPLEMENT_IS_TYPE_B1(Barcheck_req,Timing_req);
 
 void
 Barcheck_req::do_print() const{}
 
 /* *************** */
 IMPLEMENT_STATIC_NAME(Clef_change_req);
+IMPLEMENT_IS_TYPE_B1(Clef_change_req,Command_req);
 
 void
 Clef_change_req::do_print() const
@@ -86,6 +94,7 @@ Clef_change_req::Clef_change_req(String s)
 }
 /* *************** */
 IMPLEMENT_STATIC_NAME(Group_feature_req);
+IMPLEMENT_IS_TYPE_B1(Group_feature_req,Command_req);
 
 void
 Group_feature_req::do_print() const
@@ -95,25 +104,10 @@ Group_feature_req::do_print() const
 #endif
 }
 
-IMPLEMENT_STATIC_NAME(Group_change_req);
-
-void
-Group_change_req::do_print()const
-{
-#ifndef NPRINT
-    mtor << "id : " << newgroup_str_;
-#endif
-}
 /* *************** */
-IMPLEMENT_STATIC_NAME(Terminate_voice_req);
-
-void
-Terminate_voice_req::do_print()const
-{
-}
 
-/* *************** */
 IMPLEMENT_STATIC_NAME(Partial_measure_req);
+IMPLEMENT_IS_TYPE_B1(Partial_measure_req,Timing_req);
 
 void
 Partial_measure_req::do_print() const
@@ -122,6 +116,7 @@ Partial_measure_req::do_print() const
 }
 
 IMPLEMENT_STATIC_NAME(Meter_change_req);
+IMPLEMENT_IS_TYPE_B1(Meter_change_req,Timing_req);
 
 void
 Meter_change_req::do_print() const
@@ -151,6 +146,7 @@ Meter_change_req::set(int b,int o)
 /* *************** */
 
 IMPLEMENT_STATIC_NAME(Measure_grouping_req);
+IMPLEMENT_IS_TYPE_B1(Measure_grouping_req,Timing_req);
 
 void
 Measure_grouping_req::do_print() const
@@ -171,6 +167,7 @@ Key_change_req::transpose(Melodic_req const & d)const
 }
 
 IMPLEMENT_STATIC_NAME(Key_change_req);
+IMPLEMENT_IS_TYPE_B1(Key_change_req,Command_req);
 void
 Key_change_req::squash_octaves()
 {
diff --git a/lily/complex-walker.cc b/lily/complex-walker.cc
deleted file mode 100644 (file)
index d32d9db..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-  complex-walker.cc -- implement Complex_walker
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "score.hh" 
-#include "staff-column.hh"
-#include "voice.hh"
-#include "p-score.hh"
-#include "debug.hh"
-#include "complex-walker.hh"
-#include "walk-regs.hh"
-#include "score-elem.hh"
-#include "staff.hh"
-#include "staffline.hh"
-
-void
-Complex_walker::do_post_move()
-{
-    walk_regs_p_->post_move_processing();
-}
-
-void
-Complex_walker::do_pre_move()
-{
-    walk_regs_p_->pre_move_processing();
-}
-
-void
-Complex_walker::do_announces()
-{
-    walk_regs_p_->do_announces();
-}
-
-
-void
-Complex_walker::try_request(Request*req)
-{
-    bool b =walk_regs_p_->try_request(req);
-    if (!b)
-       req->warning("junking request: "  + String(req->name()));
-}
-
-void
-Complex_walker::process_requests()
-{
-    Staff_column*c =ptr();
-
-    for (int i=0; i < c->creationreq_l_arr_.size(); i++) {
-       try_request(c->creationreq_l_arr_[i]);
-    }    
-    for (int i=0; i < c->commandreq_l_arr_.size(); i++) {
-       try_request(c->commandreq_l_arr_[i]);
-    }
-
-    for (int i=0; i < c->musicalreq_l_arr_.size(); i++) {
-       try_request(c->musicalreq_l_arr_[i]);
-    }
-
-    regs_process_requests();
-    do_announces();
-}
-
-void
-Complex_walker::regs_process_requests()
-{
-    walk_regs_p_->process_requests();
-}
-
-void
-Complex_walker::typeset_element(Score_elem *elem_p)
-{
-    if (!elem_p)
-       return;
-    staff_l_->staff_line_l_->add_element(elem_p);
-    if (elem_p->spanner())
-       pscore_l_->typeset_unbroken_spanner(elem_p->spanner());
-    else
-       ptr()->typeset_musical_item(elem_p->item()); 
-}
-
-Complex_walker::Complex_walker(Staff*s)
-    : Staff_walker(s, s->score_l_->pscore_p_)
-{
-    walk_regs_p_ = new Walker_registers(this);    
-    do_post_move();
-}
-
-
-Complex_walker::~Complex_walker()
-{
-    delete walk_regs_p_;
-}
-
-
-
index 4ca1196b091090d27deeccf8d6d7cad9422bb0d3..bcf6c1c8b79a58c033f463716541afef28eb50db 100644 (file)
@@ -54,3 +54,4 @@ Crescendo::brew_molecule_p() const
 }
 
 IMPLEMENT_STATIC_NAME(Crescendo);
+IMPLEMENT_IS_TYPE_B1(Crescendo,Spanner);
index a2bce7c8ce91019fe80e30ee87bfcef43557b768..3d046bd4147ffdc26a486b54b4366423b49999f3 100644 (file)
@@ -5,9 +5,12 @@
 #include "debug.hh"
 #include "dstream.hh"
 #include "flower-debug.hh"
+#include "moment.hh"
 
 Dstream *monitor=0;
 ostream * nulldev =0;
+static void (*rat_printer)(Moment const&);
+
 // ugh
 struct _Dinit {
     _Dinit() {
@@ -41,6 +44,7 @@ float_handler(int)
 void
 debug_init()
 {
+    rat_printer = printm;      // make sure this is linked in
 #ifndef NDEBUG
     set_new_handler(&mynewhandler);
 #endif
@@ -56,6 +60,6 @@ set_debug(bool b)
 {
     check_debug =b;
     set_flower_debug(*monitor, check_debug);
-  }
+}
 
 
index 94b887432a47a6f8c60e0e90c4f578cd136cc2b8..3e953a651959af05f95d8e0501e22471526d61f0 100644 (file)
 Dynamic_register::Dynamic_register()
 {
     dir_i_ =0;
-    post_move_processing();
+    do_post_move_processing();
     dynamic_p_ =0;
     to_end_cresc_p_ = cresc_p_ = 0;
     cresc_req_l_ = 0;
 }
 
 void
-Dynamic_register::post_move_processing()
+Dynamic_register::do_post_move_processing()
 {
     dynamic_req_l_arr_.set_size(0);
 }
 
 bool    
-Dynamic_register::try_request(Request * r)
+Dynamic_register::do_try_request(Request * r)
 {
     Musical_req * m = r->musical();
     if (!m || !m->dynamic())
@@ -41,7 +41,7 @@ Dynamic_register::try_request(Request * r)
     return true;
 }
 void
-Dynamic_register::process_requests()
+Dynamic_register::do_process_requests()
 {
     Crescendo*  new_cresc_p=0; 
     for (int i=0; i < dynamic_req_l_arr_.size(); i++) {
@@ -90,7 +90,7 @@ Dynamic_register::process_requests()
 }
 
 void
-Dynamic_register::pre_move_processing()
+Dynamic_register::do_pre_move_processing()
 {
     Staff_symbol* s_l = get_staff_info().staff_sym_l_;
     if (dynamic_p_) {
@@ -109,13 +109,6 @@ Dynamic_register::pre_move_processing()
     }
 }
 
-bool
-Dynamic_register::acceptable_request_b(Request*r)const
-{
-    Musical_req * m = r->musical();
-    return  (m && m->dynamic());
-}
-
 void
 Dynamic_register::set_feature(Feature i)
 {
@@ -124,6 +117,7 @@ Dynamic_register::set_feature(Feature i)
 }
 
 IMPLEMENT_STATIC_NAME(Dynamic_register);
+IMPLEMENT_IS_TYPE_B1(Dynamic_register,Request_register);
 ADD_THIS_REGISTER(Dynamic_register);
 
 Dynamic_register::~Dynamic_register()
diff --git a/lily/elem-group-item.cc b/lily/elem-group-item.cc
new file mode 100644 (file)
index 0000000..2c174c6
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+  elem-group-item.cc -- implement Horizontal_vertical_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "elem-group-item.hh"
+
+void
+Horizontal_vertical_group_item::do_print()const
+{
+    Horizontal_vertical_group::do_print();
+}
+IMPLEMENT_STATIC_NAME(Horizontal_vertical_group_item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item);
+    
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+IMPLEMENT_STATIC_NAME(Horizontal_group_item);
index e4a012d3f3cab6bd921e26384cf9ab7d2d550d9f..e104187fc24c85cbb21dc9a3a49f78a5a75ab9f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
 elem-group.cc -- implement Element_group
elem-group.cc -- implement Horizontal_vertical_group
 
   source file of the GNU LilyPond music typesetter
 
 #include "item.hh"
 #include "debug.hh"
 
+bool
+Elbement_group::contains_b(Score_elem const*e)const
+{
+    return elem_l_arr_.find_l(e);
+}
+
 Interval
-Element_group::do_height()const 
+Vertical_group::do_height()const 
 {
     Interval r;
     for (int i=0; i < elem_l_arr_.size(); i++) 
@@ -21,7 +27,7 @@ Element_group::do_height()const
 }
 
 Interval
-Element_group::do_width()const 
+Horizontal_group::do_width()const 
 {
     Interval r;
     for (int i=0; i < elem_l_arr_.size(); i++) 
@@ -30,27 +36,55 @@ Element_group::do_width()const
     return r;
 }
 
+IMPLEMENT_STATIC_NAME(Horizontal_group);
+IMPLEMENT_IS_TYPE_B1(Horizontal_group, Elbement_group);
+IMPLEMENT_IS_TYPE_B1(Vertical_group, Elbement_group);
+IMPLEMENT_STATIC_NAME(Vertical_group);
+
 void
-Element_group::add_element(Score_elem*i_l)
+Elbement_group::add_element(Score_elem*i_l)
 {
-    i_l->group_element_i_ ++;
-    
-    assert(! elem_l_arr_.find_l(i_l));
+    assert(i_l!= this);
+    assert(! contains_b(i_l));
+
     elem_l_arr_.push(i_l);
     add_dependency(i_l);
 }
 
 void
-Element_group::translate(Offset o)
+Horizontal_group::add_element(Score_elem*elt)
+{
+    elt->x_group_element_i_ ++;
+    Elbement_group::add_element(elt);
+}
+
+void
+Vertical_group::add_element(Score_elem*e)
+{
+    e->y_group_element_i_++;
+    Elbement_group::add_element(e);
+}
+
+
+void
+Horizontal_group::translate_x(Real x)
+{
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       elem_l_arr_[i]->translate_x(x);
+}
+
+void
+Vertical_group::translate_y(Real y)
 {
     for (int i=0; i < elem_l_arr_.size(); i++) 
-       elem_l_arr_[i]->translate(o);
+       elem_l_arr_[i]->translate_y(y);
 }
 
-IMPLEMENT_STATIC_NAME(Element_group);
+IMPLEMENT_STATIC_NAME(Elbement_group);
+IMPLEMENT_IS_TYPE_B1(Elbement_group, Score_elem);
 
 void
-Element_group::do_print() const
+Elbement_group::do_print() const
 {
 #ifndef NPRINT
     for (int i=0; i < elem_l_arr_.size(); i++) 
@@ -59,35 +93,91 @@ Element_group::do_print() const
 }
 
 void
-Element_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+Horizontal_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
 {
     int i;
 
     while ((i=elem_l_arr_.find_i(old))>=0) {
+       old->x_group_element_i_--;
        
-       old->group_element_i_--;
        if (new_l){ 
-           new_l->group_element_i_ ++;
+           new_l->x_group_element_i_ ++;
            elem_l_arr_[i] = new_l;
        }else {     
            elem_l_arr_.del(i);
        }
     }
+}
+
+void
+Vertical_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+{
+    int i;
 
+    while ((i=elem_l_arr_.find_i(old))>=0) {
+       old->y_group_element_i_--;
+       
+       if (new_l){ 
+           new_l->y_group_element_i_ ++;
+           elem_l_arr_[i] = new_l;
+       }else {     
+           elem_l_arr_.del(i);
+       }
+    }
 }
 
-String
-Element_group::TeX_string()const
+Vertical_group::Vertical_group(Vertical_group 
+                              const &s)
+    : Elbement_group(s)
 {
-    return "";
+   for (int i=0; i < elem_l_arr_.size(); i++) 
+       elem_l_arr_[i]->y_group_element_i_ ++;   
 }
 
-Element_group::Element_group(Element_group const&s)
-    :elem_l_arr_(s.elem_l_arr_)
+Horizontal_group::Horizontal_group(Horizontal_group 
+                                  const &s)
+    : Elbement_group(s)
 {
    for (int i=0; i < elem_l_arr_.size(); i++) 
-       elem_l_arr_[i]->group_element_i_ ++;   
+       elem_l_arr_[i]->x_group_element_i_ ++;   
+}
+
+Elbement_group::Elbement_group()
+{
+    transparent_b_ = true;
+}
+
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group);
+IMPLEMENT_STATIC_NAME(Horizontal_vertical_group);
+
+void
+Horizontal_vertical_group::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Vertical_group::do_substitute_dependency(o,n);
+    Horizontal_group::do_substitute_dependency(o,n);
+}
+
+void
+Horizontal_vertical_group::add_element(Score_elem*e)
+{
+    Vertical_group::add_element(e);
+    Horizontal_group::add_element(e);
+}
+
+void
+Horizontal_vertical_group::do_print()const
+{
+    Vertical_group::do_print();
 }
 
-Element_group::Element_group()
-{}
+void
+Vertical_group::do_print()const
+{
+    Elbement_group::do_print();
+}
+
+void
+Horizontal_group::do_print() const
+{
+    Elbement_group::do_print();
+}
index e35a56cc2e247116574231f2f66d3e0e09f1fb0c..688e9cdd36c933c537b60eb8cca3b07f4c042dfc 100644 (file)
@@ -68,3 +68,4 @@ General_script_def::get_atom(Paper_def*, int)const
     return Atom(s);
 }
 IMPLEMENT_STATIC_NAME(General_script_def);
+IMPLEMENT_IS_TYPE_B(General_script_def);
index f05f98c6aa4a6fba2f2bc6131f0691ef96a4b537..ca027af462f7d13136a1c3f2486129e57009efba 100644 (file)
@@ -38,7 +38,7 @@ add_request_register(String s, Reg_ctor f)
 
 
 Request_register*
-get_nongroup_register_p(String s)
+get_register_p(String s)
 {
     for (int i=0; i < reg_table->size(); i++) {
        if ((*reg_table)[i].name_str_ == s)
index 8a144ad142e6d9d97d7351f4ed9a5eb7a59ae324..e5a7279fa2df602483390c593c9ea2b2c13b1288 100644 (file)
@@ -7,18 +7,20 @@
 #include "note-head.hh"
 #include "head-reg.hh"
 #include "paper-def.hh"
-#include "complex-walker.hh"
 #include "musical-request.hh"
 
 Note_head_register::Note_head_register()
 {
     note_p_ = 0;
-    post_move_processing();
+    do_post_move_processing();
 }
 
 bool
-Note_head_register::try_request(Request *req_l) 
+Note_head_register::do_try_request(Request *req_l) 
 {
+    if (note_req_l_)
+       return false;
+    
     if (req_l->musical() && (req_l->musical()->note() || req_l->musical()->rest()))
        note_req_l_=req_l->musical()->rhythmic();
     else
@@ -28,7 +30,7 @@ Note_head_register::try_request(Request *req_l)
 }
 
 void
-Note_head_register::process_requests()
+Note_head_register::do_process_requests()
 {
     if (!note_req_l_)
        return;
@@ -53,7 +55,7 @@ Note_head_register::process_requests()
 }
 
 void
-Note_head_register::pre_move_processing()
+Note_head_register::do_pre_move_processing()
 {
     if (note_p_) {
        typeset_element(note_p_);
@@ -61,10 +63,11 @@ Note_head_register::pre_move_processing()
     }
 }
 void
-Note_head_register::post_move_processing()
+Note_head_register::do_post_move_processing()
 {
     note_req_l_ = 0;
 }
 
 IMPLEMENT_STATIC_NAME(Note_head_register);
+IMPLEMENT_IS_TYPE_B1(Note_head_register,Request_register);
 ADD_THIS_REGISTER(Note_head_register);
diff --git a/lily/horizontal-align-item.cc b/lily/horizontal-align-item.cc
new file mode 100644 (file)
index 0000000..6cfb0c0
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+  horizontal-align-item.cc -- implement Horizontal_align_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "horizontal-align-item.hh"
+IMPLEMENT_STATIC_NAME(Horizontal_align_item);
+IMPLEMENT_IS_TYPE_B1(Horizontal_align_item,Item);
+
+bool
+Horizontal_align_item::contains_b(Item *i)const
+{
+    return item_l_arr_.find_l(i);
+}
+
+void
+Horizontal_align_item::add(Item *i,int p)
+{
+    assert(! contains_b(i));
+    priority_i_arr_.push(p);
+    item_l_arr_.push(i);
+    add_dependency(i);
+}
+
+void
+Horizontal_align_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    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);
+    }
+}
+
+struct Horizontal_align_item_content {
+    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(Item*i, int p) {
+       priority_i_ = p;
+       item_l_ = i;
+    }
+    Horizontal_align_item_content(){item_l_ =0; priority_i_ =0; }
+};
+
+
+void
+Horizontal_align_item::do_pre_processing()
+{
+    {  
+       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_.set_size(0);
+       priority_i_arr_.set_size(0);
+       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++) {
+       
+       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;
+    for ( int i=0 ;  i < item_l_arr_.size(); i++) {
+       item_l_arr_[i]->translate_x(where_f -dims[i][-1] );
+       where_f += dims[i].length();
+    }
+}
+
+Interval
+Horizontal_align_item::do_width() const
+{
+    return Interval(0,0);
+}
+
+void
+Horizontal_align_item::do_print()const
+{
+}
+
+Horizontal_align_item::Horizontal_align_item()
+{
+    align_i_ = 0;
+    empty_b_ = true;
+    transparent_b_ = true;
+}
index 9829e40a42101ec67d3ab8fd1bdd10ab62631311..d306953191c8b144941eb8f17cf5431f932d6f2d 100644 (file)
@@ -8,19 +8,20 @@
 
 #include <assert.h>
 
+#include "score.hh"
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
 #include "input-register.hh"
-#include "input-score.hh" 
 #include "symtable.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
 #include "lookup.hh"
 #include "script-def.hh"
 #include "request.hh"
 #include "input-register.hh"
 
+IMPLEMENT_STATIC_NAME(Identifier);
+IMPLEMENT_IS_TYPE_B(Identifier);
+
 Identifier::~Identifier()
 {
     if (!accessed_b_ && !init_b_)
@@ -30,7 +31,7 @@ void
 Identifier::error(String expect)
 {
     String e("Wrong identifier type: ");
-    e += String(classname()) + "(expected " + expect + ")";
+    e += String(name()) + "(expected " + expect + ")";
     ::error(e);
 }
 
@@ -58,14 +59,12 @@ Class::do_print() const { \
 } \
 class Class
 
-DEFAULT_PRINT(Script_id, Script_def, script);
+DEFAULT_PRINT(Script_id, General_script_def, script);
 DEFAULT_PRINT(Lookup_id, Lookup, lookup);
 DEFAULT_PRINT(Symtables_id, Symtables, symtables);
-DEFAULT_PRINT(Staff_id, Input_staff, staff);
-DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
-DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
+DEFAULT_PRINT(Music_id,Music , music);
 DEFAULT_PRINT(Request_id, Request, request);
-DEFAULT_PRINT(Score_id, Input_score, score);
+DEFAULT_PRINT(Score_id, Score, score);
 DEFAULT_PRINT(Input_regs_id, Input_register, iregs);
 
 void
@@ -75,11 +74,7 @@ Real_id::do_print() const
     mtor << *((Real_id*)this)->real(false)<< "\n";
 }
 
-#define implement_id_class(Idclass, Class, accessor)   \
-char const * Idclass::classname() const\
-{\
-    return #Class;\
-}\
+#define default_accessor(Idclass, Class, accessor)\
 Class*\
 Idclass::accessor(bool copy) {\
        if (copy){ \
@@ -88,18 +83,32 @@ Idclass::accessor(bool copy) {\
         }else\
            return (Class*) data;\
     }\
+
+#define virtual_accessor(Idclass, Class, accessor)\
+Class*\
+Idclass::accessor(bool copy) {\
+       if (copy){ \
+           accessed_b_ = true;\
+           return (Class*) ((Class*) data)->clone();\
+        }else\
+           return (Class*) data;\
+    }\
+
+
+#define implement_id_class(Idclass, Class, accessor)   \
+IMPLEMENT_STATIC_NAME(Idclass)\
+IMPLEMENT_IS_TYPE_B1(Idclass,Identifier)\
 Idclass::~Idclass() { delete accessor(false); }\
 Idclass::Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\
 
 
+
 implement_id_class(Real_id, Real, real);
-implement_id_class(Script_id, Script_def, script);
+implement_id_class(Script_id, General_script_def, script);
 implement_id_class(Lookup_id, Lookup, lookup);
 implement_id_class(Symtables_id, Symtables, symtables);
-implement_id_class(Staff_id, Input_staff, staff);
-implement_id_class(M_chord_id, Music_general_chord, mchord);
-implement_id_class(M_voice_id, Music_voice, mvoice);
-implement_id_class(Score_id, Input_score, score);
+implement_id_class(Music_id, Music, music);
+implement_id_class(Score_id, Score, score);
 implement_id_class(Request_id, Request, request);
 implement_id_class(Input_regs_id, Input_register, iregs);
 
@@ -107,3 +116,13 @@ Identifier::Identifier(Identifier const&)
 {
     assert(false);
 }
+
+
+default_accessor(Real_id, Real, real);
+default_accessor(Script_id, General_script_def, script);
+default_accessor(Lookup_id, Lookup, lookup);
+default_accessor(Symtables_id, Symtables, symtables);
+virtual_accessor(Music_id, Music, music);
+default_accessor(Score_id, Score, score);
+virtual_accessor(Request_id, Request, request);
+default_accessor(Input_regs_id, Input_register, iregs);
diff --git a/lily/include/atom.hh b/lily/include/atom.hh
deleted file mode 100644 (file)
index 5e9f260..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-  atom.hh -- declare 
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef ATOM_HH
-#define ATOM_HH
-
-#include "symbol.hh"
-#error
-
-
-#endif // ATOM_HH
diff --git a/lily/include/bar-align-reg.hh b/lily/include/bar-align-reg.hh
new file mode 100644 (file)
index 0000000..7219cf4
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+  bar-align-reg.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_ALIGN_REG_HH
+#define BAR_ALIGN_REG_HH
+
+#endif // BAR_ALIGN_REG_HH
index f871915a01ccc69eddd23d590c2724a53a597933..8a6d1606c5bd224a44fcd582bc48beef9a253cd2 100644 (file)
   generate bars. Either user ("|:"), or default (new measure)
   */
 class Bar_register : public Request_register {
-    void split_bar(Bar *& pre, Bar * no, Bar * &post);
-public:
     Bar_req * bar_req_l_;
     Bar * bar_p_;
-    virtual bool try_request(Request *req_l);
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+public:
     Bar_register();
     NAME_MEMBERS();
+
+     
+protected:
+    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();
 };
 
 #endif // BARREG_HH
index eecc32f51fb0bc1c98ee583a6607bc0154f9dabc..447a807f0ac048d23c1b21e0d4ddc199c5396fa4 100644 (file)
  */
 class Bar:public Item {
 public:
-    String type;
+    String type_str_;
     
     NAME_MEMBERS();
-    Bar(String type);
+    SCORE_ELEM_CLONE(Bar)
+    Bar();
 private:
     void do_print() const;
+protected:
+    virtual void do_pre_processing();
     Molecule*brew_molecule_p()const;
 };
 #endif // BAR_HH
index d1e28ee4f683b36674f128a5fa15b7ba59812a68..01726c57df993a134e6318a96987c9e5744d5cd0 100644 (file)
@@ -31,7 +31,7 @@ public:
 
     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
     void set_stemlens();
-    SPANNER_CLONE(Beam)
+    SCORE_ELEM_CLONE(Beam)
 protected:
     virtual Interval do_width()const;    
     virtual Offset center() const;
diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh
new file mode 100644 (file)
index 0000000..916e284
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  break-align-item.hh -- declare Break_align_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BREAK_ALIGN_ITEM_HH
+#define BREAK_ALIGN_ITEM_HH
+
+#include "horizontal-align-item.hh"
+
+/// align breakable items (clef, bar, etc.)
+class Break_align_item : public Horizontal_align_item {
+
+protected:
+    virtual void do_pre_processing();
+public:
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Break_align_item)
+       
+};
+#endif // BREAK_ALIGN_ITEM_HH
index 23e346c083d49dfb3db49c066263bfd201b49582..ab089f0ffc48dc64fac2335a88e43b6eff9b2ab1 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
   clef-item.hh -- declare Clef_item
 
@@ -14,6 +13,7 @@
  */
 class Clef_item : public Item {
 protected:
+    virtual void do_pre_processing();
     Molecule* brew_molecule_p()const;
 public:
     
@@ -21,10 +21,14 @@ public:
     int y_off;
 
     /// is this a change clef (smaller size)?
-    bool change;
+    bool change_b_;
+    
+    /// set because of existence of a bar
+    bool default_b_;
 
     /* *************** */
-NAME_MEMBERS();
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Clef_item)
     Clef_item();
     void read(Clef_register const&);
     void read(String);
index b78f3dd682a55096f758c1197a4f3524f4e5ec2e..91dd8d57e78696a66813f59123d9d619f6d5174d 100644 (file)
@@ -19,10 +19,13 @@ class Clef_register : public  Request_register {
     void read_req(Clef_change_req*);
     bool set_type(String);
 protected:
-     virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
-    virtual bool try_request(Request*);
+     virtual void do_process_requests();
+    virtual void fill_staff_info(Staff_info&);
+    virtual void do_pre_move_processing();
+    virtual void do_removal_processing();
+    virtual void do_creation_processing();
+    virtual void do_post_move_processing();
+    virtual bool do_try_request(Request*);
     virtual void acknowledge_element(Score_elem_info);
 public:
     int c0_position_i_;
index 5eef92a9e96aed244cfa3c5c38badffb0b61768a..d0affb0df4eae1f2acfdde1141d6fc80c29345de 100644 (file)
@@ -17,7 +17,7 @@ class Collision_register : public Request_register {
 
 protected:
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
+    virtual void do_pre_move_processing();
 public:
     Collision_register();
     NAME_MEMBERS();
index c4676c76af8455d2e314e9c8f4890d23af4a4763..285d0cbb8501cdadf961eed0f655b21d9a97ef0c 100644 (file)
@@ -18,8 +18,6 @@
 class Command_req  : public virtual Request  {
 public:
     REQUESTMETHODS(Command_req, command);
-    virtual Terminate_voice_req *terminate() {return 0;}
-    virtual Group_change_req * groupchange() { return 0;}
     virtual Group_feature_req * groupfeature() { return 0; }
     virtual Measure_grouping_req * measuregrouping() { return 0; }
     virtual Clef_change_req * clefchange() { return 0; }
@@ -93,12 +91,6 @@ public:
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
-class Group_change_req  : public Command_req  {
-public:
-    String newgroup_str_;
-    REQUESTMETHODS(Group_change_req, groupchange);
-};
-
 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
   the latter should only happen at the start of a measure.  */
 class Bar_req  : public Command_req  {
@@ -108,10 +100,6 @@ public:
     int compare(const Bar_req&)const;
     REQUESTMETHODS(Bar_req,bar);
 };
-class Terminate_voice_req  : public Command_req  {
-public:
-    REQUESTMETHODS(Terminate_voice_req,terminate);
-};
 
 class Group_feature_req  : public Command_req  {
 public:
diff --git a/lily/include/complex-walker.hh b/lily/include/complex-walker.hh
deleted file mode 100644 (file)
index cc16eef..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  complex-walker.hh -- declare Complex_walker
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef COMPLEXWALKER_HH
-#define COMPLEXWALKER_HH
-
-#include "lily-proto.hh"
-#include "staff-walker.hh"
-#include "score-elem-info.hh"
-
-/**
-  A staff walker which uses registers to decide what to print
- */
-class Complex_walker: public Staff_walker {
-    bool try_command_request(Command_req *req_l);
-    void do_announces();
-    void try_request(Request*req);    
-
-
-    
-public:
-    Walker_registers *walk_regs_p_;
-    
-    /* *************** */
-
-    void regs_process_requests();
-    void typeset_element(Score_elem *elem_p);
-    void announce_element(Score_elem_info);
-    virtual void process_requests();
-    virtual void do_post_move();
-    virtual void do_pre_move();
-
-    Complex_walker(Staff*);
-    ~Complex_walker();
-
-private:
-};
-
-
-#endif // COMPLEXWALKER_HH
-
-
index 56a3e1a9212599941eb1212fa4550513c370a69e..ece423d154f2ada9c22327f3441969a47ebdb7e9 100644 (file)
@@ -26,7 +26,7 @@ public:
     bool left_dyn_b_;
     Crescendo();
 protected:
-    SPANNER_CLONE(Crescendo)
+    SCORE_ELEM_CLONE(Crescendo)
     virtual Molecule*brew_molecule_p()const;
     NAME_MEMBERS();
     
index a3f4e8876b65498635004344a3b93a8adaec51a6..71b0036b72b3e99ce030e690829a9adc2e4217ac 100644 (file)
@@ -4,7 +4,7 @@
 #include "real.hh"
 #include "string.hh"
 
-const Real INCH_TO_PT=72.0;
+const Real INCH_TO_PT=72.270;
 const Real CM_TO_PT=INCH_TO_PT/2.54;
 const Real MM_TO_PT=CM_TO_PT/10;
 const Real PT_TO_PT =1.0;
index 72823a79a1026c11cc5dea48cf260732a1b893dd..4e13d25a6fb8dab6ef561a8c1fd33a87b42288b6 100644 (file)
@@ -26,11 +26,10 @@ public:
     NAME_MEMBERS();
 protected:
     virtual void acknowledge_element(Score_elem_info);
-    virtual bool try_request(Request *req_l);
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
-    virtual bool acceptable_request_b(Request*) const;
+    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();
     virtual void set_feature(Feature);
 };
 
diff --git a/lily/include/elem-group-item.hh b/lily/include/elem-group-item.hh
new file mode 100644 (file)
index 0000000..6a79952
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  elem-group-item.hh -- declare Element_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ELEM_GROUP_ITEM_HH
+#define ELEM_GROUP_ITEM_HH
+
+#include "elem-group.hh"
+#include "item.hh"
+
+class Horizontal_vertical_group_item  : public Item, public Horizontal_vertical_group {
+public:
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Horizontal_vertical_group_item)
+protected:
+    virtual void do_print() const;
+};
+
+class Horizontal_group_item : public Item, public Horizontal_group {
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Horizontal_group_item)
+protected:
+    virtual void do_print() const { Elbement_group::do_print(); }
+};
+
+#endif // ELEM_GROUP_ITEM_HH
index c0a23ccbcb826a1bfd6f3e0f67530a55643394d7..c49c425a45e3493cfdbb2ff47c9f5d8f08861c32 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  elem-group.hh -- declare Element_group
+  elem-group.hh -- declare Horizontal_vertical_group
 
   source file of the GNU LilyPond music typesetter
 
 #define ELEM_GROUP_HH
 #include "score-elem.hh"
 
+class Elbement_group: public virtual Score_elem {
+protected:
+    Link_array<Score_elem> elem_l_arr_;
+    
+    virtual void do_print() const ;
+public:
+    Elbement_group();
+    bool contains_b(Score_elem const *)const;
+    void add_element(Score_elem*);
+    NAME_MEMBERS();
+       
+};
+
+class Horizontal_group : public Elbement_group {
+public:
+    NAME_MEMBERS();
+    Horizontal_group(Horizontal_group const&);
+    Horizontal_group(){}
+    void add_element(Score_elem*);
+protected:
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void do_print() const ;
+  virtual void translate_x(Real);
+    virtual Interval do_width()const;
+};
+
+class Vertical_group : public Elbement_group {
+protected:
+    virtual void translate_y(Real);
+    virtual void do_print() const ;
+  virtual Interval do_height()const;
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    void add_element(Score_elem*);
+public:
+    Vertical_group(Vertical_group const &);
+    Vertical_group(){}
+    NAME_MEMBERS();
+};
+
 /** A class to treat a group of elements as a single entity. The
   dimensions are the unions of the dimensions of what it contains.
   Translation means translating the contents.
   */
-class Element_group : virtual Score_elem{  
+class Horizontal_vertical_group : public Vertical_group, 
+                                 public Horizontal_group 
+{  
 protected:
-    Link_array<Score_elem> elem_l_arr_;
-    virtual void do_substitute_dependency(Score_elem* old, Score_elem* new_l);
-    virtual Interval do_height()const;
-    virtual Interval do_width()const;
-    virtual void do_print() const ;
-    virtual Element_group* elem_group() { return this; }
-    
-    
+    virtual Horizontal_vertical_group* elem_group() { return this; }
 public:
     Element_group();
-    Element_group(Element_group const&);
+    bool contains_b(Score_elem const *)const;
     NAME_MEMBERS();
-    virtual void translate(Offset);
-    virtual void add_element(Score_elem*);
-    virtual String TeX_string()const;
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void do_print() const;
+    void add_element(Score_elem*);
 };
 
 #endif // ELEM_GROUP_HH
index 82487b688202d71ece28cea1456f5523a1b0687d..e4e3c1ef16e746b52ba08cd8c6237f064ab4d4c6 100644 (file)
@@ -15,10 +15,10 @@ struct Note_head_register : Request_register {
     
     /* *************** */
     Note_head_register();
-    virtual bool try_request(Request *req_l) ;
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    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();
     NAME_MEMBERS();
 };
 
diff --git a/lily/include/horizontal-align-item.hh b/lily/include/horizontal-align-item.hh
new file mode 100644 (file)
index 0000000..6132046
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+  horizontal-align-item.hh -- declare Horizontal_align_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef HORIZONTAL_ALIGN_ITEM_HH
+#define HORIZONTAL_ALIGN_ITEM_HH
+#include "elem-group.hh"
+#include "item.hh"
+
+/**
+  Order elems left to right.
+
+  TODO: insert(order, elem)
+  */
+class Horizontal_align_item :  public Item {
+protected:
+    Link_array<Item> item_l_arr_;
+    Array<int> priority_i_arr_;
+    int align_i_;
+    
+public:
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Horizontal_align_item)
+    void add(Item*, int p);
+    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;
+};
+#endif // HORIZONTAL_ALIGN_ITEM_HH
index 1a413cfef4210faabf630bca0c8e8ad6692e613d..bd45068ab4ddc6c84abb957b78f1e9c85e05964e 100644 (file)
@@ -10,6 +10,7 @@
 #include "lily-proto.hh"
 #include "string.hh"
 #include "input.hh"
+#include "virtual-methods.hh"
 
 /* boolean argument to accesor is copy_b..*/
 #define IDACCESSOR( Input_staff, staff)\
@@ -27,20 +28,17 @@ struct Identifier : public Input {
     virtual ~Identifier() ;
 
     void print()const;
-    virtual char const *classname() const{ return "new Identifier"; }
+    NAME_MEMBERS();
     void error(String);
-    IDACCESSOR(Input_staff, staff)
-    IDACCESSOR(Input_music, music)
-    IDACCESSOR(Music_voice, mvoice)
+    IDACCESSOR(Music, music)
     IDACCESSOR(Input_register, iregs)  
-              
-    IDACCESSOR(Script_def, script)
+    IDACCESSOR(General_script_def, script)
     IDACCESSOR(Symtables, symtables)
-    IDACCESSOR(Music_general_chord, mchord)
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
     IDACCESSOR(Request, request)
-    IDACCESSOR(Input_score, score)
+    IDACCESSOR(Score, score)
+    IDACCESSOR(int, intid)
 
 protected:
     virtual void do_print()const=0;
@@ -50,7 +48,7 @@ private:
 
 #define declare_id_class(Idclass, Class, accessor)     \
 struct Idclass : Identifier {\
-       virtual char const *classname()const;\
+        NAME_MEMBERS();                            \
        Idclass(String s, Class*st, int code);\
        virtual Class* accessor(bool copy);\
        ~Idclass();\
@@ -60,13 +58,12 @@ struct Idclass : Identifier {\
 
 
 declare_id_class(Real_id, Real, real);
-declare_id_class(Script_id, Script_def, script);
+declare_id_class(Script_id, General_script_def, script);
 declare_id_class(Lookup_id, Lookup, lookup);
 declare_id_class(Symtables_id, Symtables, symtables);
-declare_id_class(Staff_id, Input_staff, staff);
-declare_id_class(M_chord_id, Music_general_chord, mchord);
-declare_id_class(M_voice_id, Music_voice, mvoice);
-declare_id_class(Score_id, Input_score, score);
+declare_id_class(Music_id, Music, music);
+declare_id_class(Int_id, int, intid);
+declare_id_class(Score_id, Score, score);
 declare_id_class(Request_id, Request, request);
 declare_id_class(Input_regs_id, Input_register, iregs);
 
diff --git a/lily/include/input-music.hh b/lily/include/input-music.hh
deleted file mode 100644 (file)
index 31c60c2..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-  input-music.hh -- part of GNU LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef INPUTMUSIC_HH
-#define INPUTMUSIC_HH
-
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "voice.hh"
-#include "moment.hh"
-
-struct Voice_list : public Link_list<Voice*> {
-    void translate_time(Moment dt);
-};
-
-/**
-
-  A set voices.
-  Input_music is anything that can simply be regarded as/converted to
-  a set of voices "cooperating" or independant. It has some basic
-  characteristics that real music has too:
-
-  - it is rhythmic (it has a length, and can be translated horizontally)
-  - a pitch (it can be transposed)
-
-  */
-struct Input_music {
-    virtual Voice_list convert()const=0;
-    virtual Moment length()const=0;
-    virtual void translate_time(Moment dt)=0;
-    virtual ~Input_music(){}
-    virtual void print() const =0;
-    virtual void set_default_group(String)=0;
-    virtual void transpose(Melodic_req const&) const =0;
-    
-    
-    virtual Input_music *clone() const = 0;
-    virtual Simple_music *simple() { return 0; }
-};
-
-/// Simple music consists of one voice
-struct Simple_music : Input_music {
-    Voice voice_;
-
-    /* *** */
-    virtual void transpose(Melodic_req const&) const ;
-
-    virtual Simple_music*simple() { return this; }  
-    void add(Voice_element*);
-    virtual void set_default_group(String g) { voice_.set_default_group(g); }
-    virtual Moment length()const;
-    virtual Voice_list convert()const;
-    virtual void translate_time(Moment dt);
-    virtual void print() const;
-    virtual Input_music *clone() const {
-       return new Simple_music(*this);
-    }
-};
-
-/// Complex_music consists of multiple voices
-struct Complex_music : Input_music {
-    Pointer_list<Input_music*> elts;
-    /* *************** */
-    virtual void transpose(Melodic_req const&) const ;
-    virtual void set_default_group(String g);
-    void add(Input_music*inmusic_p);
-    Complex_music();
-    Complex_music(Complex_music const &);
-    virtual void print() const ;
-    void concatenate(Complex_music*);
-};
-
-
-/**
-  A voice like list of music.
-
-  different music forms which start after each other ( concatenated,
-  stacked "horizontally )
- */
-
-struct Music_voice : Complex_music {
-    
-    /* *************** */
-    Moment length()const;
-    virtual void translate_time(Moment dt);
-    virtual Voice_list convert()const;
-    void add_elt(Voice_element*);
-    virtual Input_music *clone() const {
-       return new Music_voice(*this);
-    }
-    virtual void print() const ;
-};
-
-/**
-  Multiple musicstuff stacked on top of each other
-  chord like :
-
-  - different music forms which start at the same time ( stacked "vertically" )
-  
-  */
-struct Music_general_chord : Complex_music {
-
-
-    /* *************** */
-
-    virtual Moment length()const;
-    virtual Voice_list convert()const;
-    virtual void translate_time(Moment dt);
-    void add_elt(Voice_element*);
-    virtual Input_music *clone() const {
-       return new Music_general_chord(*this);
-    }
-    
-    virtual void print() const ;
-};
-
-struct Multi_voice_chord : Music_general_chord {
-    void set_default_group(String);
-    virtual Input_music *clone() const {
-       return new Multi_voice_chord(*this);
-    }
-};
-struct Voice_group_chord : Music_general_chord {
-
-    virtual Input_music *clone() const {
-       return new Voice_group_chord(*this);
-    }
-};
-#endif // INPUTMUSIC_HH
index 74cfa7acf5c5698541569c44de3270cf76c0b189..2d088a146b84040804b41aa0de93783f8222b3fc 100644 (file)
 #include "string.hh"
 #include "lily-proto.hh"
 #include "input.hh"
+#include "string.hh"
+#include "varray.hh"
 
 struct Input_register : Input { 
-    Pointer_list<Input_register*> ireg_list_;
+    Pointer_list<Input_register*> contains_ireg_p_list_;
+    Array<String> consists_str_arr_;
+    Array<String> alias_str_arr_;
     String name_str_;
+
+    void add(Input_register *);
     
-    void add(Input_register*);
-    Input_register();
-    bool group_b() const;
-    ~Input_register();
-    /** Get an Input_register with a certain name
-
-      @return 0 if not found.
-      */
-    Input_register *get_ireg_l(String name) const;
-    Input_register(Input_register const&);
-    /** 
-      The names of all non -groups.
-      */
-    Array<String> get_nongroups_str_arr() const;
+    bool accept_req_b();
+    bool accepts_b(String);
     void print() const;
-    /**
-      Construct the registers.
-     */
-    Array<Request_register*> get_nongroup_p_arr()const;
+    Register_group_register * get_group_register_p();
+    Input_register * get_default_ireg_l();
+    Input_register * recursive_find(String nm);
+    Input_register * find_ireg_l(String nm);    
 };
 
-Request_register * get_nongroup_register_p(String);
+
+void add_global_input_register(Input_register* ireg_p);
+Input_register*lookup_reg(String);
+Request_register*get_register_p(String s);
 
 #endif // INPUT_REGISTER_HH
diff --git a/lily/include/input-score.hh b/lily/include/input-score.hh
deleted file mode 100644 (file)
index 436e5e0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  input-score.hh -- declare Input_score
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef INPUTSCORE_HH
-#define INPUTSCORE_HH
-
-#include "varray.hh"
-#include "lily-proto.hh"
-#include "plist.hh"
-#include "string.hh"
-#include "input.hh"
-
-/// the total music def of one movement
-class Input_score : public Input {
-public:
-    int errorlevel_i_;
-    
-    /// paper_, staffs_ and commands_ form the problem definition.
-    Paper_def *paper_p_;
-    Midi_def* midi_p_;
-    Pointer_list<Input_staff*> staffs_;
-
-    
-    /* *************************************************************** */
-    Input_score();
-    Input_score(Input_score const&);
-
-    void add(Input_staff*);
-    ~Input_score();
-    /// construction
-    void set(Paper_def* paper_p);
-    void set(Midi_def* midi_p);
-    void print() const;
-    Score*parse();
-};
-
-#endif
diff --git a/lily/include/input-staff.hh b/lily/include/input-staff.hh
deleted file mode 100644 (file)
index 4cf8198..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  input-staff.hh -- declare Input_staff
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef INPUTSTAFF_HH
-#define INPUTSTAFF_HH
-
-#include "string.hh"
-#include "plist.hh"
-#include "varray.hh"
-#include "lily-proto.hh"
-#include "input.hh"
-
-class Input_staff:public Input {
-public:
-    
-    Pointer_list<Input_music*> music_;
-    Input_register * ireg_p_;
-    
-    /* *************** */
-    ~Input_staff();
-    void add(Input_music*m);
-    Input_staff(Input_staff const&);
-    Input_staff();
-    Staff* parse(Score*);
-    void print() const;
-};
-
-
-#endif // INPUTSTAFF_HH
-
diff --git a/lily/include/interpreter.hh b/lily/include/interpreter.hh
new file mode 100644 (file)
index 0000000..1c0703f
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+  interpretor.hh -- declare Interpreter
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Interpreter_HH
+#define Interpreter_HH
+
+class Interpreter {
+public:
+    virtual bool interpret_request_b(Request*) { return false;}
+};
+
+#endif // Interpreter_HH
diff --git a/lily/include/interpretor.hh b/lily/include/interpretor.hh
new file mode 100644 (file)
index 0000000..b13582f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  interpretor.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Interpreter_HH
+#define Interpreter_HH
+
+class Interpreter {
+public:
+    /// link to my definition
+    Input_register * ireg_l_;
+    void interpret_request(Request *);
+    NAME_MEMBERS();
+    ~Interpreter();
+    /** typeset any items/spanners. Default: do nothing
+     */
+    virtual void do_pre_move_processing(){}
+};
+
+class Paper_interpreter : Interpreter {
+    
+};
+
+class Midi_interpreter : Interpreter {
+};
+
+#endif // Interpreter_HH
index 4ddc3ebd6c9ceaeadf13b5ce55590760b4466b4c..109a9c8191d30e44f8e8e37ed5f57c34caeb4628 100644 (file)
@@ -27,6 +27,13 @@ class Item : public virtual Score_elem {
 public:
     /// indirection to the column it is in
     PCol * pcol_l_;
+    
+    Item * broken_to_a_[2];
+
+    // nobreak = 0, pre =1, post = 2
+    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();
@@ -34,6 +41,8 @@ public:
     NAME_MEMBERS();
     virtual Line_of_score * line_l() const;
 protected:
+    virtual void  do_breakable_col_processing();
+    virtual void handle_prebroken_dependencies();
     virtual void do_print()const;
 
 };
index 4b4c347eef9b47cfc24bf3137e2114e43521c2d9..fda86e5375651cd1a2c9a7bc08196c0c4bd1b1c1 100644 (file)
@@ -19,7 +19,9 @@ struct Key_item : Item {
 
     
     /* *************** */
-NAME_MEMBERS();
+    NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Key_item)
+
     Key_item(int cposition);
     void add(int pitch, int acc);
     void read(const Key_register&);
index bfa5fd05141d3bf8d36684a6f114ce2d98da05b8..39a416bb647c1a829afe0d48c7f5970dbf0f6acb 100644 (file)
@@ -21,10 +21,10 @@ struct Key_register : Request_register {
     bool default_key_b_;
     bool change_key_b_;
     
-    virtual bool try_request(Request *req_l);
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    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();
     virtual void acknowledge_element(Score_elem_info);
     Key_register();
     NAME_MEMBERS();
index b54fd5623e178e18ff6741b507eef93def350942..380b5d105689ed45c962165eaef9cc0af8d789d4 100644 (file)
@@ -22,20 +22,23 @@ struct Beam;
 struct Beam_req;
 struct Blank_req;
 struct Box;
+struct Break_align_item;
 struct Bracket_req;
 struct Cadenza_req;
+struct Change_iterator;
+struct Change_reg;
 struct Chord;
 struct Clef_change_req;
 struct Clef_item;
 struct Clef_register;
 struct Col_hpositions;
+struct Chord;
 struct Colinfo;
 struct Collision;
 struct Collision_register;
 struct Command_req;
 struct Command_script_req;
 struct Complex_music;
-struct Complex_walker;
 struct Cresc_req;
 struct Crescendo ;
 struct Decresc_req;
@@ -44,18 +47,21 @@ struct Durational_req;
 struct Dynamic;
 struct Dynamic_req;
 struct Element_group;
+struct Element_group_item;
 struct Feature;
 struct General_script_def;
 struct Group_change_req;
 struct Group_feature_req;
+struct Horizontal_align_item;
+struct Horizontal_group;
+struct Horizontal_group_item;
+struct Horizontal_vertical_group;
 struct Idealspacing;
 struct Identifier;
-struct Input;
+struct Interpreter;
 struct Input_file;
-struct Input_music;
 struct Input_register;
 struct Input_score;
-struct Input_staff;
 struct Item;
 struct Key;
 struct Key_change_req;
@@ -85,16 +91,16 @@ struct Midi_item;
 struct Midi_output;
 struct Midi_pitch;
 struct Midi_score;
-struct Midi_staff;
 struct Midi_stream;
 struct Midi_track;
-struct Midi_walker;
 struct Mixed_qp;
 struct Molecule;
 struct Music_general_chord;
 struct Musical_script_req;
 struct Music_voice;
 struct Musical_req;
+struct Music;
+struct Music_list;
 struct My_lily_parser;
 struct Note_column;
 struct Note_column_register;
@@ -128,7 +134,6 @@ struct Score;
 struct Score_column;
 struct Score_elem;
 struct Score_elem_info;
-struct Score_walker;
 struct Script;
 struct Script_column;
 struct Script_def;
@@ -143,11 +148,8 @@ struct Spacing_req ;
 struct Span_dynamic_req;
 struct Span_req;
 struct Spanner;
-struct Staff;
-struct Staff_column;
 struct Staff_side;
 struct Staff_symbol;
-struct Staff_walker;
 struct Stem;
 struct Stem_beam_register;
 struct Stem_req;
@@ -171,6 +173,8 @@ struct Time_description;
 struct Timing_req;
 struct Vertical_brace;
 struct Vertical_spanner;
+struct Vertical_group;
+
 struct Voice;
 struct Voice_element;
 struct Voice_group_registers;
index 98abf99ccd4232e27e6eb70c5988005243fe303b..41088f7c603052e362e643cf7a71132ea82c385a 100644 (file)
@@ -20,9 +20,9 @@ struct Local_key_register : Request_register {
     Link_array<Item  > forced_l_arr_;
     Link_array<Item > tied_l_arr_;
     /* *************** */
-    virtual void process_requests();
+    virtual void do_process_requests();
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
+    virtual void do_pre_move_processing();
     Local_key_register();
     NAME_MEMBERS();
 };
index 083654e66f9df87f8308fc1adfac0b741e8e4128..e8468f0b9fca0504007e0023c005f6e8e1c7e963 100644 (file)
 
 class Lyric_register : public Request_register {
     Array<Lyric_req*> lreq_arr_;
-    virtual bool acceptable_request_b(Request*);
-    virtual bool try_request(Request*);
-    virtual void process_requests();
-    virtual void post_move_processing();
+    virtual bool do_try_request(Request*);
+    virtual void do_process_requests();
+    virtual void do_post_move_processing();
 public:
     NAME_MEMBERS();
     Lyric_register();
index 334777183dbe03e23728ff6c8122d549fbe55231..7ec479ebd208b2af90a6b2e2120a8c4badcc9c13 100644 (file)
@@ -5,7 +5,7 @@
 void debug_init();
 void set_debug(bool);
 void do_scores();
-void add_score(Input_score * s);
+void add_score(Score* s);
 void set_default_output(String s);
 Input_score* current_iscore_l();
 String find_file(String);
index 5930ea08d9739a0a533f1c739e226156c992f5e1..26f9eaf0bf59856e9a5eed27278f426bf43ab7d0 100644 (file)
 #ifndef METERREG_HH
 #define METERREG_HH
 #include "register.hh"
+#include "time-description.hh"
+#include "grouping.hh"
 
 /**
   generate meters. 
   */
 class Meter_register : public Request_register {
 public:
+    Time_description time_;
+    Rhythmic_grouping  default_grouping_;
+    
     Meter_change_req * meter_req_l_;
     Meter * meter_p_;
  
-    virtual bool try_request(Request *req_l);
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_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_creation_processing();
+    virtual void do_post_move_processing();
     Meter_register();
     NAME_MEMBERS();
 };
index 7cd1d40ac315add00b2940cf17bb07f9e436f7fa..14a50f0f45aa3dc6d7b74beed251070ed2ac29a5 100644 (file)
@@ -24,6 +24,7 @@ protected:
 public:
     Meter(Array<Scalar> args) ;
     NAME_MEMBERS();
+    SCORE_ELEM_CLONE(Meter)
 };
 #endif // METER_HH
 
index 575842ebbdbeaf10af487c98cac9e6b2ab38865e..0338916a538d529c496882b4f603a16d4b770f2e 100644 (file)
@@ -13,6 +13,7 @@
 
 
 struct Midi_output {
+    #if 0
     Midi_output(Score* score_l, Midi_def* );
 
     void do_staff(Staff*st_l, int count);
@@ -22,6 +23,7 @@ struct Midi_output {
     Score* score_l_;
     Midi_def* midi_l_;
     Midi_stream* midi_stream_l_;
+#endif
 };
 
 #endif // MIDIOUTPUT_HH
index 2eac3747d600cd35f1a7a291ae5ccee9372f90fd..96005c8931a460363a0f1d5abaf7653f4e7aec6d 100644 (file)
@@ -7,11 +7,14 @@
 #ifndef MIDIWALKER_HH
 #define MIDIWALKER_HH
 
+#if 0
 #include "lily-proto.hh"
 #include "grouping.hh"
 #include "staff-walker.hh"
 #include "pcursor.hh"
 #include "pqueue.hh"
+
+
 struct Note_event : PQueue_ent<Moment,Melodic_req*>
 {
     bool ignore_b_;
@@ -42,10 +45,10 @@ class Midi_walker : public PCursor<Staff_column*>
 public:
     
     Midi_walker(Staff*, Midi_track*);
-    void process_requests();
+    void do_process_requests();
     ~Midi_walker();
 };
-
+#endif
 
 #endif // MIDIWALKER_HH
 
index 37021a214ee9e0f335e01dc1ab40ef470e5b10af..2eccfd3ee8b6cbf381f82736939eed4ae654307b 100644 (file)
@@ -22,6 +22,8 @@ struct Molecule {
     void add_bottom(const Molecule &m);
     void add(Molecule const &m);
     void translate(Offset);
+    void translate_y(Real);
+    void translate_x(Real);
     void add(Atom const & a) ;
     /// how big is #this#? 
     Box extent() const;
diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh
new file mode 100644 (file)
index 0000000..a0501d7
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+  music-iterator.hh -- declare {Music,Chord,Voice}_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSIC_ITERATOR_HH
+#define MUSIC_ITERATOR_HH
+
+#include "lily-proto.hh"
+#include "plist.hh"
+#include "moment.hh"
+
+class Music_iterator {
+protected:
+    bool first_b_;
+    
+public:
+    Music_iterator *daddy_iter_l_;
+    NAME_MEMBERS();
+    Register_group_register *report_to_reg_l_;
+    
+    static Music_iterator* static_get_iterator_p(Music*,Register_group_register*);
+    Music_iterator* get_iterator_p(Music*)const;
+    Music_iterator();
+    virtual void next(Moment until);
+    virtual Moment next_moment()const;
+    virtual bool ok()const;
+    virtual ~Music_iterator();
+    virtual void construct_children();
+    virtual Register_group_register * get_req_acceptor_l();
+};
+
+// duh.
+class Request_iterator : public Music_iterator {
+    Request  *req_l_;
+public:
+    Request_iterator(Request const *);
+    NAME_MEMBERS();
+protected:
+    virtual void next(Moment);
+};
+
+class Change_iterator : public Music_iterator {
+    Change_reg * change_l_;
+public:
+     NAME_MEMBERS();
+    virtual void next(Moment);
+    Change_iterator(Change_reg*);
+};
+
+class Chord_iterator : public Music_iterator
+{
+    const Chord *chord_C_;
+    Pointer_list<Music_iterator*> children_p_list_;
+public:
+    Chord_iterator(Chord const*);
+    NAME_MEMBERS();
+protected:
+    virtual void construct_children();
+    virtual void next(Moment);
+    virtual Moment next_moment()const;
+    virtual bool ok()const;
+};
+
+class Voice_element_iterator : public Chord_iterator {
+
+protected:
+    virtual void construct_children();
+public:
+    Voice_element_iterator(Voice_element*);
+    NAME_MEMBERS();
+};
+
+
+class Voice_iterator :  private PCursor<Music*>, public Music_iterator
+{
+    Moment here_mom_;
+    const Voice * voice_C_;
+    Music_iterator * iter_p_;
+    void next_element();
+public:
+    Voice_iterator(Voice const*);
+    NAME_MEMBERS();
+protected:
+    virtual void construct_children();
+    ~Voice_iterator();    
+    virtual void next(Moment);
+    virtual Moment next_moment()const;
+    virtual bool ok()const;
+};
+
+#endif // MUSIC_ITERATOR_HH
diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh
new file mode 100644 (file)
index 0000000..0198e98
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+  music-list.hh -- declare Music_list, Chord and Voice
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSIC_LIST_HH
+#define MUSIC_LIST_HH
+
+#include "music.hh"
+#include "plist.hh"
+
+
+/**
+  Music can be a list of other "Music" elements
+ */
+class Music_list : public Music {
+    
+public:
+    int multi_level_i_;
+  
+    /// what kind of iterator needed to walk this music?
+    String type_str_;
+
+    /// what name (or look for this name)
+    String id_str_;    
+    Music_list(Music_list const&);    
+    Music_list();
+    NAME_MEMBERS();
+    VIRTUAL_COPY_CONS(Music_list,Music)
+    virtual void add(Music*);
+    virtual void transpose(Melodic_req const *);
+    
+    Pointer_list<Music*> music_p_list_;
+protected:
+    virtual void do_print() const;
+};
+
+/**
+  Chord is a list of music-elements which happen simultaneously
+ */
+
+class Chord : public Music_list {
+public:
+    Chord();
+    NAME_MEMBERS();
+    VIRTUAL_COPY_CONS(Chord,Music)
+    virtual void translate(Moment dt);
+    virtual MInterval time_int()const;
+};
+
+class Voice_element : public Chord {
+public:
+    NAME_MEMBERS();
+    VIRTUAL_COPY_CONS(Voice_element,Music)
+};
+
+/**
+  Voice is a list of music-elements which are placed behind each other.
+ */
+class Voice : public Music_list {
+    
+public:
+    Moment offset_mom_;
+
+    Voice();
+    NAME_MEMBERS();
+    VIRTUAL_COPY_CONS(Voice, Music)
+    virtual void translate(Moment dt);
+    virtual MInterval time_int()const;
+};
+
+/** A simple piece of music, which wishes to change the spot of its
+  interpretor  */
+class Change_reg : public Music {
+public:
+    
+    /// what kind of iterator needed to walk this music?
+    String type_str_;
+
+    /// what name (or look for this name)
+    String id_str_;
+
+    NAME_MEMBERS();
+    VIRTUAL_COPY_CONS(Change_reg, Music)
+};
+#endif // MUSIC_LIST_HH
index 06fbcd73957dee0818ccef74d092dd6d2dfdc8c5..eb4058c6ddc4d8333bdfae3f245562cf0c98564f 100644 (file)
 #ifndef MUSIC_HH
 #define MUSIC_HH
 
-#include "plist.hh"
 #include "virtual-methods.hh"
 #include "input.hh"
 #include "minterval.hh"
 #include "lily-proto.hh"
+#include "string.hh"
 
+/** In Lily, everything that has a length and a pitch (which can be
+  transposed) is considered "music", 
+
+  Music is hierarchical: 
+
+  @seealso Music_list
+  */
 class Music:public Input {
 public:
+    Music_list * parent_music_l_;
+
     virtual MInterval time_int()const;
     virtual ~Music(){}
     void print() const;
@@ -32,38 +41,6 @@ protected:
   
 };
 
-class Music_list : public Music {
-public:
-    Music_list(Music_list const&);    
-    Music_list();
-    NAME_MEMBERS();
-    VIRTUAL_COPY_CONS(Music_list,Music)
-    virtual void add(Music*);
-    virtual void transpose(Melodic_req const *);
-protected:
-    Pointer_list<Music*> music_p_list_;
-    virtual void do_print() const;
-};
-
-
-class Chord : public Music_list {
-public:
-    NAME_MEMBERS();
-    VIRTUAL_COPY_CONS(Chord,Music)
-    virtual void translate(Moment dt);
-    virtual MInterval time_int()const;
-};
-
-
-class MVoice : public Music_list {
-public:
-    NAME_MEMBERS();
-    VIRTUAL_COPY_CONS(MVoice, Music)
-    virtual void translate(Moment dt);
-    virtual MInterval time_int()const;
-};
-
 #endif // MUSIC_HH
 
 
index 84d1da4440af959466a76d975394890db6edd941..122f1c20a8954893b68283bed700584add646790 100644 (file)
@@ -16,7 +16,7 @@
 
 
 /**
-  A request which is coupled to a #Voice_element# with nonzero duration.
+  A request which is coupled to a #Voice_element#
   Base class only
  */
 class Musical_req  : public virtual Request  {
@@ -30,6 +30,8 @@ public:
     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; }
@@ -40,13 +42,6 @@ public:
 };
 
 
-class Skip_req  : public Musical_req  {
-public:
-    Moment duration_;
-    
-    virtual Moment duration() const;
-    REQUESTMETHODS(Skip_req, skip);
-};
 
 /** a request with a duration.
   This request is used only a base class.
@@ -63,6 +58,10 @@ public:
     REQUESTMETHODS(Rhythmic_req, rhythmic);
 };
 
+class Skip_req  : public Rhythmic_req  {
+public:
+    REQUESTMETHODS(Skip_req, skip);
+};
 struct Spacing_req :virtual Request {
     Moment next;
     Real distance;
index feb3301b00f4baed964523c625ef20a2ecc567ec..5ecfd7d62c94577adfd6ba69e628b16415b35cc1 100644 (file)
@@ -25,11 +25,12 @@ class My_lily_parser {
     Array<Input> define_spot_array_;
     String init_str_;
 
-    void add_requests( Voice_element*v);
+    void add_requests( Chord*v);
+
+    Chord * get_note_element(Note_req * ,Duration *);
+    Chord* get_rest_element(String,Duration *);
+    Chord* get_word_element(Text_def*, Duration*);
 
-    Voice_element * get_note_element(Note_req * ,Duration *);
-    Voice_element* get_rest_element(String,Duration *);
-    Voice_element* get_word_element(Text_def*, Duration*);
     void set_last_duration(Duration const *);
     void set_default_duration(Duration const *);
     void set_duration_mode(String s);
@@ -39,7 +40,7 @@ public:
     Duration default_duration_;
     String textstyle_str_;
     bool first_b_;
-    bool last_duration_mode ;
+    bool last_duration_mode_b_ ;
     Array<Request*> pre_reqs, post_reqs;
     int fatal_error_i_;
     Sources * source_l_;
index 45b8d4d4fb3c0d3f77693d233c5fc5f69db8e9a8..a15cd9108b6af438de8e54918c33de38d31b0b92 100644 (file)
@@ -28,8 +28,8 @@ class Note_column_register :public Request_register {
 protected:
     virtual void set_feature(Feature);
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
 public:
     Note_column_register();
     NAME_MEMBERS();
index 11d1cc8cc06fea2da2bd1f6fcf43b72e39c3775e..593420cea0894a977551c27a27ac55695044a9b4 100644 (file)
@@ -56,6 +56,8 @@ public:
 
     /// does this column have items
     bool used_b() const;
+    bool breakpoint_b() const;
+    void clean_breakable_items();
     
     void add(Item *i);
 
index 75b875c6169f4907f5db6ad0fb16875efef3a5d8..32231f6371415397c2f99f3d1573d7aea854a620 100644 (file)
@@ -49,7 +49,7 @@ public:
        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,int breakstatus=1);
+    void typeset_item(Item *item_p,  PCol *pcol_l,int breakstatus=0);
 
     ///    add to bottom of pcols
     void add(PCol*);
index 1c067669e94634683a832e6529a91c677d680fbe..2ce328406b9f4bda4972b0b203fcd6475c6733b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-paper-def.hh -- declare Paper_def
+  paper-def.hh -- declare Paper_def
 
   source file of the GNU LilyPond music typesetter
 
@@ -20,14 +20,15 @@ paper-def.hh -- declare Paper_def
   symbols, dimensions and constants
 
   This struct takes care of all kinds of symbols, dimensions and
- constants. Most of them are related to the point-size of the fonts,
- so therefore, the lookup table for symbols is also in here.
-
- TODO: 
-
- add support for multiple fontsizes 
- split into "Input_paper_def" and Paper_def
- add support for other len->wid conversions.
+  constants. Most of them are related to the point-size of the fonts,
+  so therefore, the lookup table for symbols is also in here.
+
+  TODO: 
+  
+  add support for multiple fontsizes 
+  split into "Input_paper_def" and Paper_def
+  add support for other len->wid conversions.
  */
 class Paper_def {
     Lookup *lookup_p_;
diff --git a/lily/include/pulk-voice.hh b/lily/include/pulk-voice.hh
deleted file mode 100644 (file)
index 085a0a3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  pulk-voice.hh -- declare Pulk_voice
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef PULK_VOICE_HH
-#define PULK_VOICE_HH
-
-#include "lily-proto.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-#include "priorities.hh"
-#include "pcursor.hh"
-
-/**
-  Align requests with starting time.
-
-  To our foreign readers "pulk"ing is what you do with the stuff in
-  your nose to get it out.  (and I don't mean blowing) */
-class Pulk_voice
-{
-    PCursor<Voice_element*> cur_;
-    Moment elt_mom_;
-    Priorities<Moment> subtle_moment_priorities_;
-    int subtle_idx_;
-    void set_subtle();
-    void next();
-public:
-    int staff_idx_;
-
-    Moment when()const;
-    bool ok()const { return cur_.ok() ; }
-
-    Pulk_voice(Voice*, int staff_idx);
-
-    /**
-      Get the requests at when(), and advance.
-     */
-    Array<Request*> get_req_l_arr();
-};
-
-#endif // PULK_VOICE_HH
diff --git a/lily/include/pulk-voices.hh b/lily/include/pulk-voices.hh
deleted file mode 100644 (file)
index fd388d1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  pulk-voices.hh -- declare Pulk_voices
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-
-  TODO 
-  integrate Meter handling, to guarantee proper creation of staff_columns.
-*/
-
-
-#ifndef PULK_VOICES_HH
-#define PULK_VOICES_HH
-
-#include "pqueue.hh"
-#include "plist.hh"
-#include "moment.hh"
-#include "lily-proto.hh"
-#include "lily-proto.hh"
-#include "voice.hh"
-#include "time-description.hh"
-
-
-struct Voice_l { 
-    Voice *l_;
-    int  staff_idx_;
-    Voice_l(Voice*v, int i){ l_ = v;
-      staff_idx_ = i;
-    }
-    Voice_l() { l_ = 0; staff_idx_ =0; }
-};
-int compare(Voice_l const &p1, Voice_l const &p2);
-
-class Pulk_voices
-{
-PQueue< Voice_l > voice_pq_;
-    Pointer_list< Pulk_voice * > pulk_p_list_;
-    Link_list<Staff *> staff_l_list_;
-    Array < Time_description > time_arr_;
-    Moment next_mom_;
-
-public:
-    Moment last_;
-    bool time_checks_failed_b() const;
-    bool ok() const;
-    Moment next_mom() const;
-    Pulk_voices(Link_list<Staff*> const&);
-    void get_aligned_request(Request_column *col_l );
-};
-
-
-#endif // PULK_VOICES_HH
index 9d13c292f9680cc379e460e145eab152c84e0fa5..e0778d8e4e0a12581c2a36f441123f423977f890 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef REGISTERGROUP_HH
 #define REGISTERGROUP_HH
 
-
+#include "parray.hh"
 #include "plist.hh"
 #include "score-elem-info.hh"
 #include "register.hh"
 class Register_group_register : public Request_register {
 protected:
     Pointer_list<Request_register*> reg_list_;
+    Link_array<Register_group_register> group_l_arr_;
+    Link_array<Request_register> nongroup_l_arr_;
+    String id_str_;
+    
+    Array<Score_elem_info> announce_info_arr_;
+    
     virtual void do_print()const;
+    
 public:
-
+    /// Score_register = 0, Staff_registers = 1, etc)
+    virtual int depth_i()const;
+    /**
+      Go up in the tree. default: choose next parent
+     */
+    Register_group_register * ancestor_l(int l=1);
+    
+    Input_register * ireg_l_;
+    
     /**
       Junk #reg_l#.
 
@@ -38,18 +53,25 @@ public:
     /**
       Remove #reg_l# from the list, and return it.
      */
-    virtual Request_register * get_register_p(Request_register*reg_l);
+    virtual Request_register * remove_register_p(Request_register*reg_l);
     virtual void set_feature(Feature i);
-    virtual bool acceptable_request_b(Request*)const;
     virtual void sync_features() ;
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
-    virtual void acknowledge_element(Score_elem_info info);
-    virtual bool try_request(Request*);
-    virtual void process_requests();
-    virtual ~Register_group_register();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
+
+    virtual void do_removal_processing();
+    virtual bool do_try_request(Request*);
+    virtual void do_process_requests();
+    virtual Staff_info get_staff_info()const;
+    
+    virtual Register_group_register * find_register_l(String name,String id);
+    virtual void do_announces();    
+    virtual void announce_element(Score_elem_info);
+    virtual Register_group_register* find_get_reg_l(String name, String id);
+    virtual Register_group_register * get_default_interpreter();
+    
     virtual void add(Request_register* reg_p);
-    void add(Array<Request_register*> reg_p_arr);
+
     virtual bool contains_b(Request_register*)const;
 };
 
index 8ede14b1d3fc3fc433310d1d610079ca871ae178..c628276429dd4e9d0ebe35339826ff3fca2d97bb 100644 (file)
@@ -16,6 +16,9 @@
 #include "score-elem-info.hh"
 #include "staff-info.hh"
 
+
+
+
 /**
   a struct which processes requests, and creates the #Score_elem#s.
   It may use derived classes. Hungarian postfix: register
@@ -26,46 +29,43 @@ class Request_register {
       You cannot copy a Request_register
      */
     Request_register(const Request_register&){}
+
+    enum { 
+       VIRGIN,
+       CREATION_INITED,
+       MOVE_INITED,
+       ACCEPTED_REQS,
+       PROCESSED_REQS,
+       ACKED_REQS,
+       MOVE_DONE
+    } status;
+
 protected:
     
 
     /// utility
     virtual Paper_def * paper() const;
 
-    /**
-      try to fit the request in this register
-
-      @return
-      false: not noted,  not taken.
-
-      true: request swallowed. Don't try to put the request elsewhere.
-
-
-      Default: always return false
-      */
-    virtual bool try_request(Request *req_l);
     
     /// make items/spanners with the requests you got
-    virtual void process_requests(){}
+    virtual void do_process_requests(){}
 
     /** typeset any items/spanners. Default: do nothing
      */
-    virtual void pre_move_processing(){}
+    virtual void do_pre_move_processing(){}
     /** reset any appropriate data. Default: do nothing
      */
-    virtual void post_move_processing(){}
+    virtual void do_post_move_processing(){}
    
-    /**
-      Is this request eligible to be processed? Default: return false.
-     */
-    virtual bool acceptable_request_b(Request*) const;
+
+    virtual void do_creation_processing () {}
+    virtual void do_removal_processing() {}
 
     /**
       typeset a "command" item. Default: pass on to daddy.
       If the column is not breakable, #pre_p# and #post_p# are junked
       */
-    virtual void typeset_breakable_item(Item * pre_p ,
-                                       Item * nobreak_p, Item * post_p);
+    virtual void typeset_breakable_item(Item * nobreak_p);
     /**
       Invoke walker method to typeset element. Default: pass on to daddy.
       */
@@ -95,18 +95,38 @@ protected:
      */
 
     virtual void sync_features() {}
-    
+   
     virtual bool contains_b(Request_register*reg_l)const;
     /**
       Get information on the staff. Default: ask daddy.
       */
-    virtual Staff_info get_staff_info();
+    virtual Staff_info get_staff_info()const;
+    virtual void fill_staff_info(Staff_info&);
 
 
     virtual void do_print()const;  
+    /*    
+         @see{try_request}
+         Default: always return false
+      */
+    virtual bool do_try_request(Request *req_l);
 public:
-    /** Every Request_register (except for the 'top' which is directly
-      inside the Staff_walker, is a element of a group.  */
+    void pre_move_processing();
+    void process_requests();
+    /**
+      try to fit the request in this register
+
+      @return
+      false: not noted,  not taken.
+
+      true: request swallowed. Don't try to put the request elsewhere.
+
+      */
+    bool try_request(Request*);
+
+    void post_move_processing();
+    virtual Interpreter * interpreter_l() { return 0; }
+    
     Register_group_register * daddy_reg_l_;
 
     Request_register();
diff --git a/lily/include/request-column.hh b/lily/include/request-column.hh
deleted file mode 100644 (file)
index 82377cf..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  request-column.hh -- declare Request_column
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef REQUEST_COLUMN_HH
-#define REQUEST_COLUMN_HH
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-#include "varray.hh"
-/**
-  Like staff_column, but Score wide. One per when().
- */
-class Request_column 
-{
-    Pointer_list<Staff_column*> staff_cols_;
-    Array<Staff_column*> staff_col_l_arr_;
-    Moment when_;
-    
-public:
-    Score_column *musical_column_l_, *command_column_l_;
-    Request_column(Link_list<Staff*> const& );
-    bool used_b()const;
-    Moment when();
-    void add_reqs(int staff_idx, Array<Request*> const&);
-    void update_time(int staff_idx, Time_description &);
-    void set_score_cols(Score_column*, Score_column*);
-};
-
-#endif // REQUEST_COLUMN_HH
index 6d9343a0652440238d01b5960ef759eeafb3d0f3..4fa49691d879b03d3ef48ffc681c733293235c27 100644 (file)
@@ -8,33 +8,33 @@
 
 #ifndef REQUEST_HH
 #define REQUEST_HH
-// GNU LilyPond's second egg of columbus!
 
 #include "glob.hh"
 #include "string.hh"
 #include "moment.hh"
 #include "virtual-methods.hh"
 #include "input.hh"
+#include "music.hh"
 
 /**
  a voice element wants something printed.
  Hungarian postfix: req
  @see lilygut manpage
  */
-class Request : public Input {
+class Request : public Music {
+
 public:
-    Voice_element*elt_l_;
+    Voice  * voice_l();
     
     /* *************** */
-    Voice  * voice_l();
-    Request();
-    Request(Request const&);
+
     virtual ~Request(){}
 
     NAME_MEMBERS();
-    virtual Request* clone() const { return new Request(*this); }
-    void print()const ;
+    VIRTUAL_COPY_CONS(Request,Music)
     
+    void print()const ;
+    virtual MInterval time_int() const;
     virtual void transpose(Melodic_req const &){}
     virtual Moment duration() const { return 0; }
 
@@ -43,8 +43,6 @@ public:
      */
     virtual Barcheck_req *barcheck() { return 0; }
     virtual Script_req *script() { return 0;}
-    virtual Text_req*text() { return 0; }
-    virtual Rest_req *rest() { return 0; }
     virtual Span_req *span() { return 0; }
     virtual Spacing_req * spacing() { return 0; }
     virtual Blank_req * blank() { return 0; }
index a1e13957351973723b5b537a57c25eaae421499b..b324fe245faaac9d3a5fc8ba22c99f11a715d66a 100644 (file)
@@ -18,7 +18,7 @@ class Rest_collision_register : public Request_register {
     Array< Collision *> collision_l_arr_;
 protected:
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
+    virtual void do_pre_move_processing();
 public:
     Rest_collision_register();
     NAME_MEMBERS();
diff --git a/lily/include/score-align-reg.hh b/lily/include/score-align-reg.hh
new file mode 100644 (file)
index 0000000..533e471
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  score-align-reg.hh -- declare Score_align_reg
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_ALIGN_REG_HH
+#define SCORE_ALIGN_REG_HH
+
+#include "register.hh"
+
+class Score_align_register: public Request_register
+{
+    
+    const char* type_ch_C_;
+    Horizontal_group_item  * align_p_;
+public:
+    int priority_i_;
+    Score_align_register(char const*);
+    NAME_MEMBERS();
+protected:
+    virtual void acknowledge_element(Score_elem_info);
+    virtual void do_pre_move_processing();
+};
+#endif // SCORE_ALIGN_REG_HH
index 4d6fc17af7550c0690c3fdc880046ce2518a8eca..80986a4f825a5e9313f965c026d63e384c651fe6 100644 (file)
@@ -1,11 +1,15 @@
 /*
-  sccol.hh -- part of GNU LilyPond
+  score-column.hh -- declare Score_column
 
-  (c) 1996,97 Han-Wen Nienhuys
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#ifndef SCCOL_HH
-#define SCCOL_HH
+
+#ifndef SCORE_COLUMN_HH
+#define SCORE_COLUMN_HH
+
 #include "lily-proto.hh"
 #include "varray.hh"
 #include "moment.hh"
@@ -54,7 +58,9 @@ public:
 
 instantiate_compare(Score_column&, Score_column::compare);
 
-#endif // SCCOL_HH
+#endif // SCORE_COLUMN_HH
+
+
 
 
 
index d567f8ef02d25f1fbc4eeed9ab378f9aabc0f654..95c6b0ba1d52ca24c9d6bc1f5ced3fe2422d1e77 100644 (file)
@@ -13,6 +13,7 @@
 #include "virtual-methods.hh"
 #include "directed-graph.hh"
 
+#define SCORE_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem)
 
 /** Both Spanner and Item are Score_elem's. Most Score_elem's depend
   on other Score_elem's, eg, Beam needs to know and set direction of
@@ -37,6 +38,8 @@ class Score_elem : private Directed_graph_node {
     enum Status {
        ORPHAN,                 // not yet added to pstaff
        VIRGIN,                 // added to pstaff
+       PREBREAKING,
+       PREBROKEN,
        PRECALCING,
        PRECALCED,              // calcs before spacing done
        BREAKING,
@@ -48,15 +51,10 @@ class Score_elem : private Directed_graph_node {
        DELETED,                // to catch malloc mistakes.
     } status;
 
-
-    Score_elem* dependency(int) const;
-    Score_elem* dependent(int) const;
-    int dependent_size() const;
-    int dependency_size() const;
 public:
     PScore *pscore_l_;    
-    int group_element_i_;
-        
+    int x_group_element_i_;
+    int y_group_element_i_;
     Score_elem(Score_elem const&);
     virtual String TeX_string () const ;
     virtual void print() const;
@@ -66,20 +64,22 @@ public:
     virtual ~Score_elem();
     Score_elem();
     NAME_MEMBERS();    
-    virtual bool is_type_b(const char *);
     
     Interval width() const;
     Interval height() const;
+    virtual void translate_x(Real);
+    virtual void translate_y(Real);
      /**
       translate the symbol. The symbol does not have to be created yet. 
       Overridable, since this score-elem might act as a pseudo-list.
      */
-    virtual void translate(Offset);
+    void translate(Offset);
     Offset offset()const;
 
     void add_processing();
     void OK() const;
     void pre_processing();
+    void breakable_col_processing();
     void break_processing();
     
     void post_processing();
@@ -95,9 +95,10 @@ public:
     
     
     virtual Spanner* spanner()  { return 0; }
-    virtual Element_group* elem_group() { return 0; }
+    virtual Horizontal_vertical_group* elem_group() { return 0; }
     virtual Item * item() { return 0; }
     virtual Line_of_score * line_l() const;
+    SCORE_ELEM_CLONE(Score_elem)
 protected:
 
     virtual  Interval do_height()const;
@@ -112,13 +113,25 @@ protected:
     /// 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 void do_substitute_dependency(Score_elem * , Score_elem *);
     virtual void do_break_processing();
     virtual void handle_broken_dependencies();
+    virtual void handle_prebroken_dependencies();
+
+    Score_elem* dependency(int) const;
+    Score_elem* dependent(int) const;
+    int dependent_size() const;
+    int dependency_size() const;
+
+
+    /// no dimension, translation is noop
+    bool empty_b_;
+    /// do not print anything black
+    bool transparent_b_;
 };
 
 
diff --git a/lily/include/score-halign-reg.hh b/lily/include/score-halign-reg.hh
new file mode 100644 (file)
index 0000000..8a0559f
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  score-halign-reg.hh -- declare Score_horizontal_align_register
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_HALIGN_REG_HH
+#define SCORE_HALIGN_REG_HH
+#include "register.hh"
+class Score_horizontal_align_register : public Request_register {
+    
+    Break_align_item * halign_p_;
+public:
+    NAME_MEMBERS();
+    Score_horizontal_align_register();
+protected:
+    virtual void acknowledge_element(Score_elem_info);
+    virtual void do_pre_move_processing();
+};
+#endif // SCORE_HALIGN_REG_HH
diff --git a/lily/include/score-reg.hh b/lily/include/score-reg.hh
new file mode 100644 (file)
index 0000000..569ddb7
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  score-reg.hh -- declare Score_register
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_REG_HH
+#define SCORE_REG_HH
+
+#include "register-group.hh"
+#include "pqueue.hh"
+
+class Score_register : public Register_group_register {
+    Line_of_score * scoreline_l_;
+    Score * score_l_;
+    
+    Array<Item*> nobreak_item_p_arr_;
+    Link_array<Score_elem> musical_item_p_arr_;
+    
+    Score_column* command_column_l_;
+    Score_column* musical_column_l_;
+    
+    friend class Score;
+    void set_cols(Score_column*,Score_column*);
+    void typeset_all();
+    
+    PQueue<Moment> extra_mom_pq_;
+    Moment last_mom_;
+public:
+    NAME_MEMBERS();
+
+    void add_moment_to_process(Moment);
+    Score_register();
+    int depth_i() const;
+protected:   
+    void set_score(Score * score_l);
+    
+
+    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 typeset_breakable_item(Item * nobreak_p);
+    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_REG_HH
diff --git a/lily/include/score-walker.hh b/lily/include/score-walker.hh
deleted file mode 100644 (file)
index ca19c0f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  score-walker.hh -- declare Score_walker
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-
-    
-*/
-
-
-#ifndef SCOREWALKER_HH
-#define SCOREWALKER_HH
-#include "pcursor.hh"
-#include "lily-proto.hh"
-#include "varray.hh"
-
-
-/**
-  walk through the score_columns, and while doing so, walk all staffs in a score.
-
-  TODO
-  support for vertical spanners.
-  */
-class Score_walker : public PCursor<Score_column *>
-{
-    Score* score_l_;
-    /// walkers for the individual staves.
-    Array<Staff_walker *> walker_p_arr_;
-    Array<Staff_walker *> disallow_break_walk_l_arr;
-    int disallow_break_count_;
-    int breaks_i_;
-    void reinit();
-public:
-    bool break_allowed_b();
-    void allow_break(Staff_walker*w);
-    Score_walker(Score*);
-    ~Score_walker();
-    Moment when();
-    void operator++(int);
-    /// process staff walkers. 
-    void process();
-};
-#endif // SCOREWALKER_HH
index 364146883750a5042a82e3e6b83cf57f0cc4600b..846144d0cdf7d97558ef03ffa58af1d5f63b18a2 100644 (file)
 #include "lily-proto.hh"
 
 /// the total music def of one movement
-struct Score {
+class Score: public Input {
+public:
     /// paper_, staffs_ and commands_ form the problem definition.
     Paper_def *paper_p_;
     Midi_def *midi_p_;
-    Pointer_list<Staff*> staffs_;
+    Music * music_p_;
     
-    /// "runtime" fields for setting up spacing    
-    Pointer_list<Request_column*> rcols_;
     
     Pointer_list<Score_column*> cols_;
     PScore *pscore_p_;
 
-    Input input_;
     int errorlevel_i_;
     
     /* *************************************************************** */
@@ -40,7 +38,6 @@ struct Score {
     /// construction
     Score();
     ~Score();    
-    void add(Staff*);
 
     /// do everything except outputting to file
     void process();
@@ -64,10 +61,11 @@ struct Score {
     /// when does the last *musical* element finish?
     Moment last() const;
 
+    Score(Score const&);
+
 private:
     void paper_output();
     void setup_music();
-    void process_music();
     /// do midi stuff
     void midi();
 
@@ -77,7 +75,6 @@ private:
     // utils:
     PCursor<Score_column*> create_cols(Moment, PCursor<Score_column*> &last);
 
-    Score(Score const&){}
 
     /**
       make the pcol_l_ fields of each Score_column point to the correct PCol,
index 1aa02fa7dd8b778d59f72a3f974b0a1d6bff18cf..16accf1a83570b2f0ead047a45c86c964bad157e 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
   scoreline.hh -- part of GNU LilyPond
 
 
 #include "colhpos.hh"
 #include "spanner-elem-group.hh"
+#include "vertical-align-elem.hh"
 
 /// the columns of a score that form one line.
-class Line_of_score : public Spanner_elem_group {
+class Line_of_score : public Spanner, public Vertical_align_elem {
 public:
-    Link_array<Spanner_elem_group> line_arr_;
-    Link_array<PCol > cols;
+    Link_array<PCol> cols;
     bool error_mark_b_;
     virtual String TeX_string() const;    
     
-    /* *************** */
+
     NAME_MEMBERS();
     Line_of_score();
     
-    void add_line(Spanner_elem_group *);
+    void add(Score_elem *);
 
     /// is #c# contained in #*this#?
     bool contains_b(PCol const *c)const;
+    bool contains_b(Score_elem const*e) const {  
+       return Vertical_align_elem::contains_b(e); 
+    }
     
     Link_array<Line_of_score> get_lines()const;
     void set_breaking(Array<Col_hpositions> const&);
@@ -34,11 +36,9 @@ public:
 protected:
     virtual void break_into_pieces();
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual void do_pre_processing();
-    virtual void do_post_processing();
-
-
-    SPANNER_CLONE(Line_of_score)
+    virtual Interval do_width()const;
+    virtual void do_print() const;
+    SCORE_ELEM_CLONE(Line_of_score)
 };
 
 #endif
index 3b94feda7a926677fafddee4df78530586b583ac..242acd4bdbc3ae31ebda3d990e2edb9420176563 100644 (file)
 #ifndef SCRIPT_COLUMN_HH
 #define SCRIPT_COLUMN_HH
 
-#include "elem-group.hh"
-#include "item.hh"
+#include "elem-group-item.hh"
 
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts ) as a single entity.  */
-class Script_column : public Item, public Element_group {
+class Script_column : public Horizontal_vertical_group_item {
 
 protected:
     virtual void do_print() const;
index 7fa5294814d56a7e1ea9eed20431251469695c62..41dccfb6c30393cc53fe601c102a3ec73dff9eff 100644 (file)
@@ -21,11 +21,11 @@ public:
     NAME_MEMBERS();
     Script_register();
 protected:
-    virtual bool try_request(Request*);
-    virtual void process_requests();
+    virtual bool do_try_request(Request*);
+    virtual void do_process_requests();
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
 
 };
 
index a18d7234b66641d75d784ff7da1ff0bf27b47f88..4fae2f9bbc894eb5802bb537fc7d241398a120d0 100644 (file)
@@ -19,13 +19,12 @@ class Slur_register :public Request_register {
     /* *************** */
 protected:
     virtual ~Slur_register();
-    virtual bool try_request(Request*);
+    virtual bool do_try_request(Request*);
     virtual void set_feature(Feature);
-    virtual bool acceptable_request_b(Request*);
-    virtual void process_requests();
+    virtual void do_process_requests();
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
 public:
     Slur_reg();
     NAME_MEMBERS();
index 5731317866b33e30843c8ffb8f4ba440114b4cff..7ec510afa2f10b5a8b4364df0071c2431a29fa1b 100644 (file)
@@ -24,7 +24,7 @@ protected:
     virtual void do_post_processing();
     virtual void do_substitute_dependency(Score_elem*, Score_elem*);
     virtual void do_pre_processing();
-    SPANNER_CLONE(Slur)
+    SCORE_ELEM_CLONE(Slur)
     NAME_MEMBERS();
 };
 
index 0d91319b63e8397e2e88fc65d7e1e7e73c2930cc..d133fb66b50645564d6330e025cce502f358fc55 100644 (file)
 #include "spanner.hh"
 #include "elem-group.hh"
 
-class Spanner_elem_group : public Spanner, public Element_group {
+class Spanner_elem_group : public Spanner, public Horizontal_vertical_group {
     
 protected:
     virtual Interval do_width()const;
     virtual void do_print() const;
-    SPANNER_CLONE(Spanner_elem_group)
+    SCORE_ELEM_CLONE(Spanner_elem_group)
+public:
     NAME_MEMBERS();
 };
 #endif // SPANNER_ELEM_GROUP_HH
index 84c85f3e98f3ca6d43d3e1346950a84bd19829be..2aee51cc2e56dbd4fe80ee951e2dc96244baa31d 100644 (file)
@@ -11,7 +11,6 @@
 #include "score-elem.hh"
 
 
-#define SPANNER_CLONE(T) VIRTUAL_COPY_CONS(T, Spanner)
 
 /** a symbol which is attached between two columns. A spanner is a
   symbol which spans across several columns, so its final appearance
@@ -44,7 +43,7 @@ public:
     bool broken_b() const;
     Spanner* find_broken_piece(Line_of_score*)const;
 protected:
-    SPANNER_CLONE(Spanner)
+    SCORE_ELEM_CLONE(Spanner)
     virtual void break_into_pieces();
 
     Link_array<Spanner> broken_into_l_arr_;
diff --git a/lily/include/staff-column.hh b/lily/include/staff-column.hh
deleted file mode 100644 (file)
index 7550ae2..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  staff-column.hh -- declare Staff_column
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFCOLUMN_HH
-#define STAFFCOLUMN_HH
-
-#include "lily-proto.hh"
-#include "varray.hh"
-#include "moment.hh"
-
-/// store simultaneous requests
-class Staff_column {
-
-    Staff_column(Staff_column const&);
-
-public:
-    Array<Request*> creationreq_l_arr_;
-    Array<Request*> musicalreq_l_arr_;
-    Array<Request*> commandreq_l_arr_;
-    Staff * staff_l_;
-    Request_column * req_col_l_;
-    /// fields to collect timing data vertically.
-    Array<Timing_req*> timing_req_l_arr_;
-
-    /* *************** */
-
-    Staff_column();
-    Score_column* command_column_l();
-    Score_column* musical_column_l();
-    Moment when() const;
-    void set_req_col(Request_column *c1);
-    void add_reqs (Array<Request*> req_l_arr);
-    void OK() const;
-    ~Staff_column();
-    void update_time(Time_description&, Rhythmic_grouping*);
-    void typeset_breakable_items(Array<Item *> &pre_p_arr,
-                                Array<Item *> &nobreak_p_arr,
-                                Array<Item *> &post_p_arr);
-    void typeset_musical_item(Item *i);
-    void setup_one_request(Request*);
-protected:
-};
-
-
-
-#endif // STAFFCOLUMN_HH
-
index a3aa533d2b77ced6d4630d4e4880cee0a08ab382..1f65f20f00bbe4a88f4c971681b05998d25ab7b8 100644 (file)
 #ifndef STAFF_INFO_HH
 #define STAFF_INFO_HH
 
+#include "lily-proto.hh"
+
 /// struct to pass staff info along a Request_register hierarchy.
 struct Staff_info {
     int *c0_position_i_l_;
-    Staff_walker *walk_l_;
     Staff_symbol*staff_sym_l_;
     
     /// when is now?
     Time_description const *time_C_;
     Rhythmic_grouping const *rhythmic_C_;
+    Score_column *musical_l_;
+    Score_column *command_l_;
 
     ///
     bool break_allowed_b_;
-
+    Score * score_l_;
     Moment when();
-    Staff * staff_l();
     Score *score_l();
     PCol * command_pcol_l();
-    PCol * musical_pcol_l();
-    Staff_column *column_l();
-    Score_column *musical_l();
+    Score_column* musical_l();
     Score_column *command_l();
+    PCol * musical_pcol_l();
     Staff_info();
 };
 
index 8f7bba348536db18b765590a93e45fac5ad37c40..783a7438f5bd5ea852ad8f920b6a155764e084fd 100644 (file)
 
 /**
   Registers which manage a Staff (one 5-line linestaff)
+  
  */
 class Staff_registers : public Register_group_register {
-    int c0_position_i_;    
-    Input_register const *ireg_C_;
-    int base_position_i_;
-    Array<Voice_group_registers*> group_l_arr_;
-    Staff_symbol * staff_sym_l_;
+    Line_of_staff *staffline_p_;   
+    Link_array<Score_elem> staff_elem_l_arr_;
+
+    void group_staff_elems();
 protected:
-    virtual bool try_request(Request * r);
-    virtual Staff_info get_staff_info();
-    virtual bool acceptable_request_b(Request*) const ;
-    virtual void acknowledge_element(Score_elem_info);
+    virtual void do_pre_move_processing();
+    virtual void do_creation_processing();
+    virtual void do_removal_processing();
+    virtual void typeset_element(Score_elem*);
+    virtual void typeset_breakable_item( Item * it_p);
+
 public:
     
-    /* *************** */
     NAME_MEMBERS();
-    void change_group(Group_change_req * greq_l,
-                     Voice_registers *voice_regs_l,
-                     Voice_group_registers * old_group);
-    Voice_group_registers * get_group(String id);
-    void terminate_register(Request_register * reg);
-    Staff_registers(Input_register const*);
+    Staff_registers();
 };
 
 #endif // STAFF_REGS_HH
index d25d109d22ecff81e5b70b102abde7026ee89b74..1d4245abbbc0b26222c1614ca8bcda50ef2d7870 100644 (file)
@@ -34,6 +34,7 @@ public:
   
     Staff_side();
     void add_support(Score_elem*);
+    NAME_MEMBERS();
     
 protected:
     virtual void do_substitute_dependency(Score_elem *, Score_elem*);
index 06303c0aa4a9eba5a8e2f574f8c3b6bd9c6b03d3..b21e697dea834f8de218ec27eedc0ab5e7da28c8 100644 (file)
  */
 class Staff_sym_register : public Request_register { 
     Staff_symbol *span_p_;
-    Moment last_mom_;
 public:
     Staff_sym_register();
     NAME_MEMBERS();
 protected:
-    virtual void process_requests();
-    ~Staff_sym_register();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual void do_process_requests();
+    virtual void fill_staff_info(Staff_info&);
+    virtual void do_removal_processing();
+    virtual void do_creation_processing();
+       
 };
 #endif // STAFF_SYM_REG_HH
index dc50a37e0aac6347a0350f41158def8cecf41acd..68b1c11d4a877a95152a69a844a09cf7520917b3 100644 (file)
@@ -28,7 +28,7 @@ public:
     Real inter_note_f()const;
     int steps_i()const;
 protected:
-    SPANNER_CLONE(Staff_symbol)
+    SCORE_ELEM_CLONE(Staff_symbol)
     virtual Molecule* brew_molecule_p() const;
     virtual void do_print()const;
 };
diff --git a/lily/include/staff-walker.hh b/lily/include/staff-walker.hh
deleted file mode 100644 (file)
index e46f0a8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  staff-walker.hh -- declare Staff_walker
-  
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFWALKER_HH
-#define STAFFWALKER_HH
-
-#include "lily-proto.hh"
-#include "time-description.hh"
-#include "pcursor.hh"
-
-/**
-  manage run-time info when walking staffcolumns such as: key,
-  meter, pending beams & slurs
-  */
-struct Staff_walker : public PCursor<Staff_column*> {
-    Staff * staff_l_;
-    PScore * pscore_l_;
-    Score_walker *score_walk_l_;
-    Time_description time_;
-    Rhythmic_grouping *default_grouping;
-    
-    /* *************** */
-
-    Moment when() const;    
-    virtual ~Staff_walker();
-    Staff_walker(Staff*, PScore*);
-    void process() ;
-
-    void operator++(int);
-    void allow_break();
-
-protected:
-    /// every time before ++ is called
-    virtual void do_pre_move(){}
-    /// every time after ++ is called
-    virtual void do_post_move(){}
-    virtual void process_requests()=0;
-private:
-    void process_timing_reqs();
-    Staff_walker(Staff_walker const&);
-};
-
-#endif // STAFFWALKER_HH
-
diff --git a/lily/include/staff.hh b/lily/include/staff.hh
deleted file mode 100644 (file)
index f9f24d8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  staff.hh -- declare Staff
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STAFF_HH
-#define STAFF_HH
-
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-
-/// A collection of voices.
-class Staff {
-    Staff(const Staff&src);
-    
-public:
-    Input_register * ireg_p_;
-    
-    Link_list<Voice*> voice_list_;
-    /// runtime field
-    Link_list<Staff_column*> cols_;
-    Line_of_staff * staff_line_l_;
-
-    Score *score_l_;
-    PScore *pscore_l_;
-    
-    /* *************************************************************** */
-
-    void add(Link_list<Voice*> const&s);
-
-    void add_voice(Voice *v_p);
-    Paper_def*paper()const;
-
-    void OK() const;
-    void print() const;
-
-    /// when does the last *musical* element finish?
-    Moment last() const;
-
-    /// remove unused cols
-    void clean_cols() ;
-    Staff();
-    
-    virtual void set_output(PScore * destination);
-    Staff_walker *get_walker_p();
-    virtual ~Staff();
-    void add_col(Staff_column*);
-protected:
-
-};
-#endif
diff --git a/lily/include/staffeleminfo.hh b/lily/include/staffeleminfo.hh
deleted file mode 100644 (file)
index 8eb28bc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  staffeleminfo.hh -- declare Score_elem_info
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STAFFELEMINFO_HH
-#define STAFFELEMINFO_HH
-
-#include "lily-proto.hh"
-
-/// data container.
-struct Score_elem_info {
-    Score_elem * elem_p_;
-    Request*req_l_;
-    Voice const * voice_l_;
-    Voice_group_registers * group_regs_l_; 
-    Request_register * origin_reg_l_;
-
-    /* *** */
-    Score_elem_info(Score_elem*, Request*, Request_register*);
-    Score_elem_info();
-};
-
-#endif // STAFFELEMINFO_HH
index 9d9174e6889379d3083ff90676b0f0762b13b388..5afdc785c03cadb7511883012ba7effad989178b 100644 (file)
@@ -12,7 +12,7 @@
 /// one broken line of staff.
 struct Line_of_staff : public Spanner_elem_group{
 
-    SPANNER_CLONE(Line_of_staff)
+    SCORE_ELEM_CLONE(Line_of_staff)
 public:
     NAME_MEMBERS();
 
index f6b1b5317eacc8d1527ca5ff899bb90dd7a25814..a162e725e45c83309f5bbb5640488435a6cd0742 100644 (file)
@@ -31,10 +31,10 @@ public:
 protected:
     ~Stem_beam_register();
     virtual void set_feature(Feature dir_i_);
-    virtual bool try_request(Request*);
-    virtual void process_requests();
+    virtual bool do_try_request(Request*);
+    virtual void do_process_requests();
     virtual void acknowledge_element(Score_elem_info);
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
 };
 #endif // STEMBEAMREG_HH
index 34cb868d56743d4ed22cb7685bfce8fa0c2f0206..d2b8a7e19fc109eb3115de1918ae3391355905ab 100644 (file)
   \end{itemize}
 
   should move beam_{left, right} into Beam
+
+  TODO.
+  
+  Stem size depends on flag.
   */
 class Stem : public Item {
     
@@ -73,7 +77,8 @@ public:
     void do_print() const;
     void set_stemend(Real);
     int get_default_dir();
-    int get_center_distance();
+    int get_center_distance_from_top();
+    int get_center_distance_from_bottom();
     void set_default_dir();
     void set_default_stemlen();
     void set_default_extents();
@@ -84,7 +89,6 @@ public:
     Real stem_start_f() const;
 
     bool invisible_b()const;
-    bool chord_b()const;
     
     /// heads that the stem encompasses (positions)
     int max_head_i() const;
index 391d0b6472975cd715c616ed3402fd046045229f..937f890d0b1049f26380fbae51022bc579279739 100644 (file)
@@ -19,7 +19,7 @@
 class Swallow_register : public Request_register {
 protected:
     bool acceptable_request_b(Request*) const;
-    bool try_request(Request*) ;
+    bool do_try_request(Request*) ;
 public:
     NAME_MEMBERS();
 };
index 96fbd7c9b89383a691f43e239ece5ea654b2935b..e1e24b25e068b45dfbe405471e0649be60187ef9 100644 (file)
@@ -25,13 +25,19 @@ struct Symbol {
 
 /// a symbol which can be translated, and freely copied
 struct Atom {
-    Offset off;
-    Symbol sym;
+    Offset off_;
+    Symbol sym_;
 
     /* *************** */
     
     void translate(Offset o) {
-       off += o;
+       off_ += o;
+    }
+    void translate_x(Real r){ 
+       off_.x += r;
+    }
+    void translate_y(Real r) {
+       off_.y += r;
     }
     
     /// how big is #this#?
index c1f4929044e28725a36ce99bbc6cb33bea2bec3a..7b8213bdb686ab1515980ac9a7f383af38b2d563 100644 (file)
@@ -16,10 +16,10 @@ class Text_register : public Request_register{
     /* *************** */
 protected:
     virtual void set_feature(Feature );
-    virtual bool try_request(Request*);
-    virtual void process_requests();
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
+    virtual bool do_try_request(Request*);
+    virtual void do_process_requests();
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
     virtual void acknowledge_element(Score_elem_info);
 public:
     Text_register();
index c7e6ca9a9275999db5847d9696f8e0593beb94fb..1381be3b5ef7efc8f3608f30f01d6f57ada5b403 100644 (file)
@@ -23,7 +23,7 @@ public:
     void set_support(Directional_spanner*);
     Text_spanner();
 protected:
-    SPANNER_CLONE(Text_spanner)
+    SCORE_ELEM_CLONE(Text_spanner)
     ~Text_spanner();
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual void do_pre_processing();
index eb4772b50038f4d7422df88e3327d02d355f302c..a1ea3ed14d9a2199ca195f285bdb4cb1ceb86a1e 100644 (file)
@@ -25,12 +25,12 @@ class Tie_register : public Request_register {
 protected:
     virtual ~Tie_register();
     virtual void acknowledge_element(Score_elem_info);
-    virtual bool try_request(Request*);
+    virtual bool do_try_request(Request*);
     virtual bool acceptable_request_b(Request*);
     virtual void sync_features();
-    virtual void process_requests();
-    virtual void post_move_processing();
-    virtual void pre_move_processing();
+    virtual void do_process_requests();
+    virtual void do_post_move_processing();
+    virtual void do_pre_move_processing();
     virtual void set_feature(Feature);
 public:
     Tie_register();
index dc3b812f5ede3a2c143a34a8c7aa2c30ce196150..70c6a8a7af5d5ea4d7de589f300dfd1423dc3f38 100644 (file)
@@ -29,6 +29,6 @@ public:
 
     Tie();
     NAME_MEMBERS();
-    SPANNER_CLONE(Tie)
+    SCORE_ELEM_CLONE(Tie)
 };
 #endif // TIE_HH
diff --git a/lily/include/vertical-align-elem.hh b/lily/include/vertical-align-elem.hh
new file mode 100644 (file)
index 0000000..0f17b97
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  vertical-align-item.hh -- declare Vertical_align_elem
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef VERTICAL_ALIGN_ITEM_HH
+#define VERTICAL_ALIGN_ITEM_HH
+
+#include "elem-group.hh"
+/**
+  Order elements top to bottom.
+ */
+class Vertical_align_elem : virtual public Score_elem {
+    Link_array<Score_elem> elem_l_arr_;
+public:
+    void add(Score_elem*);
+    bool contains_b(Score_elem const*)const;
+    NAME_MEMBERS();
+protected:
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void do_post_processing() ;
+};
+#endif // VERTICAL_ALIGN_ITEM_HH
diff --git a/lily/include/voice-element.hh b/lily/include/voice-element.hh
deleted file mode 100644 (file)
index 6bc8559..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  voice-element.hh -- declare Voice_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef VOICE_ELEMENT_HH
-#define VOICE_ELEMENT_HH
-
-#include "lily-proto.hh"
-#include "plist.hh"
-#include "moment.hh"
-#include "input.hh"
-
-/** one horizontal bit.  Voice_element is nothing but a container for
-    *the requests, */
-class Voice_element : public Input{
-public:
-    /** the duration of the element.  This can be 0; The duration is
-      determined from rhythmical requests contained in this
-      Voice_element */
-    Moment duration_;
-    Voice const *voice_C_;
-    Pointer_list<Request*> req_p_list_;
-    Request * principal_req_l_;
-
-    /* *************** */
-    void transpose(Melodic_req const &)const;
-    Voice_element();
-    Voice_element(Voice_element const & src );
-
-    void add(Request*);
-    void print ()const;
-    void set_default_group(String id);
-};
-
-#endif // VOICE-ELEMENT_HH
index 187b6c147e1485ce0b9ce2dd27bcb8daded59e7c..c4f04e1af23376c402d978a4c2315da4e4949d50 100644 (file)
  */
 class Voice_group_registers  : public Register_group_register {
     Moment termination_mom_;
-    Input_register const *ireg_C_;
     int dir_i_;
 
 protected:
     virtual void do_print() const;
-    virtual void set_feature(Feature);
     virtual Scalar get_feature(String);
-    virtual void post_move_processing();
-    virtual bool try_request(Request*);
+    virtual void do_post_move_processing();
+    virtual bool do_try_request(Request*);
 public:
-    void OK() const;
-    virtual Request_register * get_register_p(Request_register  * reg_l);
-    /// each group in a staff has an unique ID.
-    String group_id_str_;
-
-    /// The pointers are in the base class. This is just administration
-    Array<Voice_registers*> voice_reg_l_arr_;
-    /* *************** */
+    
     
     NAME_MEMBERS();
     static bool static_acceptable_request_b(Request*);
-    virtual void add(Request_register*);
-    Voice_group_registers(String id, Input_register const *);
+    Voice_group_registers();
 };
 #endif // VOICEGROUPREGS_HH
index 5f99de381f70e9e2906d5c80daf787acf5b18f7e..3c282b34b21ddf54e6825ab162059e71e8be4a55 100644 (file)
 #define VOICEREGS_HH
 
 #include "register-group.hh"
+#include "interpreter.hh"
 
-class Voice_registers : public Register_group_register {
-    Input_register const *ireg_C_;
-    bool terminate_b_;
+class Voice_registers : public Interpreter, public Register_group_register {
 public:
-    Voice *voice_l_;
-    /* *************** */
-
-    Voice_registers(Voice*, Input_register const*);
+    Voice_registers();
     NAME_MEMBERS();
 
 protected:
-    virtual void pre_move_processing();
-    virtual bool acceptable_request_b(Request*);
-    virtual void acknowledge_element(Score_elem_info info);
-    virtual bool try_request(Request*);
+    virtual bool interpret_request_b(Request*);
+    virtual Interpreter* interpreter_l() { return this; }
     virtual void do_print() const;
 };
 
diff --git a/lily/include/voice.hh b/lily/include/voice.hh
deleted file mode 100644 (file)
index a40142d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  voice.hh -- declare Voice
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef VOICE_HH
-#define VOICE_HH
-
-#include "lily-proto.hh"
-#include "plist.hh"
-#include "moment.hh"
-
-/** class for  horizontal stuff.
-
-    Voice is a ordered row of Voice_elements. It is strictly
-    horizontal: you cannot have two rhythmic elements running parallel
-    in a Voice. For proper processing, each Voice should have
-    Group_change_req as a first element.
-
-    */
-
-struct Voice {
-    /** the elements, earliest first.
-      Please use the member #add()# to add a new element
-      */
-    Pointer_list<Voice_element *> elts_;
-    Moment start_;
-
-    /* *************** */
-    Voice();
-    Voice(Voice const&);
-
-    Moment when(Voice_element const *)const;
-    Moment last() const;
-    void transpose(Melodic_req const &)const;
-    void add(Voice_element*);
-    void print() const;
-    void set_default_group(String id);
-};
-
-#endif
diff --git a/lily/include/walk-regs.hh b/lily/include/walk-regs.hh
deleted file mode 100644 (file)
index e339baa..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  walkregs.hh -- declare Walker_registers
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef WALKREGS_HH
-#define WALKREGS_HH
-
-
-#include "register-group.hh"
-#include "parray.hh"
-/**
-  Top level registers: the interface to Complex_walker.
-
-  [sigh. Sometimes I wish C++ could do better late binding.]
-
-  Basically, this distributes and collects elements and elementinfo to
-  children
-  */
-class Walker_registers : public Register_group_register {
-
-    Array<Item*> prebreak_item_p_arr_;
-    Array<Item*> nobreak_item_p_arr_;
-    Array<Item*> postbreak_item_p_arr_;
-    Link_array<Score_elem> musical_item_p_arr_;
-    
-    Array<Score_elem_info> announce_info_arr_;
-    Complex_walker * walk_l_;
-protected:   
-    virtual Staff_info get_staff_info();
-
-    virtual void announce_element(Score_elem_info);
-    virtual void acknowledge_element(Score_elem_info);
-    virtual void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p);
-    virtual void typeset_element(Score_elem*elem_p);
-    virtual Paper_def * paper() const;
-public:
-    virtual void pre_move_processing();
-    virtual void post_move_processing();
-
-
-    void do_announces();
-    Walker_registers(Complex_walker*);
-};
-
-#endif // WALKREGS_HH
diff --git a/lily/input-music.cc b/lily/input-music.cc
deleted file mode 100644 (file)
index 2d4527c..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-#include "debug.hh"
-#include "input-music.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "voice-element.hh"
-
-void
-Simple_music::transpose(Melodic_req const &d)const
-{
-    voice_.transpose(d);
-}
-
-void
-Simple_music::add(Voice_element*v)
-{
-    voice_.add(v);
-}
-
-Moment
-Simple_music::length()const
-{
-    return voice_.last();
-}
-void
-Simple_music::translate_time(Moment t)
-{
-    voice_.start_ += t;
-}
-
-Voice_list
-Simple_music::convert()const
-{
-    Voice_list l;
-    Voice * v_p = new Voice(voice_);
-    PCursor<Voice_element*> i= v_p->elts_.bottom();
-    
-    if (!i.ok() || i->duration_) {
-       v_p->add ( new Voice_element);
-       i=v_p->elts_.bottom();
-    }
-    
-    // need-to-have, otherwise memory will be filled up with regs. 
-    i->add(new Terminate_voice_req); 
-    l.bottom().add(v_p);
-    return l;
-}
-
-
-void
-Simple_music::print() const
-{
-#ifndef NPRINT
-    mtor << "Simple_music {";
-    voice_.print();
-    mtor << "}\n";
-#endif
-}
-
-/* *************** */
-
-void
-Complex_music::transpose(Melodic_req const& d) const
-{
-     for (iter_top(elts,i); i.ok(); i++)
-        i->transpose(d);
-}
-void
-Complex_music::add(Input_music*v)
-{
-    elts.bottom().add(v);
-}
-
-void
-Complex_music::print() const
-{
-    for (iter_top(elts,i); i.ok(); i++)
-        i->print();
-}
-
-void
-Complex_music::concatenate(Complex_music*h)
-{
-    for (iter_top(h->elts,i); i.ok(); i++)
-       add(i->clone());    
-}
-
-Complex_music::Complex_music()
-{
-}
-
-Complex_music::Complex_music(Complex_music const&s)
-{
-    for (iter_top(s.elts,i); i.ok(); i++)
-       add(i->clone());
-}
-void
-Complex_music::set_default_group(String g)
-{
-    for (iter_top(elts,i); i.ok(); i++)
-           i->set_default_group(g);
-}
-/* *************************************************************** */
-
-void
-Music_voice::print() const
-{
-    mtor << "Music_voice {";
-    Complex_music::print();    
-    mtor << "}\n";
-}
-
-void
-Music_voice::add_elt(Voice_element*v)
-{
-    PCursor<Input_music*> c(elts.bottom());
-    if (!c.ok() || !c->simple()) {
-       Simple_music*vs = new Simple_music;
-       
-       c.add(vs);
-    }
-    
-    c = elts.bottom();
-    Simple_music *s = c->simple();
-    s->add(v);             
-}
-
-Moment
-Music_voice::length()const
-{
-    Moment l = 0;
-    
-    for (iter_top(elts,i); i.ok(); i++)
-       l += i->length();
-    return l;
-}
-
-    
-Voice_list
-Music_voice::convert()const
-{
-    Voice_list l;
-    Moment here = 0;
-    
-    for (iter_top(elts,i); i.ok(); i++) {
-       Moment len = i->length();       
-       Voice_list k(i->convert());
-       k.translate_time(here); 
-       l.concatenate(k);
-       here +=len;     
-    }
-    return l;    
-}
-
-void
-Music_voice::translate_time(Moment t)
-{
-    elts.bottom()->translate_time(t);
-}
-
-    
-    
-/* *************** */
-
-void
-Music_general_chord::add_elt(Voice_element*v)
-{
-    Simple_music*vs = new Simple_music;
-    vs->add(v);
-    elts.bottom().add(vs);
-}
-
-void
-Music_general_chord::print() const
-{
-    mtor << "Music_general_chord {";
-    Complex_music::print();
-     mtor << "}\n";
-}
-
-void
-Music_general_chord::translate_time(Moment t)
-{
-    for (iter_top(elts,i); i.ok(); i++) 
-       i->translate_time(t);    
-}
-
-Moment
-Music_general_chord::length()const
-{
-    Moment l =0;
-    
-    for (iter_top(elts,i); i.ok(); i++) 
-       l = l >? i->length();
-    return l;
-}
-
-Voice_list
-Music_general_chord::convert()const
-{
-    Voice_list l;
-    for (iter_top(elts,i); i.ok(); i++) {
-       Voice_list k(i->convert());
-       l.concatenate(k);
-    }
-    return l;
-}
-
-/* *************** */
-
-void
-Multi_voice_chord::set_default_group(String g)
-{
-    int j=0;
-    for (iter_top(elts, i); i.ok(); i++) {
-       i->set_default_group(g + String(j));
-       j++;
-    }
-}
-
-
-/* *************** */
-
-void
-Voice_list::translate_time(Moment x)
-{
-    for (iter_top(*this,i); i.ok(); i++)
-       i->start_ += x;    
-}
-
index 4d0d24902a602f2c5c7ac692bf5fbc3b3a7bd002..f946e622fe9e1d4413bbecc770f46b2b84233c7d 100644 (file)
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "debug.hh"
 #include "register.hh"
 #include "input-register.hh"
-Input_register::~Input_register()
-{}
+#include "parray.hh"
+#include "input-register.hh"
+#include "register-group.hh"
 
-Input_register::Input_register()
+void
+Input_register::print() const
 {
+#ifndef NPRINT
+    mtor << "name " << name_str_;
+    mtor << "Consists of ";
+    for (int i=0; i< consists_str_arr_.size(); i++)
+       mtor << consists_str_arr_[i] << ',';
+    mtor << "contains " ;
+    for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++) 
+       i->print();
+#endif 
 }
 
-bool
-Input_register::group_b()const
+/*
+  UGH. Global.
+ */
+Link_array<Input_register> iregs_p_arr;
+
+void
+add_global_input_register(Input_register *reg_p)
 {
-    return ireg_list_.size();
+    iregs_p_arr.push(reg_p);
 }
 
-Array<String>
-Input_register::get_nongroups_str_arr()const
+Input_register *
+lookup_reg(String nm)
 {
-    Array<String> s_arr;
-    for (iter_top(ireg_list_, i); i.ok(); i++) {
-       if (!i->group_b())
-           s_arr.push(i->name_str_);
-    }
-    return s_arr;
+    for (int i=0; i < iregs_p_arr.size(); i++)
+       if (iregs_p_arr[i]->name_str_ == nm)
+           return iregs_p_arr[i];
+
+    error("can't find reg `" + nm + "'");
 }
 
-Input_register*
-Input_register::get_ireg_l(String nm)const
+Input_register *
+Input_register::recursive_find(String nm)
+{
+    if ( nm == name_str_)
+       return this;
+
+    Input_register * r =0;
+    for (iter(contains_ireg_p_list_.top(), i); !r &&i.ok(); i++)
+       r = i->recursive_find(nm);
+
+    return r;
+}
+Input_register *
+Input_register::find_ireg_l(String nm)
 {
-    for (iter_top(ireg_list_, i); i.ok(); i++) {
+    for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++)
        if (i->name_str_ == nm)
            return i;
-    }
+
     return 0;
 }
-Array<Request_register*>
-Input_register::get_nongroup_p_arr() const 
+
+
+Register_group_register *
+Input_register::get_group_register_p()
 {
-    Array <Request_register*>a;
-    Array<String> sa(get_nongroups_str_arr());
-    for (int i=0; i < sa.size(); i++)
-       a.push(get_nongroup_register_p(sa[i]));
-    return a;
+    Register_group_register * reg_p = (Register_group_register*)
+       get_register_p(name_str_);
+
+    
+     
+    for (int i=0; i < consists_str_arr_.size(); i++) {
+       reg_p->add( get_register_p( consists_str_arr_[i]) );
+    }
+    reg_p -> ireg_l_ = this;
+    return reg_p;
 }
 
-void
-Input_register::add(Input_register *p)
+
+bool
+Input_register::accept_req_b()
 {
-    ireg_list_.bottom().add(p);
+    return ! contains_ireg_p_list_.size();
 }
 
 void
-Input_register::print() const
+Input_register::add(Input_register *ip)
 {
-#ifndef NPRINT
-    mtor << name_str_ << " { ";
-    for (iter_top(ireg_list_, i); i.ok(); i++)
-       i->print();
-    mtor <<" }\n";
-#endif 
+    contains_ireg_p_list_.bottom().add(ip);
 }
-       
 
-Input_register::Input_register(Input_register const&s)
-    : Input(s)
+Input_register*
+Input_register::get_default_ireg_l()
 {
-    name_str_ = s.name_str_;
-    for (iter_top(s.ireg_list_, i); i.ok(); i++)
-       add(new Input_register(*i.ptr()));
+    return contains_ireg_p_list_.top();
 }
diff --git a/lily/input-score.cc b/lily/input-score.cc
deleted file mode 100644 (file)
index 5ba571a..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-  input-score.cc -- implement Input_score
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "debug.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
-#include "score.hh"
-#include "paper-def.hh"
-#include "midi-def.hh"
-
-
-
-void
-Input_score::add(Input_staff*s)
-{
-    staffs_.bottom().add(s);
-}
-
-void
-Input_score::set(Paper_def*p)
-{
-    delete paper_p_;
-    paper_p_ = p;
-}
-
-void
-Input_score::set(Midi_def* midi_p)
-{
-    delete midi_p_;
-    midi_p_ = midi_p;
-}
-Input_score::Input_score(Input_score const&s)
-    : Input(s)
-{
-    paper_p_ = (s.paper_p_)? new Paper_def(*s.paper_p_) :0;
-    midi_p_ = (s.midi_p_)? new Midi_def(*s.midi_p_) : 0;
-    errorlevel_i_ = s.errorlevel_i_;
-}
-
-Score*
-Input_score::parse()
-{
-    Score *s_p = new Score;
-
-    s_p->errorlevel_i_ = errorlevel_i_;
-    if (midi_p_)
-       s_p->set(new Midi_def(*midi_p_));
-    if (paper_p_)
-       s_p->set(new Paper_def(*paper_p_));
-
-    for (iter_top(staffs_,i); i.ok(); i++) {
-       Staff* staf_p=i->parse(s_p);
-       s_p->add(staf_p);
-    }
-
-    return s_p;
-}
-
-
-Input_score::~Input_score()
-{
-    delete paper_p_;
-    delete midi_p_;
-}
-
-Input_score::Input_score()
-{
-    paper_p_= 0;
-    midi_p_ = 0;
-    errorlevel_i_ = 0;
-}
-
-void
-Input_score::print()const
-{
-#ifndef NPRINT
-    mtor << "Input_score {\n";
-    for (iter_top(staffs_,i); i.ok(); i++) {
-       i->print();
-    }
-    mtor << "}\n";
-#endif
-}
diff --git a/lily/input-staff.cc b/lily/input-staff.cc
deleted file mode 100644 (file)
index 0b127ba..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  input-staff.cc -- implement Input_staff
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "debug.hh"
-#include "score.hh"
-#include "input-music.hh"
-#include "input-staff.hh"
-#include "staff.hh"
-#include "my-lily-lexer.hh"
-#include "input-register.hh"
-
-Input_staff::Input_staff()
-{
-    ireg_p_ =0;
-}
-
-void
-Input_staff::add(Input_music*m)
-{
-    music_.bottom().add(m);
-}
-
-Staff*
-Input_staff::parse(Score*score_l)
-{
-    Staff *p=new Staff;
-   
-    p->score_l_ = score_l;
-    p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
-    for (iter_top(music_,i); i.ok(); i++) {
-       Voice_list vl = i->convert();
-       p->add(vl);
-    }
-    return p;
-}
-
-Input_staff::Input_staff(Input_staff const&s)
-    : Input(s)
-{    
-    for (iter_top(s.music_,i); i.ok(); i++)
-       add(i->clone());
-
-    ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
-}
-
-void
-Input_staff::print() const
-{
-#ifndef NPRINT
-    mtor << "Input_staff {\n";
-    for (iter_top(music_,i); i.ok(); i++)
-       i->print();
-    ireg_p_->print();
-    mtor << "}\n";
-#endif
-}
-Input_staff::~Input_staff()
-{
-    delete ireg_p_;
-}
index 7c3b207eacf4e83a10f6c67843a56c818a9f3c8c..f1de7827e8951b9fd35bd7cc9392bb5710336cee 100644 (file)
@@ -5,7 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "p-score.hh"
 #include "debug.hh"
 #include "item.hh"
 #include "p-col.hh"
 Item::Item()
 {
     pcol_l_ = 0;
+
+    broken_to_a_[0]
+       = broken_to_a_[1]=0;
 }
 
 IMPLEMENT_STATIC_NAME(Item);
+IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
 
 void
 Item::do_print() const
@@ -39,3 +43,67 @@ Item::line_l()const
 {
     return pcol_l_->line_l_;
 }
+
+int
+Item::break_status_i() const
+{
+    PCol * c = pcol_l_;
+    if (c->breakable_b())
+       return 0;
+    else if (!c->daddy_l_) 
+       return 0; 
+    else if (c == c->daddy_l_->prebreak_p_)
+       return -1;
+    else 
+       return 1;
+}
+
+void
+Item::do_breakable_col_processing()
+{
+    PCol * c = pcol_l_;
+    if (!c->breakable_b())
+       return;
+    
+    for (int i=0; i < 2; i++) {
+       broken_to_a_[i] = clone()->item();
+       pscore_l_->typeset_item(broken_to_a_[i], c, -1+ 2*i);
+       broken_to_a_[i]->handle_prebroken_dependencies();
+    }
+
+    handle_prebroken_dependencies();
+}
+
+Item*
+Item::find_prebroken_piece(Line_of_score*l) const
+{
+    if (line_l() == l) 
+       return 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 0;
+}
+
+Item*
+Item::find_prebroken_piece(PCol*c)const
+{
+    if (c == pcol_l_ )
+       return (Item *) this;   // ugh
+
+    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];
+
+    assert(false);
+}
+
+void
+Item::handle_prebroken_dependencies()
+{
+    if ( pcol_l_->breakable_b() || pcol_l_->daddy_l_ )
+       Score_elem::handle_prebroken_dependencies();
+}
index 783572b0936f4ea2fd7e9807df553441248bc425..54ee56b195179f1f951e678d21b76010b3a89d15 100644 (file)
@@ -59,14 +59,16 @@ Key_item::brew_molecule_p()const
     for (int i =0; i < pitch.size(); i++) {
        Symbol s= paper()->lookup_l()->accidental(acc[i]);
        Atom a(s);
-       a.translate(Offset(0,(c_position + pitch[i]) * inter));
+       a.translate_y((c_position + pitch[i]) * inter);
        Molecule m(a);
        output->add_right(m);   
     }
     Molecule m(paper()->lookup_l()->fill(Box(
        Interval(0, paper()->note_width()),
        Interval(0,0))));
-    output->add_right(m);
+    if ( pitch.size() )
+       output->add_right(m);
     return output;
 }
 IMPLEMENT_STATIC_NAME(Key_item);
+IMPLEMENT_IS_TYPE_B1(Key_item,Item);
index 459ddf4d42766758b0a4442991ce237fc54847db..4effed1fee1dad133e154ffc5cb342df952d5a50 100644 (file)
@@ -12,7 +12,6 @@
 #include "key-reg.hh"
 #include "key-item.hh"
 #include "command-request.hh"
-#include "staff-column.hh"
 #include "local-key-reg.hh"
 #include "musical-request.hh"
 #include "local-key-item.hh"
 
 Key_register::Key_register()
 {
-    post_move_processing();
+    do_post_move_processing();
 }
 
 bool
-Key_register::try_request(Request * req_l)
+Key_register::do_try_request(Request * req_l)
 {
     Command_req* creq_l= req_l->command();
     if (!creq_l|| !creq_l->keychange())
        return false;
      
-    assert(!keyreq_l_);                // todo
+    if (keyreq_l_)
+       return false;           // TODO
     keyreq_l_ = creq_l->keychange();
     change_key_b_ = true;
     read_req(keyreq_l_);
@@ -41,44 +41,46 @@ Key_register::try_request(Request * req_l)
 void
 Key_register::acknowledge_element(Score_elem_info info)
 {
-    Command_req * r_l = info.req_l_->command() ;
+    int c0_i= *get_staff_info().c0_position_i_l_;      
+        Command_req * r_l = info.req_l_->command() ;
     if (r_l && r_l->clefchange()) {
-       change_key_b_ = true;
+
+        if (!kit_p_) {
+           kit_p_ = new Key_item(c0_i);
+           announce_element(Score_elem_info(kit_p_,0));
+        }
+        change_key_b_ = true;
     }
     
-    if (info.elem_l_->name() == Bar::static_name()) 
+    if (info.elem_l_->name() == Bar::static_name()) {
        default_key_b_ = true;
+        if (!kit_p_) {
+           kit_p_ = new Key_item(c0_i);
+           announce_element(Score_elem_info(kit_p_,0));
+        }
+    }
 
 }
 
 void
-Key_register::process_requests()
+Key_register::do_process_requests()
 {
     int c0_i= *get_staff_info().c0_position_i_l_;
 
     if (key_.multi_octave_b_)
        assert(false); // TODO . 
-    else 
+    else if (keyreq_l_) {
        kit_p_ = new Key_item(c0_i);
-    kit_p_->read(*this);
-    announce_element(Score_elem_info(kit_p_, keyreq_l_));
+       kit_p_->read(*this);
+       announce_element(Score_elem_info(kit_p_, keyreq_l_));
+    }
 }
 
 void
-Key_register::pre_move_processing()
+Key_register::do_pre_move_processing()
 { 
-    Time_description const * time_C_ = get_staff_info().time_C_;
-    if ( time_C_->whole_in_measure_&& default_key_b_ && ! change_key_b_ ) {
-       delete kit_p_ ;
-       kit_p_ =0;
-    }
-    
     if (kit_p_) {
-       if (change_key_b_) 
-           typeset_breakable_item(
-               new Key_item(*kit_p_), kit_p_, new Key_item(*kit_p_));
-       else 
-           typeset_breakable_item(0,0,kit_p_);
+       typeset_breakable_item( kit_p_);
        kit_p_ = 0;
     }
 }
@@ -104,7 +106,7 @@ Key_register::read_req(Key_change_req * r)
 }
 
 void
-Key_register::post_move_processing()
+Key_register::do_post_move_processing()
 {
     keyreq_l_ = 0;
     default_key_b_ = false;
@@ -112,4 +114,5 @@ Key_register::post_move_processing()
     change_key_b_ = false;
 }
 IMPLEMENT_STATIC_NAME(Key_register);
+IMPLEMENT_IS_TYPE_B1(Key_register,Request_register);
 ADD_THIS_REGISTER(Key_register);
index 72ab455a2633b1f156f3e5b8f39532f9655e638c..31bc1674d4ad37c80d57d8fa7e028ecb6f85c6fc 100644 (file)
@@ -29,7 +29,6 @@
 #include "varray.hh"
 #include "parser.hh"
 #include "debug.hh"
-#include "input-score.hh"
 #include "parseconstruct.hh"
 #include "main.hh"
 #include "identifier.hh"
@@ -71,13 +70,12 @@ TEX         {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
 INT            -?{N}+
-REAL           {INT}?(\.{N}+)?
+REAL           {INT}?\.{N}*
 KEYWORD                \\{WORD}
 WHITE          [ \n\t\f]
 BLACK          [^ \n\t\f]
 RESTNAME       [rs]
 NOTECOMMAND    \\{A}+
-DOTS           \.+
 LYRICS         ({AA}|{NATIONAL})[^0-9 \t\n\f]*
 
 %%
@@ -177,10 +175,6 @@ LYRICS             ({AA}|{NATIONAL})[^0-9 \t\n\f]*
                return scan_escaped_word(YYText()+1);
        }
 
-       {DOTS}          {
-               yylval.i = strlen(YYText());
-               return DOTS;
-       }
        {INT}           {
                yylval.i = String_convert::dec2_i( String( YYText() ) );
                return INT;
@@ -219,10 +213,6 @@ LYRICS             ({AA}|{NATIONAL})[^0-9 \t\n\f]*
        \" {
                start_quote();
        }
-       {DOTS}          {
-               yylval.i = strlen(YYText());
-               return DOTS;
-       }
        {INT}           {
                yylval.i = String_convert::dec2_i( String( YYText() ) );
                return INT;
@@ -272,9 +262,9 @@ LYRICS              ({AA}|{NATIONAL})[^0-9 \t\n\f]*
        return REAL;
 }
 
-{INT}\. { // backup rule
-       cerr << "int. encountered" << endl;
-       exit( 1 );
+{INT}  {
+       yylval.i = String_convert::dec2_i( String( YYText() ) );
+       return INT;
 }
 
 [{}]   {
index 03f605394de9ca9937a71fc6b168b2e350c8dec8..2890cd3e8aaebb2443aa3f99bd5a6267b2dab69f 100644 (file)
@@ -10,7 +10,7 @@ static const int build=
 char const * 
 lily_version_sz()
 {
-    static char v[1024];
+    static char v[1024];       // ugh
     sprintf(v, s, build);
     return v;
 }
index d53299c9e9c57735c59eb7a5fbbd8dc9b789c6f8..439f24f9fef15390b7269e1f93b11cc1a69cc559 100644 (file)
@@ -66,7 +66,7 @@ Local_key_item::brew_molecule_p()const
        if (accs[i].octave_i_ != lastoct) {
            if (octmol){
                Real dy =lastoct*7*paper()->internote_f();
-               octmol->translate(Offset(0, dy));
+               octmol->translate_y( dy);
                output->add(*octmol);
                delete octmol;
            }
@@ -76,20 +76,20 @@ Local_key_item::brew_molecule_p()const
        Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_);   
        Atom a(s);
        Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f();
-       a.translate(Offset(0,dy));
+       a.translate_y(dy);
 
        octmol->add_right(a);
     }
 
     if (octmol){
        Real dy =lastoct*7*paper()->internote_f();
-       octmol->translate(Offset(0, dy));
+       octmol->translate_y( dy);
        output->add(*octmol);
        delete octmol;
     }
 
     Interval head_width=itemlist_width(support_items_);
-    output->translate(Offset(-output->extent().x.right + head_width.left ,0));
+    output->translate_x(-output->extent().x.right + head_width.left );
     
     return output;
 }
@@ -105,6 +105,7 @@ Local_acc::compare(Local_acc&a, Local_acc&b)
     return a.accidental_i_ - b.accidental_i_;
 };
 IMPLEMENT_STATIC_NAME(Local_key_item);
+IMPLEMENT_IS_TYPE_B1(Local_key_item,Item);
 
 void
 Local_key_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
index 8ce3577f6cfa00355d5ac12962210cecb0e266ae..268f2811587041ec6f7f0e781d44c72503358cf8 100644 (file)
@@ -8,12 +8,12 @@
 #include "command-request.hh"
 #include "local-key-reg.hh"
 #include "local-key-item.hh"
-#include "complex-walker.hh"
 #include "key-reg.hh"
 #include "debug.hh"
 #include "key-item.hh"
 #include "tie.hh"
 #include "note-head.hh"
+#include "time-description.hh"
 
 Local_key_register::Local_key_register()
 {
@@ -21,7 +21,7 @@ Local_key_register::Local_key_register()
 }
 
 void
-Local_key_register::pre_move_processing()
+Local_key_register::do_pre_move_processing()
 {
     Local_key_item *key_item_p = 0;
     if (mel_l_arr_.size()) {
@@ -91,16 +91,17 @@ Local_key_register::acknowledge_element(Score_elem_info info)
 }
 
 void
-Local_key_register::process_requests()
+Local_key_register::do_process_requests()
 {
     Time_description const * time_C_ = get_staff_info().time_C_;
     if (! time_C_->whole_in_measure_){
        if (key_C_)
            local_key_= *key_C_;
-       else if( time_C_->when_ >Moment(0))
+       else if(0&& time_C_->when_ >Moment(0))
            warning ("Help me! can't figure out current key");
     }
 }
 
 IMPLEMENT_STATIC_NAME(Local_key_register);
+IMPLEMENT_IS_TYPE_B1(Local_key_register,Request_register);
 ADD_THIS_REGISTER(Local_key_register);
index e6f4a29256aed5615ba6b98ed71b8eb0738a0d71..396fae38dc3db44c9ed5801cddfd1da5df0b4497 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "staff-walker.hh"
 #include "lyric-register.hh"
 #include "musical-request.hh"
 #include "text-item.hh"
@@ -18,7 +17,7 @@ Lyric_register::Lyric_register()
 }
 
 bool
-Lyric_register::try_request(Request*r)
+Lyric_register::do_try_request(Request*r)
 {
     Musical_req * m =r->musical();
     if (!m || ! m->lreq_l()) 
@@ -29,7 +28,7 @@ Lyric_register::try_request(Request*r)
 }
 
 void
-Lyric_register::process_requests()
+Lyric_register::do_process_requests()
 {
     Text_item * last_item_l =0;
     for (int i=0; i < lreq_arr_.size(); i++) {
@@ -41,22 +40,15 @@ Lyric_register::process_requests()
        last_item_l = lp;
        typeset_element(lp);
     }
-    get_staff_info().walk_l_->allow_break();
 }
 
 void
-Lyric_register::post_move_processing()
+Lyric_register::do_post_move_processing()
 {
     lreq_arr_.set_size(0);
 }
 
 
-bool
-Lyric_register::acceptable_request_b(Request*r)
-{
-    Musical_req * m =r->musical();
-    return (!m || ! m->lreq_l()) ;
-}
-
 IMPLEMENT_STATIC_NAME(Lyric_register);
+IMPLEMENT_IS_TYPE_B1(Lyric_register,Request_register);
 ADD_THIS_REGISTER(Lyric_register);
index 19960f03def1b82ab92f04203857b51243a62cb5..7fbaf0c24ff25c8db1eb50ed365208742ce45e37 100644 (file)
@@ -81,6 +81,7 @@ notice()
        "  Jan Nieuwenhuizen <jan@digicash.com>\n"
        "Contributors\n"
        "  Mats Bengtsson <matsb@s3.kth.se>\n"
+       "  Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>\n"
        "\n"
        "    This program is free software; you can redistribute it and/or\n"
        "modify it under the terms of the GNU General Public License version 2\n"
index 4c34c187348e76641f72f06911055412e7fee2df..e0e3829ed0414b5da75271531fc743a4bebfd343 100644 (file)
@@ -9,28 +9,80 @@
 #include "meter-reg.hh"
 #include "meter.hh"
 #include "command-request.hh"
+#include "score-reg.hh"
 
 Meter_register::Meter_register()
+{ 
+    meter_req_l_ = 0;
+    meter_p_ =0;
+    default_grouping_ = Rhythmic_grouping(MInterval(0,4),4); // ugh
+}
+
+void
+Meter_register::fill_staff_info(Staff_info&inf)
 {
-    post_move_processing();
+    inf.time_C_ = &time_;
+    inf.rhythmic_C_ = &default_grouping_;
 }
 
 bool
-Meter_register::try_request(Request*r_l)
+Meter_register::do_try_request(Request*r)
 {
-    Command_req* creq_l= r_l->command();
-     if (!creq_l || !creq_l->meterchange()) 
-       return false;
-     Meter_change_req *m = creq_l->meterchange();
-     if (meter_req_l_ && meter_req_l_->compare(*m))
-        return false;
-     
-    meter_req_l_ = m;
-    return true;
+    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_register::process_requests()
+Meter_register::do_creation_processing()
+{
+    time_.when_ = get_staff_info().when();
+}
+
+void
+Meter_register::do_process_requests()
 {
     if (meter_req_l_ ) {
        Array<Scalar> args;
@@ -45,22 +97,30 @@ Meter_register::process_requests()
 }
 
 void
-Meter_register::pre_move_processing()
+Meter_register::do_pre_move_processing()
 {
     if (meter_p_) {
-       Meter * post_p =new Meter(*meter_p_);
-       Meter * pre_p =new Meter(*meter_p_);
-       
-       typeset_breakable_item(pre_p, meter_p_, post_p);
+       typeset_breakable_item(meter_p_);
        meter_p_ =0;
+       meter_req_l_ = 0;
     }
+
+    Register_group_register * reg_l = daddy_reg_l_;
+    while (reg_l->daddy_reg_l_) {
+       reg_l = reg_l->daddy_reg_l_;
+    }
+    
+    assert( reg_l->name() == Score_register::static_name());
+    if (!time_.cadenza_b_)
+       ((Score_register*)reg_l)->add_moment_to_process( time_.next_bar_moment());
 }
 
 void
-Meter_register::post_move_processing()
+Meter_register::do_post_move_processing()
 {
-    meter_req_l_ = 0;
-    meter_p_ =0;
+    time_.add( get_staff_info().when()  - time_.when_ );
 }
+
 IMPLEMENT_STATIC_NAME(Meter_register);
 ADD_THIS_REGISTER(Meter_register);
+IMPLEMENT_IS_TYPE_B1(Meter_register,Request_register); 
index 4e45b61185215136792dc76de20b61323f270c4a..d56bc338697818d12e686db80ef42a3777175e03 100644 (file)
@@ -17,3 +17,5 @@ Meter::brew_molecule_p()const
 }
 
 IMPLEMENT_STATIC_NAME(Meter);
+
+IMPLEMENT_IS_TYPE_B1(Meter,Item);
index 5a391323df810fac69f26c0a8aa41cecf0a61e6c..404f06b5ca5b103829854ede06f4a8c986b6c039 100644 (file)
@@ -15,7 +15,7 @@
 #include "string-convert.hh"
 #include "request.hh"
 #include "musical-request.hh"
-#include "voice.hh"
+#include "music-list.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 
index 1f34358a9d459d1506ed4304eb7a706adf8930eb..1a880fa58c56d0a35154ed329f18d57031429df1 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com> 
 */
 
+#if 0
 #include "time.h"
 #include "main.hh"
 #include "source.hh"
@@ -15,7 +16,6 @@
 #include "string-convert.hh"
 #include "debug.hh"
 #include "score.hh"
-#include "staff.hh"
 #include "main.hh"
 #include "midi-stream.hh"
 #include "midi-def.hh"
@@ -58,7 +58,7 @@ Midi_output::do_staff(Staff*st_l,int track_i)
     midi_track.add( Moment( 0 ), &midi_tempo );
 
     for (Midi_walker w (st_l, &midi_track); w.ok(); w++)
-       w.process_requests();
+       w.do_process_requests();
 
     *midi_stream_l_  << midi_track;
 }  
@@ -115,3 +115,4 @@ Midi_output::staffs()
        do_staff(i, track_i++);
 }
 
+#endif
index b6d25ea43aa64056c9ae3480f05c0e914a1e57b9..3068c987ddbdb0c458f5b1e8adf0c7bd0d4587bc 100644 (file)
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "p-score.hh"
-#include "staff.hh"
 #include "midi-walker.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 #include "debug.hh"
-#include "staff-column.hh"
-
+#if 0
 Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
     : PCursor<Staff_column*>(st_l->cols_)
 {
@@ -86,7 +84,7 @@ Midi_walker::output_event(Midi_item &i, Moment now)
 }
 
 void
-Midi_walker::process_requests()
+Midi_walker::do_process_requests()
 {
     do_stop_notes(ptr()->when());
 
@@ -130,3 +128,4 @@ compare(Note_event const&e1, Note_event const&e2)
 {
     return sign(e1.key - e2.key);
 }
+#endif
index c39082ab929cf7d8ddbf4c15ffc0fe594f7bcba7..2c946484c8657eb2279f7ef623025d7e7ebe7f21 100644 (file)
@@ -42,6 +42,18 @@ Molecule::translate(Offset o)
        c->translate(o);
 }
 
+void
+Molecule::translate_x(Real x)
+{
+    translate(Offset(x,0));
+}
+
+void
+Molecule::translate_y(Real y)
+{
+    translate(Offset(0,y));
+}
+
 void
 Molecule::add(Molecule const &m)
 {
@@ -86,7 +98,7 @@ Molecule::add_top(Molecule const &m)
     }
   Real yof=extent().y.right - m.extent().y.left;
     Molecule toadd(m);
-    toadd.translate(Offset(0,yof));
+    toadd.translate_y(yof);
     add(toadd);
 }
 
@@ -99,7 +111,7 @@ Molecule::add_bottom(Molecule const &m)
     }
     Real yof=extent().y.left- m.extent().y.right;
     Molecule toadd(m);
-    toadd.translate(Offset(0,yof));
+    toadd.translate_y(yof);
     add(toadd);
 }
 
diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc
new file mode 100644 (file)
index 0000000..e84f052
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+  music-iterator.cc -- implement {Music,Chord,Voice}_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "music-list.hh"
+#include "music-iterator.hh"
+#include "register.hh"
+#include "register-group.hh"
+#include "interpreter.hh"
+
+IMPLEMENT_STATIC_NAME(Music_iterator);
+IMPLEMENT_IS_TYPE_B(Music_iterator);
+
+Register_group_register * 
+Music_iterator::get_req_acceptor_l()
+{
+    assert(report_to_reg_l_);
+    if (report_to_reg_l_->interpreter_l() )
+       return report_to_reg_l_;
+
+    report_to_reg_l_ =  report_to_reg_l_->get_default_interpreter();
+    return report_to_reg_l_;
+}
+
+void
+Music_iterator::construct_children()
+{
+
+}
+
+Music_iterator::~Music_iterator(){
+}
+
+Moment
+Music_iterator::next_moment()const
+{
+    return 0;
+}
+
+void
+Music_iterator::next(Moment)
+{
+    first_b_ = false;
+}
+
+bool
+Music_iterator::ok()const
+{
+    return first_b_;
+}
+
+Music_iterator*
+Music_iterator::static_get_iterator_p(Music *m,
+                                     Register_group_register *report_l)
+{
+    Music_iterator * p =0;
+    if (m->is_type_b( Change_reg::static_name()))
+       p = new Change_iterator((Change_reg*)m);
+    else if (m->is_type_b( Voice_element::static_name()))
+       p = new Voice_element_iterator( (Voice_element*) m);
+    else if (m->is_type_b( Chord::static_name())) 
+       p =  new Chord_iterator( (Chord*) m);
+    else if (m->is_type_b( Voice::static_name())) 
+       p =  new Voice_iterator(  (Voice*) m);
+    else if (m->is_type_b( Request::static_name() ))
+       p =  new Request_iterator(  (Request*) m );
+    
+     if ( m->is_type_b( Music_list::static_name())) {
+       Music_list* ml = (Music_list*) m;
+       if (ml -> type_str_ != "") {
+           p->report_to_reg_l_ =
+               report_l->find_get_reg_l(ml-> type_str_, ml->id_str_);
+           
+       } 
+    } 
+     if (! p->report_to_reg_l_ )
+       p ->report_to_reg_l_ = report_l;
+    
+    return p;
+}
+
+Music_iterator*
+Music_iterator::get_iterator_p(Music*m)const
+{
+    Music_iterator*p = static_get_iterator_p(m,report_to_reg_l_);
+    p->daddy_iter_l_ = (Music_iterator*)this;
+    p->construct_children();
+    return p;
+}
+
+Music_iterator::Music_iterator()
+{
+    daddy_iter_l_ =0;
+    report_to_reg_l_ = 0;
+    first_b_ = true;
+}
+
+/* ************** */
+
+Chord_iterator::Chord_iterator(Chord const *chord_C)
+{
+    chord_C_ = chord_C;
+}
+
+void
+Chord_iterator::construct_children()
+{
+    int j =0;
+    for(iter(chord_C_->music_p_list_.top(), i); i.ok(); j++, i++) {
+       
+       Music_iterator * mi =  get_iterator_p( i.ptr());
+       report_to_reg_l_ = mi->report_to_reg_l_->ancestor_l( chord_C_->multi_level_i_ );
+       children_p_list_.bottom().add( mi );
+    }
+}
+
+void
+Chord_iterator::next(Moment until)
+{
+    for (iter(children_p_list_.top(), i); i.ok(); ) {
+       if  (i->next_moment() == until) {
+           i->next(until);
+       }
+       if (!i->ok()) 
+           i.del();
+       else
+           i++;
+    }
+    Music_iterator::next(until);
+
+    assert(!ok() || next_moment() > until);
+}
+
+IMPLEMENT_STATIC_NAME(Chord_iterator);
+IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
+
+Moment
+Chord_iterator::next_moment()const
+{
+    Moment next_ = INFTY;
+    for (iter(children_p_list_.top(), i); i.ok(); i++) 
+       next_ = next_ <? i->next_moment() ;
+    return next_;
+}
+
+
+
+bool
+Chord_iterator::ok()const
+{
+    return children_p_list_.size();
+}
+
+/* ************** */
+
+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()
+{
+    if (ok()) {
+       
+       iter_p_ = Music_iterator::get_iterator_p( ptr() );      
+       report_to_reg_l_ = 
+           iter_p_->report_to_reg_l_->ancestor_l( voice_C_ ->multi_level_i_ );
+    }
+}
+
+void
+Voice_iterator::next_element()
+{
+    delete iter_p_ ;
+    iter_p_ =0;
+    here_mom_ += ptr()->time_int().length();
+    PCursor<Music*>::next();
+    construct_children();
+}
+
+Voice_iterator::~Voice_iterator()
+{
+    delete iter_p_;
+}
+
+IMPLEMENT_STATIC_NAME(Voice_iterator);
+IMPLEMENT_IS_TYPE_B1(Voice_iterator,Music_iterator);
+
+void
+Voice_iterator::next(Moment until)
+{
+    while (ok()) {
+       Moment local_until = until - here_mom_;
+       while ( iter_p_ && iter_p_->ok() ) {
+           Moment here = iter_p_->next_moment();
+           if (here != local_until)
+               return;
+           iter_p_->next(local_until);
+       }
+       if (!iter_p_)
+           iter_p_ = Music_iterator::get_iterator_p( ptr() );
+       else if (!iter_p_->ok() )
+           next_element();
+    }
+    Music_iterator::next(until);
+    assert(!ok() || next_moment() > until);
+}
+
+Moment
+Voice_iterator::next_moment()const
+{
+    return iter_p_->next_moment() + here_mom_;
+}
+
+bool
+Voice_iterator::ok()const
+{
+    return PCursor<Music*>::ok();
+}
+
+/* ***************** */
+
+Request_iterator::Request_iterator(Request const*c)
+{
+    req_l_ = (Request*)c;
+}
+
+void
+Request_iterator::next(Moment m)
+{
+    if ( !daddy_iter_l_->report_to_reg_l_->
+        interpreter_l()->interpret_request_b(req_l_) )
+       req_l_->warning("Junking request: " + String(req_l_->name()));
+
+    
+    Music_iterator::next(m);
+}
+
+IMPLEMENT_STATIC_NAME(Request_iterator);
+IMPLEMENT_IS_TYPE_B1(Request_iterator, Music_iterator);
+
+/* ****************** */
+
+Change_iterator::Change_iterator(Change_reg * ch)
+{
+    change_l_ = ch;
+}
+
+IMPLEMENT_STATIC_NAME(Change_iterator);
+IMPLEMENT_IS_TYPE_B1(Change_iterator,Music_iterator);
+
+/*
+  TODO: pop/pushgroup
+ */
+void
+Change_iterator::next(Moment mom)
+{
+    Register_group_register *group_l =
+       report_to_reg_l_->find_get_reg_l(change_l_->type_str_, 
+                                        change_l_->id_str_);
+
+    report_to_reg_l_->daddy_reg_l_->remove_register_p(report_to_reg_l_);
+    group_l->add(report_to_reg_l_);
+
+    Music_iterator::next(mom);
+}
+
+
+
+/* ******************** */
+
+IMPLEMENT_STATIC_NAME(Voice_element_iterator);
+IMPLEMENT_IS_TYPE_B1(Voice_element_iterator,Chord_iterator);
+
+void
+Voice_element_iterator::construct_children()
+{
+    if ( daddy_iter_l_ 
+        && daddy_iter_l_->is_type_b(Voice_iterator::static_name() )) {
+       report_to_reg_l_ = daddy_iter_l_-> get_req_acceptor_l();
+    } else if (daddy_iter_l_
+              && daddy_iter_l_-> is_type_b( Chord_iterator::static_name() )) {
+
+       get_req_acceptor_l();
+    }
+    Chord_iterator::construct_children();
+}
+
+Voice_element_iterator::Voice_element_iterator(Voice_element*el_l)
+    : Chord_iterator(el_l)
+{
+    
+}
index 3d8f965b8b21608a1b2828ea79393849759aec17..9008ddc27a4d0353510a3c542516a7885de26010 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  music-list.cc -- implement Music_list, 
+  music-list.cc -- implement Music_list, Chord, Voice
 
   source file of the GNU LilyPond music typesetter
 
@@ -9,68 +9,98 @@
 
 #include "music.hh"
 #include "debug.hh"
+#include "music-list.hh"
 
 Music_list::Music_list(Music_list const&s)
 {
+    multi_level_i_ = s.multi_level_i_;   
     for (iter(s.music_p_list_.top(), i); i.ok(); i++)
        add(i->clone());
 }
 
-
 IMPLEMENT_STATIC_NAME(Music_list);
+IMPLEMENT_STATIC_NAME(Chord);
+IMPLEMENT_STATIC_NAME(Voice);
+IMPLEMENT_IS_TYPE_B1(Music_list, Music);
+IMPLEMENT_IS_TYPE_B1(Voice,Music_list);
+IMPLEMENT_IS_TYPE_B1(Chord,Music_list);
 
+MInterval
+Chord::time_int()const
+{
+    MInterval m;
+    for (iter(music_p_list_.top(), i); i.ok(); i++)
+       m.unite(i->time_int());
+    return m;
+}
 void
-Music_list::add(Music*mus_p)
+Chord::translate(Moment m)
 {
-    music_p_list_.bottom().add(mus_p);
+    for (iter(music_p_list_.top(), i); i.ok(); i++)
+       i->translate(m); 
 }
 
-void
-Music_list::transpose(Melodic_req const*m)
+Chord::Chord()
 {
-  for (iter(music_p_list_.top(), i); i.ok(); i++)
-      i->transpose(m);
+
 }
 
-void
-Music_list::do_print() const
+Voice::Voice()
 {
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       i->print();
+    offset_mom_ =0;
 }
 
-IMPLEMENT_STATIC_NAME(Chord);
+MInterval
+Voice::time_int() const
+{
+    Moment last=0;
+    for (iter(music_p_list_.top(), i); i.ok(); i++)
+       last += i->time_int().length();
+    return  offset_mom_ + MInterval(0,last);
+}
 
 void
-Chord::translate(Moment dt)
+Voice::translate(Moment dt)
 {
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       i->translate(dt);
+    offset_mom_ += dt;
 }
 
-MInterval
-Chord::time_int()const
+
+Music_list::Music_list()
 {
-    MInterval m;
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       m.unite(i->time_int());
-    return m;
+    multi_level_i_ = 0;
 }
 
-MInterval
-MVoice::time_int() const
+void
+Music_list::add(Music*m_p)
 {
-    Moment last=0;
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       last += i->time_int().length();
-    return MInterval (0,last);
+    if (!m_p)
+       return;
+
+    m_p->parent_music_l_ = this;
+    music_p_list_.bottom().add(m_p);
 }
 
 void
-MVoice::translate(Moment dt)
+Music_list::transpose(Melodic_req const*rq)
 {
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       i->translate(dt);
+    for (iter(music_p_list_.top(),i); i.ok(); i++)
+       i->transpose(rq);    
 }
 
-IMPLEMENT_STATIC_NAME(MVoice);
+void
+Music_list::do_print()const
+{
+#ifndef NPRINT
+    for (iter(music_p_list_.top(),i); i.ok(); i++)
+       i->print();
+#endif 
+}
+
+IMPLEMENT_IS_TYPE_B1(Voice_element, Chord);
+IMPLEMENT_STATIC_NAME(Voice_element);
+
+Voice_element::Voice_element()
+{
+    multi_level_i_ =0;
+}
index 155c7e31ff50564498196e294a1238bd1705c62d..ca55e559ecc3023e121e5c25a7d805fac960cf50 100644 (file)
@@ -8,6 +8,7 @@
 
 
 #include "music.hh"
+#include "music-list.hh"
 #include "debug.hh"
 
 MInterval
@@ -18,12 +19,13 @@ Music::time_int() const
 void
 Music::print()const
 {
-    #ifndef NPRINT
+#ifndef NPRINT
     mtor << name() << "{" ;
     do_print();
     mtor << "}\n";
-    #endif
+#endif
 }
+
 void
 Music::transpose(Melodic_req const*)
 {
@@ -41,7 +43,15 @@ Music::do_print()const
 }
 
 IMPLEMENT_STATIC_NAME(Music);
+IMPLEMENT_IS_TYPE_B(Music);
+
 
 
     
-Music::Music(){}
+Music::Music()
+{
+    parent_music_l_ =0;
+}
+
+IMPLEMENT_IS_TYPE_B1(Change_reg,Music)
+IMPLEMENT_STATIC_NAME(Change_reg);
index bee66ea3272282fb78ba5e9f5b7fcf41f19ee523..5f9723a0a57f01ec08345819e98f2098684029e6 100644 (file)
 #include "debug.hh"
 #include "script-def.hh"
 #include "text-def.hh"
-#include "voice.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
 
 IMPLEMENT_STATIC_NAME(Stem_req);
+IMPLEMENT_IS_TYPE_B1(Stem_req,Rhythmic_req);
 void
 Stem_req::do_print() const
 {
@@ -31,30 +31,19 @@ Stem_req::Stem_req()
 
 /* ************** */
 IMPLEMENT_STATIC_NAME(Musical_req);
+IMPLEMENT_IS_TYPE_B1(Musical_req,Request);
 void
 Musical_req::do_print()const{}
 void
 Tie_req::do_print()const{}
 
-IMPLEMENT_STATIC_NAME(Request);
-
-void Request::do_print() const{}
 
 /* *************** */
-
-void
-Request::print() const
-{
-#ifndef NPRINT
-    mtor << name() << " {";
-    do_print();
-    mtor << "}\n";
-#endif
-}
-     
+   
 
 
 IMPLEMENT_STATIC_NAME(Span_req);
+IMPLEMENT_IS_TYPE_B1(Span_req,Musical_req);
 
 void
 Span_req::do_print() const    
@@ -64,16 +53,6 @@ Span_req::do_print() const
 #endif
 }
 
-Request::Request()
-{
-    elt_l_ = 0;
-}
-Request::Request(Request const&src)
-    :Input(src)
-{
-    elt_l_ = 0;
-}
-/* *************** */
 Spacing_req::Spacing_req()
 {
     next = 0;
@@ -81,6 +60,7 @@ Spacing_req::Spacing_req()
     strength = 0;
 }
 IMPLEMENT_STATIC_NAME(Spacing_req);
+IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
 
 void
 Spacing_req::do_print()const
@@ -91,6 +71,7 @@ Spacing_req::do_print()const
 }
 
 IMPLEMENT_STATIC_NAME(Blank_req);
+IMPLEMENT_IS_TYPE_B2(Blank_req,Spacing_req,Rhythmic_req);
 
 void
 Blank_req::do_print()const
@@ -126,6 +107,7 @@ Melodic_req::transpose(Melodic_req const & delta)
 }
 
 IMPLEMENT_STATIC_NAME(Melodic_req);
+IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
 
 int
 Melodic_req::compare(Melodic_req const&m1, Melodic_req const&m2)
@@ -182,6 +164,7 @@ Rhythmic_req::Rhythmic_req()
 }
 
 IMPLEMENT_STATIC_NAME(Rhythmic_req);
+IMPLEMENT_IS_TYPE_B1(Rhythmic_req,Musical_req);
 
 void
 Rhythmic_req::do_print() const
@@ -206,6 +189,7 @@ Lyric_req::Lyric_req(Text_def* def_p)
 }
 
 IMPLEMENT_STATIC_NAME(Lyric_req);
+IMPLEMENT_IS_TYPE_B2(Lyric_req,Musical_req,Rhythmic_req);
 
 void
 Lyric_req::do_print() const
@@ -220,6 +204,7 @@ Note_req::Note_req()
     forceacc_b_ = false;
 }
 IMPLEMENT_STATIC_NAME(Note_req);
+IMPLEMENT_IS_TYPE_B2(Note_req,Melodic_req,Rhythmic_req);
 
 void
 Note_req::do_print() const
@@ -234,6 +219,7 @@ Note_req::do_print() const
 }
 /* *************** */
 IMPLEMENT_STATIC_NAME(Rest_req);
+IMPLEMENT_IS_TYPE_B1(Rest_req,Rhythmic_req);
 
 void
 Rest_req::do_print() const
@@ -247,10 +233,12 @@ Beam_req::Beam_req()
     nplet = 0;
 }
 IMPLEMENT_STATIC_NAME(Beam_req);
+IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
 void
 Beam_req::do_print()const{}
 /* *************** */
 IMPLEMENT_STATIC_NAME(Slur_req);
+IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
 void
 Slur_req::do_print()const{}
 /* *************** */
@@ -286,6 +274,7 @@ Script_req::Script_req()
 }
 
 IMPLEMENT_STATIC_NAME(Script_req);
+IMPLEMENT_IS_TYPE_B1(Script_req,Request);
 
 void
 Script_req::do_print() const
@@ -299,6 +288,7 @@ Musical_script_req::do_print() const
 {}
 
 IMPLEMENT_STATIC_NAME(Musical_script_req);
+IMPLEMENT_IS_TYPE_B2(Musical_script_req,Musical_req, Script_req);
 
 
 Script_req::~Script_req()
@@ -332,6 +322,7 @@ Text_req::Text_req(int dir_i, Text_def* tdef_p)
 }
 
 IMPLEMENT_STATIC_NAME(Text_req);
+IMPLEMENT_IS_TYPE_B1(Text_req,Musical_req);
 
 void
 Text_req::do_print() const
@@ -345,13 +336,8 @@ Text_req::do_print() const
 
 /* *************** */
 
-Moment
-Skip_req::duration() const
-{
-    return duration_;
-}
-
 IMPLEMENT_STATIC_NAME(Skip_req);
+IMPLEMENT_IS_TYPE_B1(Skip_req,Musical_req);
 
 void
 Skip_req::do_print() const
@@ -365,14 +351,15 @@ Skip_req::do_print() const
 Voice *
 Request::voice_l()
 {
-    if (!elt_l_)
+    if (!parent_music_l_)
        return 0;
     else
-       return (Voice*)elt_l_->voice_C_;
+       return (Voice*)parent_music_l_;
 }
 /* *************** */
 
 IMPLEMENT_STATIC_NAME(Subtle_req);
+IMPLEMENT_IS_TYPE_B1(Subtle_req,Musical_req);
 
 void
 Subtle_req::do_print() const
@@ -383,6 +370,7 @@ Subtle_req::do_print() const
 }
 
 IMPLEMENT_STATIC_NAME(Dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Dynamic_req,Musical_req);
 
 void
 Dynamic_req::do_print() const
@@ -391,6 +379,7 @@ Dynamic_req::do_print() const
 }
 
 IMPLEMENT_STATIC_NAME(Absolute_dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Absolute_dynamic_req,Musical_req);
 
 void
 Absolute_dynamic_req::do_print() const
@@ -428,6 +417,7 @@ Span_dynamic_req::Span_dynamic_req()
 }
 
 IMPLEMENT_STATIC_NAME(Span_dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Span_dynamic_req,Musical_req);
 
 void
 Span_dynamic_req::do_print()const
@@ -439,5 +429,6 @@ Span_dynamic_req::do_print()const
 }
 
 IMPLEMENT_STATIC_NAME(Tie_req);
+IMPLEMENT_IS_TYPE_B1(Tie_req,Musical_req);
 
 
index 4a44823344aa6ed4804ae6aea0b37f6c2950d60a..f80534ed2e0ed2f9759d370c3c407ad757b8ec20 100644 (file)
 #include "parseconstruct.hh"
 
 static Keyword_ent the_key_tab[]={
+    {"accepts", ACCEPTS},
+    {"alias", ALIAS},
     {"bar", BAR},
     {"cadenza", CADENZA},
     {"clear", CLEAR},
     {"clef", CLEF},
     {"cm", CM_T},
+    {"consists", CONSISTS},
+    {"contains", CONTAINS},
     {"duration", DURATIONCOMMAND},
     {"absdynamic", ABSDYNAMIC},
     {"group", GROUP},
     {"geometric", GEOMETRIC},
     {"hshift", HSHIFT},
+    {"id", ID},
     {"in", IN_T},
     {"init_end", INIT_END},
-    {"inputregister", INPUT_REGS},
+    {"requestregister", REQUESTREGISTER},
     {"lyric", LYRIC},
     {"key", KEY},
     {"melodic" , MELODIC},
@@ -41,7 +46,7 @@ static Keyword_ent the_key_tab[]={
     {"meter", METER},
     {"midi", MIDI},
     {"mm", MM_T},
-    {"multivoice", MULTIVOICE},
+    {"multi", MULTI},
     {"note", NOTE},
     {"notenames", NOTENAMES},
     {"octave", OCTAVECOMMAND},
index c742946294bb4078ad02b25b2d6a61fa1e1b976f..a4b7f13a8e25a7d075290b7c5e3333f727859aeb 100644 (file)
@@ -10,7 +10,7 @@
 #include "my-lily-lexer.hh"
 #include "debug.hh"
 #include "main.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
 #include "musical-request.hh"
 #include "command-request.hh"
 #include "parser.hh"
@@ -109,13 +109,13 @@ void
 My_lily_parser::set_duration_mode(String s)
 {
     s = s.upper_str();
-    last_duration_mode = (s== "LAST");
+    last_duration_mode_b_ = (s== "LAST");
 }
 
 void
 My_lily_parser::set_default_duration(Duration const *d)
 {
-    last_duration_mode = false;
+    last_duration_mode_b_ = false;
     default_duration_ = *d;
 }
 
@@ -123,15 +123,15 @@ My_lily_parser::set_default_duration(Duration const *d)
 void
 My_lily_parser::set_last_duration(Duration const *d)
 {
-    if (last_duration_mode)
+    if (last_duration_mode_b_)
        default_duration_ = *d;
 }
 
 
-Voice_element*
+Chord*
 My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
 {
-    Voice_element* velt_p = new Voice_element;
+    Chord* velt_p = new Voice_element;
     
     Lyric_req* lreq_p = new Lyric_req(tdef_p);
 
@@ -144,15 +144,16 @@ My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
     return velt_p;
 }
 
-Voice_element *
+Chord *
 My_lily_parser::get_rest_element(String s,  Duration * duration_p )
 {    
-    Voice_element* velt_p = new Voice_element;
+    Chord* velt_p = new Voice_element;
     velt_p->set_spot( here_input());
 
     if (s=="s") { /* Space */
        Skip_req * skip_p = new Skip_req;
-       skip_p->duration_ = duration_p->length();
+       skip_p->duration_ = *duration_p;
+
        skip_p->set_spot( here_input());
        velt_p->add(skip_p);
     }
@@ -172,10 +173,10 @@ My_lily_parser::get_rest_element(String s,  Duration * duration_p )
     return velt_p;
 }
 
-Voice_element *
+Chord *
 My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
 {
-    Voice_element*v = new Voice_element;
+    Chord*v = new Voice_element;
     v->set_spot( here_input());
 
     v->add(rq);
@@ -264,12 +265,12 @@ My_lily_parser::My_lily_parser(Sources * source_l)
     default_octave_i_ = 0;
     textstyle_str_="roman";            // in lexer?
     error_level_i_ = 0;
-    last_duration_mode = false;
+    last_duration_mode_b_ = true;
     fatal_error_i_ = 0;
 }
 
 void
-My_lily_parser::add_requests(Voice_element*v)
+My_lily_parser::add_requests(Chord*v)
 {
     for (int i = 0; i < pre_reqs.size(); i++) {
        v->add(pre_reqs[i]);
index 8ea7cc2d6855eaaff54d9948c592d9cb08fa6cc8..4dbf16f8877fa2cc6ea9f7222a631611438de335 100644 (file)
@@ -64,7 +64,7 @@ Note_column_register::acknowledge_element(Score_elem_info i)
 }
 
 void
-Note_column_register::pre_move_processing()
+Note_column_register::do_pre_move_processing()
 {
     Script_column *col_l = ( ncol_p_ ) ? ncol_p_ : restcol_p_;
     if (!col_l)
@@ -92,7 +92,7 @@ Note_column_register::pre_move_processing()
 }
 
 void
-Note_column_register::post_move_processing()
+Note_column_register::do_post_move_processing()
 {
     script_l_arr_.set_size(0);
     stem_l_ =0;
@@ -114,7 +114,8 @@ Note_column_register::Note_column_register()
     
     ncol_p_=0;
     restcol_p_ =0;
-    post_move_processing();
+    do_post_move_processing();
 }
 IMPLEMENT_STATIC_NAME(Note_column_register);
+IMPLEMENT_IS_TYPE_B1(Note_column_register,Request_register);
 ADD_THIS_REGISTER(Note_column_register);
index 9af2cd3fd430c5d1aaa641907b86f286fdedcb23..09ef114684af293a98bd767be1d6020ab435845b 100644 (file)
@@ -13,6 +13,7 @@
 #include "stem.hh"
 
 IMPLEMENT_STATIC_NAME(Note_column);
+IMPLEMENT_IS_TYPE_B1(Note_column,Script_column);
 
 void
 Note_column::add(Stem*stem_l)
index e0c974aa9a41786db1fae90e00f63d21ed9c336a..2db3dd6bef3683f6a61366842ee31edb19f60ca6 100644 (file)
@@ -8,14 +8,13 @@
 #include "debug.hh"
 #include "musical-request.hh"
 #include "command-request.hh"
-#include "voice.hh"
+#include "music-list.hh"
 #include "script.hh"
 #include "identifier.hh"
 #include "varray.hh"
 #include "text-def.hh"
 #include "parseconstruct.hh"
-#include "input-music.hh"
-#include "voice-element.hh"
+
 
 
 String *
@@ -46,7 +45,7 @@ get_scriptdef(char c)
 }
 
 Request*
-get_script_req(int d , Script_def*def)
+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;
@@ -54,12 +53,7 @@ get_script_req(int d , Script_def*def)
     return script_req_p;
 }
 
-Request*
-get_text_req(int d , Text_def*def)
-{
-    Text_req* text_req_p = new Text_req(d, def);
-    return text_req_p;
-}
+
 
 Request*
 get_stemdir_req(int d)
index 0e55a26a7f6558316f6a727ab161b41f3b596e5b..fa21149a6fdbfb0381142f89ba209413b898aae6 100644 (file)
@@ -44,6 +44,7 @@ Note_head::set_rhythmic(Rhythmic_req*r_req_l)
 }
     
 IMPLEMENT_STATIC_NAME(Note_head);
+IMPLEMENT_IS_TYPE_B1(Note_head,Item);
 
 void
 Note_head::do_print()const
@@ -82,10 +83,10 @@ Note_head::brew_molecule_p() const
        Molecule dm;
        dm.add(Atom(d));
        if (!(position_i_ %2))
-           dm.translate(Offset(0,dy));
+           dm.translate_y(dy);
        out->add_right(dm);
     }
-    out->translate(Offset(x_dir_i_ * p->note_width(),0));
+    out->translate_x(x_dir_i_ * p->note_width());
     bool streepjes = (position_i_<-1)||(position_i_ > staff_size_i_+1);
     
     if (rest_b_ && balltype_i_ > 2)
@@ -98,11 +99,11 @@ Note_head::brew_molecule_p() const
        Molecule sm;
        sm.add(Atom(str));
        if (position_i_ % 2)
-           sm.translate(Offset(0,-dy* dir));
+           sm.translate_y(-dy* dir);
        out->add(sm);       
     }
     
-    out->translate(Offset(0,dy*position_i_));
+    out->translate_y(dy*position_i_);
     return out;
 }
 
index 66701e384082625933be0898ea084dbaee6d1ecd..f55ea2452b9520086d29141598b58acaaee6ea05 100644 (file)
@@ -23,6 +23,19 @@ PCol::width() const
     return w;
 }
 
+void
+PCol::clean_breakable_items()
+{
+    if (!line_l_) {
+       for(iter(its.top(), j); j.ok(); ) {
+           j->unlink();
+           j.del();
+       }
+    }
+    if (prebreak_p_) prebreak_p_->clean_breakable_items();
+    if (postbreak_p_) postbreak_p_->clean_breakable_items();
+}
+
 int
 PCol::rank_i() const
 {
@@ -93,6 +106,12 @@ PCol::set_breakable()
     postbreak_p_->pscore_l_ = pscore_l_;
 }
 
+bool
+PCol::breakpoint_b() const
+{
+    return !line_l_;
+}
+
 bool
 PCol::breakable_b() const
 {
index d6c4a63940af6cbffa170dbf530fa3aadf85e987..44acc399bd4cedd018075546ca63fa65edd227ab 100644 (file)
@@ -23,6 +23,7 @@ PScore::typeset_element(Score_elem * elem_p)
 {
     elem_p_list_.bottom().add(elem_p);
     elem_p->pscore_l_ = this;
+
     elem_p->add_processing();
 }
 
@@ -31,12 +32,12 @@ PScore::typeset_item(Item *i, PCol *c, int breakstat)
 {
     assert(c && i);
 
-    if (breakstat == 0) {
+    if (breakstat == -1) {
        typeset_item(i, c->prebreak_p_);
        return;
     }
 
-    if (breakstat == 2) {
+    if (breakstat == 1) {
        typeset_item(i, c->postbreak_p_);
        return;
     }
@@ -177,6 +178,7 @@ PScore::print() const
 void
 PScore::preprocess()
 {
+    super_elem_l_->breakable_col_processing();
     super_elem_l_->pre_processing();
 }
 
@@ -205,7 +207,7 @@ PScore::set_breaking(Array<Col_hpositions> const &breaking)
     super_elem_l_->break_processing();
 
 
-    for (iter_top(spanners,i); i.ok(); ) {
+    for (iter(spanners.top(),i); i.ok(); ) {
        Spanner *span_p = i.remove_p();
        if (span_p->broken_b()) {
            span_p->unlink();
@@ -214,6 +216,9 @@ PScore::set_breaking(Array<Col_hpositions> const &breaking)
            typeset_broken_spanner(span_p);
        }
     }
+
+    for (iter_top(cols, i); i.ok(); i++)
+       i->clean_breakable_items();
 }
 
 void
@@ -235,6 +240,7 @@ PScore::process()
     *mlog << "\nPostprocessing elements..." << endl;
     postprocess();
 }
+
 /** Get all breakable columns between l and r, (not counting l and r).  */
 Link_array<PCol>
 PScore::breakable_col_range(PCol*l,PCol*r)const
index eaabea2fbe71b8f3f274bcbfd0beb8e581e8abc3..3691fabfd5ccc5fbdbff39ebf79a35b7ba63116d 100644 (file)
 
 
 
-// golden ratio
-const Real PHI = (1+sqrt(5))/2;
-
-// see  Roelofs, p. 57
 Real
 Paper_def::duration_to_dist(Moment d)
 {
index 532380bc10b63d74210cc3959ed3bd0b306edb24..7ccb227ccfe8185c420a8aa45e7825085392a802 100644 (file)
@@ -1,7 +1,7 @@
 %{ // -*-Fundamental-*-
 #include <iostream.h>
 
-#define MUDELA_VERSION "0.0.58"
+#define MUDELA_VERSION "0.0.59"
 
 #include "script-def.hh"
 #include "symtable.hh"
@@ -11,9 +11,6 @@
 #include "paper-def.hh"
 #include "midi-def.hh"
 #include "main.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
 #include "keyword.hh"
 #include "debug.hh"
 #include "parseconstruct.hh"
 #include "identifier.hh"
 #include "command-request.hh"
 #include "musical-request.hh"
-#include "voice-element.hh"
 #include "my-lily-parser.hh"
 #include "text-def.hh"
 #include "input-register.hh"
+#include "score.hh"
+#include "music-list.hh"
 
 #ifndef NDEBUG
 #define YYDEBUG 1
     Array<String> * strvec;
     Array<int> *intvec;
     Box *box;
+    Chord * chord;
     Duration *duration;
     Identifier *id;    
     Input_register * iregs;
-    Input_music *music;
-    Input_score *score;
-    Input_staff *staff;    
+    Music *music;
+    Music_list *musiclist;
+    Score *score;
     Interval *interval;
     Lookup*lookup;
     Melodic_req * melreq;
     Midi_def* midi;
     Moment *moment;
-    Music_general_chord *chord;
-    Music_voice *mvoice;
     Note_req *notereq;
     Paper_def *paper;
     Real real;
     Request * request;
-    Script_def * script;
+    General_script_def * script;
     String *string;
     Symbol * symbol;
     Symtable * symtable;
     Symtables * symtables;
     Text_def * textdef;
-    Voice *voice;    
-    Voice_element *el; 
     char c;
     const char *consstr;
     int i;
@@ -100,10 +95,14 @@ yylex(YYSTYPE *s,  void * v_l)
 /* tokens which are not keywords */
 %token CONCAT
 
+%token ALIAS
 %token BAR
 %token CADENZA
 %token CLEAR
 %token CLEF
+%token CONTAINS
+%token CONSISTS
+%token ACCEPTS
 %token CM_T
 %token DURATIONCOMMAND
 %token ABSDYNAMIC
@@ -111,9 +110,10 @@ yylex(YYSTYPE *s,  void * v_l)
 %token GEOMETRIC
 %token GROUPING
 %token GROUP
-%token INPUT_REGS
+%token REQUESTREGISTER
 %token HSHIFT
 %token IN_T
+%token ID
 %token INIT_END
 %token LYRIC
 %token KEY
@@ -122,7 +122,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token METER
 %token MIDI
 %token MM_T
-%token MULTIVOICE
+%token MULTI
 %token NOTE
 %token NOTENAMES
 %token OCTAVECOMMAND
@@ -152,18 +152,18 @@ yylex(YYSTYPE *s,  void * v_l)
 /* escaped */
 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
 
-%token <i>     DOTS
+%type <i>      dots
 %token <i>     INT
 %token <melreq>        NOTENAME_ID
-%token <id>    REGS_IDENTIFIER
 %token <id>    IDENTIFIER
 %token <id>    MELODIC_REQUEST_IDENTIFIER 
-%token <id>    CHORD_IDENTIFIER
+%token <id>    MUSIC_IDENTIFIER
 %token <id>    VOICE_IDENTIFIER
 %token <id>    POST_REQUEST_IDENTIFIER
 %token <id>    SCRIPT_IDENTIFIER
 %token <id>    STAFF_IDENTIFIER
 %token <id>    REAL_IDENTIFIER
+%token <id>    INT_IDENTIFIER
 %token <id>    SCORE_IDENTIFIER
 %token <id>    REQUEST_IDENTIFIER
 %token <real>  REAL 
@@ -176,8 +176,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <box>    box
 %type <c>      open_request_parens close_request_parens
 %type <c>      open_plet_parens close_plet_parens
-%type <chord>  music_chord music_chord_body  init_music_chord
-%type <el>     voice_elt full_element lyrics_elt command_elt
+%type <music>  simple_element music_elt full_element lyrics_elt command_elt
 %type <i>      int
 %type <i>      script_dir
 %type <id>     declaration
@@ -190,31 +189,27 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <melreqvec>      pitch_list 
 %type <midi>   midi_block midi_body
 %type <moment> duration_length
-%type <music>  init_music
-%type <mvoice>  simple_horizontal_music horizontal_music  horizontal_music_body
-%type <mvoice>  transposed_music_voice init_lyrics_voice
-%type <mvoice> music_voice_body init_music_voice  
+%type <music>  init_melodic init_lyrics init_music
+%type <music>  Music transposed_music
+%type <musiclist> Voice Voice_body 
+%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 abbrev_command_req
-%type <request>        pure_post_request pure_post_request_choice
-%type <request>        script_req textscript_req dynamic_req 
+%type <request>        script_req  dynamic_req 
 %type <score>  score_block score_body
-%type <script> script_definition script_body mudela_script
-%type <staff>  staff_block staff_init staff_body
+%type <script> script_definition script_body mudela_script gen_script_def
+%type <textdef> text_def
 %type <string> declarable_identifier
 %type <string> script_abbreviation
 %type <id>     old_identifier
 %type <symbol> symboldef
 %type <symtable>       symtable symtable_body
-%type <textdef>        mudela_text
-%type <iregs>  input_regs input_regs_body
+%type <iregs>  input_register_spec input_register_spec_body
 
 %left PRIORITY
 
-%expect 1      /* have to fix this. */
-
 %%
 
 mudela:        /* empty */
@@ -226,6 +221,7 @@ mudela:     /* empty */
        | mudela check_version { } 
        | mudela add_notenames { }
        | mudela init_end       {}
+       | mudela input_register_spec { add_global_input_register($2); }
        ;
 
 init_end: INIT_END ';'         {
@@ -287,15 +283,11 @@ declarable_identifier:
 old_identifier:
        IDENTIFIER
        |       MELODIC_REQUEST_IDENTIFIER 
-       |       CHORD_IDENTIFIER
-       |       VOICE_IDENTIFIER
        |       POST_REQUEST_IDENTIFIER
        |       SCRIPT_IDENTIFIER
-       |       STAFF_IDENTIFIER
        |       REAL_IDENTIFIER
        |       SCORE_IDENTIFIER
        |       REQUEST_IDENTIFIER
-       |       REGS_IDENTIFIER
        ;
 
 declaration:
@@ -303,24 +295,12 @@ declaration:
                $$ = new Score_id(*$1, $3, SCORE_IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' staff_block  {
-               $$ = new Staff_id(*$1, $3, STAFF_IDENTIFIER);
-               delete $1; 
-       }
-       | declarable_identifier '=' init_music_voice {
-               $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
-               delete $1;
-       }
-       | declarable_identifier '=' init_lyrics_voice {
-               $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
-               delete $1;
-       }
        | declarable_identifier '=' script_definition {
                $$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' init_music_chord  {
-               $$ = new M_chord_id(*$1, $3, CHORD_IDENTIFIER);
+       | declarable_identifier '=' init_music  {
+               $$ = new Music_id(*$1, $3, MUSIC_IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' symtables {
@@ -332,7 +312,7 @@ declaration:
                delete $1;
        }
        
-       | declarable_identifier '=' pure_post_request {
+       | declarable_identifier '=' post_request {
                $$ = new Request_id(*$1, $3, POST_REQUEST_IDENTIFIER);
                delete $1;
        }
@@ -340,36 +320,33 @@ declaration:
                $$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' input_regs  {
-               $$ = new Input_regs_id(*$1, $3, REGS_IDENTIFIER);
-               delete $1;
-       }
        ;
 
 
-input_regs:
-       INPUT_REGS
-               { THIS->remember_spot(); }
-       '{' input_regs_body '}'
-       {
-               $$ = $4;
-               $$->set_spot(THIS->pop_spot());
-       }
+
+input_register_spec:
+       REQUESTREGISTER '{' input_register_spec_body '}'
+               { $$ = $3; }
        ;
 
-input_regs_body:
-       REGS_IDENTIFIER         {
-               $$ = $1->iregs(true);
+input_register_spec_body:
+       STRING  { 
+               $$ = new Input_register; 
+               $$->name_str_ =*$1;
+               delete $1;
        }
-       |STRING { 
-               $$ = new Input_register;
-               $$->name_str_ = *$1;
+       | input_register_spec_body ALIAS STRING ';' {
+               $$-> alias_str_arr_.push(*$3);
+               delete $3;
        }
-       | input_regs_body input_regs {
-               $$->add($2);
+       | input_register_spec_body CONSISTS STRING ';'  {
+               $$-> consists_str_arr_.push(*$3);
+               delete $3;
+       }
+       | input_register_spec_body CONTAINS input_register_spec {
+               $$->add($3);
        }
        ;
-
 /*
        SCORE
 */
@@ -388,14 +365,20 @@ score_block:
        ;
 
 score_body:            { 
-               $$ = new Input_score; 
+               $$ = new Score; 
        }
        | SCORE_IDENTIFIER {
                $$ = $1->score(true);
        }
-       | score_body staff_block        { $$->add($2); }
-       | score_body paper_block                { $$->set($2);  }
-       | score_body midi_block         { $$->set($2);  }
+       | score_body init_music {
+               $$->music_p_ = $2;
+       }
+       | score_body paper_block                {
+               $$->paper_p_ = $2;      
+       }
+       | score_body midi_block         { 
+               $$->midi_p_ = $2;
+       }
        | score_body error {
 
        }
@@ -458,180 +441,113 @@ midi_body: {
        }
        ;
 
-/*
-       STAFFs
-*/
-staff_block:
-       STAFF   { THIS->remember_spot(); }
-/*cont*/       '{' staff_body '}'      {
-               $$ = $4; 
-               $$-> set_spot(THIS->pop_spot());
-       }
-       | { THIS->remember_spot(); }
-/*cont*/       STAFF_IDENTIFIER        { 
-               $$ = $2->staff(true); 
-               $$-> set_spot(THIS->pop_spot());
-       }
-       ;
-
 
 
-staff_init:
-        STAFF_IDENTIFIER {
-               $$ = $1->staff(true);
-       }
-       | REGS_IDENTIFIER {
-               $$ = new Input_staff;
-               $$->ireg_p_ = $1->iregs(true);
-       }
-       | input_regs    {
-               $$ = new Input_staff;
-               $$->ireg_p_ = $1;
-       }
-       ;
-
-staff_body:
-       staff_init
-       | staff_body init_music {
-               $$ = $1;
-               $2->set_default_group( "staff_music" + String($$->music_.size()));
-               $$->add($2);
-       }
-       | staff_body error {
-       }
-       ;
-
 /*
        let the lexer switch mode.
 */
 init_music:
-       init_music_voice        { $$ = $1; }
-       | init_music_chord      { $$ = $1; }
-       | init_lyrics_voice     { $$ = $1; }
-       | VOICE_IDENTIFIER      { 
-               $$ = $1->mvoice(true);
-       }
+       init_melodic    { $$ = $1; }
+       | init_lyrics   { $$ = $1; }
        ;
 
-init_lyrics_voice:
-       LYRIC { THIS->lexer_p_->push_lyric_state(); } 
-       horizontal_music { $$ = $3; THIS->lexer_p_->pop_state(); }
+init_lyrics:
+       LYRIC 
+               { THIS->lexer_p_->push_lyric_state(); } 
+       Music
+               { $$ = $3; THIS->lexer_p_->pop_state(); }
        ;
 
-init_music_voice:
-       MELODIC { THIS->lexer_p_->push_note_state(); } 
-       /* cont*/ horizontal_music
+init_melodic:
+       MELODIC 
+               { THIS->lexer_p_->push_note_state(); } 
+       Music
                { $$=$3; THIS->lexer_p_->pop_state(); }
        ;
 
-init_music_chord:
-       { THIS->lexer_p_->push_note_state(); } 
-       /* cont*/ music_chord
-                 { $$=$2; THIS->lexer_p_->pop_state(); }
-       ;
 /*
        MUSIC
 */
 
-horizontal_music:
-       '{' horizontal_music_body '}'   {
+Voice:
+       '{' Voice_body '}'      {
                $$ = $2;
        }
        ;
 
-horizontal_music_body:
-       simple_horizontal_music                         {
-               $$ = $1;
+Voice_body:
+       /**/            {
+               $$ = new Voice;
        }
-       | horizontal_music_body CONCAT simple_horizontal_music  {
-               $$->add($3);/* niet echt */
-       }
-       ;
-
-
-simple_horizontal_music:
-       TRANSPOSE '{' transposed_music_voice '}' {
-               $$ = $3;
-       }
-       | VOICE_IDENTIFIER {
-               $$ = $1->mvoice(true);
+       | Voice_body ID STRING STRING ';'       {
+               $$ = new Voice;
+               $$->type_str_ = *$3;    
+               $$->id_str_ = *$4;
+               delete $3;
+               delete $4;
        }
-       | music_voice_body      {
-               $$ = $1;
+       | Voice_body Music              {
+               $$->add($2);
        }
        ;
 
+Music:
+       full_element            { $$ = $1; }
+       | Voice         { $$ = $1; }
+       | Chord                 { $$ = $1; }
+       | transposed_music      { $$ = $1; }
+       | MUSIC_IDENTIFIER      { $$ = $1->music(true); }
+       ; 
 
-transposed_music_voice:
-       steno_melodic_req horizontal_music { 
-               $$ = $2;
-               $$->transpose(*$1);
-               delete $1;
-       }
+Chord:
+       '<' Chord_body '>'      { $$  = $2; }
        ;
 
-
-music_voice_body:
-        /* */  {
-               $$ = new Music_voice;
+Chord_body:
+       /**/    {
+               $$ = new Chord;
+               $$-> multi_level_i_ = 1;
        }
-       | music_voice_body full_element {
-               $$->add_elt($2);
+       | Chord_body MULTI INT ';' {
+               $$->multi_level_i_=$3;
        }
-       | music_voice_body voice_command ';' {
+       | Chord_body ID STRING STRING ';'       {
+               $$->type_str_ = *$3;    
+               $$->id_str_ = *$4;
+               delete $4; 
+               delete $3;
        }
-       | music_voice_body music_chord  {
+       | Chord_body Music {
                $$->add($2);
        }
-       | music_voice_body error {
-       }
-       | music_voice_body '>' {
-               THIS->fatal_error_i_ = 1;
-               THIS->parser_error("Confused by errors: bailing out");
-       }
        ;
 
-music_chord:  '<' music_chord_body '>' { $$ = $2; }
-       ;
-
-music_chord_body:
-       CHORD_IDENTIFIER {
-               $$=$1->mchord(true);
-       }
-       | /* */ {
-               $$ = new Voice_group_chord;
-       }
-       | MULTIVOICE {
-               $$ = new Multi_voice_chord;
-       }
-       | music_chord_body horizontal_music {
-               $$->add($2);
-       }
-       | music_chord_body full_element {
-               $$ ->add_elt($2);
-       }
-       | music_chord_body '}' {
-               THIS->fatal_error_i_ = 1;
-               THIS->parser_error("Confused by errors: bailing out");
-       }
-       | music_chord_body error {
+transposed_music:
+       TRANSPOSE steno_melodic_req Music {
+               $$ = $3;
+               $$ -> transpose($2);
+               delete $2;
        }
        ;
 
+
 /*
        VOICE ELEMENTS
 */
-full_element:  pre_requests voice_elt post_requests {
-               THIS->add_requests($2);
-               $$ = $2;
-       }
-       | pre_requests lyrics_elt post_requests {
-               THIS->add_requests($2);
+full_element:
+       pre_requests simple_element post_requests       {
+               THIS->add_requests((Chord*)$2);//ugh
                $$ = $2;
-        }
-       | command_elt
+       }
+       | voice_command ';'     { $$ = 0; }
        ;       
 
+simple_element:
+       music_elt 
+       | lyrics_elt
+       | command_elt
+       ;
+
 command_elt:
 /* empty */    {
                $$ = new Voice_element;
@@ -640,9 +556,16 @@ command_elt:
 /* cont: */
        command_req {
                $2-> set_spot( THIS->here_input());
-               $$->add($2);
+               ((Chord*)$$) ->add($2);//ugh
 
        }
+       | GROUP STRING ';' { // ugh ugh ugh
+               Change_reg *chr_p = new Change_reg;
+               $$ = chr_p;
+               chr_p-> type_str_ = "Voice_group_registers"; //ugh
+               chr_p-> id_str_ = *$2;
+               delete $2;
+       }
        ;
 
 command_req:
@@ -674,7 +597,10 @@ verbose_command_req:
        }
        | SKIP duration_length {
                Skip_req * skip_p = new Skip_req;
-               skip_p->duration_ = *$2;
+               skip_p->duration_ = Duration(1,0);
+               skip_p->duration_.set_plet($2->numerator().as_long(), 
+                       $2->denominator().as_long());
+               
                delete $2;
                $$ = skip_p;
        }
@@ -704,11 +630,7 @@ verbose_command_req:
        | GROUPING intastint_list {
                $$ = get_grouping_req(*$2); delete $2;
        }
-       | GROUP STRING          {
-               $$ = new Group_change_req;
-               $$ -> command()->groupchange()->newgroup_str_ = *$2;
-               delete $2;
-       }
+       
        ;
 
 post_requests:
@@ -721,26 +643,15 @@ post_requests:
        }
        ;
 
-post_request:
-       pure_post_request
-       | POST_REQUEST_IDENTIFIER       {
-               $$ = $1->request(false)->clone();
-       }
-       ;
 
-pure_post_request: 
-       pure_post_request_choice        {
-               $$ = $1;
-               $$->set_spot( THIS->here_input());
+post_request:
+       POST_REQUEST_IDENTIFIER {
+               $$ = (Request*)$1->request(true);
        }
-       ;
-
-pure_post_request_choice:
-       close_request_parens    { 
+       |close_request_parens   { 
                $$ = THIS->get_parens_request($1); 
        }
        | script_req
-       | textscript_req
        | dynamic_req
        ;
 
@@ -816,6 +727,7 @@ close_request_parens:
                $$ = ']';
        }
        | close_plet_parens {
+               $$ = ']';
        }
        | E_SMALLER {
                $$ = '<';
@@ -824,7 +736,7 @@ close_request_parens:
                $$ = '>';
        }
        ;
-  
+
 open_plet_parens:
        '[' INT '/' INT {
                $$ = '[';
@@ -854,30 +766,39 @@ script_definition:
 
 script_body:
        STRING int int int int          {
-               $$ = new Script_def;
-               $$->set_from_input(*$1,$2, $3,$4,$5);
+               Script_def *s = new Script_def;
+               s->set_from_input(*$1,$2, $3,$4,$5);
+               $$  = s;
                delete $1;
        }       
        ;
 
-textscript_req:
-       script_dir mudela_text          { $$ = get_text_req($1,$2); }
+script_req:
+       script_dir gen_script_def               { 
+               Musical_script_req *m = new Musical_script_req;
+               $$ = m; 
+               m-> scriptdef_p_ = $2;
+               m-> set_spot ( THIS->here_input() );
+               m-> dir_i_  = $1;
+       }
        ;
 
-mudela_text:
-       STRING                  { 
-               $$ = new Text_def;
-               $$->text_str_ = *$1; 
-               delete $1;
-               $$->style_str_ = THIS->textstyle_str_;
-       }
+gen_script_def:
+       text_def        { $$ = $1; }
+       | mudela_script 
        ;
 
-script_req:
-       script_dir mudela_script        { 
-               $$ = get_script_req($1, $2);
+text_def:
+       STRING { 
+               Text_def *t  = new Text_def;
+               $$ = t;
+               t->text_str_ = *$1; 
+               delete $1;
+               t->style_str_ = THIS->textstyle_str_;
+               $$->set_spot( THIS->here_input() );
        }
        ;
+
 script_abbreviation:
        '^'             { $$ = get_scriptdef('^'); }
        | '+'           { $$ = get_scriptdef('+'); }
@@ -885,9 +806,7 @@ script_abbreviation:
        | '|'           { $$ = get_scriptdef('|'); }
        | 'o'           { $$ = get_scriptdef('o'); }
        | '>'           { $$ = get_scriptdef('>'); }
-       | DOTS          {
-               if ( $1 > 1 ) 
-                   THIS->here_input().warning( "too many staccato dots"  );
+       | '.'           {
                $$ = get_scriptdef('.');
        }
        ;
@@ -953,7 +872,7 @@ voice_command:
        ;
 
 duration_length:       
-        {
+       {
                $$ = new Moment(0,1);
        }
        | duration_length explicit_duration             {       
@@ -961,13 +880,18 @@ duration_length:
        }
        ;
 
+dots:
+       '.'             { $$ = 1; }
+       | dots '.'      { $$ ++; }
+       ;
+
 notemode_duration:
        /* */           { 
                $$ = new Duration(THIS->default_duration_);
        }
-       | DOTS          {
+       | dots          {
                $$ = new Duration(THIS->default_duration_);
-               $$->dots_i_ = $1;
+               $$->dots_i_  = $1;
        }
        | explicit_duration     {
                THIS->set_last_duration($1);
@@ -985,8 +909,8 @@ explicit_duration:
                        $$->set_plet(THIS->default_duration_);
                     }
        }
-       | explicit_duration DOTS        {
-               $$->dots_i_ = $2;
+       | explicit_duration '.'         {
+               $$->dots_i_ ++;
        }
        | explicit_duration '*' int  {
                $$->plet_.iso_i_ *= $3; 
@@ -997,7 +921,7 @@ explicit_duration:
        ;
 
 
-voice_elt:
+music_elt:
        steno_note_req notemode_duration                {
                if (!THIS->lexer_p_->note_state_b())
                        THIS->parser_error("have to be in Note mode for notes");
@@ -1011,7 +935,7 @@ voice_elt:
        ;
 
 lyrics_elt:
-       mudela_text notemode_duration                   {
+       text_def notemode_duration                      {
                if (!THIS->lexer_p_->lyric_state_b())
                        THIS->parser_error("Have to be in Lyric mode for lyrics");
                $$ = THIS->get_word_element($1, $2);
@@ -1030,18 +954,17 @@ pitch_list:                      {
        ;
 
 int:
-       real                    {
-               $$ = int($1);
-               if ( distance($1,Real(int($$)) ) > 1e-8)
-                       yyerror( "integer expected" );
+       INT                     {
+               $$ = $1;
+       }
+       | INT_IDENTIFIER        {
+               $$ = * $1->intid(0);
        }
        ;
 
+
 real:
-       INT                     {
-               $$ = Real($1);
-       }
-       | REAL          {
+       REAL            {
                $$ = $1;
        }
        | REAL_IDENTIFIER               {
diff --git a/lily/pulk-voice.cc b/lily/pulk-voice.cc
deleted file mode 100644 (file)
index e54c429..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-  pulk-voices.cc -- implement Pulk_voice
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "pulk-voice.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "voice-element.hh"
-
-Pulk_voice::Pulk_voice(Voice*voice_l, int idx)
-    :    cur_(voice_l->elts_)
-{
-    elt_mom_ = voice_l->start_;
-    staff_idx_= idx;
-    set_subtle();
-}
-
-Array<Request*>
-Pulk_voice::get_req_l_arr() 
-{
-    Array<Request*> req_l_arr;
-    Moment w = when();
-    do {
-       Moment sub = subtle_moment_priorities_[subtle_idx_];
-       for (PCursor<Request*> i(cur_->req_p_list_); i.ok(); i++) {
-           Musical_req* m_l = i->musical();
-           if (!sub) {
-               if (!(m_l && m_l->subtle() && m_l->subtle()->subtime_ )) 
-                   req_l_arr.push(i);
-           } else {
-               if (m_l && m_l->subtle() && m_l->subtle()->subtime_ == sub)
-                   req_l_arr.push(i);
-           }
-       }
-       next();
-    } while ( ok() && when () == w);
-    return req_l_arr;
-}
-
-void
-Pulk_voice::set_subtle()
-{
-    subtle_idx_ =0;
-
-    subtle_moment_priorities_.set_size(0);
-    if (!cur_.ok())
-       return;
-    for (PCursor<Request*> i(cur_->req_p_list_); i.ok(); i++) {
-       Musical_req* m_l = i->musical();
-       if (m_l&&m_l->subtle()){
-           Moment sub = m_l->subtle()->subtime_;
-           subtle_moment_priorities_.insert(sub);
-       } else {
-           subtle_moment_priorities_.insert(0);
-       }
-    }
-}
-
-void
-Pulk_voice::next()
-{
-    assert(ok());
-    subtle_idx_++;
-    if (subtle_idx_ == subtle_moment_priorities_.size()) {
-       elt_mom_ += cur_->duration_;
-       cur_ ++;
-       set_subtle();
-    }
-}
-
-Moment
-Pulk_voice::when()const
-{
-    return elt_mom_ + subtle_moment_priorities_[subtle_idx_];
-}
diff --git a/lily/pulk-voices.cc b/lily/pulk-voices.cc
deleted file mode 100644 (file)
index 6a480fa..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-  pulk-voices.cc -- implement Pulk_voices
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "pulk-voice.hh"
-#include "pulk-voices.hh"
-#include "staff.hh"
-#include "voice.hh"
-#include "request-column.hh"
-#include "debug.hh"
-
-Pulk_voices::Pulk_voices(Link_list<Staff*> const& l)
-    : staff_l_list_(l)
-{
-    int staff_i = 0;
-    last_= 0;
-    Moment min_staff_last_mom=1e8; // ugh
-    for (iter_top(l, i); i.ok(); i++,  staff_i++) {
-       Moment staff_last=0;
-       for (iter_top(i->voice_list_,j); j.ok(); j++) {
-           if (j->elts_.size()) {
-               staff_last = staff_last >? j->last();
-               voice_pq_.insert(Voice_l(j, staff_i));
-           }
-       }
-       min_staff_last_mom = min_staff_last_mom <? staff_last;
-       last_ = last_ >? staff_last;
-    }
-    next_mom_ = voice_pq_.front().l_->start_;
-    time_arr_.set_size(staff_i);
-
-    if (last_ != min_staff_last_mom)
-       warning("Not all staffs end simultaneously");
-
-}
-
-void
-Pulk_voices::get_aligned_request(Request_column* col_l)
-{
-    while (voice_pq_.size() && voice_pq_.front().l_->start_ == next_mom_) {
-       Voice_l v = voice_pq_.get();
-       pulk_p_list_.bottom().add( new Pulk_voice ( v.l_, v.staff_idx_ ));
-    }
-
-    /* hairy. #i# is a cursor which points to Pulk_voice (which a
-       cursor, essentially) 
-       
-       
-       At the same time bookkeeping of measures is done.
-       */
-    
-    Moment new_next_mom = last_;
-    iter(pulk_p_list_.top() , i);
-    while  ( i.ok() ) {
-       mtor << "considering staff"<< i->staff_idx_ << "at " << i->when() << "\n";
-       assert (i->when() >= next_mom_);
-       if (i->when() == next_mom_) {
-           col_l->add_reqs(i->staff_idx_, i->get_req_l_arr() );
-           Time_description &t_r  = time_arr_[i->staff_idx_]; 
-           col_l->update_time(i->staff_idx_, t_r);
-           
-           if (! t_r.cadenza_b_ && t_r.next_bar_moment() > next_mom_) {
-               mtor << "next bar at: " << t_r.next_bar_moment();
-               new_next_mom = new_next_mom <? t_r.next_bar_moment();
-           }
-
-           if (!i->ok()) {
-               i.del();
-               continue;
-           }
-       }
-       assert( i->when()  > next_mom_);
-       /* no need to call i->next(), since this is done automatically */
-       new_next_mom = new_next_mom <? i->when();
-
-       i++;
-
-    }
-    
-    if (voice_pq_.size() )
-       new_next_mom = new_next_mom <? voice_pq_.front().l_->start_;
-
-    for (int j=0; j < time_arr_.size(); j++)
-       time_arr_[j].add( new_next_mom - next_mom_  );
-
-    if (pulk_p_list_.size())
-       assert( new_next_mom > next_mom_);
-    next_mom_ = new_next_mom;
-}
-
-
-bool
-Pulk_voices::ok() const
-{
-    return pulk_p_list_.size() || voice_pq_.size();
-}
-
-int
-compare(Voice_l const& v1, Voice_l const& v2)
-{
-    return sign(v1.l_->start_ - v2.l_->start_);
-}
-           
-Moment
-Pulk_voices::next_mom()const
-{
-    return next_mom_;
-}
-
-bool
-Pulk_voices::time_checks_failed_b()const
-{
-    bool b = false;
-    for (int i=0; !b && i < time_arr_.size(); i++)
-       b|=time_arr_[i].error_b_;
-    return b;
-}
index f16aeb9e61c3d71551a334e0ed74e3341b98a005..90dccee14f0863ecdb220708582950efba8bc51c 100644 (file)
 #include "plist.hh"
 #include "register-group.hh"
 #include "register.hh"
+#include "debug.hh"
+#include "p-score.hh"
+#include "score-elem.hh"
+#include "input-register.hh"
 
-bool
-Register_group_register::acceptable_request_b(Request* r)const
+
+Register_group_register::Register_group_register()
 {
-    for (iter_top(reg_list_, i); i.ok(); i++) {
-       if (i->acceptable_request_b(r))
-           return true;
-    }
-    return false;
+    ireg_l_ =0;
 }
 
 void
@@ -44,48 +44,39 @@ Register_group_register::sync_features()
 }
 
 void
-Register_group_register::pre_move_processing()
+Register_group_register::do_pre_move_processing()
 {
     iter_top(reg_list_, i);
     while (i.ok()) {
-       // this construction to ensure clean deletion
+       
        Request_register *reg_l = i++; 
        reg_l->pre_move_processing();
     }
 }
 
 void
-Register_group_register::process_requests()
+Register_group_register::do_process_requests()
 {
     iter_top(reg_list_, i);
     while (i.ok()) {
-       // this construction to ensure clean deletion
+       
        Request_register *reg_l = i++; 
        reg_l->process_requests();
     }
 }
 
+
 void
-Register_group_register::post_move_processing()
+Register_group_register::do_post_move_processing()
 {
     iter_top(reg_list_, i);
     while (i.ok()) {
-       // this construction to ensure clean deletion
+               // this construction to ensure clean deletion
        Request_register *reg_l = i++; 
        reg_l->post_move_processing();
     }
 }
 
-void
-Register_group_register::acknowledge_element(Score_elem_info info)
-{
-    Request_register* origin = info.origin_reg_l_arr_[0];
-    if (!contains_b(origin) && !origin->contains_b(this)) // am i sure?
-       return;
-    
-    for (iter_top(reg_list_, i); i.ok(); i++) 
-       i->acknowledge_element(info);
-}
 
 bool
 Register_group_register::contains_b(Request_register* reg_l)const
@@ -103,24 +94,14 @@ Register_group_register::contains_b(Request_register* reg_l)const
 
 
 bool
-Register_group_register::try_request(Request*req_l)
-{
-    iter_top(reg_list_, i); 
-    while (i.ok()) {
-
-
-       // this construction to ensure clean deletion
-       Request_register *reg_l = i++; 
-       if (reg_l->try_request( req_l ))
-           return true;
-    }
-    return false;
-}
-void
-Register_group_register::add(Array<Request_register*> p_arr)
+Register_group_register::do_try_request(Request*req_l)
 {
-    for (int i =0; i<p_arr.size(); i++)
-       add(p_arr[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);
+    if (!hebbes_b)
+       hebbes_b = daddy_reg_l_->try_request(req_l);
+    return hebbes_b ;
 }
 
 void
@@ -128,28 +109,34 @@ Register_group_register::add(Request_register *reg_p)
 {
     reg_list_.bottom().add(reg_p);
     reg_p->daddy_reg_l_ = this;
-}
-
 
-Register_group_register::~Register_group_register()
-{
-    
+    if (reg_p->is_type_b(Register_group_register::static_name())) {
+       group_l_arr_.push((Register_group_register*)reg_p);
+    } else {
+       nongroup_l_arr_ .push(reg_p);
+    }
 }
 
+
 Request_register *
-Register_group_register::get_register_p(Request_register*reg_l)
+Register_group_register::remove_register_p(Request_register*reg_l)
 {
+    group_l_arr_.substitute((Register_group_register*)reg_l,0);
+    nongroup_l_arr_.substitute(reg_l,0);
     iterator(reg_list_) reg_cur= reg_list_.find(reg_l);
-    assert(reg_cur.ok());
+    
     return reg_cur.remove_p();
 }
 
 void
 Register_group_register::terminate_register(Request_register*r_l)
 {
-    delete get_register_p(r_l);
+    Request_register * reg_p =remove_register_p(r_l);
+    reg_p->do_removal_processing();
+    delete reg_p;
 }
 
+IMPLEMENT_IS_TYPE_B1(Register_group_register,Request_register);
 IMPLEMENT_STATIC_NAME(Register_group_register);
 ADD_THIS_REGISTER(Register_group_register);
 
@@ -157,7 +144,121 @@ void
 Register_group_register::do_print()const
 {
 #ifndef NPRINT
+    mtor << "ID: " << id_str_ << "\n";
     for (iter_top(reg_list_, i); i.ok(); i++) 
        i->print();
 #endif
 }
+
+
+Register_group_register*
+Register_group_register::find_register_l(String n, String id)
+{
+    if (name() == n && id_str_ == id)
+       return this;
+    Register_group_register * r = 0;
+    for (int i =0; !r && i<  group_l_arr_.size(); i++) {
+       r = group_l_arr_[i]->find_register_l(n,id);
+    }
+    
+    return r;
+}
+
+Register_group_register*
+Register_group_register::find_get_reg_l(String n,String id)
+{
+    Register_group_register * ret=0;
+    if (ireg_l_-> find_ireg_l( n )) {
+       ret = find_register_l(n,id);
+       if (!ret) {
+           ret = ireg_l_-> find_ireg_l(n) -> get_group_register_p();
+           add (  ret );
+           ret ->id_str_ = id;
+       }
+    } else if (daddy_reg_l_)
+       ret =daddy_reg_l_->find_get_reg_l(n,id);
+    else {
+       warning("Can't find or create `" + n + "' called `" + id + "'\n");
+       ret =0;
+    }
+    return ret;
+}
+
+int
+Register_group_register::depth_i()const
+{
+    return daddy_reg_l_->depth_i()  + 1;
+}
+
+Register_group_register*
+Register_group_register::ancestor_l(int l)
+{
+    if (!l || !daddy_reg_l_)
+       return this;
+    
+    return daddy_reg_l_->ancestor_l(l-1);
+}
+
+void
+Register_group_register::announce_element(Score_elem_info info)
+{
+    announce_info_arr_.push(info);
+    Request_register::announce_element(info);
+}
+
+void
+Register_group_register::do_announces()
+{
+    for (int i=0; i < group_l_arr_.size(); i++) {
+       group_l_arr_[i]->do_announces();
+    }
+    
+    Request dummy_req;
+    for (int j =0; j < announce_info_arr_.size(); j++){
+       Score_elem_info info = announce_info_arr_[j];
+       mtor << "Announcing " << info.elem_l_->name()<<"\n";
+       
+       if (!info.req_l_)
+           info.req_l_ = &dummy_req;
+       for (int i=0; i < nongroup_l_arr_.size(); i++) {
+          if (nongroup_l_arr_[i] != info.origin_reg_l_arr_[0])
+              nongroup_l_arr_[i]->acknowledge_element(info);
+       }
+    }
+    announce_info_arr_.set_size(0);
+}
+
+
+void
+Register_group_register::do_removal_processing()
+{
+    for (iter( reg_list_.top(), i); i.ok(); i++)
+       i->do_removal_processing();
+}
+
+Staff_info
+Register_group_register::get_staff_info()const
+{
+    Staff_info inf = Request_register::get_staff_info();
+
+    for (int i=0; i < nongroup_l_arr_.size(); i++)
+       nongroup_l_arr_[i]->fill_staff_info(inf);
+    
+    return inf;
+}
+
+Register_group_register*
+Register_group_register::get_default_interpreter()
+{
+    if ( interpreter_l() )
+       return daddy_reg_l_->get_default_interpreter();
+
+    Register_group_register *reg_p= ireg_l_->
+       get_default_ireg_l()->get_group_register_p();
+    add(reg_p );
+    if (reg_p->interpreter_l())
+       return reg_p;
+    else
+       return reg_p->get_default_interpreter();
+}
index 7a846bd6a586b926f12810ac994360ba1bf7596f..dd228e1be3c870a9480b7bec368ebfd6d15bc607 100644 (file)
@@ -6,15 +6,61 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "voice.hh"
+#include "music-list.hh"
 #include "musical-request.hh"
 #include "register.hh"
-#include "note-head.hh"
-#include "complex-walker.hh"
-#include "local-key-item.hh"
 #include "register-group.hh"
 #include "debug.hh"
 
+void
+Request_register::post_move_processing()
+{
+        
+    if (status < CREATION_INITED) {
+       do_creation_processing();
+       status = CREATION_INITED;
+    }
+    if (status >= MOVE_INITED)
+       return;
+
+    do_post_move_processing();
+    status = MOVE_INITED;
+}
+
+bool
+Request_register::try_request(Request * r)
+{
+    if (status < MOVE_INITED)
+       post_move_processing();
+
+    return do_try_request(r);
+}
+
+void
+Request_register::process_requests()
+{
+    if (status < PROCESSED_REQS)
+       post_move_processing();
+    else if (status >= PROCESSED_REQS)
+       return; 
+    
+    status = PROCESSED_REQS;
+    do_process_requests();
+}
+
+void
+Request_register::pre_move_processing()
+{
+    do_pre_move_processing();
+    status = CREATION_INITED;
+}
+
+void
+Request_register::fill_staff_info(Staff_info&)
+{
+    
+}
+
 Scalar
 Request_register::get_feature(String t)
 {
@@ -22,13 +68,14 @@ Request_register::get_feature(String t)
 }
 
 bool
-Request_register::try_request(Request*)
+Request_register::do_try_request(Request*)
 {
     return false;
 }
 
 Request_register::Request_register()
 {
+    status = VIRGIN;
     daddy_reg_l_ = 0;
 }
 
@@ -52,16 +99,9 @@ Request_register::paper()const
 }
 
 void
-Request_register::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
-                                        Item * post_p)
+Request_register::typeset_breakable_item(Item * nobreak_p)
 {
-    daddy_reg_l_->typeset_breakable_item(pre_p,  nobreak_p, post_p);
-}
-
-bool
-Request_register::acceptable_request_b(Request*)const
-{
-    return false;
+    daddy_reg_l_->typeset_breakable_item(nobreak_p);
 }
 
 bool
@@ -71,7 +111,7 @@ Request_register::contains_b(Request_register *reg_l)const
 }
 
 Staff_info
-Request_register::get_staff_info() 
+Request_register::get_staff_info() const
 {
     return daddy_reg_l_->get_staff_info();
 }
@@ -87,8 +127,11 @@ Request_register::print() const
 }
 
 IMPLEMENT_STATIC_NAME(Request_register);
+IMPLEMENT_IS_TYPE_B(Request_register);
 
 void
 Request_register::do_print()const
 {
 }
+
+
diff --git a/lily/request-column.cc b/lily/request-column.cc
deleted file mode 100644 (file)
index 24ec7de..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  request-column.cc -- implement Request_column
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "score-column.hh"
-#include "request-column.hh"
-#include "staff-column.hh"
-#include "staff.hh"
-
-Moment
-Request_column::when()
-{
-    if (command_column_l_ || musical_column_l_)
-       when_ = (command_column_l_)? command_column_l_->when() 
-           : musical_column_l_->when();
-
-    return when_;
-}
-
-void
-Request_column::add_reqs(int idx , Array<Request*> const & req_l_arr)
-{
-    staff_col_l_arr_[idx]->add_reqs(req_l_arr);
-}
-
-Request_column::Request_column(Link_list<Staff*> const& list )
-{
-    musical_column_l_ = command_column_l_ =0;
-    iter(list.top(), j);
-    for (int i=0; i < list.size(); i++,j++) {
-       Staff_column * col_p = new Staff_column;
-       col_p->set_req_col(this);
-       staff_col_l_arr_.push(col_p);
-       staff_cols_.bottom().add(col_p);
-       j->add_col(col_p);
-    }
-    when_ = 0;
-}
-
-void
-Request_column::set_score_cols(Score_column* c1, Score_column *c2)
-{
-    command_column_l_ = c1;
-    musical_column_l_ = c2;
-}
-bool
-Request_column::used_b() const
-{
-    bool b = false;
-    if (command_column_l_)
-       b |= command_column_l_->used_b();
-    if (musical_column_l_)
-       b |= command_column_l_->used_b();
-    return b;
-}
-void
-Request_column::update_time(int idx, Time_description&t)
-{
-    staff_col_l_arr_[idx]->update_time(t, 0);
-}
diff --git a/lily/request.cc b/lily/request.cc
new file mode 100644 (file)
index 0000000..545abce
--- /dev/null
@@ -0,0 +1,27 @@
+#include "request.hh"
+#include "debug.hh"
+
+IMPLEMENT_STATIC_NAME(Request);
+IMPLEMENT_IS_TYPE_B1(Request,Music);
+
+void
+Request::do_print() const
+{
+}
+
+MInterval
+Request::time_int() const
+{
+    return MInterval(0, duration());
+}
+
+void
+Request::print() const
+{
+#ifndef NPRINT
+    mtor << name() << " {";
+    do_print();
+    mtor << "}\n";
+#endif
+}
+  
index 8fba3f418b99cf5dd85a6c4c452dab69ec4355ea..81b27a417a795a4273cf81338bc189913c261613 100644 (file)
@@ -27,7 +27,7 @@ Rest_collision_register::acknowledge_element(Score_elem_info i)
 }
 
 void
-Rest_collision_register::pre_move_processing()
+Rest_collision_register::do_pre_move_processing()
 {
     if (rest_collision_p_) {
        typeset_element(rest_collision_p_);
@@ -41,4 +41,5 @@ Rest_collision_register::Rest_collision_register()
 }
 
 IMPLEMENT_STATIC_NAME(Rest_collision_register);
+IMPLEMENT_IS_TYPE_B1(Rest_collision_register, Request_register);
 ADD_THIS_REGISTER(Rest_collision_register);
index 0a7807ce3140cdd6465dbe10d8e9ed1f416ecc68..368d47d574c580fe11e736c73473c2f9932ac0b5 100644 (file)
@@ -56,6 +56,9 @@ Rest_collision::do_post_processing()
 #endif
 }
 IMPLEMENT_STATIC_NAME(Rest_collision);
+IMPLEMENT_IS_TYPE_B1(Rest_collision,Item);
+
+
 void
 Rest_collision::do_substitute_dependency(Score_elem*o,Score_elem*n)
 {
index 8d0963482abc49ab7be4d6ccdddd5a5801111a96..39cd296b85143ae15655a03b8aa9841bcf13ce87 100644 (file)
@@ -21,10 +21,11 @@ void
 Rest_column::translate_y(Real dy_f)
 {
     for (int i=0; i < head_l_arr_.size(); i++)
-       head_l_arr_[i]->translate(Offset(0,dy_f));
+       head_l_arr_[i]->translate_y(dy_f);
 }
 
 IMPLEMENT_STATIC_NAME(Rest_column);
+IMPLEMENT_IS_TYPE_B1(Rest_column,Item);
 
 Rest_column::Rest_column()
 {
diff --git a/lily/score-align-reg.cc b/lily/score-align-reg.cc
new file mode 100644 (file)
index 0000000..74af8c2
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  score-align-reg.cc -- implement Score_align_register
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "elem-group-item.hh"
+#include "score-align-reg.hh"
+#include "item.hh"
+
+Score_align_register::Score_align_register(const char *nm)
+{
+    type_ch_C_ = nm;
+    priority_i_ =0;
+    align_p_=0;
+}
+
+void
+Score_align_register::do_pre_move_processing()
+{
+    if (align_p_) {
+       typeset_breakable_item( align_p_);
+       align_p_ =0;
+    }
+}
+
+void
+Score_align_register::acknowledge_element(Score_elem_info inf)
+{
+    if (inf.elem_l_->name() == type_ch_C_ ) {
+       if (! align_p_ ) {
+           align_p_ = new Horizontal_group_item;
+           announce_element(Score_elem_info(align_p_,0));
+       }
+       
+       align_p_->add_element(inf.elem_l_);
+    }
+}
+
+IMPLEMENT_STATIC_NAME(Score_align_register)
+IMPLEMENT_IS_TYPE_B1(Score_align_register,Request_register);
diff --git a/lily/score-align-regs.cc b/lily/score-align-regs.cc
new file mode 100644 (file)
index 0000000..526b9a7
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  score-align-regs.cc -- implement different alignment registers.
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "key-item.hh"
+#include "clef-item.hh"
+#include "meter.hh"
+#include "bar.hh"
+#include "score-align-reg.hh"
+
+#define IMPLEMENT_ALIGN_REG(C,T,p)\
+class C ## _align_register : public Score_align_register               \
+{                                                                      \
+public:                                                                        \
+    NAME_MEMBERS();                                                    \
+    C ## _align_register() : Score_align_register(T::static_name()) {\
+    priority_i_ = p;}  \
+};                                                                     \
+IMPLEMENT_STATIC_NAME(C ## _align_register)    ;                       \
+ADD_THIS_REGISTER(C ## _align_register);                               \
+IMPLEMENT_IS_TYPE_B1(C ## _align_register, Score_align_register)       ;
+
+
+IMPLEMENT_ALIGN_REG(Key,Key_item,3);
+IMPLEMENT_ALIGN_REG(Clef,Clef_item,2);
+IMPLEMENT_ALIGN_REG(Meter,Meter,4);
+IMPLEMENT_ALIGN_REG(Bar, Bar,0);
+
index 11ce7936aaaef79e7d6bc1591504237f2fd9acc8..868dc3e176340ffec850aa1e5782fc8ed20f0e5a 100644 (file)
@@ -16,6 +16,8 @@
 #include "dimen.hh"
 #include "spanner.hh"
 #include "scoreline.hh"
+#include "item.hh"
+#include "p-col.hh"
 
 Score_elem*
 Score_elem::dependency(int i)const
@@ -46,6 +48,8 @@ String
 Score_elem::TeX_string() const
 {
     assert( status > POSTCALCED);
+    if (transparent_b_ )
+       return "";
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
     a.push(print_dimen(offset_.y));
@@ -57,12 +61,15 @@ Score_elem::TeX_string() const
 
 Score_elem::Score_elem(Score_elem const&s)
 {
+    transparent_b_ = s.transparent_b_;
+    empty_b_ = s.empty_b_;
     /* 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.      
      */
     copy_edges_out(s);
-    group_element_i_ = 0;
+    x_group_element_i_ = 0;
+    y_group_element_i_ = 0;    
     status = s.status;
     assert(!s.output);
     output = 0;
@@ -77,20 +84,36 @@ Score_elem::~Score_elem()
     delete output;
     status = DELETED;
     output = 0;
-    assert(!group_element_i_ );
+    assert(!x_group_element_i_ && !y_group_element_i_);
 }
 
+void
+Score_elem::translate_x(Real x)
+{
+    offset_.x += x;
+}
+
+
+
+void
+Score_elem::translate_y(Real y)
+{
+    offset_.y += y;
+}
+
+
 void
 Score_elem::translate(Offset O)
 {
-    offset_ += O;
+    translate_y(O.y);
+    translate_x(O.x);
 }
 
 Interval
 Score_elem::do_width() const 
 {
     Interval r;
-    
+
     if (!output){
        Molecule*m = brew_molecule_p();
        r = m->extent().x;
@@ -103,7 +126,7 @@ Score_elem::do_width() const
 Interval
 Score_elem::width() const
 {
-    Interval r=do_width();
+    Interval r=(empty_b_)?Interval(0,0):do_width();
 
     if (!r.empty_b()) // float exception on DEC Alpha
        r+=offset_.x;
@@ -127,7 +150,7 @@ Score_elem::do_height() const
 Interval
 Score_elem::height() const
 {
-    Interval r=do_height();
+    Interval r=(empty_b_)?Interval(0,0): do_height();
 
     if (!r.empty_b())
        r+=offset_.y;
@@ -141,7 +164,7 @@ Score_elem::print()const
 {
 #ifndef NPRINT
     mtor << name() << "{\n";
-    mtor << "deps: " << dependent_size() << "depts: \n" << 
+    mtor << "dets: " << dependent_size() << "dependencies: " << 
        dependency_size() << "\n";
     do_print();
     if (output)
@@ -155,7 +178,9 @@ Score_elem::print()const
 
 Score_elem::Score_elem()
 {
-    group_element_i_ = 0;
+    transparent_b_ = empty_b_ = false;
+    x_group_element_i_ = 0;
+    y_group_element_i_ =0;
     pscore_l_=0;
     offset_ = Offset(0,0);
     output = 0;
@@ -196,6 +221,23 @@ Score_elem::pre_processing()
     status = PRECALCED;
 }
 
+void
+Score_elem::breakable_col_processing()
+{
+    if (status >= PREBROKEN )
+       return;
+
+    assert(status != PREBREAKING); // cyclic dependency
+    status = PREBREAKING;
+
+    for (int i=0; i < dependency_size(); i++)
+       dependency(i)->breakable_col_processing();
+
+    
+    do_breakable_col_processing();
+    status = PREBROKEN;
+}
+
 void
 Score_elem::break_processing()
 {
@@ -245,6 +287,8 @@ Score_elem::molecule_processing()
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->molecule_processing();
 
+    if (transparent_b_)
+       return ;
     output= brew_molecule_p();
 }
 
@@ -253,6 +297,12 @@ Score_elem::do_post_processing()
 {
 }
 
+void
+Score_elem::do_breakable_col_processing()
+{
+    handle_prebroken_dependencies();
+}
+
 void
 Score_elem::do_pre_processing()
 {
@@ -271,6 +321,7 @@ Score_elem::do_substitute_dependency(Score_elem*,Score_elem*)
 
 
 IMPLEMENT_STATIC_NAME(Score_elem);
+IMPLEMENT_IS_TYPE_B(Score_elem);
 
 Molecule*
 Score_elem::brew_molecule_p()const
@@ -307,11 +358,6 @@ Score_elem::add_dependency(Score_elem*e)
     Directed_graph_node::add(e);
 }
 
-bool
-Score_elem::is_type_b(char const *s)
-{
-    return s == static_name();
-}
 
 void
 Score_elem::handle_broken_dependencies()
@@ -329,7 +375,12 @@ Score_elem::handle_broken_dependencies()
                Spanner * broken = sp->find_broken_piece(line);
                do_substitute_dependency(sp, broken);
                add_dependency(broken);
-               remove_us_arr.push(sp);
+           } 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);
+               do_substitute_dependency( elt, my_item);
+               if (my_item)
+                   add_dependency( my_item);
            }
            remove_us_arr.push(elt);
        } 
@@ -341,10 +392,61 @@ Score_elem::handle_broken_dependencies()
     for (int i=0;  i <remove_us_arr.size(); i++)
        remove_dependency(remove_us_arr[i]);
 
+    /* Reset this. If we are a (broken) copy of a spanner, then
+      break_processing() was not called on us (and we are not breaking).  */
     if (status < BROKEN)
        status = BROKEN;
 }
 
+/*
+  This sux.
+
+  unlike with spanners, the number of items can increase
+
+  span: item1
+
+  becomes
+
+  span: item1 item2 item3
+
+  How to let span (a derived class) know that this happened?
+ */
+void
+Score_elem::handle_prebroken_dependencies()
+{
+    Link_array<Score_elem> remove_us_arr;
+    for (int i=0; i < dependency_size(); i++) {
+       Score_elem * elt = dependency(i);
+       Item *it_l = elt->item();
+       if (it_l && it_l->pcol_l_->breakable_b())
+           if (item()) {
+               Score_elem *new_l = it_l->find_prebroken_piece(item()->pcol_l_);
+               if (new_l != elt ) {
+                   do_substitute_dependency( elt, new_l);
+                   remove_us_arr.push(elt);
+                   
+                   add_dependency(new_l);
+               } 
+           }else {
+               add_dependency(it_l->broken_to_a_[0]);
+               add_dependency(it_l->broken_to_a_[1]);          
+           }
+
+    }
+    
+    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]);
+
+    /*
+      see comment at handle_broken_dependencies()
+     */
+    if (status < PREBROKEN)
+       status = PREBROKEN;
+}
+
+
 
 void
 Score_elem::unlink_all()
@@ -352,7 +454,8 @@ Score_elem::unlink_all()
     for (int i=0; i < dependency_size(); i++) 
        dependency(i)->unlink_all();
     junk_links();
-    group_element_i_ = 0;
+    y_group_element_i_ = 0;
+    x_group_element_i_ = 0;
 }
 
 void
diff --git a/lily/score-halign-reg.cc b/lily/score-halign-reg.cc
new file mode 100644 (file)
index 0000000..f2423f9
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+  score-halign-reg.cc -- implement Score_horizontal_align_register
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "break-align-item.hh"
+#include "score-halign-reg.hh"
+#include "score-align-reg.hh"
+
+Score_horizontal_align_register::Score_horizontal_align_register()
+{
+    halign_p_ =0;
+}
+
+void
+Score_horizontal_align_register::do_pre_move_processing()
+{
+    if (halign_p_) {
+       typeset_breakable_item(halign_p_);
+       halign_p_ =0;
+    }
+       
+}
+
+void
+Score_horizontal_align_register::acknowledge_element(Score_elem_info i)
+{
+    Request_register* reg = i.origin_reg_l_arr_[0];
+    if (reg->is_type_b( 
+       Score_align_register::static_name()) )
+    {
+       if (!halign_p_) {
+           halign_p_ = new Break_align_item;
+           announce_element(Score_elem_info(halign_p_,0));
+       }
+       halign_p_->add(i.elem_l_->item(), 
+                      ((Score_align_register*)reg)->priority_i_  );
+    }
+}
+IMPLEMENT_STATIC_NAME(Score_horizontal_align_register);
+IMPLEMENT_IS_TYPE_B1(Score_horizontal_align_register,Request_register);
+ADD_THIS_REGISTER(Score_horizontal_align_register);
diff --git a/lily/score-reg.cc b/lily/score-reg.cc
new file mode 100644 (file)
index 0000000..47d5a70
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+  score-reg.cc -- implement Score_register
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "super-elem.hh"
+#include "scoreline.hh"
+#include "debug.hh"
+#include "score-elem.hh"
+#include "bar.hh"              // needed for Bar::static_name
+#include "staffline.hh"
+#include "score-reg.hh"
+#include "p-col.hh"
+#include "p-score.hh"
+#include "score.hh"
+#include "musical-request.hh"
+#include "score-column.hh"
+
+int
+Score_register::depth_i()const
+{
+    return 0;
+}
+
+void
+Score_register::set_score(Score *s)
+{
+    score_l_ = s;
+    scoreline_l_ = s->pscore_p_->super_elem_l_->line_of_score_l_;
+    last_mom_ = score_l_->music_p_->time_int().max();
+    extra_mom_pq_.insert(last_mom_);
+}
+
+Score_register::Score_register()
+{
+    score_l_ = 0;
+    scoreline_l_ =0;
+    command_column_l_ =0;
+    musical_column_l_ =0;
+}
+
+
+void
+Score_register::do_creation_processing()
+{
+    scoreline_l_->left_col_l_ = get_staff_info().command_pcol_l();
+    scoreline_l_->left_col_l_ ->set_breakable();
+    Register_group_register::do_creation_processing();
+}
+
+void
+Score_register::set_cols(Score_column*c1,Score_column*c2)
+{
+    command_column_l_ = c1;
+    musical_column_l_ = c2;
+}
+
+void
+Score_register::do_removal_processing()
+{
+    Register_group_register::do_removal_processing();
+    scoreline_l_->right_col_l_ = get_staff_info().command_pcol_l();
+    scoreline_l_->right_col_l_ ->set_breakable();
+    typeset_all();
+}
+
+
+void
+Score_register::announce_element(Score_elem_info info)
+{
+    info.origin_reg_l_arr_.push(this);
+    if (info.elem_l_->name() == Bar::static_name()) {
+       get_staff_info().command_pcol_l()->set_breakable();
+    } else if ( info.elem_l_->is_type_b( Line_of_staff::static_name() ) &&
+               !scoreline_l_->contains_b( info.elem_l_) )
+       
+       scoreline_l_->add(info.elem_l_);
+    
+    announce_info_arr_.push(info);
+}
+void
+Score_register::do_announces()
+{
+    /* All elements are propagated to the top upon announcement. If
+      something was created during one run of
+      Register_group_register::do_announces, then
+      announce_info_arr_.size() will be nonzero again
+
+      */
+    while (announce_info_arr_.size()) {
+       for (int i=0; i <announce_info_arr_.size(); i++)
+           /*
+             TODO
+
+             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_column_l_->add_duration( m->duration());
+               }
+           }
+       Register_group_register::do_announces();
+    }
+}
+
+
+void
+Score_register::typeset_element(Score_elem *elem_p)
+{
+    musical_item_p_arr_.push(elem_p);
+}
+
+void
+Score_register::typeset_breakable_item(Item * nobreak_p)
+{
+    if (nobreak_p) {
+       nobreak_item_p_arr_.push(nobreak_p);
+    }
+}
+void
+Score_register::typeset_all()
+{
+    PCol * c= get_staff_info().command_pcol_l();
+    PScore *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, 0);
+       scoreline_l_->add(nobreak_item_p_arr_[i]);
+    }
+    nobreak_item_p_arr_.set_size(0);
+    
+    for (int i=0; i < musical_item_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, 0);
+       } else
+           assert(false);
+    }
+    musical_item_p_arr_.set_size(0);
+}
+
+
+void
+Score_register::do_pre_move_processing()
+{
+    // this generates all items.
+    Register_group_register::do_pre_move_processing();
+    
+    typeset_all();
+}
+
+
+Staff_info
+Score_register::get_staff_info()const
+{
+    Staff_info inf;
+
+    inf.command_l_ = command_column_l_;
+    inf.musical_l_ = musical_column_l_;
+    return inf;
+}
+
+Paper_def*
+Score_register::paper()const
+{
+    return score_l_->paper_p_;
+}
+
+
+
+bool
+Score_register::do_try_request(Request*r)
+{
+    bool gotcha = false;  
+    for (int i =0; !gotcha && i < nongroup_l_arr_.size() ; i++)
+       gotcha = nongroup_l_arr_[i]->try_request(r);
+  
+    return gotcha;
+}
+
+IMPLEMENT_IS_TYPE_B1(Score_register,Register_group_register);
+IMPLEMENT_STATIC_NAME(Score_register);
+ADD_THIS_REGISTER(Score_register);
+
+void
+Score_register::add_moment_to_process(Moment m)
+{
+    if (m  > last_mom_)
+       return;
+    
+    for (int i=0; i <  extra_mom_pq_.size(); i++)
+       if (extra_mom_pq_[i] == m)
+           return;
+    extra_mom_pq_.insert(m);
+}
diff --git a/lily/score-walker.cc b/lily/score-walker.cc
deleted file mode 100644 (file)
index 7804161..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-  score-walker.cc -- implement Score_walker
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "score-walker.hh"
-#include "score.hh"
-#include "staff-walker.hh"
-#include "staff.hh"
-#include "score-column.hh"
-
-Score_walker::Score_walker(Score *s)
-    :PCursor<Score_column *> (s->cols_)
-{
-    score_l_ = s;
-    for (iter_top(s->staffs_,i); i.ok(); i++) {
-       Staff_walker* w_p=i->get_walker_p();
-       w_p->score_walk_l_ =this;
-       walker_p_arr_.push(w_p);
-    }
-
-    reinit();
-    breaks_i_=0;
-}
-
-
-void
-Score_walker::reinit()
-{
-    disallow_break_walk_l_arr = walker_p_arr_;
-    disallow_break_count_ = disallow_break_walk_l_arr.size();
-}
-
-
-/** Advance the cursor, and all Staff_walkers contained in this. Reset
-  runtime fields */
-void 
-Score_walker::operator ++(int )
-{
-    Moment last = ptr()->when();
-    
-    PCursor<Score_column *>::operator++(0);
-    if (ok() && ptr()->when() == last)
-       PCursor<Score_column *>::operator++(0);
-    reinit();
-    bool last_b =  (!ok());    // ughh
-    for (int i=0; i< walker_p_arr_.size(); i++) {
-       if (walker_p_arr_[i]->ok() &&
-           (last_b || walker_p_arr_[i]->when() < when())) {
-
-           walker_p_arr_[i]->operator++(0);
-       }
-    }
-}
-
-/** Allow the command_column to be breakable for one staff. If all
-  staffs allow, then allow a break here.  */
-void
-Score_walker::allow_break(Staff_walker*w)
-{
-    for (int i=0; i < disallow_break_walk_l_arr.size(); i++) {
-       if (w == disallow_break_walk_l_arr[i]) {
-           disallow_break_count_ --;
-           disallow_break_walk_l_arr[i] =0;
-
-           if (!disallow_break_count_) {
-               PCursor<Score_column*> col_cursor = *this;
-               if (ptr()->musical_b())
-                   col_cursor --;
-               col_cursor->set_breakable();
-           }
-       }
-    }
-}
-
-bool
-Score_walker::break_allowed_b()
-{
-    return !disallow_break_count_;
-}
-
-Moment
-Score_walker::when()
-{
-    return ptr()->when();
-}
-
-void
-Score_walker::process()
-{
-    for (int i=0; i < walker_p_arr_.size(); i++) {
-       Staff_walker *w = walker_p_arr_[i];
-       if ( w->ok() && w->when() == when() ) {
-           walker_p_arr_[i]->process();
-       }
-    }
-    if (break_allowed_b()){
-       breaks_i_ ++;
-       if (! (breaks_i_ % 8)) 
-           *mlog << "[" <<breaks_i_<<"]"<<flush;
-    }
-}
-
-Score_walker::~Score_walker()
-{
-    *mlog << "[" <<breaks_i_<<"]"<<flush;
-    for (int i=0; i < walker_p_arr_.size(); i++) 
-       delete walker_p_arr_[i];
-}
-
-
index 92a08351fff910cd150d255eaaf14a4431b9e2fe..5463e829389d0fb828c1b9c88447a53ae3ac75d5 100644 (file)
@@ -9,77 +9,81 @@
 #include "score.hh"
 #include "score-column.hh"
 #include "p-score.hh"
-#include "staff.hh"
 #include "debug.hh"
 #include "paper-def.hh"
 #include "main.hh"
 #include "source.hh"
 #include "source-file.hh"
-#include "score-walker.hh"
 #include "midi-output.hh"
 #include "midi-def.hh"
-#include "pulk-voices.hh"
-#include "request-column.hh"
 #include "p-col.hh"
+#include "score-reg.hh"
+#include "music-iterator.hh"
+#include "music.hh"
+#include "music-list.hh"
+#include "input-register.hh"
 
 extern String default_out_fn;
 
+Score::Score(Score const &s)
+{
+    assert(!pscore_p_);
+    music_p_ = s.music_p_->clone();
+    midi_p_ = new Midi_def(*s.midi_p_);
+    paper_p_ = new Paper_def(*s.paper_p_);
+}
+
 void
 Score::setup_music()
 {
     *mlog << "\nSetting up requests..." << flush;
     
-    Pulk_voices pulk(staffs_); 
-
-    Moment l_mom = pulk.last_;
-    if (l_mom == Moment(0)) {
-       errorlevel_i_ |= 1;
-       input_.error("Need to have music in a score.");
-    }
-    
-    Moment previous_mom = -1;
-    while (pulk.ok()) {
+    Score_register * score_reg =  
+       (Score_register*)lookup_reg("Score_register")->get_group_register_p();
+
+    score_reg->set_score (this);
+    Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_, 
+                                                                 score_reg);
+    iter->construct_children();
+
+    while ( iter->ok() || score_reg->extra_mom_pq_.size() ) {
+       Moment w = INFTY;
+       if (iter->ok() ) 
+           w = iter->next_moment();
+       
+       if (score_reg->extra_mom_pq_.size() && 
+           score_reg->extra_mom_pq_.front() <= w)
+           
+           w = score_reg->extra_mom_pq_.get();
 
-       Moment w= pulk.next_mom();
-       assert(w > previous_mom);
-       Request_column* rcol_p = new Request_column( staffs_ );
+       mtor << "processing moment " << w << "\n";
 
        Score_column* c1 = new Score_column(w);
        Score_column* c2 = new Score_column(w);
-       if (w == Moment(0) || w == l_mom) {
-           c1->set_breakable();
-       }
-               
+       
        c1->musical_b_ = false;
        c2->musical_b_ = true;
        
        cols_.bottom().add(c1);
        cols_.bottom().add(c2);
-       rcol_p->set_score_cols(c1, c2);
-       rcols_.bottom().add(rcol_p);
-       pulk.get_aligned_request( rcol_p );
-       previous_mom =w;
+       score_reg->set_cols(c1,c2);
+       
+       score_reg->post_move_processing();
+       iter->next( w );
+       
+       score_reg->process_requests();
+       score_reg->do_announces();
+       score_reg->pre_move_processing();
     }
-
-    errorlevel_i_ |= pulk.time_checks_failed_b(); 
-}
-
-void
-Score::process_music()
-{
-    *mlog << "Processing requests ..." << flush;
-    for (Score_walker w(this); w.ok(); w++) {
-       w.process();
-   }
+    delete iter;
+    score_reg->do_removal_processing();
+    delete score_reg;
 }
 
 void
 Score::process()
 {
-    setup_music();
-
     paper();
-    midi();
 }
 
 void
@@ -87,19 +91,16 @@ Score::paper()
 {
     if (!paper_p_)
        return;
+
     if( errorlevel_i_){
        // should we? hampers debugging. 
        warning("Errors found, /*not processing score*/");
 //     return;
     }
     pscore_p_ = new PScore(paper_p_);
+    setup_music();
     do_cols();
     
-    for (iter_top(staffs_,i); i.ok(); i++) 
-       i->set_output(pscore_p_);
-
-    
-    process_music();
     clean_cols();    // can't move clean_cols() farther up.
     print();
     calc_idealspacing();
@@ -121,18 +122,6 @@ void
 Score::clean_cols()
 {
 #if 1
-    for (iter_top(staffs_,i); i.ok(); i++)
-       i->clean_cols();
-
-    for (iter_top(rcols_,i); i.ok(); i++) {
-       i->when();              // update cache, ugh
-       if (!i->command_column_l_->used_b()) {
-           i->command_column_l_ = 0;
-       }
-       if (!i->musical_column_l_->used_b())
-           i->musical_column_l_ = 0;
-    }
-    
     for (iter_top(cols_,c); c.ok(); ) {
        if (!c->pcol_l_->used_b()) {
            delete c.remove_p();
@@ -172,9 +161,7 @@ Moment
 Score::last() const
 {    
     Moment l = 0;
-    for (iter_top(staffs_,i); i.ok(); i++) {
-       l = l>? i->last();
-    }
+    // TODO
     return l;
 }
 
@@ -196,11 +183,6 @@ void
 Score::OK() const
 {
 #ifndef NDEBUG
-    for (iter_top(staffs_,i); i.ok(); i++) {
-       i->OK();
-       assert(i->score_l_ == this);
-    }
-    staffs_.OK();
     cols_.OK();
     for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
        assert(cc->when() <= (cc+1)->when());
@@ -214,9 +196,7 @@ Score::print() const
 {
 #ifndef NPRINT
     mtor << "score {\n"; 
-    for (iter_top(staffs_,i); i.ok(); i++) {
-       i->print();
-    }
+    music_p_->print();
     for (iter_top(cols_,i); i.ok(); i++) {
        i->print();
     }
@@ -239,6 +219,7 @@ Score::Score()
 
 Score::~Score()
 {
+    delete music_p_;
     delete pscore_p_;
     delete paper_p_;
     delete midi_p_;
@@ -261,7 +242,7 @@ Score::paper_output()
     Tex_stream the_output(paper_p_->outfile);
     
     the_output << "% outputting Score, defined at: " <<
-       input_.location_str() << "\n";
+       location_str() << "\n";
     pscore_p_->output(the_output);
     
 }
@@ -269,6 +250,7 @@ Score::paper_output()
 void
 Score::midi()
 {
+#if 0
     if (!midi_p_)
        return;
 
@@ -277,11 +259,6 @@ Score::midi()
     
     *mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";    
     Midi_output(this, midi_p_);
+#endif
 }
 
-void
-Score::add(Staff*s)
-{
-    s->score_l_ = this;
-    staffs_.bottom().add(s);
-}
index c3edbdcc144ad42a470445aba79ec49bde9a6919..5449b32b1ceba063acdc6fd5cc199028b8fdf22a 100644 (file)
@@ -67,41 +67,21 @@ Line_of_score::Line_of_score()
 }
 
 
-void
-Line_of_score::do_substitute_dependency(Score_elem*o, Score_elem*n)
-{
-    Spanner_elem_group::do_substitute_dependency(o,n);
-    
-    int i;
-    while ((i =line_arr_.find_i((Spanner_elem_group*)o->spanner())) >=0)
-       if (n)
-           line_arr_[i] = (Spanner_elem_group*)n->spanner();
-       else 
-           line_arr_.del(i);
-}
-
 
-void
-Line_of_score::do_post_processing()
-{
-    Real y_pos=0;
-    for (int i=line_arr_.size(); i--; ) {
-       Interval y = line_arr_[i]->height() ;
-       if (y.empty_b())
-           continue;
-       line_arr_[i]->translate(Offset(0, -y[-1] + y_pos));
-       y_pos += y.length();
-    }
-    translate(Offset(0, -y_pos));
-}
 
 IMPLEMENT_STATIC_NAME(Line_of_score);
+IMPLEMENT_IS_TYPE_B2(Line_of_score,Spanner,Vertical_align_elem);
 
 void
-Line_of_score::add_line(Spanner_elem_group*e)
+Line_of_score::add(Score_elem*e)
 {
-    add_element(e);
-    line_arr_.push(e);
+    if (e->is_type_b( Line_of_staff::static_name()) 
+           && ! Vertical_align_elem::contains_b( e) ) 
+           
+       Vertical_align_elem::add(e);
+    else { 
+       add_dependency(e);
+    }
 }
 
 bool
@@ -110,17 +90,6 @@ Line_of_score::contains_b(PCol const* c)const
     return cols.find_l((PCol*)c);
 }
 
-void
-Line_of_score::do_pre_processing()
-{
-    left_col_l_ = pscore_l_->cols.top();
-    right_col_l_ = pscore_l_->cols.bottom();
-    for (int i=0; i < line_arr_.size(); i++){
-       line_arr_[i]->left_col_l_ = left_col_l_;
-       line_arr_[i]->right_col_l_ = right_col_l_;
-    }
-}
-
 void
 Line_of_score::set_breaking(Array<Col_hpositions> const &breaking)
 {
@@ -132,32 +101,66 @@ Line_of_score::set_breaking(Array<Col_hpositions> const &breaking)
        for (int i=0; i < errors.size(); i++)
            errors[i]->error_mark_b_ = true;
 
-       Line_of_score *line_p = (Line_of_score*)clone();
+       Line_of_score *line_l=0;
+       Line_of_score *line_p =0;
+       
+       if (breaking.size() >1) {
+           line_p = (Line_of_score*)clone()->spanner();
+           line_l = line_p;
+       } else 
+           line_l =  this;
+       
+       ((Array<PCol*> &)line_l->cols) = curline;
+       line_l->left_col_l_ =  curline[0];
+       line_l->right_col_l_= curline.top();
+       
+       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]->hpos = config[i];
-           curline[i]->line_l_ = (Line_of_score*)line_p;
+           curline[i]->line_l_ = (Line_of_score*)line_l;
        }
-       ((Array<PCol*> &)line_p->cols) = curline;
-       line_p->left_col_l_ =  curline[0];
-       line_p->right_col_l_= curline.top();
-       pscore_l_->typeset_broken_spanner(line_p);
-       broken_into_l_arr_.push(line_p);
     }
 }
 
 void
 Line_of_score::break_into_pieces()
 {
-    
 }
 
 Link_array<Line_of_score>
 Line_of_score::get_lines()const
 {
     Link_array<Line_of_score> ret;
-    assert(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]);
-    }
+
+    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]);
+       }
+    else 
+       ret.push((Line_of_score*)this); // ugh
+    
     return ret;
 }
+
+void
+Line_of_score::do_print()const
+{
+    Spanner::do_print();
+}
+
+Interval
+Line_of_score::do_width()const
+{ 
+    return Spanner::do_width();
+}
+
+void
+Line_of_score::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Spanner::do_substitute_dependency(o,n);
+    Vertical_align_elem::do_substitute_dependency(o,n);
+}
index 22526b42bd3cddc7173edbe98a7eae007ea5b9be..be558b29c153fcf12e145259acba072f7a7a600d 100644 (file)
@@ -1,40 +1,48 @@
+/*
+  scores.cc -- implement some globals
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "main.hh"
-#include "input-score.hh"
 #include "score.hh"
 #include "string.hh"
 #include "paper-def.hh"
 #include "debug.hh"
 
-static Array<Input_score*> score_array_global;
+static Array<Score*> score_array_global;
 String default_out_fn = "lelie";
 
 void
 do_scores()
 {
     for (int i=0; i < score_array_global.size(); i++) {
-       Input_score* &is_p = score_array_global[i];
-       if (is_p->errorlevel_i_) {
-           is_p->warning("Score contains errors. Will not process it. ");
-           delete is_p;
-           continue;
-       } 
+       Score *&is_p = score_array_global[i];
        
        if (only_midi) {
            delete is_p->paper_p_;
            is_p->paper_p_ = 0;
        }
-
-       Score * s_p = is_p->parse();    
+       
+       if (is_p->errorlevel_i_) {
+           is_p->warning("Score contains errors. Will not process it. ");
+         
+       } else { 
+       
+           is_p->print ();
+           is_p->process();
+       }
        delete is_p;
-       s_p->print ();
-       s_p->process();
-       delete s_p;
+       is_p =0;
+
     }
     score_array_global.set_size(0);
 }
 
 void
-add_score(Input_score * s)
+add_score(Score * s)
 {
     score_array_global.push(s);
 }
index f2e21bd2fbc2ce43a579b0514ac44f23f43fab05..ef676502b062d4a79e05079407d01db0cd4b3be8 100644 (file)
@@ -13,6 +13,7 @@
 #include "stem.hh"
 
 IMPLEMENT_STATIC_NAME(Script_column);
+IMPLEMENT_IS_TYPE_B1(Script_column,Horizontal_vertical_group_item);
 
 
 void
@@ -29,12 +30,12 @@ Script_column::do_print()const
     mtor << "scripts: " << script_l_arr_.size() << '\n'; 
 }
 
-
 void
 Script_column::do_pre_processing()
 {
     if (!script_l_arr_.size()) 
        return;
+    
     /* up+outside, up+inside, down+outside, down+inside */
     Array<Script*> placed_l_arr_a[4];
     for (int i=0; i < script_l_arr_.size(); i++) {
@@ -86,7 +87,7 @@ Script_column::add_support(Item*i_l)
 void
 Script_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
 {
-    Element_group::do_substitute_dependency(o,n);
+    Horizontal_vertical_group::do_substitute_dependency(o,n);
     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));
index 7d1b09d4afda0cea635f0dd0e5616d04b0d7b921..b07bbc71a8f05c726ca4b916db077d7cc367d70b 100644 (file)
@@ -80,6 +80,7 @@ Script_def::get_atom(Paper_def *p , int d)const
 }
 
 IMPLEMENT_STATIC_NAME(Script_def);
+IMPLEMENT_IS_TYPE_B1(Script_def,General_script_def);
 
 int
 Script_def::priority_i()const
index b73a6a5fe2a8d1b33809aeb2b7ab44fc3f375f44..9eed43434ea1de9c3e32826b772720fd6225a800 100644 (file)
@@ -7,17 +7,16 @@
 #include "script-reg.hh"
 #include "script.hh"
 #include "musical-request.hh"
-#include "complex-walker.hh"
 #include "stem.hh"
 #include "staff-sym.hh"
 
 Script_register::Script_register()
 {
-    post_move_processing();
+    do_post_move_processing();
 }
 
 bool
-Script_register::try_request(Request *r_l)
+Script_register::do_try_request(Request *r_l)
 {
     if (!r_l->musical() || ! r_l->musical()->musicalscript())
        return false ;
@@ -33,7 +32,7 @@ Script_register::try_request(Request *r_l)
 }
 
 void
-Script_register::process_requests()
+Script_register::do_process_requests()
 {
     for (int i=0; i < script_req_l_arr_.size(); i++){
        Script_req* l=script_req_l_arr_[i];
@@ -65,7 +64,7 @@ Script_register::acknowledge_element(Score_elem_info info)
 }
 
 void
-Script_register::pre_move_processing()
+Script_register::do_pre_move_processing()
 {
     Staff_symbol* s_l = get_staff_info().staff_sym_l_;
     for (int i=0; i < script_p_arr_.size(); i++) {
@@ -78,10 +77,11 @@ Script_register::pre_move_processing()
 }
 
 void
-Script_register::post_move_processing()
+Script_register::do_post_move_processing()
 {
     script_req_l_arr_.set_size(0);
 }
 
 IMPLEMENT_STATIC_NAME(Script_register);
+IMPLEMENT_IS_TYPE_B1(Script_register,Request_register);
 ADD_THIS_REGISTER(Script_register);
index 578a8853208b72cbf353320ee99a73c73f5664e9..2a39c57a0dd0e9d8786033e13b52de5a4cc359aa 100644 (file)
@@ -74,11 +74,12 @@ Script::brew_molecule_p() const
     Real dy = paper()->internote_f();
     
     Molecule*out = new Molecule(specs_l_->get_atom(paper(), dir_i_));
-    out->translate(Offset(0,dy * pos_i_));
+    out->translate_y(dy * pos_i_);
     return out;
 }
 
 IMPLEMENT_STATIC_NAME(Script);
+IMPLEMENT_IS_TYPE_B2(Script,Item,Staff_side);
 
 int 
 Script::compare(Script  *const&l1, Script *const&l2) 
index 992889d94ea04ce7e1609e4e833583aa9df59148..2a4963c18af84e73c0b89f5f41e830c0410a0507 100644 (file)
@@ -7,22 +7,13 @@
 #include "proto.hh"
 #include "plist.hh"
 #include "musical-request.hh"
-#include "complex-walker.hh"
 #include "slur-reg.hh"
 #include "slur.hh"
 #include "debug.hh"
 #include "note-column.hh"
 
 bool
-Slur_register::acceptable_request_b(Request*req_l)
-{
-   Musical_req *mus_l = req_l->musical();
-    
-    return mus_l && mus_l->slur();
-}
-
-bool
-Slur_register::try_request(Request *req_l)
+Slur_register::do_try_request(Request *req_l)
 {
     Musical_req *mus_l = req_l->musical();
     if(!mus_l || !mus_l->slur())
@@ -59,7 +50,7 @@ Slur_register::Slur_register()
     dir_i_ =0;
 }
 void
-Slur_register::process_requests()
+Slur_register::do_process_requests()
 {
     Array<Slur*> start_slur_l_arr_;
     for (int i=0; i< new_slur_req_l_arr_.size(); i++) {
@@ -87,7 +78,7 @@ Slur_register::process_requests()
 }
 
 void
-Slur_register::pre_move_processing()
+Slur_register::do_pre_move_processing()
 {
     for (int i = 0; i < end_slur_l_arr_.size(); i++) {
        if (dir_i_)
@@ -98,7 +89,7 @@ Slur_register::pre_move_processing()
 }
 
 void
-Slur_register::post_move_processing()
+Slur_register::do_post_move_processing()
 {
     new_slur_req_l_arr_.set_size(0);
 }
@@ -109,4 +100,5 @@ Slur_register::~Slur_register()
     }
 }
 IMPLEMENT_STATIC_NAME(Slur_register);
+IMPLEMENT_IS_TYPE_B1(Slur_register,Request_register);
 ADD_THIS_REGISTER(Slur_register);
index 3250dc26c9012bf7434f032cfa903518578ad697..098bdc3fe425c60c9ccd718e3817cd7b2d4bf4d4 100644 (file)
@@ -95,3 +95,4 @@ Slur::do_post_processing()
     right_pos_i_ += dir_i_;
 }
 IMPLEMENT_STATIC_NAME(Slur);
+IMPLEMENT_IS_TYPE_B1(Slur,Spanner);
index 26b5f9fd33c59f5b4c774ec3472ed8e03d3cddde..9ec544e52d0a2fbffdff792f3a88f76459c589af 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  spanner-elem-group.cc -- implement 
+  spanner-elem-group.cc -- implement Spanner_elem_group
 
   source file of the GNU LilyPond music typesetter
 
@@ -11,6 +11,7 @@
 
 
 IMPLEMENT_STATIC_NAME(Spanner_elem_group);
+IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group);
 
 Interval
 Spanner_elem_group::do_width() const
@@ -21,6 +22,6 @@ Spanner_elem_group::do_width() const
 void
 Spanner_elem_group::do_print() const
 {
-    Element_group::do_print();
+    Horizontal_vertical_group::do_print();
 }
 
index 10ee753e1996544db1e6c4f3b08b510298b1b845..2d071cb8ad3305922720cdde8b40da8642f41b28 100644 (file)
@@ -12,6 +12,7 @@
 #include "p-score.hh"
 
 IMPLEMENT_STATIC_NAME(Spanner);
+IMPLEMENT_IS_TYPE_B1(Spanner,Score_elem);
 
 void
 Spanner::do_print()const
@@ -36,7 +37,7 @@ Spanner::break_into_pieces()
     break_cols.push(right);
 
     for (int i=1; i < break_cols.size(); i++) {
-       Spanner* span_p = clone();
+       Spanner* span_p = clone()->spanner();
        left = break_cols[i-1];
        right = break_cols[i];
        if (!right->line_l_)
diff --git a/lily/staff-column.cc b/lily/staff-column.cc
deleted file mode 100644 (file)
index 55871e0..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-  staff-column.cc -- implement Staff_column
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "proto.hh"
-#include "plist.hh"
-#include "staff.hh"
-#include "voice.hh"
-#include "time-description.hh"
-#include "score-column.hh"
-#include "staff-column.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
-#include "interval.hh"
-#include "p-score.hh"
-#include "item.hh"
-#include "p-col.hh"
-#include "request-column.hh"
-#include "grouping.hh"
-
-void
-Staff_column::OK() const
-{
-#ifndef NDEBUG
-    
-#endif
-}
-
-Moment
-Staff_column::when() const
-{
-    return req_col_l_->when();
-}
-
-void
-Staff_column::add_reqs(Array<Request*> req_l_arr)
-{
-    for (int i=0; i < req_l_arr.size(); i++) {
-       Request * j = req_l_arr[i];
-       if (j->command()) {
-           Command_req * c_l = j->command();
-           if (c_l->timing()) {
-               timing_req_l_arr_.push(j->command()->timing());
-           }
-           if (c_l->groupchange())
-               creationreq_l_arr_.push(c_l);
-           else if (!c_l->barcheck() &&  !c_l->partial() &&
-               !c_l->measuregrouping())
-               setup_one_request(j);   
-       } else {
-           if (j->musical()) {
-               
-               Musical_req*m = j->musical();
-               if (m->rhythmic()) {
-                   req_col_l_->musical_column_l_->add_duration(m->rhythmic()->duration());
-               }
-               if(m->skip())
-                   continue;
-           }
-           setup_one_request(j);
-       }
-    }
-}
-
-Staff_column::Staff_column()
-{
-    staff_l_ = 0;
-}
-
-
-
-
-Staff_column::~Staff_column()
-{
-}
-
-void
-Staff_column::set_req_col(Request_column *col_l)
-{
-    req_col_l_ = col_l;
-}
-
-void
-Staff_column::setup_one_request(Request * j)
-{
-    if (j->command()) // ugh
-       commandreq_l_arr_.push(j);
-    else if (j->musical())
-       musicalreq_l_arr_.push(j);
-}
-
-void
-Staff_column::typeset_musical_item(Item*i)
-{
-    assert(i);
-    Score_column * scorecolumn_l = req_col_l_->musical_column_l_;
-    scorecolumn_l->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_);
-}
-
-/**
-  align items in #item_l_arr#,
-
-  @return the width of the items after aligning.
- */
-Interval
-align_items(Array<Item*> item_l_arr)
-{
-    Interval wid(0,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);
-       }
-       Real dx =wid.right - item_width.left;
-       item_width += dx;
-       item_l_arr[i]->translate(Offset(dx ,0));
-       wid.unite(item_width);
-    }
-    return wid;
-}
-
-void 
-translate_items(Real x,  Array<Item*> item_l_arr)
-{
-    for  (int i =0; i < item_l_arr.size(); i++) 
-       item_l_arr[i]->translate(Offset(x, 0));
-}
-/**
-  TODO: 
-  Write a "horizontal align" item, which aligns the pres, nobreaks, posts, etc.
-  
-  */
-void
-Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
-                                     Array<Item *> &nobreak_p_arr,
-                                     Array<Item *> &post_p_arr)
-{
-    Score_column * scol_l= req_col_l_->command_column_l_;
-    PCol * c= scol_l->pcol_l_;
-    PScore *ps_l=scol_l->pcol_l_->pscore_l_;
-    
-    if (!c->breakable_b()) {     
-       for  (int i =0; i < pre_p_arr.size(); i++) {
-           pre_p_arr[i]->unlink();
-           delete pre_p_arr[i];
-       }
-       pre_p_arr.set_size(0);
-       for  (int i =0; i < post_p_arr.size(); i++) {
-           post_p_arr[i]->unlink();
-           delete post_p_arr[i];
-       }
-       post_p_arr.set_size(0);
-    }
-
-      
-    for  (int i =0; i < pre_p_arr.size(); i++) {
-       ps_l->typeset_item(pre_p_arr[i], c,0);
-    }
-    for  (int i =0; i < nobreak_p_arr.size(); i++) {
-       ps_l->typeset_item(nobreak_p_arr[i], c, 1);
-    }
-    for  (int i =0; i < post_p_arr.size(); i++) {
-       ps_l->typeset_item(post_p_arr[i], c, 2);
-    }
-
-    Interval pre_wid= align_items(pre_p_arr);
-    translate_items( -pre_wid.right, pre_p_arr);
-    align_items(nobreak_p_arr);
-    Interval post_wid =align_items(post_p_arr);
-    translate_items (-post_wid.left , post_p_arr);
-
-    pre_p_arr.set_size(0);
-    post_p_arr.set_size(0);
-    nobreak_p_arr.set_size(0);
-}
-
-Score_column*
-Staff_column::command_column_l()
-{
-    return req_col_l_->command_column_l_;
-}
-
-Score_column*
-Staff_column::musical_column_l()
-{
-    return req_col_l_->musical_column_l_;
-}
-
-void
-Staff_column::update_time(Time_description &time_, 
-                   Rhythmic_grouping *default_grouping)
-{
-    // first all meter changes
-    for (int i=0; i < timing_req_l_arr_.size(); i++) {
-       Timing_req * tr_l = timing_req_l_arr_[i];
-       if (tr_l->meterchange()) {
-           int b_i=tr_l->meterchange()->beats_i_;
-           int o_i = tr_l->meterchange()->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);
-               if (default_grouping)
-                   *default_grouping = 
-                   Rhythmic_grouping(MInterval(0,Moment(b_i, o_i)), b_i);
-           }
-       }
-    }
-    
-    // then do the rest
-    for (int i=0; i < timing_req_l_arr_.size(); i++) {
-       Timing_req * tr_l = timing_req_l_arr_[i];
-       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() && 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()) {
-           if (default_grouping)
-               *default_grouping = parse_grouping(
-                   tr_l->measuregrouping()->beat_i_arr_,
-                   tr_l->measuregrouping()->elt_length_arr_);
-       }
-    }
-    time_.OK();
-}   
-
index 5e4ce77c05ecc4af4020d31c0716bcea2b3a3005..250d3273d68a3706c2390d11887234cc99a2c1b7 100644 (file)
@@ -2,62 +2,54 @@
   staff-info.cc -- implement Staff_info
 
   source file of the GNU LilyPond music typesetter
+
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "proto.hh"
 #include "plist.hh"
-#include "staff.hh"
 #include "staff-info.hh"
 #include "score-column.hh"
-#include "complex-walker.hh"
-#include "staff-column.hh"
-
-Staff*
-Staff_info::staff_l()
-{
-    return walk_l_->staff_l_;
-}
 
 Score*
 Staff_info::score_l()
 {
-    return staff_l()->score_l_;
+    return score_l_;
 }
 Staff_info::Staff_info()
 {
+    score_l_ =0;
     c0_position_i_l_ = 0;
-    walk_l_ = 0;
     time_C_ = 0;
     rhythmic_C_ =0;
     break_allowed_b_ = 0;
 }
 
-Staff_column*
-Staff_info::column_l()
-{
-    return  walk_l_->ptr();
-}
-
 Score_column*
 Staff_info::musical_l()
 {
-    return column_l() -> musical_column_l();
+    return musical_l_;
 }
 
 Score_column*
 Staff_info::command_l()
 {
-    return column_l() -> command_column_l();
+    return command_l_;
 }
 PCol*
 Staff_info::command_pcol_l()
 {
     return command_l()->pcol_l_;
 }
+PCol*
+Staff_info::musical_pcol_l()
+{
+    return musical_l()->pcol_l_;
+}
 
 Moment
 Staff_info::when()
 {
-    return walk_l_->when();
+    return command_l()->when();
 }
 
index 19129a02cab7f252cf6aed61fd890baf435dd7e6..cd595e51b9f7c03e0f1cd0465147acabc2960a3e 100644 (file)
@@ -5,6 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "staff-sym.hh"
 #include "voice-group-regs.hh"
 #include "voice-regs.hh"
 #include "bar.hh"
 #include "debug.hh"
 #include "input-register.hh"
+#include "meter-reg.hh"
+#include "staffline.hh"
 
-Staff_info
-Staff_registers::get_staff_info() 
-{
-    Staff_info inf;
-    inf = Request_register::get_staff_info();
-    inf.staff_sym_l_=staff_sym_l_;
-    inf.c0_position_i_l_ = &c0_position_i_;
-    return inf;
-}
 
-Staff_registers::Staff_registers(Input_register const*ireg_C)
+Staff_registers::Staff_registers()
 {
-    staff_sym_l_ =0;
-    c0_position_i_ = 0;
-    base_position_i_ =0;
-    add( ireg_C->get_nongroup_p_arr());
-    ireg_C_ =ireg_C;
+    staffline_p_ =0;
 }
 
-/** Magic function which takes a Voice_registers out of one of its own
-  children, and puts it in another. This also handles the push and
-  popgroup feature.  */
 void
-Staff_registers::change_group(Group_change_req * greq_l,
-                              Voice_registers *voice_regs_l,
-                              Voice_group_registers * old_group)
+Staff_registers::typeset_element(Score_elem *elem_p)
 {
-
-    Voice_registers *regs_p = (old_group)
-       ? (Voice_registers*) old_group->get_register_p(
-           voice_regs_l)
-       : new Voice_registers(
-           greq_l->voice_l(), ireg_C_->get_ireg_l("Voice_group_registers")
-           ->get_ireg_l("Voice_registers"));
-
-    String new_str = greq_l->newgroup_str_;
-    String old_str;
-    if (old_group)
-        old_str = old_group->group_id_str_;
-    if ( new_str[0] == '+') {
-       new_str = old_str + new_str;
-    } else if (new_str[0] == '-') {
-       int idx = old_str.index_last_i('+');
-       if (idx >=0)
-           new_str = old_str.left_str ( idx );
-    }
-    Voice_group_registers * new_group_l = get_group(new_str);
-    new_group_l->add(regs_p);
-    regs_p->sync_features(); 
-    mtor << "processed change_group " << get_staff_info().when()<<"\n";
-    print();
+    staff_elem_l_arr_.push(elem_p);
+    Register_group_register::typeset_element(elem_p);
 }
 
-Voice_group_registers *
-Staff_registers::get_group(String id)
+void
+Staff_registers::typeset_breakable_item( Item * nobreak_p)
 {
-    for (int i=0; i < group_l_arr_.size(); i++) {
-       if (group_l_arr_[i]->group_id_str_ == id)
-           return group_l_arr_[i];
-    }
-    Voice_group_registers *group_p = 
-       new Voice_group_registers(id, ireg_C_->get_ireg_l("Voice_group_registers"));
-    group_l_arr_.push(group_p);
-    add(group_p);
-    return group_p;
+    staff_elem_l_arr_.push(nobreak_p);
+    Register_group_register::typeset_breakable_item(nobreak_p);
 }
 
-
 void
-Staff_registers::terminate_register(Request_register * reg)
+Staff_registers::do_pre_move_processing()
 {
-    for (int i=0; i < group_l_arr_.size(); i++) {
-       if (group_l_arr_[i] == reg) {
-           group_l_arr_.del(i);
-           Register_group_register::terminate_register(reg);
-           return;
-       }
-    }
-    assert(false);
+    Register_group_register::do_pre_move_processing();
+    group_staff_elems();
 }
 
-bool
-Staff_registers::try_request(Request * r)
+void
+Staff_registers::group_staff_elems()
 {
-    bool b = Register_group_register::try_request(r);
-    if (!b) {
-       Command_req * cr_l = r->command() ;
-       
-       if (cr_l && cr_l->groupchange()) {
-           change_group(cr_l->groupchange(), 0, 0);
-           b = true;
-       } else 
-           b= false;
-    }
-    return b;
+    for (int i=0; i <staff_elem_l_arr_.size(); i++)
+       staffline_p_->add_element(staff_elem_l_arr_[i]);
+    staff_elem_l_arr_.set_size(0);
 }
 
-IMPLEMENT_STATIC_NAME(Staff_registers);
-
-bool
-Staff_registers::acceptable_request_b(Request*r)const
+void
+Staff_registers::do_removal_processing()
 {
-    return Register_group_register::acceptable_request_b(r) ||
-       (r->command() && r->command()->groupchange());
+    /* this is a "destructor type function", first do children, then self. */
+    Register_group_register::do_removal_processing();
+    group_staff_elems();
+
+    staffline_p_->right_col_l_ = get_staff_info().command_pcol_l();
+    Request_register::typeset_element(staffline_p_);
+    staffline_p_ = 0;
 }
 
 void
-Staff_registers::acknowledge_element(Score_elem_info i)
+Staff_registers::do_creation_processing()
 {
-    Register_group_register::acknowledge_element(i);
-    if ( i.elem_l_->name() == Staff_symbol::static_name())
-       staff_sym_l_ = (Staff_symbol*)i.elem_l_->item();
+    staffline_p_ = new Line_of_staff;
+    staffline_p_->left_col_l_ = get_staff_info().command_pcol_l();
+
+    // don't broadcast to self.
+    Request_register::announce_element(Score_elem_info(staffline_p_,0));
+    Register_group_register::do_creation_processing();
 }
+
+
+IMPLEMENT_STATIC_NAME(Staff_registers);
+IMPLEMENT_IS_TYPE_B1(Staff_registers,Register_group_register);
+ADD_THIS_REGISTER(Staff_registers);
+
index 3491b2f20d0949987bed0530bf007ccd92f591e2..2c5e1848c8fad807a6e1f0e04f53883b591fe5ee 100644 (file)
@@ -106,3 +106,6 @@ Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
     if (staff_sym_l_ == o)
        staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }
+
+IMPLEMENT_STATIC_NAME(Staff_side);
+IMPLEMENT_IS_TYPE_B1(Staff_side, Score_elem);
index f0683f0d44ae6959c3526b45ec4ae269b3b642bc..c309351a819292a891d9eda1ed4edce8c01cd68a 100644 (file)
 #include "p-col.hh"
 
 const NO_LINES = 5;
+void
+Staff_sym_register::fill_staff_info(Staff_info&i)
+{
+    i.staff_sym_l_ = span_p_;
+}
 
 Staff_sym_register::Staff_sym_register()
 {
    span_p_ = 0;
-   last_mom_ =0;
 }
 
 void
-Staff_sym_register::post_move_processing()
+Staff_sym_register::do_creation_processing()
 {
-    if (!span_p_ && !last_mom_) {
-       span_p_= new Staff_symbol(NO_LINES);
-       span_p_->left_col_l_ =
-           get_staff_info().command_pcol_l()->postbreak_p_; // ugh
-    }
-    if (!last_mom_) {
-       last_mom_ = get_staff_info().score_l()->last();
-    }
+    span_p_ = new Staff_symbol(NO_LINES);
+    span_p_->left_col_l_ = get_staff_info().command_pcol_l(); // ugh
 }
 
 void
-Staff_sym_register::process_requests()
+Staff_sym_register::do_removal_processing()
 {
-    announce_element(Score_elem_info(span_p_, 0));
+    span_p_->right_col_l_ = get_staff_info().command_pcol_l();
+    typeset_element(span_p_);
+    span_p_ =0;
 }
 
 void
-Staff_sym_register::pre_move_processing()
+Staff_sym_register::do_process_requests()
 {
-    Staff_info i=get_staff_info();
-    if ( span_p_ && i.when() == last_mom_) {
-       span_p_->right_col_l_ = i.command_pcol_l()->prebreak_p_;
-       typeset_element(span_p_);
-       span_p_ =0;
-    }
+    announce_element(Score_elem_info(span_p_, 0));
 }
 
+
 IMPLEMENT_STATIC_NAME(Staff_sym_register);
+IMPLEMENT_IS_TYPE_B1(Staff_sym_register,Request_register);
 ADD_THIS_REGISTER(Staff_sym_register);
-Staff_sym_register::~Staff_sym_register()
-{
-    assert(!span_p_);
-    delete span_p_;
-}
index 8624878496e3adf96219882f7f74cc5a4b7185b5..b83406c3a9d907852b6f99dce00a10e891222389 100644 (file)
@@ -19,6 +19,7 @@ Staff_symbol::Staff_symbol(int l)
 }
 
 IMPLEMENT_STATIC_NAME(Staff_symbol);
+IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner);
 
 void
 Staff_symbol::do_print()const
diff --git a/lily/staff-walker.cc b/lily/staff-walker.cc
deleted file mode 100644 (file)
index b83c527..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-  staff-walker.cc -- implement Staff_walker
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "grouping.hh"
-#include "staff.hh"
-#include "musical-request.hh"
-#include "staff-walker.hh"
-#include "staff-column.hh"
-#include "score-column.hh"
-#include "debug.hh"
-#include "time-description.hh"
-#include "command-request.hh"
-#include "grouping.hh"
-#include "score-walker.hh"
-
-Staff_walker::~Staff_walker()
-{
-    do_pre_move();
-}
-
-Staff_walker::Staff_walker(Staff_walker const &s)
-    :PCursor<Staff_column*> (s)
-{
-    assert(false);
-}
-
-Staff_walker::Staff_walker(Staff * s, PScore*ps )
-    : PCursor<Staff_column*> (s->cols_)
-{
-    staff_l_ = s;
-    pscore_l_ = ps;
-    
-    // should be in tdes. TODO
-    default_grouping = new Rhythmic_grouping(MInterval(0, 1), 4); 
-    score_walk_l_ = 0;
-}
-
-Moment
-Staff_walker::when() const
-{
-    return ptr()->when();
-}
-
-void
-Staff_walker::process_timing_reqs()
-{
-    ptr()->update_time(time_, default_grouping);
-}
-
-void
-Staff_walker::operator++(int i)
-{
-    Moment last = when();
-
-    do_pre_move();
-    PCursor<Staff_column*>::operator++(i);
-    if (ok() ) {
-       Moment delta_t = when() - last;
-       assert(delta_t >Moment(0));
-       time_.add( delta_t );
-    }
-    do_post_move();
-}
-
-void
-Staff_walker::process()
-{
-    process_timing_reqs();    
-    process_requests();
-}
-
-void 
-Staff_walker::allow_break()
-{
-    score_walk_l_->allow_break(this);
-}
diff --git a/lily/staff.cc b/lily/staff.cc
deleted file mode 100644 (file)
index 76e6d99..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-  staff.cc -- implement Staff
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "input-register.hh"
-#include "staff.hh"
-#include "score.hh"
-#include "voice.hh"
-#include "staff-column.hh"
-#include "score-column.hh"
-#include "voice-element.hh"
-#include "debug.hh"
-#include "musical-request.hh"
-#include "command-request.hh" // todo
-#include "staffline.hh"
-#include "complex-walker.hh"
-#include "super-elem.hh"
-#include "p-score.hh"
-#include "scoreline.hh"
-
-void
-Staff::add(Link_list<Voice*> const &l)
-{
-    for (iter_top(l,i); i.ok(); i++)
-       voice_list_.bottom().add(i);
-}
-
-Paper_def *
-Staff::paper() const
-{
-    return score_l_->paper_p_;
-}
-
-void
-Staff::clean_cols()
-{
-#if 0 // TODO
-    iter_top(cols_,i);
-    for(; i.ok(); ){
-       if (!i->musical_column_l_->used_b())
-           i->musical_column_l_ = 0;
-       if (!i->command_column_l_->used_b())
-           i->command_column_l_ =0;
-       
-       if (!i->command_column_l_&& !i->musical_column_l_)
-           delete i.remove_p();
-       else
-           i++;
-    }
-#endif
-}
-
-
-void
-Staff::OK() const
-{
-#ifndef NDEBUG
-    cols_.OK();
-    voice_list_.OK();
-    assert(score_l_);
-#endif    
-}
-
-
-Moment
-Staff::last() const
-{
-    Moment l = 0;
-    for (iter_top(voice_list_,i); i.ok(); i++) {
-       l = l >? i->last();
-    }
-    return l;
-}
-
-void
-Staff::print() const
-{
-#ifndef NPRINT
-    mtor << "Staff {\n";
-    for (iter_top(voice_list_,i); i.ok(); i++) {
-       i->print();     
-    }
-    ireg_p_->print();
-    mtor <<"}\n";
-#endif
-}
-
-Staff::~Staff()
-{
-    delete ireg_p_;
-}
-
-Staff::Staff()
-{    
-    ireg_p_ =0;
-    score_l_ =0;
-    pscore_l_ =0;
-}
-
-void
-Staff::add_col(Staff_column*c_l)
-{
-    cols_.bottom().add(c_l);
-    c_l->staff_l_ = this;
-}
-
-void
-Staff::set_output(PScore* pscore_l )
-{
-    pscore_l_ = pscore_l;
-    staff_line_l_ = new Line_of_staff;
-    pscore_l_->typeset_unbroken_spanner(staff_line_l_);
-    pscore_l_->super_elem_l_->line_of_score_l_->add_line(staff_line_l_);
-}
-
-
-Staff_walker * 
-Staff::get_walker_p()
-{
-    return new Complex_walker(this);
-}
index 533d51264585dcb7123c33db4969dd0b6b647ac5..359d719f0beba863a7a12d60a610461462ae4ff8 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  staffline.cc -- implement Line_of_staff
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "staffline.hh"
 #include "scoreline.hh"
 #include "dimen.hh"
 
 
 IMPLEMENT_STATIC_NAME(Line_of_staff);
+IMPLEMENT_IS_TYPE_B2(Line_of_staff,Spanner,Horizontal_vertical_group);
 
 void
 Line_of_staff::add_element(Score_elem*elem_l)
 {
-    if (!elem_l->group_element_i_)
-       Element_group::add_element(elem_l);
+    if (!elem_l->y_group_element_i_)
+       Horizontal_vertical_group::add_element(elem_l);
 }
index 8f85238abf0525a700a3d97211b1289370adc441..1630f4b79dd6685f06b09b8267fa9bd75f537c8a 100644 (file)
 #include "stem.hh"
 #include "grouping.hh"
 #include "text-spanner.hh"
-#include "complex-walker.hh"
 #include "debug.hh"
 #include "grouping.hh"
 #include "note-head.hh"
+#include "time-description.hh"
 
 Stem_beam_register::Stem_beam_register()
 {
-    post_move_processing();
+    do_post_move_processing();
 
     current_grouping = 0;
     beam_p_ = 0;
@@ -26,7 +26,7 @@ Stem_beam_register::Stem_beam_register()
 }
 
 bool
-Stem_beam_register::try_request(Request*req_l)
+Stem_beam_register::do_try_request(Request*req_l)
 {
     
     Musical_req* mus_l = req_l->musical();
@@ -65,7 +65,7 @@ Stem_beam_register::try_request(Request*req_l)
 }
 
 void
-Stem_beam_register::process_requests()
+Stem_beam_register::do_process_requests()
 {
     if (beam_req_l_) {
        if (beam_req_l_->spantype == Span_req::STOP) {
@@ -74,7 +74,7 @@ Stem_beam_register::process_requests()
        } 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();
@@ -127,7 +127,7 @@ Stem_beam_register::acknowledge_element(Score_elem_info info)
     }
 }
 void
-Stem_beam_register::pre_move_processing()
+Stem_beam_register::do_pre_move_processing()
 {
     if (stem_p_) {
        if (default_dir_i_)
@@ -140,6 +140,7 @@ Stem_beam_register::pre_move_processing()
        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;
@@ -148,7 +149,7 @@ Stem_beam_register::pre_move_processing()
     end_beam_b_ = false;
 }
 void
-Stem_beam_register::post_move_processing()
+Stem_beam_register::do_post_move_processing()
 {
     stem_p_ = 0;
     beam_req_l_ = 0;
@@ -170,4 +171,5 @@ Stem_beam_register::set_feature(Feature i)
 }
 
 IMPLEMENT_STATIC_NAME(Stem_beam_register);
+IMPLEMENT_IS_TYPE_B1(Stem_beam_register,Request_register);
 ADD_THIS_REGISTER(Stem_beam_register);
index 3cd58198b3b34fb82aa332596696e555ee76cbd9..d41d96f9c3c28c772c3687731cef4b2258033813 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  stem.cc -- implement Stem
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "stem.hh"
 #include "dimen.hh" 
 #include "debug.hh"
@@ -41,10 +49,10 @@ Stem::Stem(int c)
 
     print_flag_b_=true;
     stem_xoffset_f_ =0;
-
 }
 
 IMPLEMENT_STATIC_NAME(Stem);
+IMPLEMENT_IS_TYPE_B1(Stem,Item);
 
 void
 Stem::do_print() const
@@ -105,31 +113,39 @@ Stem::invisible_b()const
 {
     return !head_l_arr_.size();
 }
-bool
-Stem::chord_b() const
+
+// if dir_i_ is set we return fake values.
+
+int
+Stem::get_center_distance_from_top()
 {
-    return head_l_arr_.size() > 1;
+    if (dir_i_)
+       return (dir_i_ > 0) ? 0 : 1;
+
+    int staff_center = staff_size_i_ / 2;
+    int max = max_head_i() - staff_center;
+    return max >? 0;
 }
 
-// if dir_i_ is set we return a fake value.
+// if dir_i_ is set we return fake values.
 int
-Stem::get_center_distance()
+Stem::get_center_distance_from_bottom()
 {
     if (dir_i_)
-      return -dir_i_;
+       return (dir_i_ > 0) ? 1 : 0;
 
     int staff_center = staff_size_i_ / 2;
-    int min = min_head_i() - staff_center;
-    int max = max_head_i() - staff_center;
-    return (abs(max) > abs(min)) ? max : min;
+    int min = staff_center - min_head_i();
+    return min >? 0;
 }
 
 int
 Stem::get_default_dir()
 {
     if (dir_i_)
-        return dir_i_;
-    return -sign(get_center_distance());
+       return dir_i_;
+    return (get_center_distance_from_top() >=
+       get_center_distance_from_bottom()) ? -1 : 1;
 }
 
 
@@ -211,6 +227,8 @@ Stem::do_pre_processing()
        set_default_extents();
     set_noteheads();
     flag_i_ = dir_i_*abs(flag_i_);
+    transparent_b_ = invisible_b();
+    empty_b_ = invisible_b();
 }
 
 
@@ -229,9 +247,7 @@ Molecule*
 Stem::brew_molecule_p()const 
 {
     Molecule *out =0;
-    if ( invisible_b() )
-       return Score_elem::brew_molecule_p();
-    
+        
     Real bot  = stem_bottom_f_;
     Real top = stem_top_f_;
     
@@ -255,7 +271,7 @@ Stem::brew_molecule_p()const
            assert(false); 
     }
 
-    out->translate(Offset(stem_xoffset_f_,0));
+    out->translate_x(stem_xoffset_f_);
     return out;
 }
 
index 792f97f503fa9e2a120fcfe0adfbcf666361d00b..c2554516fe16bdc89903ac863194ad051fd93f78 100644 (file)
@@ -54,3 +54,4 @@ Super_elem::do_add_processing()
 
 
 IMPLEMENT_STATIC_NAME(Super_elem);
+IMPLEMENT_IS_TYPE_B1(Super_elem,Score_elem);
index a84d9054d73398a34ea5cac8294c463ed37767d7..6f182fbd98cf0cd5dba2cbc6fa338850f854b989 100644 (file)
@@ -8,16 +8,12 @@
 #include "swallow-reg.hh"
 
 IMPLEMENT_STATIC_NAME(Swallow_register);
+IMPLEMENT_IS_TYPE_B1(Swallow_register,Request_register);
 ADD_THIS_REGISTER(Swallow_register);
 
-bool
-Swallow_register::acceptable_request_b(Request*) const
-{
-    return true;
-}
 
 bool
-Swallow_register::try_request(Request*) 
+Swallow_register::do_try_request(Request*) 
 {
     return true;
 }
index 676fb4b7fbfbd111234d93848a1216b93daf0acb..0a765f3110feb85073ca8b8896321a801e50a4ac 100644 (file)
@@ -13,8 +13,6 @@
 #include "item.hh"
 #include "musical-request.hh"
 #include "spanner.hh"
-#include "scoreline.hh" 
-#include "staffline.hh"
 #include "pcursor.tcc"
 #include "plist.tcc"
 
@@ -22,8 +20,6 @@
 #define IPLC_instantiate(a) IPL_instantiate(a); PL_instantiate(const a)
 
 
-IPLC_instantiate(Line_of_score);
-IPLC_instantiate(Line_of_staff);
 IPLC_instantiate(Score_elem);
 IPLC_instantiate(Spanner);
 IPLC_instantiate(Idealspacing);
index 1115253ce5749bfcf29754a644b456b05d69c793..385fc141605d241443724963e7997653083f31a4 100644 (file)
@@ -6,24 +6,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "music.hh"
-#include "symbol.hh"
-#include "voice.hh"
-#include "voice-element.hh"
-#include "musical-request.hh"
-#include "staff.hh"
 #include "score-column.hh"
-#include "staff-column.hh"
-#include "spanner.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
 
-IPL_instantiate(Request);
 IPL_instantiate(Score_column);
-IPL_instantiate(Staff_column);
-IPL_instantiate(Staff);
-IPL_instantiate(Voice_element);
-IPL_instantiate(Voice);
-
-
-IPL_instantiate(Music);
index 42a48125f0231e4639f72a4fffcc7226ea570c24..54ce79274478ea918e846f611622a9a5096159f1 100644 (file)
@@ -8,16 +8,10 @@
 
 #include "symbol.hh"
 #include "request.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
 #include "input-register.hh"
 #include "molecule.hh"
-#include "voice-element.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
 
 IPL_instantiate(Atom);
-IPL_instantiate(Input_staff);
-IPL_instantiate(Input_music);
 IPL_instantiate(Input_register);
index 0401c8cd938ff9c135381455f165426db01403cc..d543208d8dcfab978472997693734263be3313c6 100644 (file)
@@ -1,10 +1,5 @@
 #include "proto.hh"
 #include "plist.tcc"
 #include "register.hh"
-#include "voice-group-regs.hh"
-#include "voice-regs.hh"
 
-
-IPL_instantiate(Voice_registers);
-IPL_instantiate(Voice_group_registers);
 IPL_instantiate(Request_register);
index ef2969b78483979d2420866586af562e84429235..602fdeb2b62326e7f3890620fbbc1ce9c74ac1ee 100644 (file)
@@ -6,9 +6,11 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "staff-column.hh"
-#include "request-column.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
 
-IPL_instantiate(Request_column);
+#include "music-list.hh"
+#include "music-iterator.hh"
+
+IPL_instantiate(Music);
+IPL_instantiate(Music_iterator);
index 09da3b6ec7d1bb9c2dd7385d0dfd861cdac0a758..db1531f0a9750e5fb0d5aec0d49174963682ff3b 100644 (file)
@@ -1,6 +1,3 @@
-#include "pulk-voice.hh"
 
 #include "plist.tcc"
 #include "pcursor.tcc"
-
-IPL_instantiate(Pulk_voice);
index d44b3469291fef02122f3be2992480a126ff50e9..76d1de2060e19f5840eb9e1aa50ed4ad3f17b940 100644 (file)
@@ -55,7 +55,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir) const
     f+=String( "{" ) + String( idx ) + "}";
     s.tex = f;
     Atom a(s);
-    a.translate(Offset(dx/2,0));
+    a.translate_x(dx/2);
     s.tex = a.TeX_string();
 
     return s;
@@ -169,7 +169,7 @@ Lookup::slur (int dy , Real &dx, int dir) const
     s.tex = f;
 
     Atom a(s);
-    a.translate(Offset(dx/2,0));
+    a.translate_x(dx/2);
     s.dim = a.extent();
     s.tex = a.TeX_string();
     return s;    
@@ -195,10 +195,10 @@ Lookup::big_slur(int dy , Real &dx, int dir) const
     Molecule mol;
     mol.add(l);
     Atom a(m);
-    a.translate(Offset(0,slur_extra * internote_f()));
+    a.translate_y(slur_extra * internote_f());
     mol.add_right(m);
     mol.add_right(r);
-    mol.translate(Offset(0, l_dy * internote_f()));
+    mol.translate_y( l_dy * internote_f());
     Symbol s;
     s.tex = mol.TeX_string();
     s.dim = mol.extent();
index a9e95ef68d4fc2bd424dccac193de3422482f8e7..dc7ed6f58a2bd174fc84405ffca96c083e5ec9ad 100644 (file)
@@ -18,7 +18,7 @@ Text_def::width(Paper_def * p) const
 {
     Atom a = get_atom(p,0);
 
-    Real guess_width_f = text_str_.length_i() * a.sym.dim.x.length(); // ugh
+    Real guess_width_f = text_str_.length_i() * a.sym_.dim.x.length(); // ugh
     Interval i(0, guess_width_f);
     i += - (align_i_ + 1)* i.center();
     return i;
@@ -50,3 +50,4 @@ Text_def::print() const
        style_str_ << "align " << align_i_ << '\n';
 }
 IMPLEMENT_STATIC_NAME(Text_def);
+IMPLEMENT_IS_TYPE_B1(Text_def,General_script_def);
index 9d661f405f2153bdff6dd3f5b7e0d26b3f888297..42ae3994c4040a0a3db659e4aa873aef226caab2 100644 (file)
@@ -60,10 +60,11 @@ Text_item::brew_molecule_p() const
     Molecule* mol_p = new Molecule(a);
 
     if(dir_i_<0 )              // should do something better anyway.
-       mol_p->translate(Offset(0, -mol_p->extent().y.left ));
-    mol_p->translate(Offset(0, pos_i_ * paper()->internote_f()));
+       mol_p->translate_y( -mol_p->extent().y.left );
+    mol_p->translate_y( pos_i_ * paper()->internote_f());
     
     return mol_p;
 }
 
 IMPLEMENT_STATIC_NAME(Text_item);
+IMPLEMENT_IS_TYPE_B1(Text_item,Item);
index afbf035d22da7f5b57b874a1e4f7c4129b10c248..99c35d276b4477ad4efd184b425e7b0790af0f1b 100644 (file)
@@ -12,20 +12,21 @@ Text_register::Text_register()
 {
     text_p_ = 0;
     dir_i_ =0;
-    post_move_processing();
+    do_post_move_processing();
 }
 
 bool
-Text_register::try_request(Request*req_l)
+Text_register::do_try_request(Request*req_l)
 {
-    if (!req_l->text())
+    Musical_req *m = req_l->musical();
+    if (!m || ! m->text())
        return false;
     if (text_req_l_ &&
-       Text_req::compare(*req_l->text(), *text_req_l_))
+       Text_req::compare(*m->text(), *text_req_l_))
 
        return false;
 
-    text_req_l_ = req_l->text();
+    text_req_l_ = m->text();
     return true;
 }
 void
@@ -36,7 +37,7 @@ Text_register::acknowledge_element(Score_elem_info i)
     }
 }
 void
-Text_register::process_requests()
+Text_register::do_process_requests()
 {
     if (text_req_l_) {
        text_p_ = new Text_item(text_req_l_->tdef_p_, text_req_l_->dir_i_); // ugh
@@ -44,7 +45,7 @@ Text_register::process_requests()
     }
 }
 void
-Text_register::pre_move_processing()
+Text_register::do_pre_move_processing()
 {
     if (text_p_) {
        if (dir_i_ && !text_p_->dir_i_)
@@ -63,9 +64,10 @@ Text_register::set_feature(Feature i)
        dir_i_ = i.value_;
 }
 void
-Text_register::post_move_processing()
+Text_register::do_post_move_processing()
 {
     text_req_l_ = 0;
 }
 IMPLEMENT_STATIC_NAME(Text_register);
+IMPLEMENT_IS_TYPE_B1(Text_register,Request_register);
 ADD_THIS_REGISTER(Text_register);
index ceaacd8793109ca0c0d0cc159516d86c89637ca4..2b40f00e8ec6725ef0572ca32f0843504dcd8be1 100644 (file)
@@ -32,6 +32,7 @@ Text_spanner::Text_spanner()
 }
 
 IMPLEMENT_STATIC_NAME(Text_spanner);
+IMPLEMENT_IS_TYPE_B1(Text_spanner,Spanner);
 
 void
 Text_spanner::do_print() const
index 2b8fe5d642a5431306bc5fe33c89f7eb8b318fcc..5541888b3c316e97e38c79527d47dbe76279cb86 100644 (file)
@@ -10,7 +10,7 @@
 #include "tie.hh"
 #include "note-head.hh"
 #include "musical-request.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
 
 Tie_register::Tie_register()
 {
@@ -31,7 +31,7 @@ Tie_register::sync_features()
     
 
 void
-Tie_register::post_move_processing()
+Tie_register::do_post_move_processing()
 {
     if (tie_p_ && get_staff_info().when() == end_mom_) {
        end_tie_p_ = tie_p_;
@@ -50,7 +50,7 @@ Tie_register::acceptable_request_b(Request*r)
 }
 
 bool
-Tie_register::try_request(Request*r)
+Tie_register::do_try_request(Request*r)
 {
     if(!acceptable_request_b(r))
        return false;
@@ -58,12 +58,13 @@ Tie_register::try_request(Request*r)
        return false;
     }
     req_l_ = r->musical()->tie();
-    end_mom_ = r->elt_l_->duration_ + get_staff_info().when();
+    end_mom_ = r->parent_music_l_->time_int().length()
+       + get_staff_info().when();
     return true;
 }
 
 void
-Tie_register::process_requests()
+Tie_register::do_process_requests()
 {
     if (req_l_ && ! tie_p_) {
        tie_p_ = new Tie;
@@ -89,7 +90,7 @@ Tie_register::acknowledge_element(Score_elem_info i)
 }
 
 void
-Tie_register::pre_move_processing()
+Tie_register::do_pre_move_processing()
 {
     if (end_tie_p_) {
        if (dir_i_)
@@ -118,4 +119,5 @@ Tie_register::set_feature(Feature f)
 }
 
 IMPLEMENT_STATIC_NAME(Tie_register);
+IMPLEMENT_IS_TYPE_B1(Tie_register,Request_register);
 ADD_THIS_REGISTER(Tie_register);
index 80170cf0b3c27e2af386d6a3f6a8af8c78675eff..7ce834946c887d185a5b5318e814135ebdd61eb4 100644 (file)
@@ -92,3 +92,4 @@ Tie::do_substitute_dependency(Score_elem*o, Score_elem*n)
 
 
 IMPLEMENT_STATIC_NAME(Tie);
+IMPLEMENT_IS_TYPE_B1(Tie,Bow);
diff --git a/lily/vertical-align-elem.cc b/lily/vertical-align-elem.cc
new file mode 100644 (file)
index 0000000..4ff58ee
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+  vertical-align-item.cc -- implement Vertical_align_elem
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "vertical-align-elem.hh"
+#include "interval.hh"
+
+void
+Vertical_align_elem::add(Score_elem*el_l)
+{
+    assert( ! contains_b(el_l));
+    elem_l_arr_.push(el_l);
+    add_dependency(el_l);
+}
+
+void
+Vertical_align_elem::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    int i;
+    while((i = elem_l_arr_.find_i(o))>=0) 
+       if (n) 
+           elem_l_arr_[i] = n;
+       else
+           elem_l_arr_.del(i);
+}
+void
+Vertical_align_elem::do_post_processing()
+{
+    Array<Interval> dims;
+    for (int i=elem_l_arr_.size(); i--; ) {
+       Interval y = elem_l_arr_[i]->height() ;
+       if (y.empty_b())
+           y = Interval(0,0);
+       
+       dims.push(y);
+    }
+
+    Real where_f=0;
+    for ( int i=0 ;  i < elem_l_arr_.size(); i++) {
+       elem_l_arr_[i]->translate_y( - dims[i][1] - where_f);
+       where_f += dims[i].length();
+    }
+}
+
+bool
+Vertical_align_elem::contains_b(Score_elem const *e)const
+{
+    return elem_l_arr_.find_l(e);
+}
+
+Vertical_align_elem::Vertical_align_elem()
+{
+    transparent_b_ = true;
+    empty_b_ =true;
+}
+
+IMPLEMENT_STATIC_NAME(Vertical_align_elem);
+IMPLEMENT_IS_TYPE_B1(Vertical_align_elem, Score_elem);
+
diff --git a/lily/voice-element.cc b/lily/voice-element.cc
deleted file mode 100644 (file)
index f08aa77..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-  voice-elt.cc -- implement Voice_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "voice.hh"
-#include "voice-element.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-
-
-void
-Voice_element::transpose(Melodic_req const&d)const
-{
-    for (iter_top(req_p_list_,i); i.ok(); i++) {
-       i->transpose(d);
-      }
-}
-
-void
-Voice_element::print() const
-{
-#ifndef NPRINT
-    mtor << "voice_element { dur :"<< duration_ <<"\n";
-    mtor << "principal: " << principal_req_l_->name() << "\n";
-    for (iter_top(req_p_list_,rc); rc.ok(); rc++) {
-       rc->print();
-    }
-    
-    mtor << "}\n";
-#endif
-}
-
-void
-Voice_element::add(Request*r)
-{
-    if (! principal_req_l_ ) 
-       principal_req_l_ = r;
-
-    if (r->duration()) {
-       assert (!duration_  || duration_ == r->duration());
-       duration_ = r->duration();
-    }
-    
-    r->elt_l_ = this;
-    req_p_list_.bottom().add(r);
-}
-
-
-Voice_element::Voice_element()
-{
-    principal_req_l_ = 0;
-    voice_C_ = 0;
-    duration_ = 0;
-}
-
-Voice_element::Voice_element(Voice_element const&src)
-    : Input(src)
-{
-    principal_req_l_ = 0;
-    voice_C_=0;
-    for (iter_top(src.req_p_list_, i); i.ok(); i++)
-       add(i->clone());
-
-}
-
-void
-Voice_element::set_default_group(String s)
-{
-    for (iter_top(req_p_list_, i); i.ok(); i++)
-       if (i->command() &&i->command()->groupchange())
-           return ;
-    Group_change_req *greq = new Group_change_req;
-    greq->newgroup_str_ = s;
-    add(greq);
-}
-
index 72f3c9426c60122d5d2e028321d6393f6e107165..06757b7b74940874e3532585beb2d2fa7b2c6902 100644 (file)
@@ -5,41 +5,28 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-#include "voice.hh"
+#include "music-list.hh"
 #include "proto.hh"
 #include "plist.hh"
 #include "musical-request.hh"
 #include "voice-regs.hh"
 #include "voice-group-regs.hh"
 #include "register.hh"
-#include "complex-walker.hh"
 #include "command-request.hh"
 #include "debug.hh"
 #include "input-register.hh"
+#include "time-description.hh"
 
-static int temp_id_count;
 
-Voice_group_registers::Voice_group_registers(String id,
-                                            Input_register const *ireg_C)
+Voice_group_registers::Voice_group_registers()
 {
     dir_i_ =0;
-    ireg_C_ =ireg_C;
-    Register_group_register::add(ireg_C->get_nongroup_p_arr());
-    if (id=="")                        // ugh
-       id = __FUNCTION__ + String(temp_id_count++);
-    group_id_str_ = id;
-    termination_mom_ = 0; 
+    termination_mom_ = INFTY; 
 }
 
 bool
-Voice_group_registers::try_request(Request*r_l)
+Voice_group_registers::do_try_request(Request*r_l)
 {
-    for (int i=0; i < voice_reg_l_arr_.size(); i++) {  
-       if (voice_reg_l_arr_[i]->voice_l_ == r_l->voice_l())
-           goto gotcha;        // yeah, yeah, I know
-    }
-    return false;
-gotcha:
     Command_req* c_l = r_l->command();
     if (c_l&& c_l->groupfeature()) {
        Feature f;
@@ -48,79 +35,33 @@ gotcha:
        set_feature(f);
        return true;
     }
-    return Register_group_register::try_request(r_l);
+    return Register_group_register::do_try_request(r_l);
 }
 
 
 IMPLEMENT_STATIC_NAME(Voice_group_registers);
+IMPLEMENT_IS_TYPE_B1(Voice_group_registers,Register_group_register);
 
 void
 Voice_group_registers::do_print() const
 {
 #ifndef NPRINT
-    mtor << "ID: " << group_id_str_<<"\n";
-    mtor << "stopping at " << termination_mom_ << "\n";
     Register_group_register::do_print();
 #endif
 }
-void
-Voice_group_registers::add(Request_register*r_l)
-{
-    Register_group_register::add(r_l);
-    if (r_l->name() == Voice_registers::static_name()) {
-       Voice_registers * vregs_l = (Voice_registers*)r_l;
-       voice_reg_l_arr_.push( vregs_l );
-       Voice *v_l = vregs_l->voice_l_;
-       termination_mom_ = termination_mom_ >? v_l -> last();
-       mtor << "adding Voice_registers, now terminating at " << 
-           termination_mom_<< "\n";
-    }
-    OK();
-}
 
 void
-Voice_group_registers::post_move_processing()
+Voice_group_registers::do_post_move_processing()
 {
     if ( get_staff_info().time_C_ ->when_ > termination_mom_ ){
        mtor << "Terminating voice_group\n";
        daddy_reg_l_->terminate_register(this);
        return ;
     }
-    Register_group_register::post_move_processing();
+    Register_group_register::do_post_move_processing();
 }
 
-Request_register *
-Voice_group_registers::get_register_p(Request_register *reg_l)
-{
-     if (reg_l->name() == Voice_registers::static_name()) {
-       for (int i=0; i <voice_reg_l_arr_.size(); i++) {
-           if (reg_l == voice_reg_l_arr_[i])
-               voice_reg_l_arr_.del(i);
-       }
-     }
-     Request_register*reg_p =Register_group_register::get_register_p(reg_l);
-     OK();
-
-     return reg_p;
-}
 
-void
-Voice_group_registers::OK() const
-{
-    for (int i=0; i < voice_reg_l_arr_.size(); i++) {
-       iter(reg_list_.find(voice_reg_l_arr_[i]), j);
-       assert(j.ok());
-    }
-}
-            
-            
-void
-Voice_group_registers::set_feature(Feature f)
-{
-    if (f.type_ == "vdir")
-       dir_i_ = f.value_;
-    Register_group_register::set_feature(f);
-}
 
 Scalar
 Voice_group_registers::get_feature(String f)
@@ -129,3 +70,5 @@ Voice_group_registers::get_feature(String f)
        return dir_i_;
     Register_group_register::get_feature(f);
 }
+
+ADD_THIS_REGISTER(Voice_group_registers);
index 43daf7081503f2690998baa5ce62318c935f9f71..641e8d6da1d4d4c86092ff0c14ea9250d03f6b29 100644 (file)
@@ -5,81 +5,34 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "proto.hh"
 #include "plist.hh"
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "voice-regs.hh"
 #include "register.hh"
-#include "staff-regs.hh"       // needed because somebody has to delete us.
 #include "debug.hh"
-#include "input-register.hh"
-#include "voice-group-regs.hh"
 
-Voice_registers::Voice_registers(Voice *v_p, Input_register const*ireg_C)
+Voice_registers::Voice_registers()
 {
-    terminate_b_ = false;
-    ireg_C_ = ireg_C;
-    voice_l_ = v_p;
-    add(ireg_C->get_nongroup_p_arr());
 }
 
-void
-Voice_registers::acknowledge_element(Score_elem_info i)
-{
-    if (i.voice_l_ != voice_l_)
-       return;
-    Register_group_register::acknowledge_element(i);
-}
-
-bool
-Voice_registers::try_request(Request*r_l)
-{
-    if (r_l->voice_l() !=voice_l_)
-       return false;
-    
-    Command_req *c=r_l->command();
-    if (c&&c->terminate()) {
-       terminate_b_ = true;
-       return true;            // scary. We're deleted now.. 
-    } else if (c&&c->groupchange()) {
-       /* this is scary as well. The groupchange has to be handled by
-        the Staff_registers, which are two levels up in the hierarchy
-        */
-         
-       assert(daddy_reg_l_->name() == Voice_group_registers::static_name());
-       ((Staff_registers*)daddy_reg_l_->daddy_reg_l_)->        // scary.
-           change_group(c->groupchange(), this,
-                        (Voice_group_registers*)daddy_reg_l_); // ugh!
-       return true;
-    }
-    
-    return Register_group_register::try_request(r_l);
-}
-
-bool
-Voice_registers::acceptable_request_b(Request*r)
-{
-    Command_req *  c_l = r->command();
-    return   (c_l&&(c_l->terminate()||c_l->groupchange()))
-       || Register_group_register::acceptable_request_b(r);
-}
-IMPLEMENT_STATIC_NAME(Voice_registers);
-
 void
 Voice_registers::do_print() const
 {
 #ifndef NPRINT
-    mtor << "Voice= " << voice_l_<<'\n';
     Register_group_register::do_print();
 #endif
 }
 
-void
-Voice_registers::pre_move_processing()
+ADD_THIS_REGISTER(Voice_registers);
+IMPLEMENT_IS_TYPE_B1(Voice_registers, Register_group_register);
+IMPLEMENT_STATIC_NAME(Voice_registers);
+
+bool
+Voice_registers::interpret_request_b(Request*r)
 {
-    if (terminate_b_)
-       daddy_reg_l_->terminate_register(this);
-    else 
-       Register_group_register::pre_move_processing();
+    return try_request(r);
 }
+
diff --git a/lily/voice.cc b/lily/voice.cc
deleted file mode 100644 (file)
index f248f3a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-  voice.cc -- implement Voice
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "midi-item.hh"
-#include "midi-stream.hh"
-#include "voice-element.hh"
-
-void
-Voice::transpose(Melodic_req const & d)const
-{
-     for (iter_bot(elts_, i); i.ok(); i--)
-       i->transpose(d); 
-}
-
-void
-Voice::set_default_group(String s)
-{
-    elts_.top()->set_default_group(s);
-}
-
-Voice::Voice(Voice const&src)
-{
-    for (iter_top(src.elts_, i); i.ok(); i++)
-       add(new Voice_element(**i));
-
-    start_ = src.start_;
-}
-
-Voice::Voice()
-{
-    start_ = 0;
-}
-
-void
-Voice::add(Voice_element*v)
-{
-    v->voice_C_ = this;
-    elts_.bottom().add(v);
-}
-
-void
-Voice::print() const
-{
-#ifndef NPRINT
-    mtor << "Voice { start_: "<< start_<<eol;
-    for (iter_top(elts_,i); i.ok(); i++)
-       i->print();
-    mtor << "}\n";
-#endif
-}
-
-/**
-   @return The moment at which last element stops.
- */
-Moment
-Voice::last() const
-{
-    Moment l =0;
-    if (elts_.size())
-       l = start_;
-    
-    for (iter_top(elts_,i); i.ok(); i++)
-       l  += i->duration_;
-    return l;
-}
-
diff --git a/lily/walk-regs.cc b/lily/walk-regs.cc
deleted file mode 100644 (file)
index 328fa17..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-  walkregs.cc -- implement Walker_registers
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "debug.hh"
-#include "walk-regs.hh"
-#include "staff-regs.hh"
-#include "score-elem.hh"
-#include "staff.hh"
-#include "complex-walker.hh"
-#include "staff-column.hh"
-#include "score-walker.hh"
-#include "bar.hh"              // needed for Bar::static_name
-#include "input-register.hh"
-#include "staffline.hh"
-
-Walker_registers::Walker_registers(Complex_walker *w)
-{
-    walk_l_ = w;
-    Input_register * ireg_l = w->staff_l_->ireg_p_;
-    if (ireg_l->name_str_ == "Staff_registers") 
-       add(new Staff_registers(ireg_l));
-    else {
-       add(ireg_l->get_nongroup_p_arr());
-    }
-}
-
-void
-Walker_registers::announce_element(Score_elem_info info)
-{
-    if (info.elem_l_->name() == Bar::static_name()) {
-       walk_l_->allow_break();
-    }
-    announce_info_arr_.push(info);
-}
-
-void
-Walker_registers::acknowledge_element(Score_elem_info )
-{
-    assert(false);
-}
-
-void
-Walker_registers::do_announces()
-{
-    Request dummy_req;
-    for (int i = 0; i < announce_info_arr_.size(); i++){
-       Score_elem_info info = announce_info_arr_[i];
-       mtor << "Announcing " << info.elem_l_->name()<<"\n";
-
-       if (!info.req_l_)
-           info.req_l_ = &dummy_req;
-       Register_group_register::acknowledge_element(info);
-    }
-    announce_info_arr_.set_size(0);
-}
-
-void
-Walker_registers::typeset_element(Score_elem *elem_p)
-{
-    musical_item_p_arr_.push(elem_p);
-}
-
-void
-Walker_registers::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
-                                      Item * post_p)
-{
-    if (pre_p) {
-       prebreak_item_p_arr_.push(pre_p);
-       walk_l_->staff_l_->staff_line_l_->add_element(pre_p);
-    }
-    if (nobreak_p) {
-       nobreak_item_p_arr_.push(nobreak_p);
-       walk_l_->staff_l_->staff_line_l_->add_element(nobreak_p);
-    }
-    if (post_p) {
-       postbreak_item_p_arr_.push(post_p);
-       walk_l_->staff_l_->staff_line_l_->add_element(post_p);
-    }
-}
-
-void
-Walker_registers::pre_move_processing()
-{
-    // this generates all items.
-    Register_group_register::pre_move_processing();
-    walk_l_->ptr()->typeset_breakable_items(prebreak_item_p_arr_,
-                                           nobreak_item_p_arr_,
-                                           postbreak_item_p_arr_);
-    for (int i=0; i < musical_item_p_arr_.size(); i++)
-           walk_l_->typeset_element(musical_item_p_arr_[i]);
-    musical_item_p_arr_.set_size(0);
-}
-void
-Walker_registers::post_move_processing()
-{
-    Register_group_register::post_move_processing();
-}
-
-
-Staff_info
-Walker_registers::get_staff_info()
-{
-    Staff_info inf;
-    if (walk_l_->score_walk_l_)        // we get called ctors
-       inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
-    inf.walk_l_ = walk_l_;
-    inf.time_C_ = &walk_l_->time_;
-    inf.rhythmic_C_ = walk_l_->default_grouping;
-    return inf;
-}
-
-Paper_def*
-Walker_registers::paper()const
-{
-    return walk_l_->staff_l_->paper();
-}
index 3a4b0fe668a3384009a8bf867a371a7b850a5429..d162fe2f70414d963fef982f393dabc905f982e4 100644 (file)
@@ -3,7 +3,7 @@
 # @configure_input@
 
 INSTALL = @INSTALL@
-USER_CXXFLAGS =
+USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@
 USER_LDFLAGS =
 
 CXX = @CXX@
index d196e1679f0a6caa91c01b0a1ad477e480e5afa8..a93ae1e1b2e282b3e6bdaf8a903f53d14cdcd883 100644 (file)
@@ -30,7 +30,7 @@ include ./$(depth)/make/out/Site.make
 # dependency list of executable:
 #
 
-$(EXECUTABLE): $(build) $(OFILES)
+$(EXECUTABLE): $(build) $(OFILES) $(outdir)/version.hh
        $(MAKE) $(MODULE_LIBDEPS) 
        $(INCREASE_BUILD)
        $(MAKE) -S $(OFILES)  $(SILENT_LOG)
@@ -223,12 +223,15 @@ $(LIBLILY): dummy
 
 # RedHat rpm package:
 #
-rpm: $(doc-dir)/$(outdir)/lelie_icon.xpm
+rpm: check-rpm-doc-deps
        -cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
        -cp $< $(rpm-sources)
        $(MAKE) -C $(make-dir) spec
        rpm -ba $(makeout)/lilypond.spec
 #
+check-rpm-doc-deps: 
+       $(MAKE) -C $(depth)/Documentation/ xpms
+
 
 installexe:
        $(INSTALL) -d $(bindir)
index be276478704f331dab0f2fa58a124567f00fa1a1..2ba9980153c323fd7d8e5cd02371b960bd03169e 100644 (file)
@@ -2,8 +2,8 @@
 
 Begin3
 Title: LilyPond
-Version: 0.0.67
-Entered-date: 05/29/97
+Version: 0.0.68pre
+Entered-date: 06/26/97
 Description: LilyPond is a program which converts a music-script (mudela) into
 TeX output, or MIDI to produce multi-staff scores. Features include multiple
 meters, clefs, keys, lyrics, versatile input-language, cadenzas
@@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: pcnov095.win.tue.nl /pub/lilypond/  
-       300k lilypond-0.0.67.tar.gz
+       300k lilypond-0.0.68pre.tar.gz
 Alternate-site: 
 Original-site: 
 Platform: unix/win32, GNU C++
index 1c1010ca7f36b49cea175594c88bafaecf4b37da..85123c76eb1c271d3a3feb729b836faa74aef773 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.0.67
+Version: 0.0.68pre
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.67.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.68pre.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
@@ -27,7 +27,7 @@ rm -rf $RPM_BUILD_ROOT
 strip lily/out/lilypond mi2mu/out/mi2mu
 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/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.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.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/lelie_logo.gif
+%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text Documentation/out/other-packages.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly 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.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/lelie_logo.gif
 /usr/bin/convert-mudela
 /usr/bin/lilypond
 /usr/lib/libflower.so
index ff0937ad8c006b7adacb528d163e744a3a03fbcf..48682ab497bceff2116e43b2c6c8244ab15d5ec5 100644 (file)
@@ -55,7 +55,7 @@ lily-mfdir = $(MFDIR)/lilypond
 
 localinstall:
        $(INSTALL) -d $(lily-mfdir)
-       $(INSTALL) -m 755 $(MFFILES) $(lily-mfdir)
+       $(INSTALL) -m 644 $(MFFILES) $(lily-mfdir)
 
 localuninstall:
        for i in $(MFFILES); do rm -f $(lily-mfdir)/$$i; done
index 2c16ef242b9c1107a8bddcfab02f748369ac4923..0e7e38765015be8b0fa1c0742ce12c8a596c62b6 100644 (file)
@@ -16,7 +16,7 @@ DISTFILES = Makefile $(TEXFILES)
 
 localinstall:
        $(INSTALL) -d $(TEXDIR)/lilypond
-       $(INSTALL) -m 755 $(TEXFILES) $(TEXDIR)/lilypond/
+       $(INSTALL) -m 644 $(TEXFILES) $(TEXDIR)/lilypond/
 
 localuninstall:
        for i in $(TEXFILES) ; do rm -f $(TEXDIR)/lilypond/$$i; done
index 093956cca99c9fba571c775a30ba694e738fce07..e09ced2737790a1173a5464d5eaf260792df208a 100644 (file)
@@ -1,7 +1,7 @@
 %
 % A tex file to help determine dims.
 %
-\font\musicfont=musix20
+\font\musicfont=opus20
 \font\slurfont=xslu16
 \def\thefont{\musicfont}
 
diff --git a/tex/eglerdefs.tex b/tex/eglerdefs.tex
new file mode 100644 (file)
index 0000000..ad2bf20
--- /dev/null
@@ -0,0 +1,118 @@
+%
+% Has to be fixed. Exercise for the reader.
+%
+
+
+\def\musixtwentyfonts{
+  \font\textfont=cmr10
+        \font\meterfont=cmbx12
+        \font\slurufont=oslu20
+        \font\slurdfont=osld20
+        \font\slurhfont=oslz20
+        \font\hslurufont=oslhu20
+        \font\hslurdfont=oslhd20
+        \font\hslurhfont=oslhz20
+        \font\musicfnt=opus20
+        \font\musicdraw=opussps
+        \font\italicfont=cmti10
+        \font\dynfont=cmbxti10 scaled \magstep1
+        \font\mathfont=cmsy10
+}
+
+
+\def\musixsixteenfonts{
+        \font\textfont=cmr8
+        \font\meterfont=cmbx12
+        \font\italicfont=cmti8
+        \font\slurufont=oslu16
+        \font\slurdfont=osld16
+        \font\slurhfont=oslz20 % sigh
+        \font\hslurufont=oslhu16
+        \font\hslurdfont=oslhd16
+        \font\hslurhfont=oslhz20
+        \font\musicfnt=opus16
+        \font\dynfont=cmbxti12
+        \font\musicdraw=opussps
+        \font\mathfont=cmsy8
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% provide interface to musixtex fonts 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mdef\quartball{26}
+\mdef\halfball{27}
+\mdef\wholeball{28}
+\mdef\halfrest{13}
+\mdef\wholerest{12}
+\mdef\quartrest{14}
+\mdef\eighthrest{15}
+\mdef\sixteenthrest{16}
+\mdef\thirtysecondrest{17}
+\mdef\sixtyfourthrest{18}
+%\mdef\hundredtwentyeighthrest{67}
+\mdef\sharp{93}
+\mdef\flat{91}
+\mdef\natural{95}
+\mdef\sharpsharp{94}
+\mdef\flatflat{92}
+
+\mdef\singledot{'00}
+\mdef\doubledot{'01}
+\mdef\tripledot{'02}
+\mdef\mussepline{155}
+
+\mdef\violinclef{65}
+\mdef\bassclef{67}
+\mdef\altoclef{69}
+\mdef\cviolinclef{66}
+\mdef\cbassclef{68}
+\mdef\caltoclef{70}
+
+\mdef\deighthflag{32}
+\mdef\dsixteenthflag{46}
+\mdef\dthirtysecondflag{47}
+\mdef\dsixtyfourthflag{48}
+\mdef\dhundredtwentyeighthflag{49}
+
+% pointing up
+\mdef\ueighthflag{40}
+\mdef\usixteenthflag{41}
+\mdef\uthirtysecondflag{42}
+\mdef\usixtyfourthflag{43}
+\mdef\uhundredtwentyeighthflag{44}
+
+\maccentdef\repeatcolon{55}{2/1}
+\def\eighthflag{\topalign{\ueighthflag}}
+\def\sixteenthflag{\topalign{\usixteenthflag}}
+\def\thirtysecondflag{\topalign{\uthirtysecondflag}}
+\def\sixtyfourthflag{\topalign{\usixtyfourthflag}}
+\def\hundredtwentyeighthflag{\topalign{\uhundredtwentyeighthflag}}
+
+\def\cquartrest{\vertcenter\quartrest}
+\def\ceighthrest{\vertcenter\eighthrest}
+\def\csixteenthrest{\vertcenter\sixteenthrest}
+\def\cthirtysecondrest{\vertcenter\thirtysecondrest}
+\def\csixtyfourthrest{\vertcenter\sixtyfourthrest}
+\def\chundredtwentyeighthrest{\vertcenter\hundredtwentyeighthrest}
+
+\def\lsingledot{\kern-\notewidth\singledot}
+\def\ldoubledot{\kern-\notewidth\doubledot}
+\def\ltripledot{\kern-\notewidth\tripledot}
+
+\maccentdef\sforzato{30}{-3/2}
+\maccentdef\marcato{20}{-1/1}
+\maccentdef\imarcato{21}{1/1}
+\maccentdef\staccato{24}{-1/3}
+\maccentdef\istaccato{25}{1/3}
+\maccentdef\staccatissimo{28}{-5/5}
+\maccentdef\istaccatissimo{29}{2/5}
+\maccentdef\portato{18}{-6/5}
+\maccentdef\iportato{19}{3/5}
+\maccentdef\tenuto{26}{-1/1}
+\maccentdef\itenuto{27}{1/1}
+\maccentdef\fermata{80}{-1/1}
+\maccentdef\ifermata{81}{1/1}
+
+\mdef\spicato{28}
+\mdef\ispicato{29}
+\mdef\upbow{23}
+\mdef\downbow{22}
index 30d2d34c1af7d91ed1f67d2213866d0593c0779c..9e71e8ddda2c9573048601483afcfb780a3d0476 100644 (file)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % set fonts and primary dimensions
 \def\musixtwentydefs{
-        \font\textfont=cmr10
-        \font\meterfont=cmbx12
-        \font\slurufont=xslu20
-        \font\slurdfont=xsld20
-        \font\slurhfont=xslz20
-        \font\hslurufont=xslhu20
-        \font\hslurdfont=xslhd20
-        \font\hslurhfont=xslhz20
-        \font\musicfnt=musix20
-        \font\musicdraw=musixsps
-        \font\italicfont=cmti10
-        \font\dynfont=cmbxti10 scaled \magstep1
-        \font\mathfont=cmsy10
         \balkheight=20pt
         \notewidth=6pt
         \noteheight=5pt
         \staffrulethickness=0.4pt
+        \musixtwentyfonts
         \musixcalc
 }
 
-
 \def\musixsixteendefs{
-        \font\textfont=cmr8
-        \font\meterfont=cmbx12
-        \font\italicfont=cmti8
-        \font\slurufont=xslu16
-        \font\slurdfont=xsld16
-        \font\slurhfont=xslz20 % sigh
-        \font\hslurufont=xslhu16
-        \font\hslurdfont=xslhd16
-        \font\hslurhfont=xslhz20
-        \font\musicfnt=musix16
-        \font\dynfont=cmbxti12
-        \font\musicdraw=musixsps
-        \font\mathfont=cmsy8
         \balkheight=16pt
         \staffrulethickness=0.4pt
         \notewidth=5pt
         \noteheight=4pt
+        \musixsixteenfonts
         \musixcalc
 }
 
 % big fat marks, if errors are detected.
 \def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
 \def\scorelineerrormark{\placebox{0pt}{-10pt}{\bf L!}}
+\def\unknown{{\bf u}}
index f1cda10fcbc0aaa31b4be3745fcc5580fcdffc68..91eb34260ad258f3820791b74a2a9175c2b55cab 100644 (file)
@@ -1,4 +1,36 @@
 
+\def\musixtwentyfonts{
+  \font\textfont=cmr10
+        \font\meterfont=cmbx12
+        \font\slurufont=xslu20
+        \font\slurdfont=xsld20
+        \font\slurhfont=xslz20
+        \font\hslurufont=xslhu20
+        \font\hslurdfont=xslhd20
+        \font\hslurhfont=xslhz20
+        \font\musicfnt=musix20
+        \font\musicdraw=musixsps
+        \font\italicfont=cmti10
+        \font\dynfont=cmbxti10 scaled \magstep1
+        \font\mathfont=cmsy10
+}
+
+
+\def\musixsixteenfonts{
+        \font\textfont=cmr8
+        \font\meterfont=cmbx12
+        \font\italicfont=cmti8
+        \font\slurufont=xslu16
+        \font\slurdfont=xsld16
+        \font\slurhfont=xslz20 % sigh
+        \font\hslurufont=xslhu16
+        \font\hslurdfont=xslhd16
+        \font\hslurhfont=xslhz20
+        \font\musicfnt=musix16
+        \font\dynfont=cmbxti12
+        \font\musicdraw=musixsps
+        \font\mathfont=cmsy8
+}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % provide interface to musixtex fonts 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%