]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.46.jcn1 release/0.0.46.jcn1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 2 Apr 1997 14:59:40 +0000 (16:59 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 2 Apr 1997 14:59:40 +0000 (16:59 +0200)
186 files changed:
.dstreamrc
.version
ANNOUNCE
Documentation/CodingStyle.pod
Documentation/error.pod
Documentation/examples.pod [new file with mode: 0644]
Documentation/faq.pod
Documentation/index.pod
Documentation/lilygut.pod
Documentation/lilyinput-pre-0.1.pod [deleted file]
Documentation/lilypond.pod
INSTALL.text
NEWS
TODO
bin/make_website
configure
configure.in
flower/.version
flower/Makefile
flower/NEWS
flower/full-storage.cc [new file with mode: 0644]
flower/include/class-name.hh [new file with mode: 0644]
flower/include/cursor.hh
flower/include/cursor.icc [new file with mode: 0644]
flower/include/cursor.inl [deleted file]
flower/include/fproto.hh
flower/include/full-storage.hh [new file with mode: 0644]
flower/include/interval.hh
flower/include/interval.tcc
flower/include/link.hh
flower/include/link.icc [new file with mode: 0644]
flower/include/link.inl [deleted file]
flower/include/list.hh
flower/include/list.icc [new file with mode: 0644]
flower/include/list.inl [deleted file]
flower/include/matrix-storage.hh [new file with mode: 0644]
flower/include/matrix.hh
flower/include/plist.hh
flower/include/smat.hh [deleted file]
flower/include/string-data.icc [new file with mode: 0644]
flower/include/string-data.inl [deleted file]
flower/include/string-handle.hh
flower/include/string-handle.icc [new file with mode: 0644]
flower/include/string-handle.inl [deleted file]
flower/include/vsmat.hh [deleted file]
flower/matrix.cc
flower/smat.cc [deleted file]
flower/string-convert.cc
flower/stringutil.cc
init/dynamic.ini
init/register.ini [new file with mode: 0644]
init/symbol.ini
init/table_sixteen.ini
input/cadenza.ly
input/coriolan-alto.ly
input/kortjakje.ly
input/martien.ly
input/midi.ly
input/scales.ly
input/scsii-menuetto.ly
input/standchen.ly
input/twinkle.ly
input/wohltemperirt.ly
lib/duration-convert.cc
lib/include/debug.hh
lib/include/input.hh [new file with mode: 0644]
lib/include/proto.hh
lib/source-file.cc
lily/.version
lily/Makefile
lily/Stable.make [new file with mode: 0644]
lily/bar-reg.cc
lily/beam.cc
lily/clef-reg.cc
lily/command-request.cc
lily/complex-staff.cc
lily/complex-walker.cc
lily/crescendo.cc
lily/debug.cc
lily/dynamic-reg.cc
lily/global-regs.cc [new file with mode: 0644]
lily/grouping.cc
lily/headreg.cc
lily/identifier.cc
lily/include/class-name.hh [deleted file]
lily/include/command-request.hh
lily/include/complex-walker.hh
lily/include/crescendo.hh
lily/include/dynamic-reg.hh
lily/include/identifier.hh
lily/include/input-register.hh [new file with mode: 0644]
lily/include/input-score.hh
lily/include/input-staff.hh
lily/include/input.hh [new file with mode: 0644]
lily/include/lyric-register.hh [new file with mode: 0644]
lily/include/lyric-staff.hh [deleted file]
lily/include/lyric-walker.hh [deleted file]
lily/include/musical-request.hh
lily/include/my-lily-parser.hh
lily/include/register-group.hh
lily/include/register.hh
lily/include/request.hh
lily/include/score-column.hh
lily/include/score.hh
lily/include/script-def.hh
lily/include/spanner.hh
lily/include/staff-elem-info.hh
lily/include/staff-elem.hh
lily/include/staff-info.hh [new file with mode: 0644]
lily/include/staff-regs.hh [new file with mode: 0644]
lily/include/staff-sym-reg.hh [new file with mode: 0644]
lily/include/staff-sym.hh [new file with mode: 0644]
lily/include/staff.hh
lily/include/staffsym.hh [deleted file]
lily/include/swallow-reg.hh [new file with mode: 0644]
lily/include/text-def.hh
lily/include/time-description.hh
lily/include/voice-element.hh
lily/include/voice-group-regs.hh
lily/include/voice-regs.hh
lily/include/walk-regs.hh
lily/input-music.cc
lily/input-register.cc [new file with mode: 0644]
lily/input-score.cc
lily/input-staff.cc
lily/input.cc [new file with mode: 0644]
lily/key-reg.cc
lily/local-key-reg.cc
lily/lyric-item.cc
lily/lyric-register.cc [new file with mode: 0644]
lily/lyric-staff.cc [deleted file]
lily/lyric-walker.cc [deleted file]
lily/main.cc
lily/meter-reg.cc
lily/midi-output.cc
lily/midi-walker.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/p-col.cc
lily/p-score.cc
lily/parser.y
lily/register-group.cc
lily/register.cc
lily/score.cc
lily/scores.cc
lily/script-reg.cc
lily/slur-reg.cc
lily/slur.cc
lily/spanner.cc
lily/staff-column.cc
lily/staff-elem-info.cc
lily/staff-elem.cc
lily/staff-info.cc [new file with mode: 0644]
lily/staff-regs.cc [new file with mode: 0644]
lily/staff-sym-reg.cc [new file with mode: 0644]
lily/staff-sym.cc [new file with mode: 0644]
lily/staff-walker.cc
lily/staff.cc
lily/staffline.cc
lily/staffsym.cc [deleted file]
lily/stem-beam-reg.cc
lily/stem.cc
lily/swallow-reg.cc [new file with mode: 0644]
lily/template3.cc
lily/text-def.cc
lily/text-reg.cc
lily/text-spanner.cc
lily/time-description.cc
lily/voice-element.cc [new file with mode: 0644]
lily/voice-elt.cc [deleted file]
lily/voice-group-regs.cc
lily/voice-regs.cc
lily/voice.cc
lily/walk-regs.cc
lily/warn.cc
make/Files.make
make/Makefile
make/Sources.make [deleted file]
make/Targets.make
make/Toplevel.make.in
make/User.make
make/Variables.make
make/lilypond.spec.in
mi2mu/midi-track.cc
tex/lilyponddefs.tex

index 5a6d7a577fd82216d3c3073aa9cd40476b66992b..c992908ec43a1c50b96cd66fd5c80ee8de7330da 100644 (file)
@@ -1,6 +1,7 @@
 # class name           silence?
 Dstream                        1
 
+File_path              1
 My_lily_lexer          1
 PCol                   1
 Score_column           1
@@ -42,7 +43,7 @@ Time_description      1
 Melodic_req            0
 Midi_walker            1
 Stem_req               1
-Group_change_req       1
+Group_change_req       0
 Script_req             1
 Colinfo                        1
 Word_wrap              1
index da73d6405edc57c6f7c58c5139db73a24c21f64a..0aa685e95db6acde06c899f692eede803d91adfb 100644 (file)
--- a/.version
+++ b/.version
@@ -1,7 +1,7 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 45
+TOPLEVEL_PATCH_LEVEL = 46
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL = .jcn1
index afcf2ffd5dcea4e8282c8ecfc054f67de75ae244..f011b485f39c57be97fb8168fddaab35b4a625e2 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,15 +1,27 @@
 
-[Draft version]
+Do you pine for the nice days of Linux 0.95, when men were men and
+wrote their own applications? Are you without a nice project and just
+dying to cut your teeth into a bleeding edge application you can
+modify for your needs. Do you find it frustrating that everything
+works in LaTeX?  No more all-nighters to get a nifty program working?
+Then this post might be just for you!
 
-CALL FOR HACKERS: LilyPond, the Music Typesetter
+I have been working very hard on a music typesetting system (called
+LilyPond) the past half year, and I finally think it is ready to be
+used and hacked at by a larger public than me and my co-developer.
 
-[Sorry if this is a bit off-topic; I want to announce this software to
-small crowd, because it is still test-stage]
+Sources for this project are on
 
-Hi net!
+       ftp://pcnov095.win.tue.nl/pub/lilypond/
 
-this is to announce the availability of the first public release
-(v0.1) of my music typesetter.
+detailed info and examples can be found on the webpage at:
+
+       http://www.stack.nl/~hanwen/lilypond/index.html
+
+(it is somewhat lousy, but I have more important things to do).
+
+
+[DETAILED DESCRIPTION]
 
 WHAT IS LILYPOND
 
@@ -20,100 +32,46 @@ output medium. (this is handy because there exist music fonts for TeX)
 
 As a bonus, you can also output a MIDI file of what you typed.
 
-HOW DOES IT WORK
-
-The input is a script file (example appended) which is read. The
-script file is a "music definition", ie, you type the melody as if it
-is read out loud
-
-LilyPond interprets this melody and generates appropriate output items
-(balls, stems, beams), and calculates where they should be put. Then
-it outputs a TeX file. Warning: this said calculations is *slow* (a full
-page of music typically takes 1 minute on my 486/66)
+The input is a script file which is read. The script file is a "music
+definition", ie, you type the melody as if it is read out loud 
 
-WHY IS THIS A TEST VERSION
+WHAT IS NEEDED?
 
-There a lot of advanced features (grace notes, piano staffs) which are
-VapourFeatures (tm). We're not sure about the language. It may change;
-having a large user base is a burden then.
+for compilation you need
 
-WHY A CALL FOR HACKERS
+       Unix. (Win32 is known to work, too)
+       GNU C++ v2.7 or better, with libg++ installed.
+       GNU make. 
+       Flex (2.5.1 or better). 
+       Bison.
 
-Currently, the development team has three people. I'd this project to
-have more people working on it (there is a lot of work to be done) I
-think this program is pretty original, so join in if you know anything
-about music and computers!
+for running you need
 
-As an aside, I really like the anarchist approach of linux development.
+       TeX
+       The MusixTeX fonts. (I use those  in MusixTeX T.59)
 
-WHAT HAS TO BE DONE
+FEATURES
 
-LilyPond is written in Gnu C++, and it is (if I say so myself) written
-very cleanly (Lots of classes, lots of comments, small files/small
-functions) and with extensions in mind.
+ASCII script input, with identifiers (for music reuse), customizable
+notenames
 
-       - Coding. For this time, there won't any biggish (global)
-source hackings. There are a lot of small projects which could use
-some work.
+MIDI output lets you check if you have entered the correct notes.
+MIDI to Mudela conversion through the mi2mu program.
 
-       - Some TeX hacking. I know little about TeX
+Multiple staffs in one score. Each staff can have a different meters.
+Multiple voices within one staff; beams optionally shared between
+voices. (well, more than 2 voices won't look pretty --yet.)  Multiple
+scores within one input file. Each score is output to a different
+file.
 
-       - Documentation. I don't have time for this
-
-I WANT MORE INFO!
-
-You can download it at:
-
-       ftp://pcnov095.win.tue.nl/pub/lilypond
-
-or visit the incredibly lousy webpage at:
-
-       http://www.stack.nl/~hanwen/lilypond/index.html
+Beams, slurs, chords, super/subscripts (accents and text), triplets,
+general n-plet (triplet, quadruplets, etc.), lyrics, transposition
+dynamics (both absolute and hairpin style) clef changes, meter
+changes, cadenza-mode, key changes, repeat bars
 
 
-EXAMPLE INPUT
-
-       % twinkle twinkle little star
-       melody = music {
-               $\clef\violin
-               c c | g g | a a | g g |
-               f f | e e | d d8.( e16 | )c2 |
-
-               g g | f f | e e | d d |
-               g g | f f | e( e8. f16 | e )d |
-
-               c c | g g | a a | g g |
-               f f | e e | d d8.( e16 | )c2 
-               $
-       }
-
-       text2 = music {
-               @
-               \textstyle "roman"
-               When the bla- zing sun is gone,2
-               When he no- thing shines up- on,2
-               Then you show your lit- tle light,2
-               Twin- kle, twin- kle, all the night.2
-               Twin- kle, twin- kle, lit- tle star,2
-               How I won- der what you are!2
-               @
-       }
-
-       english_staf = staff {
-               lyric 
-               music { text2 }
-       }
-
-       score {
-               staff { melodic music { melody }  }
-               staff { english_staf }
-               paper {
-                       unitspace 2.5cm
-               }
-               commands {
-                       meter {2 * 4}
-                       skip {24*2}
-                       bar "||"
-               }
-       }
+[Kudos to FSF, all linux hackers, and --of course-- especially
+GrandMaster Linus T, for the OS and The Announce :-]
 
+       Han-Wen Nienhuys <hanwen@stack.nl>
+       Jan Nieuwenhuizen <jan@digicash.com>
index 2f65fb775ebbc3235b9aa8b2d1fddc66965bbb2b..4661560af1de3231b0b95ff81d807a42fa29ee46 100644 (file)
@@ -33,6 +33,21 @@ this is to rewrite the program.
 
 -- Geoffrey James, "The Tao of Programming"
 
+=head2 FILES
+
+Definitions of classes that are only accessed via pointers
+(*) or references (&) shall not be included as include files.
+
+Include files in C++ always have the file name extension ".hh".
+
+Implementation files in C++ always have the file name
+extension ".cc".
+
+Inline definition files always have the file name extension ".icc".
+
+Template include files always have the file name extension ".tcc".
+
+
 =head2 INDENTATION
 
 in emacs:
@@ -58,7 +73,7 @@ in emacs:
        Class::member()
        Type Class::member_type_
 
-the C<type> is a Hungarian notation postfix for $C<Type>$. See below
+the C<type> is a Hungarian notation postfix for C<Type>. See below
 
 
 =head2 COMMENTS
@@ -176,7 +191,7 @@ existed. I feel so stupid and ashamed!
 
 =head2 Disadvantages
 
-=over 5
+=over 4
 
 =item *
 
@@ -216,7 +231,7 @@ remains an issue.
 
 =head2 Proposal
 
-=over 5
+=over 4
 
 =item *
 
@@ -241,7 +256,7 @@ with the parts of the names separated by underscores.
 
 =head2 Types
 
-=over 5
+=over 4
 
 =item C<byte>
 
@@ -297,7 +312,7 @@ unsigned integer
 The following types modify the meaning of the prefix. 
 These are precede the prefixes:
 
-=over 5
+=over 4
 
 =item C<a>
 
@@ -331,7 +346,7 @@ reference
 
 =back
 
-=over 5
+=over 4
 
 =item C<loop_i>
 
@@ -362,6 +377,3 @@ Variable foo: an C<Int*> that you must delete
 Variable bar: an C<Int*> that you must not delete
 
 =back
-
-
-
index e6ae1a689cc62798ac50445170787f94fb6954c9..371b73bd995f875effa56d4d1610e8ee3577afcc 100644 (file)
@@ -10,4 +10,8 @@ A correctly parsed F<input.ly> does not guarantuee output. A lot
 (most) of the checking is done B<after> parsing (some checks even are
 done after the break calc!); I'm sorry.
 
+Most errors come with a context of the Mudela element that originated
+it. This context may be slightly wrong: the parser sometimes reads a
+few tokens ahead to determine the syntax.
+
 [yep.. has to be written..]
diff --git a/Documentation/examples.pod b/Documentation/examples.pod
new file mode 100644 (file)
index 0000000..cd76ca1
--- /dev/null
@@ -0,0 +1,99 @@
+=head1 NAME
+
+LilyExamples - LilyPond example input
+
+=head1 DESCRIPTION
+
+This file documents the example inputfiles of LilyPond. Information of
+each file: 
+
+       title
+       description (composer, piece)
+       tested LilyPond features.
+       copyright info
+
+=head2 F<cadenza.ly>
+
+A cadenza to Mozart Horn concerto no. 3. 
+
+Features: cadenza mode.
+
+Copyright: public domain
+
+=head2 F<coriolan-alto.ly>
+
+Ludwig van Beethoven (1770-1792), Opus 62 Ouverture zu Collins
+Trauerspiel "Coriolan"
+
+a 5 bar fragment of the alto part
+
+Features: pushgroup, popgroup.
+
+=head2 F<error.ly>
+
+Error messages, context errors.
+
+=head2 F<fugue1.midi.ly>
+
+
+=head2 F<kortjakje.ly>
+
+Ah, vous dirais-je, maman" (Mozart, KV 265), bare 
+bones version.
+
+Features: example with lots of newbie comment.
+
+=head2 F<maartje.ly>
+
+Features: partial measure.
+
+=head2 F<martien.ly>, F<ml*.ly>
+
+Martien Lohman, Viola Quartet. 
+
+Features: n-plets, multi-staff scores.
+
+Copyright:  copyright Martien Lohman 1997. 
+
+=head2 F<midi.ly>
+
+Features: midi output.
+
+=head2 F<plet.ly>
+
+Features: plets.
+
+=head2 F<rhythm.ly>
+
+Features: auto beams, multiple parralel meters.
+
+=head2 F<scales.ly>
+
+Features: plets, accents, beam steepnesses.
+
+=head2 F<scsii-menuetto.ly>
+
+J. S. Bach, Solo Cello Suites. Suite II part v Menuetto I
+
+Features: breaking algorithm, chords, multivoice, accents
+
+=head2 F<standchen.ly> 
+
+St\"andchen (Serenade) "Leise flehen meine
+Lieder" D.957 No.4 Franz Schubert (1797-1828)
+
+Features: multivoice, accents, lyrics, chords, piano music
+
+=head2 F<twinkle.ly>
+
+Features: lyrics
+
+=head2 F<wohltemperirt.ly>
+
+JS Bach, Das Wohltemperirtes Clavier I, Fuga II (c-minor)
+
+a 7 bar fragment. 
+
+Features: stem direction, multivoice.
+
+Copyright: public domain
index d63883106d0e61c4af45280c52615cbd227e6407..6fc58b2f26c63394a5c1e241d851a64ac06fc226 100644 (file)
@@ -15,13 +15,13 @@ to make a few chords, but why do I have to type
 
        < { a() e } { c () g } >
 
-in stead of
+instead of
 
        <a( c(> <)e )g>
 
-to generate  slurs between the chords?
+to generate slurs between the chords?
 
-A: When you type 
+A L1: When you type 
 
        <a c> <e g>
 
@@ -40,57 +40,42 @@ formatting:
        >
 
 
-Q: Why are [] around the notes, and () inbetween?
+Q L2: Why are [] around the notes, and () inbetween?
 
-A: [] designate beams, a note can only be in one beam at the same
+A L2: [] designate beams, a note can only be in one beam at the same
 time. () is a slur, which connects notes.  You need to be able to 
 specify
 
        a()a()a
 
+Q L3: Why shouldn't I put all commands (\clef, \meter) inside the music?
 
-Q: I want a DOS/NT/W95 port.
-
-A0: Reconsider.  Try Linux.  It's fun!
-
-A1: Currently (patchlevel 27), LilyPond (and flowerLib) compiles, links
-and runs on windhoos-nt, using the cygnus gnu port (release b17.1). 
-I (JCN) only had to make a minor workaround for missing library calls.  
-Have a look at http://www.cygnus.com/gnu-win32.  To make LilyPond type
-C<make $OSTYPE>. (I am not promising to maintain this platform, it is just 
-that when having to use doze, i-m sometimes too lazy to reboot.)
-
-A2: I haven't had time to find a GCC crosscompiler (I<with> g++ and
-libg++, mind you) to DOS/win (in rpm, please :).
-
-
-Q: Why GPL?
-
-A: Yes.
-
-Q: Why shouldn't I put all commands (\clef, \meter) inside the music?
-
-A: You should do what you like, but at some time we will enable
+A L3: You should do what you like, but at some time we will enable
 quoting of music ("Stichnoten"). Besides if you are going to type an
 orchestral score, then you'd probably want to enter most of the meter,
 repeat commands only once.
 
+=head2 MISCELLANEOUS
+
+Q M1: Why GPL?
 
-Q: Could you implement feature XXXX? It is really easy, just extend
+A M1: Yes.
+
+Q M2: Could you implement feature XXXX? It is really easy, just extend
 the syntax to allow YYYY!
 
-A: If it is reasonable, I'll add XXXX to the TODO list. In general
+A M2: If it is reasonable, I'll add XXXX to the TODO list. In general
 finding a cute syntax (such as YYYY) isn't very hard. The complicated
 issue how to adapt the internals to do XXXX. The parser is really  a
 simple front end to the complicated internals. 
 
-Q: Why do I need g++ >= 2.7?
+Q M3: Why do I need g++ >= 2.7?
 
-A: By using g++ LilyPond is portable to all platforms which support
+A M3: By using g++ LilyPond is portable to all platforms which support
 g++ (there are quite a few). Not having to support other compilers
-saves us a I<lot> of trouble. LilyPond & FlowerLib uses:
+saves us a I<lot> of trouble. LilyPond and FlowerLib use:
 
-=over 6
+=over 4
 
 =item *
 builtin bool
@@ -115,3 +100,55 @@ named return values
 
 =back
 
+=head2 DOZE
+
+Q D1: I want a DOS/NT/W95 port.
+
+A D1.0: Reconsider.  Try Linux.  It's fun!
+
+A D1.1: Currently (patchlevel 27), LilyPond (and flowerLib) compiles, links
+and runs on windhoos-nt, using the cygnus gnu port (release b17.1). 
+I (JCN) only had to make a minor workaround for missing library calls.  
+Have a look at http://www.cygnus.com/gnu-win32.  To make LilyPond type
+C<make $OSTYPE>. (I am not promising to maintain this platform, it is just 
+that when having to use doze, i-m sometimes too lazy to reboot.)
+
+A D1.2: I haven't had time to find a GCC crosscompiler (I<with> g++ and
+libg++, mind you) to DOS/win (in rpm, please :).
+
+
+Q D2: I-m dozed enough to run the (sometimes bit stale) .exe-s you distribute. 
+Why do i need cygwin.dll?
+
+A D2: It-s all in this cut-n-paste:
+
+Minimalist GNU-Win32 Readme                   
+version 0.1.3                           
+March 20, 1997                       
+Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+
+[...]
+
+0.3 Fixes and Improvements          
+
+[...]
+In the "coming soon" category I have a version of the GNU Standard C++
+library ported to Mingw32. This means you can use iostreams, complex
+numbers and all those neat STL (Standard Template Library) things
+without needing the Cygwin DLL. I hope to put this port up for
+downloading soon (along with the source of course).
+       
+[...] 
+
+3.2 C++ Support                                                         
+
+To add C++ Support to the above the following extra files are required: 
+
+In C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2-    
+961023:                                                                         
+       cc1plus.exe                                                   
+
+Note that this does not include support for the standard C++ libraries
+(only the C run time libraries) or for iostreams. That support is still
+only available with the Cygwin32 API.
+
index d1e05d00e7639117d9b00cc996108a64a04b5a70..d6588acde243c232f0961b724fcc1b4df70bac13 100644 (file)
@@ -2,14 +2,34 @@
 
 LilyPond -- the Webpage
 
+Excuse me for this poor page. I don't really have time for doing this..
+
 =head1 DESCRIPTION
 
-Excuse me for this poor page. I don't really have time for doing this..
+Technically LilyPond is a preprocessor which generates TeX
+(or LaTeX) output which contains information to typeset a musical
+score. Practically it is a typesetter, which only uses TeX as an
+output medium. (this is handy because there exist music fonts for TeX)
 
-[and yes, i write webpages in POD :-]
+As a bonus, you can also output a MIDI file of what you typed.
+
+It translates script files (mudela files or F<*.ly>'s) into TeX input.
+Typesetting music is a complex task, whereas the message that printed
+music conveys is usually a simple one. LilyPond is a try at providing
+a simple interface for setting music.
 
 =head1 DOCUMENTATION
 
+=item *
+<a href=INSTALL.html
+>
+The installation instructions.
+</a
+>
+
+
+
+
 =item *
 <a href=lilypond.html
 >
@@ -46,7 +66,7 @@ errors
 >
 
 =item *
-<a href=lelieblond.png
+<a href=lelieblond.gif
 >
 The lilypond logo (Big)
 </a
@@ -55,36 +75,42 @@ The lilypond logo (Big)
 =item *
 <a href=lelie_logo.gif
 >
-The lilypond logo (in gif format)
+The lilypond logo (in gif format, medium size)
 </a
 >
 
+=item *
+<a href=example_output.html
+>
+examples: MIDI, PS, GIF and input.
+</a
+>
 
 =item *
-<a href=wohltemperirt.ly.txt
+<a href=examples.html
 >
-An example inputfile: from Bach's WTK: c-minor fugue
+info on examples
 </a
 >
 
 =item *
-<a href=wohltemperirt.gif
+<a href=TODO.txt
 >
-A Gif file of the example
+The TODO list.
 </a
 >
 
 =item *
-<a href=wohltemperirt.ps
+<a href=NEWS.txt
 >
-PS output
+The Change log
 </a
 >
 
 =item *
-<a href=wohltemperirt.midi
+<a href=CodingStyle.html
 >
-MIDI output
+The coding standards of the lilypond project.
 </a
 >
 
@@ -100,9 +126,18 @@ The DOC++ documentation of the C++ sources.
 Get it at ftp://pcnov095.win.tue.nl/pub/lilypond !
 =cut
 niet veranderen in expliciete URL. pod2* doet dit automaties.
+
+Should generate auto from POD sources.
+
 =pod
 
 
 =head1 AUTHOR
 
 Han-Wen Nienhuys <hanwen@stack.nl>, for this page
+
+<a href=sconstat/stats.html
+>
+Stats on this page.
+</a
+>
index 93a89b9eb73daa525be9cb00b1b8d057d81498c2..da7ebcea598b03e70f6162e56afe88c8450b95c7 100644 (file)
@@ -16,7 +16,7 @@ You should use doc++ to take a peek at the sources.
 
 LilyPond is a "5-pass" system:
 
-=over 5
+=over 4
 
 =item 1. Parsing:
 
@@ -45,9 +45,6 @@ are determined.
 
 Very simple, just walk all Line_of_* and follow the links over there
 
-=back
-
-
 =back
 
 =head1 Request_register
diff --git a/Documentation/lilyinput-pre-0.1.pod b/Documentation/lilyinput-pre-0.1.pod
deleted file mode 100644 (file)
index 1e04b19..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-=head1 NAME
-
-LilyInput -  LilyPond input format
-
-=head1 DESCRIPTION
-
-This page globally documents the the LilyPond input format, mudela.
-To get a better impression, please study some examples.
-
-=head2 Overview
-
-General format of a construct:
-
-       BLOCKNAME {  <info to go with this block>   }
-
-Some types allow declarations:
-
-       IDENTIFIER = BLOCKNAME {
-               <info to go with this block>
-       }
-
-       ..
-
-       BLOCKNAME {
-               IDENTIFIER
-               ...
-       }
-
-
-In musicmode, eg,
-
-       ''!c8.-"text"_v
-
-and in lyricmode, eg,
-
-       Twin- kle, twin- kle lit- tle star,2
-
-a lot of characters parse differently
-than in "command" mode, eg,
-
-       identifier = score { .. }
-
-So you have to signal this to the tokenizer. This is done with
-'$'. '$' is a delimiter, which used by the tokenizer only. The same
-goes for lyrics, it has a '@' delimiter.
-
-=item *
-musicmode: The brace still is used to group grammatical groups.
-
-=item *
-musicmode: "word" are preceded by a '\' (backslash)
-
-This means you can write some stuff in a zillion ways:
-
-=item 1.
-       $\var = \blockname { ... } $
-
-=item 2.
-       var = blockname { $ ... $ } 
-
-=item 3.
-       var = $ $ $\blockname {  ... $ } 
-
-=head2 Comments
-
-Not really crystallized; you can use '#' or '%' as line comment
-
-=head2 other
-
-LilyPond first reads 'symbol.ini', which contains declarations crucial
-to proper operation of LilyPond (symbol tables, note names).
-
-This language looks a lot like Rayce's (Rayce is a raytracer that I've
-written as a hobby project. I used as a practice program for writing
-(among others) C++ and Yacc. It also gave me RSI :-( ) which in turn
-owes a lot to the POVRay raytracer. Now, I know, musictypesetting and
-Raytracing do not necessarily require the same input format, but I was
-just to lazy to make up a new and/or better input format. Suggestions
-appreciated.
-=head1 NAME
-
-LilyInput -  LilyPond input format
-
-=head1 DESCRIPTION
-
-This page globally documents the the LilyPond input format, mudela.
-To get a better impression, please study some examples.
-
-=head2 Overview
-
-General format of a construct:
-
-       BLOCKNAME {  <info to go with this block>   }
-
-Some types allow declarations:
-
-       IDENTIFIER = BLOCKNAME {
-               <info to go with this block>
-       }
-
-       ..
-
-       BLOCKNAME {
-               IDENTIFIER
-               ...
-       }
-
-
-In musicmode, eg,
-
-       ''!c8.-"text"_v
-
-and in lyricmode, eg,
-
-       Twin- kle, twin- kle lit- tle star,2
-
-a lot of characters parse differently
-than in "command" mode, eg,
-
-       identifier = score { .. }
-
-So you have to signal this to the tokenizer. This is done with
-'$'. '$' is a delimiter, which used by the tokenizer only. The same
-goes for lyrics, it has a '@' delimiter.
-
-=item *
-musicmode: The brace still is used to group grammatical groups.
-
-=item *
-musicmode: "word" are preceded by a '\' (backslash)
-
-This means you can write some stuff in a zillion ways:
-
-=item 1.
-       $\var = \blockname { ... } $
-
-=item 2.
-       var = blockname { $ ... $ } 
-
-=item 3.
-       var = $ $ $\blockname {  ... $ } 
-
-=head2 Comments
-
-Not really crystallized; you can use '#' or '%' as line comment
-
-=head2 other
-
-LilyPond first reads 'symbol.ini', which contains declarations crucial
-to proper operation of LilyPond (symbol tables, note names).
index f4dd08b08c7c5e2796a9f618c9ca428a377f4884..da1d68bf3fab7cd5a31088a8a16d3664d5d4d56d 100644 (file)
@@ -90,6 +90,7 @@ multiple stafftypes (melodic, rhythmic) [broken from  pl28 on]
 
 beams, slurs, chords, super/subscripts (accents and text), triplets,
 general n-plet (triplet, quadruplets, etc.), lyrics, transposition
+dynamics (both absolute and hairpin style)
 
 =item *
 
@@ -208,7 +209,8 @@ quality. If you're not discouraged; this is what I type in my xterm:
 This is what the output looks like over here:
 
        LilyPond 0.0.40 #0/FlowerLib 1.1.7 #2. Compile: Mar 11 1997, 22:58:47 (g++ 2.7.2)
-       Parsing ... [./init//symbol.ini[./init//dynamic.ini][./init//dutch.ini][./init//script.ini][./init//table_sixteen.ini]][./input/wohltemperirt.ly]
+       Parsing ... [./init//symbol.ini[./init//dynamic.ini][./init//dutch.ini]
+       [./init//script.ini][./init//table_sixteen.ini]][./input/wohltemperirt.ly]
        Setting up music ...Processing music ............
        Preprocessing ...
        Calculating column positions ... [3][6][9]
@@ -265,10 +267,18 @@ includes files from the directory F<init/>.
 
 =back
 
+=head1 ENVIRONMENT
+
+B<LILYINCLUDE> an (one) additional directory for finding lilypond data.
+
 =head1 SEE ALSO
 
+mudela(5)
+
 There are some documentation files  in the subdirectory F<Documentation/>,
-among others: lilygut, lilyinput, error, faq,
+among others: lilygut,  error, faq,
+
+http://www.stack.nl/~hanwen/lilypond/index.html
 
 =head1  REMARKS
 
index 66e6a45bce7bf9b4a8542ce0d08e47b381e3f6c8..72bd01f9a1ff38485f8aea932c2110595ed371d7 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
 
 
 
-25/Mar/97                LilyPond 0.0.45                        1
+25/Mar/97                LilyPond 0.0.46                        1
 
 
 
@@ -127,7 +127,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-25/Mar/97                LilyPond 0.0.45                        2
+25/Mar/97                LilyPond 0.0.46                        2
 
 
 
@@ -193,6 +193,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-25/Mar/97                LilyPond 0.0.45                        3
+25/Mar/97                LilyPond 0.0.46                        3
 
 
diff --git a/NEWS b/NEWS
index ea2ae1e6dfa9ac6fe6f79c5ec26f023e86919f90..239dd52b9aa61dd5d8d96f551c38d3e01eb50aef 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,34 @@
+pl 46.jcn1
+Bugfix
+       - reincluded {interval,pcursor,plist}.tcc
+       - renamed Interval::elt_q to elt_b, invoking of empty to empty_b
+       - readded second (0) arg to warning function (only lily exports
+         a warning(String) function)
+       - fixed dist make/Files.make
+
+pl 46
+       - examples.pod
+       - LILYINCLUDE env var.
+       - push/popgroup
+       - website updated
+       - Swallow_register
+       - Lyric_register.
+       - Staff_sym_register
+       - user settable register config
+       - struct Input now used iso defined_ch_C_
+       - Walker_registers and Staff_registers separated
+       - dynamic-reg -> hairpins
+
+pl 44.jcn2
+       - doze configure/compile fixes
+       - doze make refixed
+       - faq
+       - install mudela manpage too
+       - RedHat spec lilypond.spec fixed
+       - target: rpm (make RedHat packages)
+
+******
+Mar 26
 pl 45
        - Removing unused Voice_regs & Voice_groups
        - -O2 bugfix
@@ -113,6 +144,7 @@ pl 41.hwn1
 pl 41.jn1
 Bugfix
        - doze compile
+*******
 pl 41
        - release
 pl 40.3
@@ -123,7 +155,6 @@ pl 40.3
 pl 40.hwn1
        - hairpin dynamics
        - notename now as identifier. Parser/lexer cleanup
-       - ''!a now a!'' (NOT!?)
 
 pl 40.2
        - mi2mu --blonde-durations, --no-silly options.
@@ -147,6 +178,7 @@ Bugfix
 
 
 ******
+Mar 11
 pl 40
        - release
 
@@ -285,6 +317,7 @@ Examples
        - fixed midi.ly
 
 *******
+Feb 25
 pl 35
        - Register_group
 Bugfix
@@ -394,6 +427,7 @@ Examples
 Bugfix
        - calcideal assertion bugfix
 *******
+Feb 12 13:55
 pl 30
 
 Features
@@ -471,6 +505,7 @@ Internal:
        - Voice_group_registers, Voice_registers, *_register
        - Complex_staff
 *******
+ Jan 27 '97 
 pl 25
        - other clefs added, keys typeset properly (MB)
 
@@ -519,7 +554,8 @@ Internal changes:
        - dependencies for Staff_elem's
 
 *******
-pl 20:
+Dec 23 
+pl 20: 
        - updated doco to .pod
        - include files from .ly
 Internal changes:
@@ -560,6 +596,7 @@ pl 14
        - Input_{score/staff}
 
 *******
+Dec  2 
 pl 13
        - Horizontal/Vertical music
        - Input_commands
diff --git a/TODO b/TODO
index 95fbfc684534d660bed863e3fd60476513e00ec5..522f9cafbe53c5bc9a85d4c74783a5981559d0a1 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,11 +1,10 @@
 before 0.1
-       
+       * update 20 pt table
+
        * remove spurious/outdated comments in .ly, debug .ly
 
        * pushgroup, popgroup.
 
-       * basic dynamics
-
        * decent TeX page layout
 
        * per-pstaff item-widths
@@ -22,8 +21,6 @@ MAKE-STUFF
 
        * flower config: separate optiflags.
 
-       * sort out headers, see m2m
-
        * do platform stuff: configure, header(s), targets, build (out?)
        
 BUGS
@@ -42,8 +39,6 @@ BUGS
 
 SEVERELY LACKING:
 
-       * hairpins
-
        * grace notes
 
 FURTHER FOR ORCHESTRAL SCORE:
@@ -56,7 +51,7 @@ FURTHER FOR ORCHESTRAL SCORE:
 
 INPUTLANGUAGE
 
-       * read ENV for include /init path 
+       * unix style paths for LILYINCLUDE ENV
 
        * configure pitch_byte
 
@@ -68,11 +63,20 @@ INPUTLANGUAGE
 
        * rest name configurable
 
+       * Raw request syntax
+
        * uniformate: \clef\violin, \clef"violin", \geometric 1.4, 
          \meter{ 2/4 }, etc.
 
+       * subtime with Subtle_reqs
+
 SMALLISH PROJECTS
 
+       * bugreport to doc++ devel: struct not in class hier; public
+       virtual baseclasses
+
+       * indentable stream for TeX stream, lily stream, Dstream.
+
        * key transposition
        
        * caching breakpoints / saving them. 
@@ -118,7 +122,6 @@ SMALLISH PROJECTS
 
        * caching of Register_group_register hierarchies.
 
-
        * use (char *) iso. String for communication between lexer and
        parser.
 
@@ -156,6 +159,8 @@ FUTURE
 
        * guitar chord
 
+       * Junk Staff_column, and find the requests while walking the Voices.?
+
        * better beamslope calculation: QLP for beams?
 
        * implement better breaking algorithm
index 5b360b94fbdb5bb5113ec6af568cefde61b1b9cb..e728bf9d2715fd4519e4cbac647c3c4f00811972 100755 (executable)
@@ -1,4 +1,6 @@
 #!/usr/bin/perl -w
+# stuff should be generated in out directory.
+
 sub
        set_hrefs
 {
@@ -22,25 +24,93 @@ sub all_refs
 }
 
 local $base="lilypond/";
-local @examples=("wohltemperirt");
+local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto");
+
+#mkdir "lilypond";
+sub
+    gen_html
+{
+    print "generating HTML";
+    foreach $a (<*.pod>) {
+       $f = $a;
+       $f =~ s/.pod/.html/;
+
+       system "pod2html $a"    if ( ! -f $f ) ;
+    }
+}
+
+sub
+    gen_examples
+{
+    print "generating examples: ";
+    foreach $a (@examples) {
+       print "$a\n";
+       $texfile="test";
+       $tex = "tex $texfile";
+       if ($a eq "standchen" || $a eq "scsii-menuetto") {
+           $tex = "latex input/$a";
+           $texfile = "$a";
+       }
+       if ( ! -f "$a.ly.txt" ) {
+           system "ln ../input/$a.ly ./$a.ly.txt";
+       }
+       if ( ! -f "$a.ps.gz" ) {
+           system "cd ..; lilypond input/$a;$tex;".
+               "dvips -o $a.ps $texfile;";
+       }
+       # generate the pixmap at twice the size, then rescale (for antialiasing)
+       if ( ! -f "$a.gif" ) {
+           system "mv ../$a.ps $a.ps; ".
+               "mv ../lelie.midi ../$a.midi $a.midi; ".
+                   "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
+           system "gzip $a.ps";
+       }   
+    }
+}
 
-system  'pod2html';
 
-print "generating examples";
+sub
+    gen_list
+{
+    open HTMLLIST, ">example_output.html";
+    print HTMLLIST "<title>LilyPond examples</title>\n";
+    foreach $a (@examples) {
+       $name=$a;
+       print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
+       $cmd= "head ../input/$a.ly | grep \^% \| sed \"s/^%/    /\"";
+       $desc = `$cmd`;
+       print HTMLLIST "$desc\n</XMP>";
 
-foreach $a (@examples) {
-    $texfile="test";
-    system "ln ../input/$a.ly ./$a.ly.txt";
-    system "cd ..; lilypond input/$a; tex $texfile;".
-       "dvips -o $texfile.ps $texfile;";
+       $inputf="$a.ly.txt";
+       $giff="$a.gif";
+       $psf="$a.ps.gz";
+       $midif="$a.midi";
+       
+       print HTMLLIST "<ul>
+<li><a href=$inputf> The input file</a>
+<li><a href=$giff>The output (gif)</a>
+<li><a href=$psf>The output (PS)</a>
+<li><a href=$midif>The output (MIDI)</a>
+</ul>";
+    }
+}
+sub
+    copy_files
+{  
+    print `ln -s ../out ./docxx` if ( ! -x "docxx" ) ;
+    system "cp ../TODO ./TODO.txt";
+    system "cp ../NEWS ./NEWS.txt";
+}
 
-    # generate the pixmap at twice the size, then rescale (for antialiasing)
-    if ( ! -f "$a.gif" ) {
-    system "mv ../$texfile.ps $a.ps; ".
-       "mv ../lelie.midi $a.midi; ".
-        "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
-    }   
+sub
+    do_tar
+{
+     system " tar hcf website.tar *.html *.gif lelie_logo.png *.ps.gz *.ly.txt *.midi docxx/*;" .
+    "gzip -f9 website.tar;" if ( ! -f "website.tar" ) ;
 }
 
-system "cd out; tar hcf ../website.tar *.html *.gif lelie_logo.png *.ps *.ly.txt *.midi docxx/;" .
-    "gzip -f9 website.tar;"
+gen_html;
+gen_examples;
+gen_list;
+copy_files;
+do_tar;
index ad504fd23df85b1ce6000e48527e8fd726e81102..51d256534baf15160f691115b0becbb648c35281 100755 (executable)
--- a/configure
+++ b/configure
@@ -895,12 +895,13 @@ else
 
 
 
+
 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:904: checking for $ac_word" >&5
+echo "configure:905: 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
@@ -934,7 +935,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:938: checking for $ac_word" >&5
+echo "configure:939: 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
@@ -968,7 +969,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:972: checking for $ac_word" >&5
+echo "configure:973: 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
@@ -1002,7 +1003,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:1006: checking for $ac_word" >&5
+echo "configure:1007: 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
@@ -1038,7 +1039,7 @@ if test $TEXPREFIX = auto ; then
     # do something sensible if root hasn't specced dir yet attempts install
 
     echo $ac_n "checking TeX installation directory""... $ac_c" 1>&6
-echo "configure:1042: checking TeX installation directory" >&5
+echo "configure:1043: checking TeX installation directory" >&5
 
     ac_tmp_prefix=$prefix
     test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix
@@ -1101,7 +1102,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1105: checking how to run the C++ preprocessor" >&5
+echo "configure:1106: 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
@@ -1114,12 +1115,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 1118 "configure"
+#line 1119 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1139,17 +1140,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:1143: checking for FlexLexer.h" >&5
+echo "configure:1144: 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 1148 "configure"
+#line 1149 "configure"
 #include "confdefs.h"
 #include <FlexLexer.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1551,7 +1552,7 @@ fi
 eval "DIR_DATADIR=$datadir"
 DIR_DATADIR="$DIR_DATADIR/lilypond"
 echo $ac_n "checking ""... $ac_c" 1>&6
-echo "configure:1555: checking " >&5
+echo "configure:1556: checking " >&5
 
 cat << EOF > lib/out/config.hh
 
index f3837945ae1154a4aaf15b08e40242e50bfb7f5f..5d74dab46e7969340a991b41bca08c2c967cd5cb 100644 (file)
@@ -105,6 +105,7 @@ if test FIND = error; then
    AC_MSG_WARN(Couldn't find \`find'.  Please use --enable-texprefix)
 else 
     
+AC_SUBST(CXX)
 AC_SUBST(DEFINES)
 AC_SUBST(COMPILEINFO)
 AC_SUBST(AUTOHEADER)
index ea70f79da1407d4ea5e72f20bd88cdd3f2821932..ddcbb111b978b2d382cb39ba1d7f2667b8335610 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 9
+PATCH_LEVEL = 10
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index 3e04a983620e7c52e6b854e2ff2825a791885eb8..7de4c58459c9bebbe2f6a1a159e6b4a903424d60 100644 (file)
@@ -55,3 +55,6 @@ localdist: configure
 
 -include /dev/null $(DEPFILES)
 #
+
+localdistclean:
+       rm -f config.cache config.status
index 5a62d17bd0169adfebbec2bbaf8edc746c79398d..629d06e5ddfdbf078f066787f642d3e8901ab896 100644 (file)
@@ -1,6 +1,11 @@
+pl 1.1.10
+       - Matrix_storage naming
+       - Matrix_storage::try_right_multiply to help speed up
+         matrix multiply routines.
+
 pl 1.1.9
        - _C iso _c_l
-       - flower debug.
+       - flower-debug.
        
 pl 1.1.8
        
diff --git a/flower/full-storage.cc b/flower/full-storage.cc
new file mode 100644 (file)
index 0000000..e9fb1f3
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+  full-storage.cc -- implement Full_storage
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "full-storage.hh"
+
+void
+Full_storage::operator=(Full_storage const &fs)
+{
+    resize(fs.height_i_, fs.width_i_);
+    OK();
+    fs.OK();
+    for (int i=0; i<height_i_; i++)
+       for (int j=0; j<width_i_; j++)
+           els_p_p_[i][j]= fs.els_p_p_[i][j];
+}
+
+void
+Full_storage::OK() const
+{
+#ifndef NDEBUG
+    //    static Real dummy;           
+    assert(max_height_i_ >= height_i_ && max_width_i_ >= width_i_);
+    assert(height_i_ >= 0 && width_i_ >= 0);
+    assert(els_p_p_||!max_height_i_);
+#endif
+}
+void
+Full_storage::resize_cols(int newh)
+{
+    if (newh <= max_height_i_) {
+       height_i_=newh;
+       return;
+    }
+   
+    Real ** newa=new Real*[newh];
+    int j=0;
+    for (; j < height_i_; j++)
+       newa[j] = els_p_p_[j];
+    for (; j < newh; j++)
+       newa[j] = new Real[max_width_i_];
+    delete[] els_p_p_;
+    els_p_p_=newa;
+
+    height_i_ = max_height_i_ = newh;
+}
+
+void
+Full_storage::resize_rows(int neww)
+{
+    if (neww <= max_width_i_) {
+       width_i_=neww;
+       return;
+    }
+    for (int i=0; i < max_height_i_ ; i++) {
+       Real* newa = new Real[neww];
+       for (int k=0; k < width_i_; k++)
+           newa[k] = els_p_p_[i][k];
+
+       delete[] els_p_p_[i];
+       els_p_p_[i] = newa;
+    }
+    width_i_ = max_width_i_ = neww;    
+}
+
+Full_storage::~Full_storage() {
+    for (int i=0; i < max_height_i_; i++)
+       delete [] els_p_p_[i];
+    delete[] els_p_p_;
+}
+
+void
+Full_storage::resize(int rows, int cols)
+{
+    OK();
+    resize_cols(rows);
+    resize_rows(cols);
+
+}
+
+
+bool
+Full_storage::mult_ok(int i, int j) const
+{
+    return valid(i,j);
+}
+
+bool
+Full_storage::trans_ok(int i, int j) const
+{
+       return valid(i,j);
+} 
+
+
+void
+Full_storage::trans_next(int &i, int &j) const
+{
+    assert(trans_ok(i,j));
+    i++;
+    if (i >= height_i_) {
+       i=0;
+       j ++;
+    }
+}
+
+void
+Full_storage::mult_next(int &i, int &j) const
+{
+    assert(mult_ok(i,j));
+    j++;
+    if (j >= width_i_) {
+       j=0;
+       i++;
+    }
+}
+
+void
+Full_storage::delete_column(int k)
+{
+    assert(0 <= k &&k<width_i_);    
+    for (int i=0; i< height_i_ ; i++)
+       for (int j=k+1; j <width_i_; j++)
+           els_p_p_[i][j-1]=els_p_p_[i][j];
+    width_i_--;
+}
+void
+Full_storage::delete_row(int k)
+{
+    assert(0 <= k &&k<height_i_);
+    for (int i=k+1; i < height_i_ ; i++)
+       for (int j=0; j < width_i_; j++)
+           els_p_p_[i-1][j]=els_p_p_[i][j];
+    height_i_--;
+}
+
+
+void
+Full_storage::insert_row(int k)
+{
+    assert(0 <= k&& k <=height_i_);
+    resize_cols(height_i_+1);
+    for (int i=height_i_-1; i > k ; i--)
+       for (int j=0; j <width_i_; j++)
+           els_p_p_[i][j]=els_p_p_[i-1][j];
+
+}
+
+
+Array<Real>
+Full_storage::row(int n) const
+{
+    Array<Real> r;
+    for (int j = 0; j < width_i_; j++)
+       r.push(els_p_p_[n][j]);
+    return r;
+}
+
+Array<Real>
+Full_storage::column(int n) const
+{
+    
+    Array<Real> r;
+    for (int i = 0; i<height_i_; i++)
+       r.push(els_p_p_[i][n]);
+    return r;
+}
+
+
+Full_storage::Full_storage(Full_storage&s)
+{
+    init();
+    (*this) = s;
+}
+Matrix_storage*
+Full_storage::clone()
+{
+    return new Full_storage(*this);
+}
+
+
+Matrix_storage *
+Matrix_storage::get_full(int n, int m)
+{
+    return new Full_storage(n,m);
+}
+
+bool
+Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * right)
+{
+    if (dest->name() != Full_storage::static_name() ||
+       right->name() != Full_storage::static_name())
+       return false;
+
+    Full_storage *d_l = (Full_storage*)dest;
+    Full_storage *r_l = (Full_storage*)right;
+    
+    d_l->set_size(height_i_, r_l->width_i_);
+    for (int i=0; i < d_l->height_i_; i++)
+       for (int j = 0; j < d_l->width_i_; j++) {
+           Real &r(d_l->els_p_p_[i][j]);
+           r=0.0;
+           for (int k = 0; k < width_i_; k++)
+               r += els_p_p_[i][k] * r_l->els_p_p_[k][j];
+           
+       }
+    return true;
+    
+    
+}
+IMPLEMENT_STATIC_NAME(Full_storage);
+IMPLEMENT_STATIC_NAME(Matrix_storage);
diff --git a/flower/include/class-name.hh b/flower/include/class-name.hh
new file mode 100644 (file)
index 0000000..14ebf4c
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  class-name.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CLASS_NAME_HH
+#define CLASS_NAME_HH
+
+/** a macro to declare the classes name as a static and virtual function.
+  The static_name() can *not* be inlined (this might have the effect that 
+  s->name() != S::static_name(). Overlapping strings need not be merged in C++
+ */
+#define NAME_MEMBERS(c)        \
+static char const *static_name();\
+virtual char const *name() const{ return c::static_name(); } \
+int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
+
+#define IMPLEMENT_STATIC_NAME(c)\
+    char const *c::static_name() { return #c; } 
+    
+#endif // CLASS-NAME_HH
index af2e251a087a2729bbd2055751b51eb970b7771d..168ee50393daacc0a9b93390054904bfe0278232 100644 (file)
@@ -107,7 +107,7 @@ template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
 
 #include "pcursor.hh"
 #include "list.hh"
-#include "cursor.inl"
+#include "cursor.icc"
 #include "iterate.hh"
 
 #endif // CURSOR_HH 
diff --git a/flower/include/cursor.icc b/flower/include/cursor.icc
new file mode 100644 (file)
index 0000000..e103c88
--- /dev/null
@@ -0,0 +1,113 @@
+ // cursor.icc -*-c++-*-
+#ifndef CURSOR_INL
+#define CURSOR_INL
+#include <assert.h>
+
+
+template<class T>
+inline
+Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) : 
+    list_((List<T>&) list )
+{
+    if ( list.size() )
+        pointer_ = pointer ? pointer : list.top_;
+    else
+        pointer_ = pointer;
+}
+
+template<class T>
+inline
+Cursor<T>::Cursor( const Cursor<T>& cursor ) :
+    list_( cursor.list_ )
+{
+    pointer_ = cursor.pointer_;
+}
+
+template<class T>
+inline T&
+Cursor<T>::thing()
+{
+    assert( pointer_ );
+    return pointer_->thing();
+}
+
+template<class T>
+Cursor<T>
+Cursor<T>::operator =( const Cursor<T>& c )
+{   
+    assert( &list_ == &c.list_ );
+    pointer_ = c.pointer_;
+    return *this;
+}
+
+template<class T>
+inline void
+Cursor<T>::add( const T& th )
+{
+    list_.add( th, *this );
+}
+
+template<class T>
+inline void
+Cursor<T>::insert( const T& th )
+{
+    list_.insert( th, *this );
+}
+
+template<class T>
+inline  List<T>&
+Cursor<T>::list() const
+{
+    return list_;
+}
+
+template<class T>
+inline Link<T>*
+Cursor<T>::pointer()
+{
+    return pointer_;
+}
+
+template<class T>
+inline bool
+Cursor<T>::backward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::forward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::ok()
+{
+    return ( pointer_ != 0 );
+}
+
+
+template<class T>
+inline Cursor<T> 
+Cursor<T>::operator ++( int )    
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->next();
+    return r;
+}
+
+template<class T>
+inline Cursor<T>
+Cursor<T>::operator --( int )
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->previous();
+    return r;
+}
+
+#endif
diff --git a/flower/include/cursor.inl b/flower/include/cursor.inl
deleted file mode 100644 (file)
index 54d3703..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
- // cursor.inl -*-c++-*-
-#ifndef CURSOR_INL
-#define CURSOR_INL
-#include <assert.h>
-
-
-template<class T>
-inline
-Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) : 
-    list_((List<T>&) list )
-{
-    if ( list.size() )
-        pointer_ = pointer ? pointer : list.top_;
-    else
-        pointer_ = pointer;
-}
-
-template<class T>
-inline
-Cursor<T>::Cursor( const Cursor<T>& cursor ) :
-    list_( cursor.list_ )
-{
-    pointer_ = cursor.pointer_;
-}
-
-template<class T>
-inline T&
-Cursor<T>::thing()
-{
-    assert( pointer_ );
-    return pointer_->thing();
-}
-
-template<class T>
-Cursor<T>
-Cursor<T>::operator =( const Cursor<T>& c )
-{   
-    assert( &list_ == &c.list_ );
-    pointer_ = c.pointer_;
-    return *this;
-}
-
-template<class T>
-inline void
-Cursor<T>::add( const T& th )
-{
-    list_.add( th, *this );
-}
-
-template<class T>
-inline void
-Cursor<T>::insert( const T& th )
-{
-    list_.insert( th, *this );
-}
-
-template<class T>
-inline  List<T>&
-Cursor<T>::list() const
-{
-    return list_;
-}
-
-template<class T>
-inline Link<T>*
-Cursor<T>::pointer()
-{
-    return pointer_;
-}
-
-template<class T>
-inline bool
-Cursor<T>::backward()
-{
-    return ( pointer_ != 0 );
-}
-
-template<class T>
-inline bool
-Cursor<T>::forward()
-{
-    return ( pointer_ != 0 );
-}
-
-template<class T>
-inline bool
-Cursor<T>::ok()
-{
-    return ( pointer_ != 0 );
-}
-
-
-template<class T>
-inline Cursor<T> 
-Cursor<T>::operator ++( int )    
-{
-    Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->next();
-    return r;
-}
-
-template<class T>
-inline Cursor<T>
-Cursor<T>::operator --( int )
-{
-    Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->previous();
-    return r;
-}
-
-#endif
index c2fc98399c4bfad9da0f6e13d29ef15d9a49db31..030157cbe458fe9f1fbdb6d336e953181ac4312e 100644 (file)
@@ -43,7 +43,7 @@ struct String_data;
 struct String_handle;
 struct String_convert;
 struct String;
-struct virtual_smat;
+struct Matrix_storage;
 struct Vector ;
 struct Text_stream;
 struct Data_file;
diff --git a/flower/include/full-storage.hh b/flower/include/full-storage.hh
new file mode 100644 (file)
index 0000000..e409415
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+  full-storage.hh -- declare Full_storage
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef FULL_STORAGE_HH
+#define FULL_STORAGE_HH
+
+#include "varray.hh"
+#include "matrix-storage.hh"
+#include "real.hh"
+/// simplest matrix storage. refer to its baseclass for the doco.
+class Full_storage : public Matrix_storage
+{
+    /// height, width
+    int height_i_,width_i_;
+    /// maxima.
+    int max_height_i_, max_width_i_;
+    
+    /// the storage
+    Real** els_p_p_;
+
+    void
+    init() {
+       els_p_p_=0;
+       height_i_=width_i_=max_height_i_=max_width_i_=0;
+
+    }
+    
+    bool valid(int i, int j) const {
+       return (i>=0 && i < height_i_)
+           && (j < width_i_ && j >=0);
+    }
+    
+
+    void resize_rows(int);
+    void resize_cols(int);
+
+public:
+    virtual int rows() const {
+       return height_i_;
+    }
+    virtual int cols() const {
+       return width_i_;
+    }
+    
+    
+    virtual void set_size(int i, int j)
+    {
+       resize(i,j); //this could be more efficient.
+    }
+    
+    virtual void set_size(int i) {
+       set_size(i,i);
+    }
+    virtual void resize(int i, int j);
+    virtual void resize(int i) {
+       resize(i,i);
+    }
+    
+    virtual Real& elem(int i,int j) {
+       assert(valid(i,j));
+       return els_p_p_[i][j];
+    }
+    virtual Real const & elem(int i, int j) const {
+       assert(valid(i,j));
+       return els_p_p_[i][j];
+    }
+    virtual Array<Real> row(int i) const;
+    virtual Array<Real> column(int j) const;
+
+    Full_storage() {
+       init();
+    }
+    Full_storage(int i, int j) {
+       init();
+       set_size(i,j);
+    }
+    Full_storage(Full_storage&);
+    Full_storage(int i) {
+       init();
+       set_size(i);
+    }
+    void OK() const;
+    void operator=(Full_storage const &);
+    
+    virtual void insert_row(int k);
+    virtual void delete_row(int k);
+    virtual void delete_column(int k);
+
+    
+    ~Full_storage();
+    virtual bool mult_ok(int i, int j)const;
+    virtual void mult_next(int &i, int &j) const ;
+    virtual bool trans_ok(int i, int j) const;
+    virtual void trans_next(int &i, int &j) const;
+    virtual Matrix_storage * clone();
+    NAME_MEMBERS(Full_storage);
+    virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const * );
+};
+
+#endif // FULL_STORAGE_HH
index aae16381dbef62ed5133b332d49714d8260b5070..57f6a5607a8cd87f5cc8cc242f6d7876e4c7b29c 100644 (file)
@@ -55,7 +55,7 @@ struct Interval_t {
 
     T length() const;
     void set_empty() ;
-    bool empty() const { return left > right; }
+    bool empty_b() const { return left > right; }
     Interval_t() {
        set_empty();
     }
@@ -69,7 +69,7 @@ struct Interval_t {
        return *this;
     }
     String str() const;    
-    bool elt_q(T r);
+    bool elt_b(T r);
 };
 
 
index 6e7b0b1279c228982edacbf11eee9775bc07dce6..32eec44580228b76f322b47d79a026c031a548d3 100644 (file)
@@ -91,7 +91,7 @@ template<class T>
 String
 Interval_t<T>::str() const
 {
-    if (empty())
+    if (empty_b())
        return "[empty]";
     String s("[");
  
@@ -100,7 +100,7 @@ Interval_t<T>::str() const
 
 template<class T>
 bool
-Interval_t<T>::elt_q(T r)
+Interval_t<T>::elt_b(T r)
 {
     return r >= left && r <= right;
 }
index 22fcec4e71c905b6e17e528deac57cc8f075c046..218a0f8e55b8a988709a98b279ece6bbc022e53a 100644 (file)
@@ -33,6 +33,6 @@ private:
     Link<T>* next_;
 };
 
-#include "link.inl"
+#include "link.icc"
 
 #endif // __LINK_HH //
diff --git a/flower/include/link.icc b/flower/include/link.icc
new file mode 100644 (file)
index 0000000..3926d6b
--- /dev/null
@@ -0,0 +1,102 @@
+// link.inl -*-c++-*-
+#ifndef LINK_INL
+#define LINK_INL
+#include <assert.h>
+template<class T>
+inline
+void
+Link<T>::OK() const
+{
+#ifndef NDEBUG
+    if (previous_) {
+       assert(previous_->next_ == this);
+    }
+    if (next_) {
+       assert(next_->previous_ == this);
+    }
+#endif    
+}
+
+template<class T>
+inline
+Link<T>::Link( const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = next_ = 0;
+}
+
+template<class T>
+inline
+Link<T>::Link( Link<T>* previous, Link<T>* next, const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = previous;
+    next_ = next;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::next()
+{
+    return next_;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::previous()
+{
+    return previous_;
+}
+
+template<class T>
+inline
+void
+Link<T>::add( const T& thing )
+{
+    
+    Link<T>* l = new Link<T>( this, next_, thing );
+    if ( next_ )
+        next_->previous_ = l;
+    next_ = l;
+}
+
+template<class T>
+inline void
+Link<T>::insert( const T& thing )
+{
+    //    Link<T>* l = new Link<T>( next_, this, thing );
+                               // bugfix hwn 16/9/96
+    Link<T>* l = new Link<T>( previous_, this, thing );
+    if ( previous_ )
+        previous_->next_ = l;
+    previous_ = l;
+}
+
+/*
+    don't forget to adjust #l#'s top_ and bottom_.
+    */
+template<class T>
+inline void
+Link<T>::remove(List<T> &l)
+{
+    if ( previous_ ) 
+        previous_->next_ = next_;
+    else 
+       l.top_ = next_;
+
+    if ( next_ )
+        next_->previous_ = previous_;
+    else
+       l.bottom_ = previous_;
+}
+
+template<class T>
+inline
+T&
+Link<T>::thing()
+{
+    return thing_;
+}
+#endif
diff --git a/flower/include/link.inl b/flower/include/link.inl
deleted file mode 100644 (file)
index 3926d6b..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-// link.inl -*-c++-*-
-#ifndef LINK_INL
-#define LINK_INL
-#include <assert.h>
-template<class T>
-inline
-void
-Link<T>::OK() const
-{
-#ifndef NDEBUG
-    if (previous_) {
-       assert(previous_->next_ == this);
-    }
-    if (next_) {
-       assert(next_->previous_ == this);
-    }
-#endif    
-}
-
-template<class T>
-inline
-Link<T>::Link( const T& thing ) : 
-    thing_( thing )
-{
-    previous_ = next_ = 0;
-}
-
-template<class T>
-inline
-Link<T>::Link( Link<T>* previous, Link<T>* next, const T& thing ) : 
-    thing_( thing )
-{
-    previous_ = previous;
-    next_ = next;
-}
-
-template<class T>
-inline
-Link<T>*
-Link<T>::next()
-{
-    return next_;
-}
-
-template<class T>
-inline
-Link<T>*
-Link<T>::previous()
-{
-    return previous_;
-}
-
-template<class T>
-inline
-void
-Link<T>::add( const T& thing )
-{
-    
-    Link<T>* l = new Link<T>( this, next_, thing );
-    if ( next_ )
-        next_->previous_ = l;
-    next_ = l;
-}
-
-template<class T>
-inline void
-Link<T>::insert( const T& thing )
-{
-    //    Link<T>* l = new Link<T>( next_, this, thing );
-                               // bugfix hwn 16/9/96
-    Link<T>* l = new Link<T>( previous_, this, thing );
-    if ( previous_ )
-        previous_->next_ = l;
-    previous_ = l;
-}
-
-/*
-    don't forget to adjust #l#'s top_ and bottom_.
-    */
-template<class T>
-inline void
-Link<T>::remove(List<T> &l)
-{
-    if ( previous_ ) 
-        previous_->next_ = next_;
-    else 
-       l.top_ = next_;
-
-    if ( next_ )
-        next_->previous_ = previous_;
-    else
-       l.bottom_ = previous_;
-}
-
-template<class T>
-inline
-T&
-Link<T>::thing()
-{
-    return thing_;
-}
-#endif
index fbb79e6edf79b031cd79670cba2aafd54a691e3e..1cfa9f54edf397e88753ce3ab42f62cfffed02d7 100644 (file)
@@ -83,7 +83,7 @@ class List
     Link<T>* bottom_;
 };
 
-#include "list.inl"
+#include "list.icc"
 #include "cursor.hh"
 
 // instantiate a template:  explicit instantiation.
diff --git a/flower/include/list.icc b/flower/include/list.icc
new file mode 100644 (file)
index 0000000..df0687b
--- /dev/null
@@ -0,0 +1,56 @@
+// -*-c++-*-
+
+#ifndef LIST_INL
+#define LIST_INL
+
+template<class T>
+inline
+List<T>::List()
+{
+    set_empty();
+}
+
+template<class T>
+inline void
+List<T>::set_empty()
+{
+    top_ = bottom_ = 0;
+    size_ = 0;
+}
+
+template<class T>
+inline void
+List<T>::remove( Cursor<T> me )
+{
+    if ( me.ok() ){
+       Link<T> *lp = me.pointer();     
+       lp->remove(*this);
+       delete lp;
+        size_--;
+    }
+}
+
+template<class T>
+inline int
+List<T>::size() const
+{ 
+    return size_;
+}
+
+template<class T>
+inline Cursor<T>
+List<T>::top()const
+{
+    return Cursor<T>( *this, top_ );
+}
+
+
+template<class T>
+inline Cursor<T>
+List<T>::bottom()const
+{
+    return Cursor<T>( *this, bottom_ );
+}
+
+
+#endif
diff --git a/flower/include/list.inl b/flower/include/list.inl
deleted file mode 100644 (file)
index df0687b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*-c++-*-
-
-#ifndef LIST_INL
-#define LIST_INL
-
-template<class T>
-inline
-List<T>::List()
-{
-    set_empty();
-}
-
-template<class T>
-inline void
-List<T>::set_empty()
-{
-    top_ = bottom_ = 0;
-    size_ = 0;
-}
-
-template<class T>
-inline void
-List<T>::remove( Cursor<T> me )
-{
-    if ( me.ok() ){
-       Link<T> *lp = me.pointer();     
-       lp->remove(*this);
-       delete lp;
-        size_--;
-    }
-}
-
-template<class T>
-inline int
-List<T>::size() const
-{ 
-    return size_;
-}
-
-template<class T>
-inline Cursor<T>
-List<T>::top()const
-{
-    return Cursor<T>( *this, top_ );
-}
-
-
-template<class T>
-inline Cursor<T>
-List<T>::bottom()const
-{
-    return Cursor<T>( *this, bottom_ );
-}
-
-
-#endif
diff --git a/flower/include/matrix-storage.hh b/flower/include/matrix-storage.hh
new file mode 100644 (file)
index 0000000..8e34d60
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+  matrix-storage.hh -- declare Matrix_storage
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MATRIX_STORAGE_HH
+#define MATRIX_STORAGE_HH
+
+#include "varray.hh"
+#include "real.hh"
+#include "class-name.hh"
+
+/** 
+
+    base class for interface with matrix storageclasses.  There are no
+    iterators for matrixclasses, since matrices are (like arrays)
+    explicitly int-indexed.
+
+    Iteration is provided by *_next, *_ok, which update and check both
+    index variables simultaneously.
+
+    TODO
+    determine type of product matrix.
+
+*/
+class Matrix_storage {
+    
+
+public:
+    /// check invariants
+    virtual void OK() const=0;
+    
+    /// height of matrix
+    virtual int rows() const = 0;
+
+    /// width of matrix
+    virtual int cols() const = 0;
+      
+    /**  set the size. contents lost.       
+      PRE
+      i >=0, j>=0
+    */
+    virtual void set_size(int rows, int cols) = 0;
+    /**set the size to square dimen. contents lost
+      PRE
+      i>=0
+    */
+    virtual void set_size(int i) = 0;
+     /**set the size to i.
+
+      keep contents. If enlarged contents unspecified
+        
+      PRE
+      i>=0, j>=0
+    
+    */
+    virtual void resize(int rows, int cols ) = 0;
+  /**    
+    set the size to square dimen. contents kept
+    Keep contents. If enlarged contents are unspecified
+    
+    PRE
+    i>=0  
+    */
+    virtual void resize(int i) = 0;
+  
+    
+        /**
+    access an element.
+
+    Generate an errormessage, if this happens
+    in the 0-part of a sparse matrix.
+    */
+
+    virtual Real& elem(int i,int j) = 0;
+
+    /// access a element, no modify
+    virtual Real const & elem(int i, int j) const = 0;
+
+    virtual Array<Real> row(int i) const = 0;
+    virtual Array<Real> column(int j) const = 0;
+
+    
+    /**
+    add a row to the matrix before  row k. Contents
+    of added row are unspecified
+
+      0 <= k <= rows()
+    */
+    virtual void insert_row(int k)=0;
+
+    
+      /**
+      delete a row from this matrix.
+
+      PRE
+      0 <= k < rows();
+    */
+    virtual void delete_row(int k)=0;
+        virtual void delete_column(int k)=0;
+    virtual ~Matrix_storage() { }
+    virtual Matrix_storage *clone()=0;
+
+
+    
+    /**
+      at end of matrix?. when doing loop
+
+      for(i=0; i<h; i++)
+        for(j=0; j<w; j++)
+          ..
+
+    */
+    virtual bool mult_ok(int i, int j) const=0;
+
+    /**
+      walk through matrix (regular multiply).
+      get next j for row i, or get next row i and reset j.
+      this will make sparse matrix implementation easy.
+    
+      PRE
+      mult_ok(i,j)
+     */
+    virtual void mult_next(int &i, int &j) const  = 0;
+
+/**
+      valid matrix entry. return false if at end of row
+    */
+    virtual bool trans_ok(int i, int j) const=0;
+
+    /**
+      walk through matrix (transposed multiply).
+      Get next i (for column j)
+    
+      PRE
+      ver_ok(i,j)
+     */
+
+    virtual void trans_next(int &i, int &j) const  = 0;
+    /// generate a "Full_storage" matrix    
+    static Matrix_storage *get_full(int n, int m);
+    
+
+    virtual bool try_right_multiply(Matrix_storage *dest, 
+                                   const Matrix_storage *fact) ;
+    /**
+      RTTI.
+     */
+    NAME_MEMBERS(Matrix_storage);
+};
+
+
+
+inline bool
+Matrix_storage::try_right_multiply(Matrix_storage *, 
+                                   const Matrix_storage *)
+{
+    return false;
+}
+#endif // MATRIX_STORAGE_HH
+
index e4f447041bb1521c85246b04581135d76923e442..18ec1e33e91cf43fc3a2075977c2c9622543cee4 100644 (file)
@@ -2,7 +2,7 @@
 #define MATRIX_HH
 
 
-#include "vsmat.hh"
+#include "matrix-storage.hh"
 #include "vector.hh"
 
 /**  a Real matrix.  This is a class for a nonsquare block of #Real#s.  The
@@ -16,7 +16,7 @@
 
 
 class Matrix {
-    virtual_smat *dat;
+    Matrix_storage *dat;
     
 public:
     void OK() const { dat->OK(); }
index f9af4c693b662bfd2f8812e5fd397e39f9b2d500..1fc4d941ab0851e6890a32c92cc10b8915247700 100644 (file)
@@ -67,6 +67,6 @@ void PL_copy(IPointerList<T*> &dst,IPointerList<T*> const&src);
 #define IPL_instantiate(a) PL_instantiate(a); \
        template class IPointerList<a*>
 
-#include "plist.inl"
+#include "plist.icc"
 
 #endif
diff --git a/flower/include/smat.hh b/flower/include/smat.hh
deleted file mode 100644 (file)
index 05bdac4..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef SMAT_HH
-#define SMAT_HH
-#include "varray.hh"
-#include "vsmat.hh"
-#include "real.hh"
-/// simplest matrix storage. refer to its baseclass for the doco.
-class Full_storage : public virtual_smat
-{
-    /// height, width
-    int h,w;
-    /// maxima.
-    int maxh, maxw;
-    
-    /// the storage
-    Real** els;
-    void
-    init() {
-       els=0;
-       h=w=maxh=maxw=0;
-
-    }
-    
-    bool valid(int i, int j) const {
-       return (i>=0 && i < h)
-           && (j < w && j >=0);
-    }
-    
-
-    void resize_rows(int);
-    void resize_cols(int);
-
-public:
-    virtual int rows() const {
-       return h;
-    }
-    virtual int cols() const {
-       return w;
-    }
-    
-    
-    virtual void set_size(int i, int j)
-    {
-       resize(i,j); //this could be more efficient.
-    }
-    
-    virtual void set_size(int i) {
-       set_size(i,i);
-    }
-    virtual void resize(int i, int j);
-    virtual void resize(int i) {
-       resize(i,i);
-    }
-    
-    virtual Real& elem(int i,int j) {
-       assert(valid(i,j));
-       return els[i][j];
-    }
-    virtual Real const & elem(int i, int j) const {
-       assert(valid(i,j));
-       return els[i][j];
-    }
-    virtual Array<Real> row(int i) const;
-    virtual Array<Real> column(int j) const;
-
-    Full_storage() {
-       init();
-    }
-    Full_storage(int i, int j) {
-       init();
-       set_size(i,j);
-    }
-    Full_storage(Full_storage&);
-    Full_storage(int i) {
-       init();
-       set_size(i);
-    }
-    void OK() const;
-    void operator=(Full_storage const &);
-    
-    virtual void insert_row(int k);
-    virtual void delete_row(int k);
-    virtual void delete_column(int k);
-
-    
-    ~Full_storage();
-    virtual bool mult_ok(int i, int j)const;
-    virtual void mult_next(int &i, int &j) const ;
-    virtual bool trans_ok(int i, int j) const;
-    virtual void trans_next(int &i, int &j) const;
-    virtual virtual_smat * clone();
-};
-
-#endif
diff --git a/flower/include/string-data.icc b/flower/include/string-data.icc
new file mode 100644 (file)
index 0000000..5a3bb39
--- /dev/null
@@ -0,0 +1,210 @@
+/* -*-C++-*-
+  String_data.inl -- implement String_data
+
+  source file of Flower lib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef STRINGDATA_INL
+#define STRINGDATA_INL
+
+#include <assert.h>
+#include <memory.h>
+
+#include "string-data.hh"
+const int INITIALMAX=8;
+
+#include <sys/types.h>
+
+INLINE void 
+String_data::OKW() 
+{
+    assert (references == 1);
+}
+
+INLINE void 
+String_data::OK() 
+{
+    assert(maxlen >= length_i_);
+    assert(bool(data_byte_p_));
+    assert(references >= 1);
+}
+
+
+INLINE
+String_data::String_data() 
+{
+    references=0;
+    maxlen = INITIALMAX;
+    data_byte_p_ = new Byte[maxlen + 1];
+    data_byte_p_[0] = 0;
+    length_i_ = 0;
+}
+
+INLINE
+String_data::String_data(String_data const &src) 
+{
+    references=0;      
+    maxlen = length_i_ = src.length_i_;                
+    data_byte_p_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.      
+    memcpy( data_byte_p_, src.data_byte_p_, length_i_ + 1 );   
+}
+
+INLINE
+String_data::~String_data() 
+{
+    assert(references == 0);
+    delete[] data_byte_p_;
+}
+
+INLINE void 
+String_data::setmax(int j) 
+{      
+    OKW();
+    if (j > maxlen) {
+       delete data_byte_p_;
+       maxlen = j;
+       data_byte_p_ = new Byte[maxlen + 1];
+    
+       data_byte_p_[0] = 0;
+       length_i_ = 0;
+    }
+}
+
+/* this is all quite hairy:  
+        update of length_i_
+        update of maxlen
+        alloc of buffer
+        copying of buffer
+ needs blondification: 
+       split tasks
+       define change authority
+*/
+INLINE void 
+String_data::remax(int j) 
+{
+    OKW();
+    if (j > maxlen) {
+       Byte *p = new Byte[j + 1];      
+       memcpy( p, data_byte_p_, ( maxlen <? length_i_ ) + 1 );     
+       maxlen = j;
+       delete[] data_byte_p_;
+       data_byte_p_ = p;
+    }
+}
+
+INLINE void 
+String_data::tighten() 
+{ // should be dec'd const
+    maxlen = length_i_;
+    Byte *p = new Byte[maxlen + 1];        
+    memcpy( p, data_byte_p_, length_i_ + 1 );      
+    delete[] data_byte_p_;
+    data_byte_p_ = p;          
+}
+// assignment.
+INLINE void 
+String_data::set( Byte const* byte_C, int length_i ) 
+{
+    OKW();
+
+    assert( byte_C && byte_C != data_byte_p_);
+
+    length_i_ = length_i;
+    remax( length_i_ );     // copies too
+    memcpy( data_byte_p_, byte_C, length_i_ );
+    data_byte_p_[ length_i_ ] = 0;
+}
+
+INLINE
+void 
+String_data::set( char const* ch_C ) 
+{
+    set( (Byte const*)ch_C, strlen( ch_C ) );
+}
+
+
+/// concatenation.
+INLINE void 
+String_data::append( Byte const* byte_C, int length_i ) 
+{
+    OK();
+    OKW();
+    int old_i = length_i_;
+    
+    length_i_ += length_i;
+    remax( length_i_ );
+    memcpy( data_byte_p_ + old_i, byte_C, length_i );  
+    data_byte_p_[ length_i_ ] = 0;
+}
+
+INLINE
+void 
+String_data::operator += ( char const* ch_C ) 
+{
+    append( (Byte const*)ch_C, strlen( ch_C ) );
+}
+
+
+
+INLINE
+char const*
+String_data::ch_C() const
+{
+    return (char const*)data_byte_p_; 
+}
+INLINE char* 
+String_data::ch_l() 
+{ 
+    return (char*)data_byte_p_; 
+}
+
+INLINE Byte const*
+String_data::byte_C() const 
+{ 
+    return data_byte_p_; 
+}
+
+INLINE Byte* 
+String_data::byte_l() 
+{
+    OKW();
+    return data_byte_p_;
+}
+
+INLINE
+void 
+String_data::trunc(int j) 
+{
+    OKW(); 
+    assert(j >= 0 && j <= length_i_);
+    data_byte_p_[j] = 0;
+    length_i_ = j;
+}
+
+INLINE bool
+String_data::is_binary_bo()const
+{
+//    return !memchr(data_byte_p_, length_i_, 0);
+    return ( (int)strlen( (char const*)data_byte_p_ ) != length_i_ );
+}
+
+INLINE Byte&
+String_data::operator [](int j) 
+{
+    assert(j >= 0 && j <= length_i_);
+    return data_byte_p_[j] ; 
+}
+
+INLINE Byte 
+String_data::operator [](int j) const 
+{
+    assert(j >= 0 && j <= length_i_);
+    return data_byte_p_[j]; 
+}
+
+
+
+
+#endif // __STRING_UTIL_CC //
diff --git a/flower/include/string-data.inl b/flower/include/string-data.inl
deleted file mode 100644 (file)
index 5a3bb39..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*-C++-*-
-  String_data.inl -- implement String_data
-
-  source file of Flower lib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STRINGDATA_INL
-#define STRINGDATA_INL
-
-#include <assert.h>
-#include <memory.h>
-
-#include "string-data.hh"
-const int INITIALMAX=8;
-
-#include <sys/types.h>
-
-INLINE void 
-String_data::OKW() 
-{
-    assert (references == 1);
-}
-
-INLINE void 
-String_data::OK() 
-{
-    assert(maxlen >= length_i_);
-    assert(bool(data_byte_p_));
-    assert(references >= 1);
-}
-
-
-INLINE
-String_data::String_data() 
-{
-    references=0;
-    maxlen = INITIALMAX;
-    data_byte_p_ = new Byte[maxlen + 1];
-    data_byte_p_[0] = 0;
-    length_i_ = 0;
-}
-
-INLINE
-String_data::String_data(String_data const &src) 
-{
-    references=0;      
-    maxlen = length_i_ = src.length_i_;                
-    data_byte_p_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.      
-    memcpy( data_byte_p_, src.data_byte_p_, length_i_ + 1 );   
-}
-
-INLINE
-String_data::~String_data() 
-{
-    assert(references == 0);
-    delete[] data_byte_p_;
-}
-
-INLINE void 
-String_data::setmax(int j) 
-{      
-    OKW();
-    if (j > maxlen) {
-       delete data_byte_p_;
-       maxlen = j;
-       data_byte_p_ = new Byte[maxlen + 1];
-    
-       data_byte_p_[0] = 0;
-       length_i_ = 0;
-    }
-}
-
-/* this is all quite hairy:  
-        update of length_i_
-        update of maxlen
-        alloc of buffer
-        copying of buffer
- needs blondification: 
-       split tasks
-       define change authority
-*/
-INLINE void 
-String_data::remax(int j) 
-{
-    OKW();
-    if (j > maxlen) {
-       Byte *p = new Byte[j + 1];      
-       memcpy( p, data_byte_p_, ( maxlen <? length_i_ ) + 1 );     
-       maxlen = j;
-       delete[] data_byte_p_;
-       data_byte_p_ = p;
-    }
-}
-
-INLINE void 
-String_data::tighten() 
-{ // should be dec'd const
-    maxlen = length_i_;
-    Byte *p = new Byte[maxlen + 1];        
-    memcpy( p, data_byte_p_, length_i_ + 1 );      
-    delete[] data_byte_p_;
-    data_byte_p_ = p;          
-}
-// assignment.
-INLINE void 
-String_data::set( Byte const* byte_C, int length_i ) 
-{
-    OKW();
-
-    assert( byte_C && byte_C != data_byte_p_);
-
-    length_i_ = length_i;
-    remax( length_i_ );     // copies too
-    memcpy( data_byte_p_, byte_C, length_i_ );
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::set( char const* ch_C ) 
-{
-    set( (Byte const*)ch_C, strlen( ch_C ) );
-}
-
-
-/// concatenation.
-INLINE void 
-String_data::append( Byte const* byte_C, int length_i ) 
-{
-    OK();
-    OKW();
-    int old_i = length_i_;
-    
-    length_i_ += length_i;
-    remax( length_i_ );
-    memcpy( data_byte_p_ + old_i, byte_C, length_i );  
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::operator += ( char const* ch_C ) 
-{
-    append( (Byte const*)ch_C, strlen( ch_C ) );
-}
-
-
-
-INLINE
-char const*
-String_data::ch_C() const
-{
-    return (char const*)data_byte_p_; 
-}
-INLINE char* 
-String_data::ch_l() 
-{ 
-    return (char*)data_byte_p_; 
-}
-
-INLINE Byte const*
-String_data::byte_C() const 
-{ 
-    return data_byte_p_; 
-}
-
-INLINE Byte* 
-String_data::byte_l() 
-{
-    OKW();
-    return data_byte_p_;
-}
-
-INLINE
-void 
-String_data::trunc(int j) 
-{
-    OKW(); 
-    assert(j >= 0 && j <= length_i_);
-    data_byte_p_[j] = 0;
-    length_i_ = j;
-}
-
-INLINE bool
-String_data::is_binary_bo()const
-{
-//    return !memchr(data_byte_p_, length_i_, 0);
-    return ( (int)strlen( (char const*)data_byte_p_ ) != length_i_ );
-}
-
-INLINE Byte&
-String_data::operator [](int j) 
-{
-    assert(j >= 0 && j <= length_i_);
-    return data_byte_p_[j] ; 
-}
-
-INLINE Byte 
-String_data::operator [](int j) const 
-{
-    assert(j >= 0 && j <= length_i_);
-    return data_byte_p_[j]; 
-}
-
-
-
-
-#endif // __STRING_UTIL_CC //
index 3f42e860e66ee5e20f8b82fb1c14f3480850c857..88954cb1683a2e616eb75caeff8e705e0e46f615 100644 (file)
@@ -60,9 +60,9 @@ public:
 
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
-#define INLINE inline
+#define INLINE.iccine
 #endif
-#include "string-handle.inl"
+#include "string-handle.icc"
 /* we should be resetting INLINE. oh well. */
 #endif
 
diff --git a/flower/include/string-handle.icc b/flower/include/string-handle.icc
new file mode 100644 (file)
index 0000000..63b2ab3
--- /dev/null
@@ -0,0 +1,156 @@
+/* -*-c++-*-
+   
+  stringhandle.inl -- implement String_handle
+
+  source file of Flower lib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef STRINGHANDLE_INL
+#define STRINGHANDLE_INL
+
+#include <assert.h>
+#include <memory.h>
+
+#include "string-data.hh"
+#include "string-handle.hh"
+
+INLINE void 
+String_handle::down() 
+{ 
+    if (!(--data->references)) delete data; data = 0; 
+}
+
+/// increase ref count
+INLINE void 
+String_handle::up(String_data *d) 
+{ 
+    data=d; data->references ++; 
+}
+
+INLINE void 
+String_handle::copy() 
+{
+    if (data->references !=1){
+       String_data *newdata = new String_data(*data);
+       down();
+       up(newdata);
+    }
+}
+
+INLINE
+String_handle::String_handle() 
+{
+    up(new String_data);
+}
+
+INLINE
+String_handle::~String_handle() 
+{      
+    down();
+}    
+
+INLINE
+String_handle::String_handle(String_handle const & src) 
+{      
+    up(src.data);
+}
+
+INLINE Byte* 
+String_handle::byte_l() 
+{
+    copy();
+    return data->byte_l();
+}
+
+INLINE char* 
+String_handle::ch_l() 
+{
+    copy();
+    return (char*)data->byte_l();
+}
+
+INLINE Byte 
+const* String_handle::byte_C() const 
+{
+    return data->byte_C();
+}
+
+INLINE char const* 
+String_handle::ch_C() const 
+{
+    return (char const*)data->byte_C();
+}
+
+INLINE void 
+String_handle::operator =(String_handle const &src) 
+{
+    if (this == &src)
+       return;
+    down();
+    up(src.data);
+}
+
+INLINE void 
+String_handle::operator += (char const *s) 
+{      
+    copy();
+    *data += s;
+}    
+
+
+INLINE Byte 
+String_handle::operator[](int j) const 
+{ 
+    return (*data)[j]; 
+}
+
+// !NOT SAFE!
+// don't use this for loops. Use byte_C()
+INLINE Byte &
+String_handle::operator[](int j) 
+{
+    copy();    // hmm. Not efficient
+    return data->byte_l()[j];
+}
+
+INLINE void 
+String_handle::append( Byte const* byte_C, int length_i ) 
+{
+    copy();
+    data->append( byte_C, length_i );
+}
+                          
+INLINE void 
+String_handle::set( Byte const* byte_C, int length_i ) 
+{
+    copy();
+    data->set( byte_C, length_i );
+}
+                          
+INLINE void 
+String_handle::operator = (char const *p) 
+{
+    copy();
+    data->set( p );
+}
+                          
+INLINE void 
+String_handle::trunc(int j) 
+{
+    copy(); data->trunc(j); 
+}
+
+INLINE int 
+String_handle::length_i() const 
+{ 
+    return data->length_i_; 
+}
+
+INLINE bool
+String_handle::is_binary_bo() const {
+    return data->is_binary_bo();
+}
+
+#endif
diff --git a/flower/include/string-handle.inl b/flower/include/string-handle.inl
deleted file mode 100644 (file)
index 63b2ab3..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*-c++-*-
-   
-  stringhandle.inl -- implement String_handle
-
-  source file of Flower lib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STRINGHANDLE_INL
-#define STRINGHANDLE_INL
-
-#include <assert.h>
-#include <memory.h>
-
-#include "string-data.hh"
-#include "string-handle.hh"
-
-INLINE void 
-String_handle::down() 
-{ 
-    if (!(--data->references)) delete data; data = 0; 
-}
-
-/// increase ref count
-INLINE void 
-String_handle::up(String_data *d) 
-{ 
-    data=d; data->references ++; 
-}
-
-INLINE void 
-String_handle::copy() 
-{
-    if (data->references !=1){
-       String_data *newdata = new String_data(*data);
-       down();
-       up(newdata);
-    }
-}
-
-INLINE
-String_handle::String_handle() 
-{
-    up(new String_data);
-}
-
-INLINE
-String_handle::~String_handle() 
-{      
-    down();
-}    
-
-INLINE
-String_handle::String_handle(String_handle const & src) 
-{      
-    up(src.data);
-}
-
-INLINE Byte* 
-String_handle::byte_l() 
-{
-    copy();
-    return data->byte_l();
-}
-
-INLINE char* 
-String_handle::ch_l() 
-{
-    copy();
-    return (char*)data->byte_l();
-}
-
-INLINE Byte 
-const* String_handle::byte_C() const 
-{
-    return data->byte_C();
-}
-
-INLINE char const* 
-String_handle::ch_C() const 
-{
-    return (char const*)data->byte_C();
-}
-
-INLINE void 
-String_handle::operator =(String_handle const &src) 
-{
-    if (this == &src)
-       return;
-    down();
-    up(src.data);
-}
-
-INLINE void 
-String_handle::operator += (char const *s) 
-{      
-    copy();
-    *data += s;
-}    
-
-
-INLINE Byte 
-String_handle::operator[](int j) const 
-{ 
-    return (*data)[j]; 
-}
-
-// !NOT SAFE!
-// don't use this for loops. Use byte_C()
-INLINE Byte &
-String_handle::operator[](int j) 
-{
-    copy();    // hmm. Not efficient
-    return data->byte_l()[j];
-}
-
-INLINE void 
-String_handle::append( Byte const* byte_C, int length_i ) 
-{
-    copy();
-    data->append( byte_C, length_i );
-}
-                          
-INLINE void 
-String_handle::set( Byte const* byte_C, int length_i ) 
-{
-    copy();
-    data->set( byte_C, length_i );
-}
-                          
-INLINE void 
-String_handle::operator = (char const *p) 
-{
-    copy();
-    data->set( p );
-}
-                          
-INLINE void 
-String_handle::trunc(int j) 
-{
-    copy(); data->trunc(j); 
-}
-
-INLINE int 
-String_handle::length_i() const 
-{ 
-    return data->length_i_; 
-}
-
-INLINE bool
-String_handle::is_binary_bo() const {
-    return data->is_binary_bo();
-}
-
-#endif
diff --git a/flower/include/vsmat.hh b/flower/include/vsmat.hh
deleted file mode 100644 (file)
index b9dcdad..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef VSMAT_HH
-#define VSMAT_HH
-#include "varray.hh"
-#include "real.hh"
-/** base class for interface with matrix storageclasses.  There are no
-    iterators for matrixclasses, since matrices are (like arrays)
-    explicitly int-indexed.
-
-    Iteration is provided by *_next, *_ok, which update and check both
-    index variables simultaneously.
-
-    TODO
-    determine type of product matrix.
-
-*/
-class virtual_smat {
-    
-
-public:
-    /// check invariants
-    virtual void OK() const=0;
-    
-    /// height of matrix
-    virtual int rows() const = 0;
-
-    /// width of matrix
-    virtual int cols() const = 0;
-      
-    /**  set the size. contents lost.       
-      PRE
-      i >=0, j>=0
-    */
-    virtual void set_size(int i, int j) = 0;
-    /**set the size to square dimen. contents lost
-      PRE
-      i>=0
-    */
-    virtual void set_size(int i) = 0;
-     /**set the size to i.
-
-      keep contents. If enlarged contents unspecified
-        
-      PRE
-      i>=0, j>=0
-    
-    */
-    virtual void resize(int i, int j) = 0;
-  /**    
-    set the size to square dimen. contents kept
-    Keep contents. If enlarged contents are unspecified
-    
-    PRE
-    i>=0  
-    */
-    virtual void resize(int i) = 0;
-  
-    
-        /**
-    access an element.
-
-    Generate an errormessage, if this happens
-    in the 0-part of a sparse matrix.
-    */
-
-    virtual Real& elem(int i,int j) = 0;
-
-    /// access a element, no modify
-    virtual Real const & elem(int i, int j) const = 0;
-
-#if 1
-    virtual Array<Real> row(int i) const = 0;
-    virtual Array<Real> column(int j) const = 0;
-#endif
-
-    
-    /**
-    add a row to the matrix before  row k. Contents
-    of added row are unspecified
-
-      0 <= k <= rows()
-    */
-    virtual void insert_row(int k)=0;
-
-    
-      /**
-      delete a row from this matrix.
-
-      PRE
-      0 <= k < rows();
-    */
-    virtual void delete_row(int k)=0;
-        virtual void delete_column(int k)=0;
-    virtual ~virtual_smat() { }
-    virtual virtual_smat *clone()=0;
-
-
-    
-    /**
-      at end of matrix?. when doing loop
-
-      for(i=0; i<h; i++)
-        for(j=0; j<w; j++)
-          ..
-
-    */
-    virtual bool mult_ok(int i, int j) const=0;
-
-    /**
-      walk through matrix (regular multiply).
-      get next j for row i, or get next row i and reset j.
-      this will make sparse matrix implementation easy.
-    
-      PRE
-      mult_ok(i,j)
-     */
-    virtual void mult_next(int &i, int &j) const  = 0;
-
-/**
-      valid matrix entry. return false if at end of row
-    */
-    virtual bool trans_ok(int i, int j) const=0;
-
-    /**
-      walk through matrix (transposed multiply).
-      Get next i (for column j)
-    
-      PRE
-      ver_ok(i,j)
-     */
-
-    virtual void trans_next(int &i, int &j) const  = 0;
-    /// generate a "Full_storage" matrix    
-    static virtual_smat *get_full(int n, int m);
-
-};
-    
-
-#endif
index 885d69f683c7a133e67dc7017c80ab1e122323a9..b096601c86dd1b14b698ded47afc97d5f3ef89ba 100644 (file)
@@ -75,19 +75,19 @@ Matrix::Matrix(Matrix const &m)
 
 Matrix::Matrix(int n, int m)
 {
-    dat = virtual_smat::get_full(n,m);
+    dat = Matrix_storage::get_full(n,m);
     fill(0);
 }
 
 Matrix::Matrix(int n)
 {
-    dat = virtual_smat::get_full(n,n);
+    dat = Matrix_storage::get_full(n,n);
     fill(0);
 }
 
 Matrix::Matrix(Vector v, Vector w)
 {   
-    dat = virtual_smat::get_full(v.dim(), w.dim());
+    dat = Matrix_storage::get_full(v.dim(), w.dim());
     for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
        dat->elem(i,j)=v(i)*w(j);
 }
@@ -188,7 +188,9 @@ Matrix::set_product(Matrix const &m1, Matrix const &m2)
 {
     assert(m1.cols()==m2.rows());
     assert(cols()==m2.cols() && rows()==m1.rows());
-    
+
+    if (m1.dat->try_right_multiply(dat, m2.dat))
+       return; 
     for (int i=0, j=0; dat->mult_ok(i,j);
         dat->mult_next(i,j)) {
        Real r=0.0;
diff --git a/flower/smat.cc b/flower/smat.cc
deleted file mode 100644 (file)
index dcc61ce..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "smat.hh"
-
-void
-Full_storage::operator=(Full_storage const &fs)
-{
-    resize(fs.h, fs.w);
-    OK();
-    fs.OK();
-    for (int i=0; i<h; i++)
-       for (int j=0; j<w; j++)
-           els[i][j]= fs.els[i][j];
-}
-
-void
-Full_storage::OK() const
-{
-#ifndef NDEBUG
-    //    static Real dummy;           
-    assert(maxh >= h && maxw >= w);
-    assert(h >= 0 && w >= 0);
-    assert(els||!maxh);
-#endif
-}
-void
-Full_storage::resize_cols(int newh)
-{
-    if (newh <= maxh) {
-       h=newh;
-       return;
-    }
-   
-    Real ** newa=new Real*[newh];
-    int j=0;
-    for (; j < h; j++)
-       newa[j] = els[j];
-    for (; j < newh; j++)
-       newa[j] = new Real[maxw];
-    delete[] els;
-    els=newa;
-
-    h = maxh = newh;
-}
-
-void
-Full_storage::resize_rows(int neww)
-{
-    if (neww <= maxw) {
-       w=neww;
-       return;
-    }
-    for (int i=0; i < maxh ; i++) {
-       Real* newa = new Real[neww];
-       for (int k=0; k < w; k++)
-           newa[k] = els[i][k];
-
-       delete[] els[i];
-       els[i] = newa;
-    }
-    w = maxw = neww;   
-}
-
-Full_storage::~Full_storage() {
-    for (int i=0; i < maxh; i++)
-       delete [] els[i];
-    delete[] els;
-}
-
-void
-Full_storage::resize(int rows, int cols)
-{
-    OK();
-    resize_cols(rows);
-    resize_rows(cols);
-
-}
-
-
-bool
-Full_storage::mult_ok(int i, int j) const
-{
-    return valid(i,j);
-}
-
-bool
-Full_storage::trans_ok(int i, int j) const
-{
-       return valid(i,j);
-} 
-
-
-void
-Full_storage::trans_next(int &i, int &j) const
-{
-    assert(trans_ok(i,j));
-    i++;
-    if (i >= h) {
-       i=0;
-       j ++;
-    }
-}
-
-void
-Full_storage::mult_next(int &i, int &j) const
-{
-    assert(mult_ok(i,j));
-    j++;
-    if (j >= w) {
-       j=0;
-       i++;
-    }
-}
-
-void
-Full_storage::delete_column(int k)
-{
-    assert(0 <= k &&k<w);    
-    for (int i=0; i< h ; i++)
-       for (int j=k+1; j <w; j++)
-           els[i][j-1]=els[i][j];
-    w--;
-}
-void
-Full_storage::delete_row(int k)
-{
-    assert(0 <= k &&k<h);
-    for (int i=k+1; i < h ; i++)
-       for (int j=0; j < w; j++)
-           els[i-1][j]=els[i][j];
-    h--;
-}
-
-
-void
-Full_storage::insert_row(int k)
-{
-    assert(0 <= k&& k <=h);
-    resize_cols(h+1);
-    for (int i=h-1; i > k ; i--)
-       for (int j=0; j <w; j++)
-           els[i][j]=els[i-1][j];
-
-}
-
-
-Array<Real>
-Full_storage::row(int n) const
-{
-    Array<Real> r;
-    for (int j = 0; j < w; j++)
-       r.push(els[n][j]);
-    return r;
-}
-
-Array<Real>
-Full_storage::column(int n) const
-{
-    
-    Array<Real> r;
-    for (int i = 0; i<h; i++)
-       r.push(els[i][n]);
-    return r;
-}
-
-
-Full_storage::Full_storage(Full_storage&s)
-{
-    init();
-    (*this) = s;
-}
-virtual_smat*
-Full_storage::clone()
-{
-    return new Full_storage(*this);
-}
-
-
-virtual_smat *
-virtual_smat::get_full(int n, int m)
-{
-    return new Full_storage(n,m);
-}
index 565c332228be4d8c016223b6b9023b1ac43c242a..4c6069ba519800a818a8e5b0c90aae3f31e12a17 100644 (file)
@@ -18,6 +18,7 @@
    2e318, this number would have approx 318 zero's in its string.
 
    Should enlarge buff dynamically.
+   
    @see
    man 3 snprintf
    */
@@ -156,7 +157,7 @@ String_convert::u2hex_str( unsigned u, int length_i, char fill_ch )
        u /= 16;
     }
 #else
-    str += int_str( u, "%x" );
+    str += int_str( u, "%x" ); // hmm. %lx vs. %x -> portability?
 #endif
 
     str = String( fill_ch, length_i - str.length_i() ) + str;
index 43c8e15d8259b8a309ce8363fc8b07b03f86f0cf..d73e4f14d374930e3479c2d30bd43c1030832eff 100644 (file)
@@ -29,5 +29,5 @@ mymemmove( void* dest, void const* src, size_t n )
 
 #include "string-handle.hh"
 #include "string-data.hh"
-#include "string-data.inl"
-#include "string-handle.inl"
+#include "string-data.icc"
+#include "string-handle.icc"
index c8d5985f7eb025d9cd78f719660ce7edce6bf58c..e1cf6e6c238c27d9c5e9f1b7fa0bc13ad0b0a93d 100644 (file)
@@ -1,10 +1,17 @@
+%
+% declare the standard dynamic identifiers.
+%
 
-ppp = \dynamic {7 }
-pp = \dynamic { 6 }
-p = \dynamic { 5 }
-mp = \dynamic { 4 }
-mf = \dynamic { 3 }
-df = \dynamic { 2 } % f is a notename too.
-ff = \dynamic { 1 }
-fff = \dynamic { 0 }
+ppp = \absdynamic {7 }
+pp = \absdynamic { 6 }
+p = \absdynamic { 5 }
+mp = \absdynamic { 4 }
+mf = \absdynamic { 3 }
+df = \absdynamic { 2 } % f is a notename too.
+ff = \absdynamic { 1 }
+fff = \absdynamic { 0 }
+
+cr = \spandynamic { 1 1 } 
+decr = \spandynamic { -1 1 }
+rc = \spandynamic { 1 2 } % stop a crescendo (worrks for decrescendo too)
 
diff --git a/init/register.ini b/init/register.ini
new file mode 100644 (file)
index 0000000..b8447d2
--- /dev/null
@@ -0,0 +1,29 @@
+%
+
+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 {
+               Voice_group_registers
+               \inputregister { Dynamic_register }
+               \inputregister { Stem_beam_register }
+               \inputregister { Text_register }
+               \inputregister { Script_register }
+               \inputregister { Voice_registers
+                       \inputregister { Notehead_register }
+                       \inputregister { Slur_register }
+               }
+       }
+}
+
+lyricregs = \inputregister {
+       Lyric_register % ugh.
+       \inputregister { Lyric_register }       
+       \inputregister { Swallow_register }
+       
+}
index 7ed0e0c99ac46d0e46d926dcde21057639091d61..2ae2fcc06427cfc1244936cefc893eaf40a32855 100644 (file)
@@ -1,4 +1,4 @@
-
+include "register.ini"
 include "dynamic.ini"
 include "dutch.ini" % do not include init/ path
 include "script.ini"
index 5d9e6842ad34c46132112193ec5b8012f54760ce..17678068259ce2187b9f296ec1cf9fd9e8fca433 100644 (file)
@@ -114,8 +114,8 @@ table_sixteen=
             "linestaf" "\linestafsym{%}{%}"
             "stem"     "\stem{%}{%}"
             "fill"     "\hbox{}"
-            "crescendo" "\crescendosym{%}"     0\pt    0\pt    -3\pt   3\pt
-            "decrescendo" "\decrescendosym{%}" 0\pt    0\pt    -3\pt   3\pt
+            "crescendosym" "\crescendosym{%}"  0\pt    0\pt    -3\pt   3\pt
+            "decrescendosym" "\decrescendosym{%}"      0\pt    0\pt    -3\pt   3\pt
      }
 
      "dots" = \table {
index 0acc9d037a46a690eeea72c949a39172bf3aa413..c631aaa5d986d22f8f47c9a2c21d82a7e156c53a 100644 (file)
@@ -6,7 +6,7 @@
 
 cad = \melodic{ 
                \cadenza {1}
-               \grouping{1*4}\duration { 8}
+               \grouping{1*4}\duration { 8}\octave{c}
        \textstyle "italic"
        \clef \violin 
        c'4.mf g8
@@ -16,7 +16,7 @@ cad = \melodic{
        [b()c'] g-\fermata
                \bar \empty
                        c [c_"rubato" e g c']
-       \octave{'}
+       \octave{c'}
        e4. e [g ()f_"rit" e d]
 
        \duration{16}
@@ -34,20 +34,23 @@ cad = \melodic{
        \duration{16}   [d cis d e]
        f4()[f e d c]
        'b4
-       \octave{} [d'8 c'8 a8]2/3
+       \octave{c} [d'8 c'8 a8]2/3
        g2
                \bar \empty 
-       [g c e g] [c' e g c']\octave{'
+       [g c e g] [c' e g c']\octave{c
        [e 'g c e] g4^\fermata %()% BUG!
                \bar \empty 
-       [g8.(_"a \tempo" e g8. )e]
+       [g8.(_"a tempo" e g8. )e]
        a4. g8 [f8 e8 d8 c8]
        'g2 d2^"tr"
        c4
        }
 
 \score {
-       \staff { cad }
-       \paper {}
+       \staff { melodicregs cad }
+       \paper {
+       
+               \unitspace 14\mm
+               \geometric 1.4}
        \midi { \tempo 4:90 }
 }
index 55f2bbb575fac307b089304f6f03cd45586fe5d7..2a59761f005d225256c8dc3113e1cdc657dd560e 100644 (file)
@@ -3,27 +3,27 @@
 % Opus 62
 % Ouverture zu Collins Trauerspiel "Coriolan"
 %
-% a 5 \bar fragment of the alto part
+% a 5 bar fragment of the alto part
 %
 % Copyright (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 %
-% when lily can handle this, i-ll type the other 304 \bars 
+% when lily can handle this, i-ll type the other 304 bars 
 % (maybe even sooner :-)
 %
 
 alto = \melodic{ 
        
-               \meter {4/4} \grouping {4*4}
+       \meter {4/4} 
        \duration{ 8 }
        \key {bes es as}
                
        \clef "alto"
        % these are chords (i.e. non-divisi)
-       % that-s why i-d rather type chords, 
-       % but how to type slurs?
+       
 %30     
        <       
-               { 
+               { \octave{ c }
+                       
                        [ c c-. ] c2.( | 
 %31
                        [ ) c c-. ] c2.( | 
@@ -31,10 +31,13 @@ alto = \melodic{
                        [ ) c c-. ] c4. c-. c4( |
 %33
                        [ ) c c-. ] c4. c-. c4 
-               }
+               \group "+bla"
+                \stem{ 1 }[ c16^"div." c16 c16 c16 ] c4 c2 
+               \group "-"
+               }
 %30:2
                { 
-                       \octave{ -1 }
+                       \octave{ 'c }
                        \textstyle "italic"
                        % this should be a \dynamic, rather than text
                        [ c c_"cresc. \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \
@@ -48,30 +51,26 @@ alto = \melodic{
                        [ ) c c-. ] c4. c-. c4( | 
 %33:2
                        [ ) c c-. ] c4. c-. c4 |
-                       \octave{ }
-               }
-%34
-       >
+                       \octave{c }
+
+%34            
+                       \group "+b"
        % these are two \voices (i.e. divisi)
        % the c4 and c2, however are really 16th...
-       % e.g.: c16*4 and c16*8  or
-       %       [ c4 c2 ]*16 ?
        % we-ll say "simile" for now...
        % 
-               < \multivoice
-               { \stem{ 1 }[ c16^"div." c16 c16 c16 ] c4 c2 }
-                 { 
-                       \octave{ -1 }
+                       \octave{ 'c }
                        \textstyle "italic"
-                       \stem{ -1 } [ as16_"\ff" as16 as16 as16 ] as4_"simile" as2
+                       \stem{ -1 } [ as16 ff as16 as16 as16 ] as4_"simile" as2
                        \textstyle "roman"
+                       \group "-"
                }
        >
        
 }
 
 \score{
-       \staff{ alto }
+       \staff{ melodicregs alto }
        \paper{ 
                \unitspace 14\mm
                \geometric 1.4
index 9bc116a99cf3f86a81f44e560829159c3973edd9..a7637f4d4a7ce09d5211feb0521789bd444acea6 100644 (file)
@@ -1,9 +1,9 @@
 % "Ah,  vous dirais-je, maman" (Mozart, KV 265)
 % 
-% \bare bones version. (written down from memory :-)
+% bare bones version. (written down from memory :-)
 % for lyrics, see twinkle.ly
 
-% the % is a co\mment.
+% the % is a comment.
 %
 % copyright: None
 %
@@ -36,13 +36,13 @@ melodie = \melodic{
 begeleiding = \melodic{
        \clef "bass"
        \meter{ 2/4 }
-       \octave{ c' }           % default octave: 1 below the first octave.
+       \octave{ c }            % default octave: 1 below the first octave.
 
        %%% theme
-       'c                      % ' means one octave lower.
-                               % Similarly: ' means one higher.
+       'c                      % ' 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
-       \octave { ' }
+       \octave { 'c }
        e '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
@@ -50,8 +50,8 @@ begeleiding = \melodic{
 }
 
 \score{
-       \staff{ melodie }
-       \staff{ begeleiding }
+       \staff{ melodicregs melodie }
+       \staff{ melodicregs begeleiding }
        \paper{
                \unitspace 2.5\cm       % a whole note takes 2.5 \cm ideally.
        }
index b3917c6209437fe647da42bde316a2e08117e8c3..7ae8fe4041909e9615464f2b148596df8986b172 100644 (file)
@@ -1,7 +1,3 @@
-%%%%%%%%% HAS TO BE ADJUSTED to pl32
-
-
-% martien.ly
 %
 % Viola Quartet
 % Martien Lohman (194x-????) 
@@ -9,7 +5,6 @@
 % quite alive at the time of writing; 
 % copyright by ml
 %
-% lilypond: src/\stem.cc:42: void Stem::set_\stemend(double): Assertion `(dir > 0 && se >= maxnote) || (se <= minnote && dir <0)' failed.
 % 
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
index 330b732414ff3f0bd98e5b76d71b7c51ad9e1696..8207361f552024dd9b5e727fdd114b4fb5651d31 100644 (file)
@@ -1,5 +1,5 @@
-% \midi.ly
-% test source for lilypond-s \midi \output
+% midi.ly
+% test source for lilypond-s midi output
 
 melodie = \melodic{
        \clef\violin
index 0c210cbf778bd8701ad6bc4656a71d46d98e6d5a..1fe1f398751da52d1bd87ed5f22f2c494467a6da 100644 (file)
@@ -1,41 +1,42 @@
 
-blah = \staff{\melodic{    \meter {6/8}
-                \skip {36*8}
-               \meter {4/4}}
-       \melodic{       
-\duration { 8 }
-                       \octave{ }
-                        |[ a a a a a a a a a ]6/9 
-                       \octave{ 1 }
-                        |[ a a a a a a a a a ]6/9 
-                       \octave { ' } 
+blah = \staff{  "melodic" 
+       \melodic {
+               \duration { 8 }           \meter {6/8}  
+               
+               \octave{ c }
+                        |[ a cr a a a a a a a rc a ]6/9 
+                       \octave{ c }
+                        |[ a decr a a a a a a a rc a ]6/9 
+                       \octave { c' } 
                         [ 'c 'g d a e' b' f'' c''' g''' ]6/9
                         [ g''' c''' f'' b' e' a d 'g 'c ]6/9
-                       \octave{ 1 }
+                       \octave{ c'' }
                         [ 'c 'g d a e' b' f'' c''' g''' ]6/9
                         [ g''' c''' f'' b' e' a d 'g 'c ]6/9
-                       \octave { } 
+                       \octave { ''c}   
                         [ c g d' ]2/3 
                         [ d' g c ]2/3  
                         [ f c' g' ]2/3 
                         [ g' c' f ]2/3  
-                       \octave{ 1 }
+                       \octave{ c }
                         [ c g d' ]2/3 
                         [ d' g c ]2/3  
                         [ f c' g' ]2/3 
                         [ g' c' f ]2/3 
-
+ [ g' c' f ]2/3 
+  \meter {4/4}
+       
 c1
        \duration { 8}
        [c-> d-> e-> f->][g-> a-> b-> c'->] % 1
-\octave{'}     [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
-\octave{     [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+\octave{c'}    [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+\octave{c}     [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
        [c-. d-. e-. f-.][g-. a-. b-. c'-.]
        [c'-- b-- a-- g][f-- e-- d c--] % 5
-       [c-\portato d-\portato e-\portato f-\portato]
-               [g-\portato a-\portato b-\portato c'-\portato]
-       [c'-\upbow b-\upbow a-\downbow g-\downbow]
-               [f-\downbow e-\downbow d-\upbow c-\upbow]
+       [c-portato d-portato e-portato f-portato]
+               [g-portato a-portato b-portato c'-portato]
+       [c'-upbow b-upbow a-downbow g-downbow]
+               [f-downbow e-downbow d-upbow c-upbow]
        [c-| d-| e-| f-|][g-| a-| b-| c'-|]
        [c' b a g][f e d c]
        [c d e f][g a b c'] % 10 
index 85c6a8e1e1df341b09fa54d37322ac5a62177471..d6d189c95c5d9d1110ea8b39b80e3097ae5e066c 100644 (file)
@@ -94,7 +94,7 @@ ii_menuetto = \melodic{
 }
 
 \score{
-       \staff{ $ii_menuetto }
+       \staff{ melodicregs $ii_menuetto }
        \paper{
                \width 195\mm
                \unitspace 9\mm  % to get lily to use only three lines
index bd98824b164f6faa8dd90c8a4ea85981b1cb1fdb..2c6a2c06a91bfe231adf0ecc7bb2f6f35870a604 100644 (file)
@@ -447,10 +447,11 @@ tekstII = \lyric{
 }
 
 \score{
-       \staff{ lyric % this sux el grandioso. What about \lyricstaff, \melodicstaff etc. 
+       \staff{ lyricregs
+               
                tekstI tekstII }
-       \staff{ melodie }
-       \staff{ begeleiding }
+       \staff{ melodicregs melodie }
+       \staff{ melodicregs begeleiding }
        \paper{
                \width 195\mm
 
index 8bcad352ec99e4cd9cee5563e55c2de1fe2ea84b..158095c36f3007d2d3247a2acdf9611dd2507694 100644 (file)
@@ -19,8 +19,8 @@ melody = \melodic{
 
 accompany = \melodic{
        \clef \bass
-       \octave{'c}
-       c c' | e' c' | f' c' | e' c' | 
+       \octave{'c}\duration{4}
+       c4 c' | e' c' | f' c' | e' c' | 
        d' b | c' a | f g | c2 | 
 
        e' g | d g | c' g | b g | 
@@ -33,7 +33,7 @@ accompany = \melodic{
 
 global = \melodic{
                \meter {2 / 4}
-               \skip {24*2}
+               \skip {2*24}
 %              \bar "||"
        }
 
@@ -102,11 +102,11 @@ textiii = \lyric{
 }
 
 \score{
-       \staff{ global melody }
-       \staff{ global tekst hegedraagjetekst }
-       \staff{ global texte }
-       \staff{ global texti textii textiii }
-       \staff{ accompany }
+       \staff{ melodicregs global melody }
+       \staff{ lyricregs global tekst hegedraagjetekst }
+       \staff{ lyricregs global texte }
+       \staff{ lyricregs global texti textii textiii }
+       \staff{ melodicregs global accompany }
        \paper{
                \unitspace 2.5\cm
        }
index 24888841b7aa1fee953428850e825518dc789337..15723bc442c4781882f624aba2c0dbb73dd8ce31 100644 (file)
@@ -55,11 +55,16 @@ bassdux = \melodic{
 }
 
 % every "melody" declared in a staff has its own "voicegroup"
-trebstaf = \staff{ global dux comes }  
-
+trebstaf = \staff{ 
+       \inputregister{ melodicregs}
+       global dux comes 
+}
+       
 \score{
        trebstaf
-       \staff{ bassdux global }
+       \staff{ \inputregister{ melodicregs}
+               bassdux global 
+       }
        \paper{}
        \midi{
                \tempo 4:90
index 80141d17d5598a18ab9a4e39092580debfc03b36..8ec7e2527da622363a6f3ed3f4e596f05a40a285 100644 (file)
@@ -198,7 +198,7 @@ Duration_convert::ticks2standardised_dur( int ticks_i )
                if ( mom == upper_mom ) // don-t miss last (sic)
                        return upper_dur;
                if ( ( mom >= lower_mom ) && ( mom <= upper_mom ) ) {
-                       warning( String( "duration not exact: " ) + String( (Real)mom ) , 0 );
+                       warning( String( "duration not exact: " ) + String( (Real)mom ), 0 );
                        if ( abs( mom - lower_mom ) < abs( mom - upper_mom ) )
                                return lower_dur;
                        else
index 92715dbfdc1fab1d9387a494da1c7b5756acf78b..7870a0da03231a05100f24b4bb8ebfe44fdbaae7 100644 (file)
@@ -1,3 +1,7 @@
+/*
+  Argh! this sux! implementation not liblily
+ */
+
 #ifndef DEBUG_HH
 #define DEBUG_HH
 
@@ -9,7 +13,10 @@
 
 void message( String message_str, char const* context_ch_c_l );
 void warning( String message_str, char const* context_ch_c_l );
+void warning( String message_str  );
 void error( String message_str, char const* context_ch_c_l );
+
+void error( String message_str);
 void error(String s);          // errors
 void error_t(const String& s, Time_description const &  t_tdes);
 void error_t(String const &s, const Moment &when);
diff --git a/lib/include/input.hh b/lib/include/input.hh
new file mode 100644 (file)
index 0000000..80ab11a
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  input.hh -- declare Input
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef INPUT_HH
+#define INPUT_HH
+
+/**
+  Base class for anything that records its poisition in the parse file.
+ */
+class Input {
+    char const *defined_ch_C_ ;
+
+public:
+    set_spot(char const *);
+    Input(char const *);
+    Input(Input const &);
+};
+
+#endif // INPUT_HH
index 32714730c7a9407a7f6f69e5cbd6af08676d0072..19273d0ab1321fb2cba44e781981477a41a61b95 100644 (file)
@@ -33,6 +33,7 @@ struct Colinfo;
 struct Complex_music;
 struct Complex_staff;
 struct Complex_walker;
+struct Crescendo ;
 struct Cresc_req;
 struct Directional_spanner;
 struct Decresc_req;
@@ -45,6 +46,8 @@ struct Group_change_req;
 struct Group_feature_req;
 struct Idealspacing;
 struct Identifier;
+struct Input;
+struct Input_register;
 struct Input_file;
 struct Input_music;
 struct Input_score;
index 28ede975d6ac6cefed262325bf1bd5aaf02b0934..43fe9c53a3b79e73c23e800d21c8886d528b0798 100644 (file)
@@ -153,7 +153,7 @@ Source_file::map()
     data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
 
     if ( (int)data_caddr_ == -1 )
-       warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ),  0);
+       warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ), );
 }
 
 String
@@ -168,7 +168,7 @@ Source_file::open()
     fildes_i_ = ::open( name_str_, O_RDONLY ); 
            
     if ( fildes_i_ == -1 ) {
-       warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ), 0 ); 
+       warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ), 0); 
         return;
     }
 
index 5cb028566e039ed4a6e1957a1a5e6fce2ef6f3b8..44ee82c2f90614ce7cac245791c775e15a505cd1 100644 (file)
@@ -1,7 +1,7 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 45
+PATCH_LEVEL = 46
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-MY_PATCH_LEVEL =
+MY_PATCH_LEVEL = .jcn1
index f052914063ee6cf391ec74d6e1620c0b714b4135..583becb8e8993d607592c4fe7929e25c7c86462f 100644 (file)
@@ -17,7 +17,7 @@ depth = ..
 include ./$(depth)/make/Variables.make
 include ./$(depth)/make/Files.make 
 include .version
-
+include Stable.make
 #
 
 # identify module:
@@ -31,15 +31,10 @@ NAME = lilypond
 SUBDIRS = include
 #
 
-# to be remade each build:
-#
-VERSION_DEPENDENCY = $(lily-version)
-#
-
 
 # list of distribution files:
 #
-DISTFILES = .version Makefile $(ALL_SOURCES)
+EXTRA_DISTFILES = .version 
 #
 
 # list of custom libraries:
@@ -53,10 +48,7 @@ LOADLIBES +=
 
 # main target of this module:
 #
-# MAINTARGET = $(EXECUTABLE)
-# MAINTARGET = $(LIBRARY)
 MAINTARGET = $(lily_bindir)/$(EXECUTABLE)# huh?
-# MAINTARGET = $(libdir)/$(LIBRARY)# huh?
 
 default: $(MAINTARGET)
 #
diff --git a/lily/Stable.make b/lily/Stable.make
new file mode 100644 (file)
index 0000000..376452d
--- /dev/null
@@ -0,0 +1,11 @@
+# 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 break.cc  \
+       item.cc keyword.cc leastsquares.cc \
+       lookup.cc molecule.cc meter.cc\
+       paper-def.cc parser.cc lexer.cc p-staff.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 wordwrap.cc spanner.cc \
+       voice-element.cc identifier.cc note.cc\
index 93334497cf6c1a23b3ad1028b9e275e65dd5c508..8450b6bf7e8ab5687c62d9a74f9ddc0fb5fc986c 100644 (file)
@@ -9,7 +9,7 @@
 #include "bar-reg.hh"
 #include "bar.hh"
 #include "command-request.hh"
-#include "score-column.hh"
+//#include "score-column.hh"
 #include "time-description.hh"
 
 Bar_register::Bar_register()
@@ -83,5 +83,6 @@ Bar_register::post_move_processing()
 }
 
 IMPLEMENT_STATIC_NAME(Bar_register);
+ADD_THIS_REGISTER(Bar_register);
 
 
index c4d62b54d2faf83dbefb8e4b27bc5ec2ba8ce884..a20e859e23a03cefda2226205432aa672d5e7553 100644 (file)
@@ -180,8 +180,8 @@ Beam::do_break_at( PCol *, PCol *) const
 void
 Beam::do_pre_processing()
 {
-    left  = (*stems.top())   ->pcol_l_;
-    right = (*stems.bottom())->pcol_l_;    
+    left_col_l_ = (*stems.top())   ->pcol_l_;
+    right_col_l_ = (*stems.bottom())->pcol_l_;    
     assert(stems.size()>1);
     if (!dir_i_)
        set_default_dir();
@@ -278,7 +278,7 @@ Beam::brew_molecule_p() const return out;
        sb.translate(Offset(x, (x * slope  + left_pos)* inter));
        out->add(sb);
     }
-    out->translate(Offset(x0 - left->hpos,0));
+    out->translate(Offset(x0 - left_col_l_->hpos,0));
 }
 
 IMPLEMENT_STATIC_NAME(Beam);
index 403dabb25047ac4674029d9e45fd4a777fffa277..f0bff0374c347e5816e0c3aa7e03cf714fa02bba 100644 (file)
@@ -36,7 +36,7 @@ Clef_register::set_type(String s)
        c0_position_i_= 10;
     }else 
        return false;
-    *get_staff_info().c0_position_i_ = c0_position_i_;
+    *get_staff_info().c0_position_i_l_ = c0_position_i_;
     
     return true;
 }
@@ -45,7 +45,7 @@ void
 Clef_register::read_req(Clef_change_req*c_l)
 {
     if (!set_type(c_l->clef_str_))
-       error("unknown clef type ", c_l->defined_ch_C_);
+       c_l->error("unknown clef type ");
 }
 
 bool
@@ -106,3 +106,4 @@ Clef_register::post_move_processing()
     }
 }
 IMPLEMENT_STATIC_NAME(Clef_register);
+ADD_THIS_REGISTER(Clef_register);
index 7d95dd980dbb3fd5b2d759462ee6f9fbe6d0d13b..dfa448f41f494ce8c348c40586e7011e139a02b1 100644 (file)
@@ -72,7 +72,9 @@ IMPLEMENT_STATIC_NAME(Clef_change_req);
 void
 Clef_change_req::do_print() const
 {
+#ifndef NPRINT
     mtor << clef_str_ ;
+#endif
 }
 
 Clef_change_req::Clef_change_req(String s)
@@ -85,7 +87,9 @@ IMPLEMENT_STATIC_NAME(Group_feature_req);
 void
 Group_feature_req::do_print() const
 {
+#ifndef NPRINT
     mtor << "stemdir " << stemdir_i_;
+#endif
 }
 
 Group_feature_req::Group_feature_req()
@@ -98,7 +102,9 @@ 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);
index 661d8332ed4b292ab8b4bf8d52df1220f0dd4465..57d2fc086122b9f536a4c11b1e8442d187c98270 100644 (file)
@@ -1,13 +1,8 @@
 #include "complex-staff.hh"
 #include "complex-walker.hh"
-#include "score.hh"
 #include "p-score.hh"
-#include "staffsym.hh"
-#include "score-column.hh"
 
-const NO_LINES = 5;
-
-/** Aside from putting fields right, this generates the staff symbol.
+/** Aside from putting fields right
  */
 void
 Complex_staff::set_output(PScore* pscore_l )
@@ -15,18 +10,6 @@ Complex_staff::set_output(PScore* pscore_l )
     pstaff_l_ = new PStaff(pscore_l);
     pscore_l_ = pscore_l;
     pscore_l_->add(pstaff_l_);
-
-    Staff_symbol *span_p = new Staff_symbol(NO_LINES);
-    
-    Score_column* col_last
-       =score_l_->find_col(score_l_->last(), false);
-    Score_column* col_first=
-       score_l_->find_col(0, false);
-       
-    span_p->set_extent(col_first->pcol_l_->postbreak_p_,
-                      col_last->pcol_l_->prebreak_p_);
-
-    pscore_l_->typeset_spanner(span_p, pstaff_l_);
 }
 
 
index 09773b1503099016efc92c11a3f3a096e9a922bd..ba7be37cd1e2558f616e90803f4aeea1279b4183 100644 (file)
@@ -5,18 +5,12 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
-#include "musical-request.hh"
 #include "staff-column.hh"
 #include "voice.hh"
 #include "p-score.hh"
 #include "complex-staff.hh"
 #include "debug.hh"
-#include "voice-group-regs.hh"
-#include "voice-regs.hh"
 #include "complex-walker.hh"
-//#include "misc.hh"
-#include "command-request.hh"
 #include "walk-regs.hh"
 
 void
@@ -37,16 +31,15 @@ Complex_walker::do_announces()
     walk_regs_p_->do_announces();
 }
 
-bool
-Complex_walker::try_command_request(Command_req *req_l)
-{
-    return walk_regs_p_->try_request(req_l);
-}
 
 void
 Complex_walker::try_request(Request*req)
 {
-    walk_regs_p_->try_request(req);
+    bool b =walk_regs_p_->try_request(req);
+    if (!b)
+       
+       req->warning("junking request: "  + String(req->name()));
+    
 }
 
 void
index 29aa3ab84176b1e0f2105a157b47f627ec8bfb96..163e3be7376c229befb865ff40b1738269aad492 100644 (file)
@@ -5,16 +5,17 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "dimen.hh"
 #include "crescendo.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
-
+#include "debug.hh"
 Crescendo::Crescendo(int s)
 {
     staff_size_i_ = s;
     grow_dir_i_ =0;
     dir_i_ = -1 ;
+    left_dyn_b_ = right_dyn_b_ =false;
 }
 
 Spanner*
@@ -27,9 +28,24 @@ Crescendo::do_break_at(PCol*, PCol*)const
 Molecule*
 Crescendo::brew_molecule_p() const return m_p ;
 {
+    Real x_off_dim=0.0;
+    Real absdyn_dim = 10 PT;   // UGR
+    
     m_p = new Molecule;
-    Real w_f = width().length();
-    Symbol s( paper()->lookup_l()->hairpin(w_f, grow_dir_i_ < 0) );
+    Real w_dim = width().length();
+    if ( left_dyn_b_ ) {
+       w_dim -= absdyn_dim;
+       x_off_dim += absdyn_dim;
+    }
+    if ( right_dyn_b_ ) {
+       w_dim -= absdyn_dim;
+    }
+    
+    if (w_dim < 0) {
+       error("Crescendo too small");
+       w_dim = 0;
+    }
+    Symbol s( paper()->lookup_l()->hairpin(w_dim, grow_dir_i_ < 0) );
     m_p->add(Atom(s));
     int pos = (dir_i_ >0) ? staff_size_i_ + 4 : - 4 ;
     m_p->translate(Offset(0,pos * paper()->internote()));
index 67bcd7068123eda280eef65618c368d2e6e13262..a2bce7c8ce91019fe80e30ee87bfcef43557b768 100644 (file)
@@ -55,6 +55,7 @@ void
 set_debug(bool b)
 {
     check_debug =b;
-}
+    set_flower_debug(*monitor, check_debug);
+  }
 
 
index 5f137035fa20907cea8ac36566006157cfaf7b36..e0e38a7a595fc950559b74754ab6e103199f02e3 100644 (file)
@@ -5,24 +5,28 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "debug.hh"
+#include "crescendo.hh"
 #include "dynamic-reg.hh"
 #include "musical-request.hh"
 #include "text-item.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
+#include "score-column.hh"
 
 Dynamic_register::Dynamic_register()
 {
     dir_i_ =0;
     post_move_processing();
     dynamic_p_ =0;
+    to_end_cresc_p_ = cresc_p_ = 0;
+    cresc_req_l_ = 0;
 }
 
 void
 Dynamic_register::post_move_processing()
 {
-    dynamic_req_l_ = 0;
+    dynamic_req_l_arr_.set_size(0);
 }
 
 bool    
@@ -31,27 +35,54 @@ Dynamic_register::try_request(Request * r)
     Musical_req * m = r->musical();
     if (!m || !m->dynamic())
        return false;
-    assert(!dynamic_req_l_);
-    dynamic_req_l_ = m->dynamic();
+    dynamic_req_l_arr_.push(m->dynamic());
     return true;
 }
 void
 Dynamic_register::process_requests()
 {
-    if(dynamic_req_l_){
-       if (dynamic_req_l_->absdynamic()) {
+    Crescendo*  new_cresc_p=0; 
+    for (int i=0; i < dynamic_req_l_arr_.size(); i++) {
+       Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
+       if (dreq_l->absdynamic()) {
            Text_def * td_p = new Text_def;
            td_p->align_i_ = 0;
            String loud =Dynamic_req::loudness_str(
-               dynamic_req_l_->absdynamic()->loudness_);
+               dreq_l->absdynamic()->loudness_);
            
            td_p->text_str_ = paper()->lookup_l()->dynamic(loud).tex;
-           
-
            td_p->style_str_ = "dynamic";
-           
+
+           assert (!dynamic_p_) ; // TODO
+               
            dynamic_p_ = new Text_item(td_p, 10 ); // TODO!
-           announce_element(Staff_elem_info(dynamic_p_, dynamic_req_l_));
+           announce_element(Staff_elem_info(dynamic_p_, dreq_l));
+       } else if (dreq_l->span_dynamic()) {
+
+           Span_dynamic_req* span_l = dreq_l->span_dynamic();
+           if (span_l->spantype == Span_req::STOP) {
+               if (!cresc_p_) {
+                   span_l->warning("Can't find cresc to end " );
+               } else {
+                   assert(!to_end_cresc_p_);
+                   to_end_cresc_p_ =cresc_p_;
+                   cresc_p_ = 0;
+               }
+           } else if (span_l->spantype == Span_req::START) {
+               cresc_req_l_ = span_l;
+               assert(!new_cresc_p);
+               new_cresc_p  = new Crescendo(10);
+               new_cresc_p->grow_dir_i_ = span_l->dynamic_dir_i_;
+               announce_element(Staff_elem_info(new_cresc_p, span_l));
+           }
+       }
+    }
+
+    if ( new_cresc_p ) {
+       cresc_p_ = new_cresc_p;
+       cresc_p_->left_col_l_ = get_staff_info().musical_l()->pcol_l_;
+       if (dynamic_p_) {
+           cresc_p_->left_dyn_b_ = true;
        }
     }
 }
@@ -63,6 +94,15 @@ Dynamic_register::pre_move_processing()
        typeset_element(dynamic_p_);
        dynamic_p_ = 0;
     }
+    if ( to_end_cresc_p_) {
+       if (dynamic_p_)
+           to_end_cresc_p_->right_dyn_b_=true;
+       
+       to_end_cresc_p_->right_col_l_ = get_staff_info().musical_l()->pcol_l_;
+       typeset_element(to_end_cresc_p_);
+       to_end_cresc_p_ = 0;
+    }
 }
 
 bool
@@ -79,3 +119,14 @@ Dynamic_register::set_feature(Features i)
 }
 
 IMPLEMENT_STATIC_NAME(Dynamic_register);
+ADD_THIS_REGISTER(Dynamic_register);
+
+Dynamic_register::~Dynamic_register()
+{
+    delete dynamic_p_;
+    delete to_end_cresc_p_;
+    if (cresc_p_) {
+       cresc_req_l_->warning("unended crescendo");
+    }
+    delete cresc_p_;
+}
diff --git a/lily/global-regs.cc b/lily/global-regs.cc
new file mode 100644 (file)
index 0000000..207cc16
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+  global-regs.cc -- implement 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "input-register.hh"
+#include "debug.hh"
+#include "register.hh"
+
+struct Request_register_table_entry {
+    String name_str_;
+    Reg_ctor ctor_l_;
+    Request_register_table_entry(String s, Reg_ctor f) {
+       name_str_ =s;
+       ctor_l_ = f;
+    }
+    Request_register_table_entry()
+    {
+       ctor_l_ =0;
+    }
+};
+
+static Array<Request_register_table_entry> *reg_table=0;
+
+void
+add_request_register(String s, Reg_ctor f)
+{
+    if (!reg_table)
+       reg_table = new Array<Request_register_table_entry>;
+    
+    reg_table->push(Request_register_table_entry(s, f));
+}
+
+
+Request_register*
+get_nongroup_register_p(String s)
+{
+    for (int i=0; i < reg_table->size(); i++) {
+       if ((*reg_table)[i].name_str_ == s)
+           return (*(*reg_table)[i].ctor_l_)();
+    }
+    error("Unknown register `" + s +"\'");
+    return 0;
+}
index bc665a19c03a453b309e0c391f008354a8cab16b..2e59f05bd242b3fdbe8e8c22a907ab4b8539d3e2 100644 (file)
@@ -93,7 +93,7 @@ Rhythmic_grouping::intersect(MInterval t)
     
     for (int i=0; i < children.size(); i++) {
        MInterval inter = intersection(t, children[i]->interval());
-       if (inter.empty() || inter.length() <= Rational( 0 )) {
+       if (inter.empty_b() || inter.length() <= Rational( 0 )) {
            delete children[i];
            children[i] =0;
        } else {
index 61232d25b8ca9779ee3cee9037722a7de259040c..318ed3a60725bc619fad8e3dd9c08b8ceb87d48e 100644 (file)
@@ -46,7 +46,7 @@ Notehead_register::process_requests()
        note_p_ = n_p;
        n_p->set_rhythmic(note_req_l_->rhythmic());
        n_p->position = note_req_l_->note()->height() +
-           *get_staff_info().c0_position_i_;
+           *get_staff_info().c0_position_i_l_;
     } else {
        note_p_ = new Rest ( note_req_l_->rhythmic()->duration_);
        if (note_req_l_->rhythmic()->duration_.type_i_ <= 2)
@@ -75,3 +75,4 @@ Notehead_register::post_move_processing()
 }
 
 IMPLEMENT_STATIC_NAME(Notehead_register);
+ADD_THIS_REGISTER(Notehead_register);
index 0eab514cb5ab5e2f2317feec031143987096ec46..8b989f9868b4bff908165956734d87662b92efbf 100644 (file)
@@ -11,7 +11,7 @@
 #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"
@@ -19,6 +19,7 @@
 #include "lookup.hh"
 #include "script-def.hh"
 #include "request.hh"
+#include "input-register.hh"
 
 void
 Identifier::error(String expect)
@@ -29,13 +30,12 @@ Identifier::error(String expect)
 }
 
 Identifier::Identifier(String n, int code)
-    : name(n) 
+    :  name(n) 
 {
     token_code_i_ = code; 
     data = 0;
     accessed_b_ = 0;
     init_b_ = 0;
-    defined_ch_C_ = 0;
 }
 
 void
@@ -61,6 +61,8 @@ DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
 DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
 DEFAULT_PRINT(Request_id, Request, request);
 DEFAULT_PRINT(Score_id, Input_score, score);
+DEFAULT_PRINT(Input_regs_id, Input_register, iregs);
+
 void
 Real_id::do_print() const
 {
@@ -85,12 +87,18 @@ 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(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(Request_id, Request, request)
+implement_id_class(Real_id, Real, real);
+implement_id_class(Script_id, 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(Request_id, Request, request);
+implement_id_class(Input_regs_id, Input_register, iregs);
+
+Identifier::Identifier(Identifier const&)
+{
+    assert(false);
+}
diff --git a/lily/include/class-name.hh b/lily/include/class-name.hh
deleted file mode 100644 (file)
index 14ebf4c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  class-name.hh -- declare 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef CLASS_NAME_HH
-#define CLASS_NAME_HH
-
-/** a macro to declare the classes name as a static and virtual function.
-  The static_name() can *not* be inlined (this might have the effect that 
-  s->name() != S::static_name(). Overlapping strings need not be merged in C++
- */
-#define NAME_MEMBERS(c)        \
-static char const *static_name();\
-virtual char const *name() const{ return c::static_name(); } \
-int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
-
-#define IMPLEMENT_STATIC_NAME(c)\
-    char const *c::static_name() { return #c; } 
-    
-#endif // CLASS-NAME_HH
index 488728d2d9143f3df50045a7126dfdffed267086..87139bd42788ccd51e81c8d7e89509502c3e70da 100644 (file)
 
 /** Request which are  assumed to be "happening" before the
   musical requests. */
-struct Command_req : virtual Request {
+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; }
     virtual Key_change_req * keychange() { return 0; }
@@ -31,12 +35,14 @@ struct Command_req : virtual Request {
 
 /** Baseclass for meter/partial req. It has to be handled by
   Staff_{walker,column} baseclass.  */
-struct Timing_req : Command_req {
+class Timing_req  : public Command_req  {
+public:
     REQUESTMETHODS(Timing_req, timing);
 };
 
 
-struct Partial_measure_req : Timing_req {
+class Partial_measure_req  : public Timing_req  {
+public:
     Moment duration_;
 
     Partial_measure_req(Moment);
@@ -46,7 +52,8 @@ struct Partial_measure_req : Timing_req {
 /**
   todo: allow C meter
  */
-struct Meter_change_req : Timing_req {
+class Meter_change_req  : public Timing_req  {
+public:
     int beats_i_, one_beat_i_;
 
     int compare(Meter_change_req const&);
@@ -56,7 +63,8 @@ struct Meter_change_req : Timing_req {
 };
 
 /// toggle Cadenza mode
-struct Cadenza_req : Timing_req {
+class Cadenza_req  : public Timing_req  {
+public:
     /// turn on?
     bool on_b_;
     Cadenza_req(bool);
@@ -64,36 +72,42 @@ struct Cadenza_req : Timing_req {
 };
 
 /// check if we're at start of a  measure.
-struct Barcheck_req : Timing_req {
+class Barcheck_req  : public Timing_req  {
+public:
 
     REQUESTMETHODS(Barcheck_req,barcheck);
 };
 
-struct Measure_grouping_req: Timing_req {
+class Measure_grouping_req : public Timing_req  {
+public:
     Array<int> beat_i_arr_;
     Array<Moment> elt_length_arr_;
 
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
-struct Group_change_req : Command_req {
+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.  */
-struct Bar_req : Command_req {
+class Bar_req  : public Command_req  {
+public:
     String type_str_;
     Bar_req(String);
     int compare(const Bar_req&)const;
     REQUESTMETHODS(Bar_req,bar);
 };
-struct Terminate_voice_req : Command_req {
+class Terminate_voice_req  : public Command_req  {
+public:
     REQUESTMETHODS(Terminate_voice_req,terminate);
 };
 
-struct Group_feature_req : Command_req {
+class Group_feature_req  : public Command_req  {
+public:
     int stemdir_i_;
     Group_feature_req();
     REQUESTMETHODS(Group_feature_req, groupfeature);
@@ -105,7 +119,8 @@ struct Group_feature_req : Command_req {
     Routines for sharps and flats are separated, 
     so that caller may identify non-conventional keys.
 */
-struct Key_change_req : Command_req {
+class Key_change_req  : public Command_req  {
+public:
     Array<Melodic_req*> melodic_p_arr_;
     bool minor_b_;
   
@@ -125,7 +140,8 @@ struct Key_change_req : Command_req {
     int minor_b();
 };
 
-struct Clef_change_req : Command_req {
+class Clef_change_req  : public Command_req  {
+public:
     String clef_str_;
     Clef_change_req(String);
     REQUESTMETHODS(Clef_change_req, clefchange);
index 861cee77f8d246f4c3544078de8281f123f98c5e..a23371abea74a6fd23b749187b918d483b7ad03e 100644 (file)
@@ -22,7 +22,6 @@ class Complex_walker: public Staff_walker {
 
     
 public:
-    int c0_position_i_;    
     Walker_registers *walk_regs_p_;
     
     /* *************** */
index 858cd44075eead6b053368adb255f836436eb5da..cb6b159ad770c9545a1447d3ed4a16ab4cd6911d 100644 (file)
 #define CRESCENDO_HH
 
 #include "spanner.hh"
-
+/**
+  The hairpin symbol. (cresc)
+ */
 class Crescendo : public Spanner {
     int staff_size_i_;
 public:
     int grow_dir_i_;
     int dir_i_;
+    /// if there is a dynamic at the end, make the sign smaller.
+    bool right_dyn_b_;
+
+    /// if there is a dynamic at the end, make the sign smaller.
+    bool left_dyn_b_;
     Crescendo(int staff_size_i);
 private:
     Spanner* do_break_at( PCol*, PCol*) const;
index cd500c190136ecf063a1fb3a5315edfd62d59aaf..164ac6af3d927cd56de1df460f2584bf1083e770 100644 (file)
 struct Dynamic_register : Request_register {
     int dir_i_;
     Text_item * dynamic_p_;
-    Dynamic_req* dynamic_req_l_;
+    Crescendo * to_end_cresc_p_;
+    Crescendo * cresc_p_;
+    Span_dynamic_req * cresc_req_l_;
+    Array<Dynamic_req*> dynamic_req_l_arr_;
     /* ************** */
     Dynamic_register();
+    ~Dynamic_register();
     virtual bool try_request(Request *req_l);
     virtual void process_requests();
     virtual void pre_move_processing();
index 2baf529b493e8195ea823f3c94af2e5f62bfa605..9078f7323cf56e9cf38f843e2f5111806164ed73 100644 (file)
@@ -9,19 +9,19 @@
 
 #include "proto.hh"
 #include "string.hh"
+#include "input.hh"
 
 /* boolean argument to accesor is copy_b..*/
 #define IDACCESSOR( Input_staff, staff)\
     virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
 
 
-struct Identifier {
+struct Identifier : public Input {
     void *data;
     String name;
     bool init_b_;
     bool accessed_b_;
     int token_code_i_;
-    char const *defined_ch_C_;
     
     Identifier(String n, int code) ;
     virtual ~Identifier() {}
@@ -32,6 +32,8 @@ struct Identifier {
     IDACCESSOR(Input_staff, staff)
     IDACCESSOR(Input_music, music)
     IDACCESSOR(Music_voice, mvoice)
+    IDACCESSOR(Input_register, iregs)  
+              
     IDACCESSOR(Script_def, script)
     IDACCESSOR(Symtables, symtables)
     IDACCESSOR(Music_general_chord, mchord)
@@ -43,7 +45,7 @@ struct Identifier {
 protected:
     virtual void do_print()const=0;
 private:
-    Identifier(Identifier const&){}
+    Identifier(Identifier const&);
 };
 
 #define declare_id_class(Idclass, Class, accessor)     \
@@ -66,5 +68,6 @@ 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(Request_id, Request, request);
+declare_id_class(Input_regs_id, Input_register, iregs);
 
 #endif // IDENTIFIER_
diff --git a/lily/include/input-register.hh b/lily/include/input-register.hh
new file mode 100644 (file)
index 0000000..6149121
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+  input-register.hh -- declare Input_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef INPUT_REGISTER_HH
+#define INPUT_REGISTER_HH
+
+#include "plist.hh"
+#include "string.hh"
+#include "proto.hh"
+#include "input.hh"
+
+struct Input_register : Input { 
+    IPointerList<Input_register*> ireg_list_;
+    String name_str_;
+    
+    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;
+    void print() const;
+    /**
+      Construct the registers.
+     */
+    Array<Request_register*> get_nongroup_p_arr()const;
+};
+
+Request_register * get_nongroup_register_p(String);
+
+#endif // INPUT_REGISTER_HH
index 36baf691c989ccb4f76956886418e88e28e46abd..a55b7a43782183985b8832b24fbf741ea083115e 100644 (file)
 #include "proto.hh"
 #include "plist.hh"
 #include "string.hh"
-
+#include "input.hh"
 
 /// the total music def of one movement
-struct Input_score {
-    /// defined where?    
-    char const * defined_ch_C_;
+class Input_score : public Input {
+public:
     int errorlevel_i_;
     
     /// paper_, staffs_ and commands_ form the problem definition.
@@ -35,7 +34,7 @@ struct Input_score {
     void add(Input_staff*);
     ~Input_score();
     /// construction
-    void set(Paper_def*);
+    void set(Paper_def* paper_p);
     void set(Midi_def* midi_p);
     void print() const;
     Score*parse();
index 25e1431162082ec463009fb974cc513da230c09a..0a35b460b6d444b185c371d6fb23cfa5fd95ae0e 100644 (file)
 #include "plist.hh"
 #include "varray.hh"
 #include "proto.hh"
+#include "input.hh"
 
-struct Input_staff {
-    
-    char const * defined_ch_C_;
-    String type;
+class Input_staff:public Input {
+public:
     
     IPointerList<Input_music*> music_;
+    Input_register * ireg_p_;
     
     /* *************** */
     ~Input_staff();
     void add(Input_music*m);
     Input_staff(Input_staff const&);
-    Input_staff(String);
+    Input_staff();
     Staff* parse(Score*);
     void print() const;
 };
diff --git a/lily/include/input.hh b/lily/include/input.hh
new file mode 100644 (file)
index 0000000..8677daa
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  input.hh -- declare Input
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef INPUT_HH
+#define INPUT_HH
+
+/**
+  Base class for anything that records its poisition in the parse file.
+ */
+class Input {
+    char const *defined_ch_C_ ;
+    Sources * sources_l_;
+public:
+    
+    void warning(String)const; // should use member func?
+    void error(String)const;
+    void message(String)const;
+    void set_spot(Input const &);
+    void set_sources(Sources *);
+    
+    String location_str()const;
+    Input(Sources *,char const*);
+    Input();
+};
+
+#endif // INPUT_HH
diff --git a/lily/include/lyric-register.hh b/lily/include/lyric-register.hh
new file mode 100644 (file)
index 0000000..f9f43be
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  lyric-register.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef LYRIC_REGISTER_HH
+#define LYRIC_REGISTER_HH
+#include "register.hh"
+#include "varray.hh"
+
+#include "proto.hh"
+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();
+public:
+    NAME_MEMBERS(Lyric_register);
+    Lyric_register();
+};
+#endif // LYRIC_REGISTER_HH
diff --git a/lily/include/lyric-staff.hh b/lily/include/lyric-staff.hh
deleted file mode 100644 (file)
index fb88c5e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  lyricstaff.hh -- part of LilyPond
-
-  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-  */
-
-#ifndef LYRICSTAFF_HH
-#define LYRICSTAFF_HH
-
-#include "staff.hh"
-
-/**
-  Hungarian prefix lstaff
- */
-struct Lyric_staff : Staff {
-    virtual void set_output(PScore *);
-    virtual Staff_walker *get_walker_p();
-};
-
-#endif // LYRICSTAFF_HH
-
-
-
-
diff --git a/lily/include/lyric-walker.hh b/lily/include/lyric-walker.hh
deleted file mode 100644 (file)
index 1a80523..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-//  lyricwalker.hh -- declare Lyric_walker
-//
-//  (c) 1996,97 Han-Wen Nienhuys, Jan Nieuwenhuizen <jan@digicash.com>
-//
-
-#ifndef LYRICWALKER_HH
-#define LYRICWALKER_HH
-
-#include "proto.hh"
-#include "grouping.hh"
-#include "staff-walker.hh"
-
-/// a simple walker which collects words, and then print them, first on top
-struct Lyric_walker: Staff_walker {
-    Array<Lyric_item*> litem_l_array_;
-
-    /* *************** */
-    virtual void process_requests();
-    
-    Lyric_walker(Lyric_staff* lstaff_l);
-    Lyric_staff* lstaff_l();
-};
-
-
-#endif // LYRICWALKER_HH
-
-
index d9a13deda938217da2cc4b232f24526f41ccc463..a3079b10f4affff1f65b865faffd8850a9901025 100644 (file)
@@ -18,7 +18,8 @@
   A request which is coupled to a #Voice_element# with nonzero duration.
   Base class only
  */
-struct Musical_req : virtual Request {
+class Musical_req  : public virtual Request  {
+public:
     
     virtual Skip_req* skip() { return 0; }
     virtual Dynamic_req* dynamic() { return 0; }
@@ -29,7 +30,8 @@ struct Musical_req : virtual Request {
 };
 
 
-struct Skip_req : Musical_req {
+class Skip_req  : public Musical_req  {
+public:
     Moment duration_;
     
     virtual Moment duration() const;
@@ -38,7 +40,8 @@ struct Skip_req : Musical_req {
 /** a request with a duration.
   This request is used only a base class.
  */
-struct Rhythmic_req : virtual Musical_req {
+class Rhythmic_req  : public virtual Musical_req  {
+public:
     Duration duration_;
     
     /* *************** */
@@ -58,13 +61,15 @@ struct Spacing_req :virtual Request {
     REQUESTMETHODS(Spacing_req, spacing);
 };
 
-struct Blank_req : Spacing_req, Rhythmic_req {
+class Blank_req  : public Spacing_req, Rhythmic_req  {
+public:
     REQUESTMETHODS(Spacing_req, spacing);
     
 };
 
 /// Put a text above or below (?) this staff.
-struct Text_req : virtual Musical_req {
+class Text_req  : public virtual Musical_req  {
+public:
     /// preferred position (above/below)
     int dir_i_;
     /// the characteristics of the text
@@ -80,7 +85,8 @@ struct Text_req : virtual Musical_req {
 /** Put a text in lyric_staff
   @see Lyric_staff
   */
-struct Lyric_req : public Rhythmic_req, Text_req {
+class Lyric_req  : public  Rhythmic_req, public Text_req  {
+public:
     Lyric_req(Text_def* t_p);
     REQUESTMETHODS(Lyric_req, lreq_l);
 };
@@ -109,7 +115,8 @@ struct Melodic_req :virtual Musical_req
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
-struct Note_req : Rhythmic_req, virtual Melodic_req {
+class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
+public:
     
     /// force/supress printing of accidental.
     bool forceacc_b_;
@@ -130,7 +137,8 @@ public:
   attach a stem to the noteball.
   Rhythmic_req parent needed to  determine if it will fit inside a beam.
   */
-struct Stem_req : Rhythmic_req {
+class Stem_req  : public Rhythmic_req  {
+public:
     /// preferred direction for the stem
     int dir_i_;
     Stem_req();
@@ -141,7 +149,8 @@ struct Stem_req : Rhythmic_req {
   Requests to start or stop something.
  This type of request typically results in the creation of a #Spanner#
 */
-struct Span_req : virtual Musical_req {
+class Span_req  : public virtual Musical_req  {
+public:
     /// should the spanner start or stop, or is it unwanted?
     enum {
        NOSPAN, START, STOP
@@ -158,7 +167,8 @@ struct Span_req : virtual Musical_req {
 
  ugr. Place in hierarchy?
  */
-struct Plet_req : virtual Request {
+class Plet_req  : public virtual Request  {
+public:
      char type_c_;
      int dur_i_;
      int type_i_;
@@ -170,7 +180,8 @@ struct Plet_req : virtual Request {
 /** Start / stop a beam at this note.  if #nplet# is set, the staff will try to put an
 appropriate number over the beam
     */
-struct Beam_req : Span_req {
+class Beam_req  : public Span_req  {
+public:
     int nplet;
 
     /* *************** */
@@ -180,7 +191,8 @@ struct Beam_req : Span_req {
 };
 
 /// a slur
-struct Slur_req : Span_req {
+class Slur_req  : public Span_req  {
+public:
  REQUESTMETHODS(Slur_req,slur);
 
 };
@@ -189,7 +201,8 @@ struct Slur_req : Span_req {
 /** Put a script above or below this ``note''. eg upbow, downbow. Why
   a request? These symbols may conflict with slurs and brackets, so
   this also a request */
-struct Script_req : Musical_req {
+class Script_req  : public Musical_req  {
+public:
     int dir_i_;
     Script_def *scriptdef_p_;
 
@@ -208,12 +221,14 @@ struct Script_req : Musical_req {
     Dynamic request carries a time, measured from the start of its
     note.
  */
-struct Subtle_req : virtual Musical_req {
+class Subtle_req  : public virtual Musical_req  {
+public:
     Moment subtime_;
     REQUESTMETHODS(Subtle_req, subtle);
 };
 
-struct Dynamic_req : Subtle_req {
+class Dynamic_req  : public Subtle_req  {
+public:
     /// for absolute dynamics
     enum Loudness {
        FFF, FF, F, MF, MP, P, PP, PPP
@@ -222,13 +237,15 @@ struct Dynamic_req : Subtle_req {
     REQUESTMETHODS(Dynamic_req, dynamic);
 };
 
-struct Absolute_dynamic_req : Dynamic_req {
+class Absolute_dynamic_req  : public Dynamic_req  {
+public:
     Loudness loudness_;
     Absolute_dynamic_req();
     REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
 };
 
-struct Span_dynamic_req : Dynamic_req, Span_req {
+class Span_dynamic_req  : public Dynamic_req, public Span_req  {
+public:
     /// Grow or shrink the volume: 1=cresc, -1 = decresc 
     int dynamic_dir_i_;
     Span_dynamic_req();
index 679c3811813fa998ab2e4c14e7ced06dc5753ecf..2eef0929a4cd508ec55d1bd0cbd11bcb39494b1f 100644 (file)
 #include "duration.hh"
 #include "string.hh"
 #include "varray.hh"
+#include "input.hh"
 
 class My_lily_parser {
+    char const* here_ch_C()const;
+    Array<Input> define_spot_array_;
+  
+
+    void add_requests( Voice_element*v);
+
+    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_duration_mode(String s);
 public:
     friend int yyparse( void*);
    
@@ -30,8 +42,6 @@ public:
     bool last_duration_mode ;
 
     Array<Request*> pre_reqs, post_reqs;
-    Array<const char *> define_spot_array_;
-    char const* defined_ch_C_;
     int fatal_error_i_;
     Sources * source_l_;
     int error_level_i_;
@@ -39,15 +49,10 @@ public:
     My_lily_lexer * lexer_p_;
  
     Moment plet_mom();
-    void add_requests( Voice_element*v);
-
-    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_duration_mode(String s);
-    char const* here_ch_C()const;
+    Input here_input()const;
     void remember_spot();
+    Input pop_spot();
+    
     Paper_def*default_paper();
     void do_yyparse();
     void parser_error(String);
@@ -60,6 +65,7 @@ public:
 public:
     void parse_file ( String init_str, String file_str);
     My_lily_parser(Sources * sources_l);
+    ~My_lily_parser();
 };
 
 #endif // MY_LILY_PARSER_HH
index 278d15075362c6bd7fbf36d3e9d5ed4b5f87010d..7af00f6505f8e14b3153238e3e6d3a0d7f62a1d9 100644 (file)
@@ -40,7 +40,7 @@ public:
      */
     Request_register * get_register_p(Request_register*reg_l);
     virtual void set_feature(Features i);
-    virtual bool acceptable_request_b(Request*);
+    virtual bool acceptable_request_b(Request*)const;
     virtual void pre_move_processing();
     virtual void post_move_processing();
     virtual void acknowledge_element(Staff_elem_info info);
@@ -48,7 +48,8 @@ public:
     virtual void process_requests();
     virtual ~Register_group_register();
     virtual void add(Request_register* reg_p);
-    virtual bool contains_b(Request_register*);
+    void add(Array<Request_register*> reg_p_arr);
+    virtual bool contains_b(Request_register*)const;
 };
 
 #endif // REGISTERGROUP_HH
index 808b28d05c80a9396216b77cc2a1bf74b6dd838b..4ac81c61e460f978cbd9ed2f4064f29842d23849 100644 (file)
@@ -11,6 +11,7 @@
 #include "varray.hh"
 #include "request.hh"
 #include "staff-elem-info.hh"
+#include "staff-info.hh"
 
 /**
   a struct which processes requests, and creates the #Staff_elem#s.
@@ -84,7 +85,7 @@ protected:
     /**
       Does this equal or contain a certain register?
      */
-    virtual bool contains_b(Request_register*reg_l);
+    virtual bool contains_b(Request_register*reg_l)const;
     /**
       Get information on the staff. Default: ask daddy.
       */
@@ -103,6 +104,22 @@ public:
     void print() const;
 };
 
+/**
+  A macro to automate administration of registers.
+ */
+#define ADD_THIS_REGISTER(c)                           \
+struct c ## init {                                     \
+    static Request_register * globalctor (){           \
+       return new c;                                   \
+    }                                                  \
+    c ## init () {                                     \
+       add_request_register(c::static_name(), globalctor);     \
+                                                       \
+    }                                                  \
+} _ ## c ## init;
+
+typedef Request_register*(*Reg_ctor)(void);
+void add_request_register(String s, Reg_ctor f);
 
 #endif // REGISTER_HH
 
index 66e62d484344a43ae15bd09ca9a7085184e368bb..c3e0deb846e8a5b6c1bf3030bc6dc078bd369535 100644 (file)
 #include "string.hh"
 #include "moment.hh"
 #include "class-name.hh"
+#include "input.hh"
 
 /**
  a voice element wants something printed.
  Hungarian postfix: req
  @see lilygut manpage
  */
-class Request {
+class Request : public Input {
 public:
     Voice_element*elt_l_;
-    char const* defined_ch_C_;
     
     /* *************** */
     Voice  * voice_l();
@@ -54,10 +54,7 @@ public:
     virtual Rhythmic_req*rhythmic() { return 0; }
     virtual Lyric_req* lreq_l() { return 0; }
     virtual Melodic_req *melodic() { return 0; }
-    virtual Terminate_voice_req *terminate() {return 0;}
-    virtual Group_change_req * groupchange() { return 0;}
-    virtual Group_feature_req * groupfeature() { return 0; }
-    virtual Spacing_req * spacing() { return 0; }
+     virtual Spacing_req * spacing() { return 0; }
     virtual Blank_req * blank() { return 0; }
     virtual Musical_req *musical() { return 0; }
     virtual Command_req * command() { return 0; }
index e961d0492016418b425631ef34a4ba235030aebd..9f2e33c6b51e316ebbf350f2baa22738d14b91a2 100644 (file)
@@ -50,6 +50,8 @@ public:
 
 };
 
+#include "compare.hh"
+
 instantiate_compare(Score_column&, Score_column::compare);
 
 #endif // SCCOL_HH
index cf86ad342a7a8ca4f28cf12398b98ccae8aa9dbf..32b57bf01f7f06c097ae09a22d133bb34ba001da 100644 (file)
@@ -16,6 +16,7 @@
 #include "moment.hh"
 #include "assoc.hh"
 #include "string.hh"
+#include "input.hh"
 
 /// the total music def of one movement
 struct Score {
@@ -28,7 +29,7 @@ struct Score {
     IPointerList<Score_column*> cols_;
     PScore *pscore_p_;
 
-    char const *defined_ch_C_;
+    Input input_;
     int errorlevel_i_;
     
     /* *************************************************************** */
index 8b5be325611db7be559c9b7f65bdebbede75ff65..8d9528b45a95a2e7f4df48db885d6856241a5280 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef SCRIPTDEF_HH
 #define SCRIPTDEF_HH
 #include "string.hh"
+
 struct Script_def{
     int stemdir;
     int staffdir;
index 43a3567fa52faf609869d1d3b9bc7aa3117fa391..3bb547b528e1898401a8049128fa1b05e684cc6d 100644 (file)
@@ -30,7 +30,7 @@
 
     */
 struct Spanner:Staff_elem {
-    PCol *left, *right;
+    PCol *left_col_l_, *right_col_l_;
 
     
     /* *************** */
index 2d58add6fb4de6f580eb66667c7e7ae479c85b42..24e09501e360ed3f35f8ff9d7bdba51e22837c6a 100644 (file)
@@ -25,17 +25,6 @@ struct Staff_elem_info {
     Staff_elem_info();
 };
 
-/// struct to pass staff info along a Request_register hierarchy.
-struct Staff_info {
-    int *c0_position_i_;
-    Staff_walker *walk_l_;
-
-    /// when is now?
-    Time_description const *time_C_;
-    Rhythmic_grouping const *rhythmic_C_;
-    bool break_allowed_b_;
-};
-
 
 struct Features {
     bool initialiser_b_;
index e2fce84582df8b177cb54f81739419c2c78ba9ae..a604385cff466692e07ef72887f8f503a3e6d0e8 100644 (file)
   Stem. So the Beam has to be calculated *before* Stem. This is
   accomplished with the dependencies field of struct Staff_elem.
 
+  (elem)
   */
-struct Staff_elem {
+class Staff_elem {
+
+    /// member: the symbols
+    Molecule *output;          // should scrap, and use temp var?
+
+
+    /**
+      This is  needed, because #output# may still be
+      NULL.
+      */
+    Offset offset_;
+    Array<Staff_elem*> dependancy_l_arr_;
+public:
     enum Status {
        ORPHAN,                 // not yet added to pstaff
        VIRGIN,                 // added to pstaff
        PRECALCING,
        PRECALCED,              // calcs before spacing done
-       POSTCALCING,
+       POSTCALCING,            // busy calculating. This is used to trap cyclic deps.
        POSTCALCED,             // after spacing calcs done
        OUTPUT,                 // molecule has been output
     } status;
@@ -68,19 +81,8 @@ protected:
     /// do calculations after determining horizontal spacing
     virtual void do_post_processing();
 
-    Array<Staff_elem*> dependants;
+    Array<Staff_elem*> dependant_l_arr_;
 
-private:
-    /// member: the symbols
-    Molecule *output;          // should scrap, and use temp var?
-
-
-    /**
-      This is  needed, because #output# may still be
-      NULL.
-      */
-    Offset offset_;
-    Array<Staff_elem*> dependencies;
 };
 
 
diff --git a/lily/include/staff-info.hh b/lily/include/staff-info.hh
new file mode 100644 (file)
index 0000000..4873da6
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  staff-info.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFF_INFO_HH
+#define STAFF_INFO_HH
+
+/// struct to pass staff info along a Request_register hierarchy.
+struct Staff_info {
+    int *c0_position_i_l_;
+    Staff_walker *walk_l_;
+    
+    
+    /// when is now?
+    Time_description const *time_C_;
+    Rhythmic_grouping const *rhythmic_C_;
+    bool break_allowed_b_;
+
+    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 *command_l();
+    Staff_info();
+};
+
+#endif // STAFF_INFO_HH
diff --git a/lily/include/staff-regs.hh b/lily/include/staff-regs.hh
new file mode 100644 (file)
index 0000000..344659d
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+  staff-regs.hh -- declare Staff_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFF_REGS_HH
+#define STAFF_REGS_HH
+
+#include "register-group.hh"
+
+/**
+  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_;
+public:
+    
+    /* *************** */
+    NAME_MEMBERS(Staff_registers);
+    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);
+    virtual bool try_request(Request * r);
+    virtual Staff_info get_staff_info();
+    Staff_registers(Input_register const*);
+    virtual bool acceptable_request_b(Request*) const ;
+};
+
+#endif // STAFF_REGS_HH
diff --git a/lily/include/staff-sym-reg.hh b/lily/include/staff-sym-reg.hh
new file mode 100644 (file)
index 0000000..24bd2c7
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  staff-sym-reg.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFF_SYM_REG_HH
+#define STAFF_SYM_REG_HH
+#include "register.hh"
+#include "moment.hh"
+
+/**
+  Manage the staff symbol.
+ */
+class Staff_sym_register : public Request_register { 
+    Staff_symbol *span_p_;
+    Moment last_mom_;
+public:
+    ~Staff_sym_register();
+    Staff_sym_register();
+    NAME_MEMBERS(Staff_sym_register);
+    virtual void pre_move_processing();
+    virtual void post_move_processing();
+};
+#endif // STAFF_SYM_REG_HH
diff --git a/lily/include/staff-sym.hh b/lily/include/staff-sym.hh
new file mode 100644 (file)
index 0000000..bcec2bf
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  staffsym.hh -- declare Staff_symbol
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFFSYM_HH
+#define STAFFSYM_HH
+#include "spanner.hh"
+/**
+  This spanner draws the lines of a pstaff.
+  The bottom line is position 0.
+  */
+class Staff_symbol : public Spanner
+{
+public:
+    /// this many lines.
+    int no_lines_i_;
+
+    NAME_MEMBERS(Staff_symbol);
+    Staff_symbol(int lines);
+    virtual Molecule* brew_molecule_p() const;
+    void set_extent(PCol* p1, PCol* p2);
+    virtual void do_print()const;
+    virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const;
+};
+#endif // STAFFSYM_HH
index 959859b6e43593b083cbf47a08a4808f53541dd8..2ceeb237fde21eb0d8feea46bf0fac605547adec 100644 (file)
@@ -20,9 +20,10 @@ class Staff {
     /// synchronous horizontal stuff
     IPointerList<Voice*> voice_list_;
     Staff_column *get_col(Moment, PCursor<Staff_column*> * last= 0);
-
+    
 public:
-
+    Input_register * ireg_p_;
+    
     /// runtime field
     IPointerList<Staff_column*> cols_;
 
diff --git a/lily/include/staffsym.hh b/lily/include/staffsym.hh
deleted file mode 100644 (file)
index bcec2bf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  staffsym.hh -- declare Staff_symbol
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STAFFSYM_HH
-#define STAFFSYM_HH
-#include "spanner.hh"
-/**
-  This spanner draws the lines of a pstaff.
-  The bottom line is position 0.
-  */
-class Staff_symbol : public Spanner
-{
-public:
-    /// this many lines.
-    int no_lines_i_;
-
-    NAME_MEMBERS(Staff_symbol);
-    Staff_symbol(int lines);
-    virtual Molecule* brew_molecule_p() const;
-    void set_extent(PCol* p1, PCol* p2);
-    virtual void do_print()const;
-    virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const;
-};
-#endif // STAFFSYM_HH
diff --git a/lily/include/swallow-reg.hh b/lily/include/swallow-reg.hh
new file mode 100644 (file)
index 0000000..9785fa2
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  swallow-reg.hh -- declare Swallow_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SWALLOW_REG_HH
+#define SWALLOW_REG_HH
+
+#include "register.hh"
+
+/**
+  This register swallows everything given to it silently. The purpose of
+  this is to prevent spurious "request junked" warnings.
+ */
+class Swallow_register : public Request_register {
+protected:
+    bool acceptable_request_b(Request*) const;
+    bool try_request(Request*) ;
+public:
+    NAME_MEMBERS(Swallow_register);
+};
+#endif // SWALLOW_REG_HH
index 50bb98105c88567b26af165e4a1073437556217a..bd59e417891e456200146d29b683a54ff43db0dc 100644 (file)
@@ -9,14 +9,13 @@
 
 #include "string.hh"
 #include "proto.hh"
+#include "input.hh"
 
-struct Text_def  {
+struct Text_def : Input {
     int align_i_;
     String text_str_;
     String style_str_;
-    char const* defined_ch_C_;
-  
-
+    
     /* *************** */
     virtual ~Text_def() {};
     bool compare(const Text_def&);
index 7e366ec4c2b12ca86fd8e5f69c79328c6d0dfe46..16ea5c5f14c12ea02d425c5e8e35f5e0630a40cf 100644 (file)
@@ -33,6 +33,7 @@ struct Time_description {
     void OK() const;
     Time_description();
     void add(Moment dt);
+    bool allow_meter_change_b();
     String str()const;
     void print() const;
     void setpartial(Moment p);
index aa72fb8122db55fd57cec9e8cffa004f7487fd36..29a41d4658c592f48ba020407dd3d659acc767ea 100644 (file)
 #include "proto.hh"
 #include "plist.hh"
 #include "moment.hh"
+#include "input.hh"
 
 /** one horizontal bit.  Voice_element is nothing but a container for
     *the requests, */
-struct Voice_element {
+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_;
-    char const* defined_ch_C_;
-    Voice const *voice_l_;
+    Voice const *voice_C_;
     IPointerList<Request*> reqs;
 
     /* *************** */
index 5f17d8fa8ba7464896aacfa835958800b1b80dd7..cdc5b3b157fcebf6c86f2c42b53b3ebdf48c832c 100644 (file)
 
 #include "register-group.hh"
 
-struct Voice_group_registers  : Register_group_register {
+/**
+  A group of voices which share certain characteristics (such as beams. ).
+ */
+class Voice_group_registers  : public Register_group_register {
+    Moment termination_mom_;
+    Input_register const *ireg_C_;
+protected:
+    virtual void do_print() const;
+    virtual void post_move_processing();
+    virtual bool try_request(Request*);
+public:
+
+    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_regs_l_;
-    Moment termination_mom_;
-    
     /* *************** */
     
     NAME_MEMBERS(Voice_group_registers);
     static bool static_acceptable_request_b(Request*);
-    virtual void terminate_register(Request_register*);
-    virtual void do_print() const;
-    virtual void post_move_processing();
     virtual void add(Request_register*);
-    Voice_group_registers(String id);
-    virtual bool try_request(Request*);
+    Voice_group_registers(String id, Input_register const *);
 };
 #endif // VOICEGROUPREGS_HH
index 70735ff10f27697b7fb87487c2030fd2f7f540f9..8b565f77357fb382339c1553414984e4ee9c6bb7 100644 (file)
@@ -13,7 +13,7 @@
 #include "register-group.hh"
 
 class Voice_registers : public Register_group_register {
-
+    Input_register const *ireg_C_;
 public:
     Voice *voice_l_;
     /* *************** */
@@ -22,7 +22,7 @@ public:
     virtual bool acceptable_request_b(Request*);
     virtual void acknowledge_element(Staff_elem_info info);
     virtual bool try_request(Request*);
-    Voice_registers(Voice*);
+    Voice_registers(Voice*, Input_register const*);
     virtual void do_print() const;
 };
 
index daa4690932c437f3099df2bf2f823dc33777c589..7739ed269b01d50ba93ab664ffabfa8b7e6c5007 100644 (file)
@@ -23,19 +23,15 @@ struct Walker_registers : Register_group_register {
     Array<Item*> nobreak_item_p_arr_;
     Array<Item*> postbreak_item_p_arr_;
     Array<Staff_elem_info> announce_info_arr_;
-    Array<Voice_group_registers*> group_l_arr_;
     Complex_walker * walk_l_;
 
     /* *************** */
-    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 typeset_musical_item(Staff_elem * elem_p);
     Walker_registers(Complex_walker*);
     void do_announces();
-    void terminate_register(Request_register * reg);
-    virtual bool try_request(Request * r);
+   
     virtual Staff_info get_staff_info();
 
     virtual void announce_element(Staff_elem_info);
index e407c87dd567b4711a10c00e72977e6040b9eac5..9ba683817993cd3718065435b003d4013b03b243 100644 (file)
@@ -12,7 +12,7 @@ Input_music::check_plet(Voice_element* velt_l)
        if ( i->plet() ) {
            Moment start_moment = 0;
            if ( !find_plet_start_b( i->plet()->type_c_, start_moment ) ) {
-               error( "begin of plet not found", i->defined_ch_C_ );
+               i ->error( "begin of plet not found");
                break;
            }
            Moment moment = 0;
diff --git a/lily/input-register.cc b/lily/input-register.cc
new file mode 100644 (file)
index 0000000..e038b18
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+  input-register.cc -- implement Input_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "debug.hh"
+#include "register.hh"
+#include "input-register.hh"
+Input_register::~Input_register()
+{}
+
+Input_register::Input_register()
+{
+}
+
+bool
+Input_register::group_b()const
+{
+    return ireg_list_.size();
+}
+
+Array<String>
+Input_register::get_nongroups_str_arr()const
+{
+    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;
+}
+
+Input_register*
+Input_register::get_ireg_l(String nm)const
+{
+    for (iter_top(ireg_list_, i); i.ok(); i++) {
+       if (i->name_str_ == nm)
+           return i;
+    }
+    return 0;
+}
+Array<Request_register*>
+Input_register::get_nongroup_p_arr() const return a;
+{
+    Array<String> sa(get_nongroups_str_arr());
+    for (int i=0; i < sa.size(); i++)
+       a.push(get_nongroup_register_p(sa[i]));
+}
+
+void
+Input_register::add(Input_register *p)
+{
+    ireg_list_.bottom().add(p);
+}
+
+void
+Input_register::print() const
+{
+#ifndef NPRINT
+    mtor << name_str_ << " { ";
+    for (iter_top(ireg_list_, i); i.ok(); i++)
+       i->print();
+    mtor <<" }\n";
+#endif 
+}
+       
+
+Input_register::Input_register(Input_register const&s)
+    : Input(s)
+{
+    name_str_ = s.name_str_;
+    for (iter_top(s.ireg_list_, i); i.ok(); i++)
+       add(new Input_register(*i.ptr()));
+}
index ed7d831eeaaefa50f2ec18bc03fb002c3250c04c..a2dacc048e6fd2da205fccc384801d70eb45ff4d 100644 (file)
@@ -37,10 +37,10 @@ Input_score::set(Midi_def* 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;
-    defined_ch_C_ = s.defined_ch_C_;
     errorlevel_i_ = s.errorlevel_i_;
 }
 
@@ -48,7 +48,7 @@ Score*
 Input_score::parse()
 {
     Score *s_p = new Score;
-    s_p->defined_ch_C_= defined_ch_C_;
+
     s_p->errorlevel_i_ = errorlevel_i_;
     if (midi_p_)
        s_p->set(new Midi_def(*midi_p_));
@@ -72,7 +72,6 @@ Input_score::~Input_score()
 
 Input_score::Input_score()
 {
-    defined_ch_C_=0;
     paper_p_= 0;
     midi_p_ = 0;
     errorlevel_i_ = 0;
index 9262851f3cdf07a00836d1d66e01923d4058ec82..618d98f012554a60fc0c050c636cdca810c6040f 100644 (file)
 #include "input-staff.hh"
 #include "staff.hh"
 #include "complex-staff.hh"
-#include "lyric-staff.hh"
-
 #include "my-lily-lexer.hh"
+#include "input-register.hh"
 
-
-Input_staff::Input_staff(String s)
+Input_staff::Input_staff()
 {
-    type= s;
-    defined_ch_C_ = 0;
+    ireg_p_ =0;
 }
 
 void
@@ -32,18 +29,10 @@ Input_staff::add(Input_music*m)
 Staff*
 Input_staff::parse(Score*score_l)
 {
-    Staff *p=0;
-    if (type == "melodic")
-       p = new Complex_staff;
-    else if (type == "lyric")
-       p = new Lyric_staff;
-    else {
-       error( "Unknown staff-type `" + type +"\'", defined_ch_C_ );
-       exit( 1 );
-    }
-
+    Staff *p=new Complex_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);
@@ -52,11 +41,12 @@ Input_staff::parse(Score*score_l)
 }
 
 Input_staff::Input_staff(Input_staff const&s)
+    : Input(s)
 {    
     for (iter_top(s.music_,i); i.ok(); i++)
        add(i->clone());
-    defined_ch_C_ = s.defined_ch_C_;
-    type = s.type;
+
+    ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
 }
 
 void
@@ -66,9 +56,11 @@ Input_staff::print() const
     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_;
 }
diff --git a/lily/input.cc b/lily/input.cc
new file mode 100644 (file)
index 0000000..1ff4e86
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+  input.cc -- implement Input
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "proto.hh"
+#include "input.hh"
+#include "string.hh"
+#include "source.hh"
+#include "source-file.hh"
+
+Input::Input(Sources*s, char const *cl)
+{
+    sources_l_=s;
+    defined_ch_C_=cl;
+}
+
+Input::Input()
+{
+    sources_l_ = 0;
+    defined_ch_C_ = 0;
+}
+
+Input::Input(Input const &s)
+{
+    sources_l_ = s.sources_l_;
+    defined_ch_C_ = s.defined_ch_C_;
+}
+
+void
+Input::set_spot(Input const &i)
+{
+    *this  = i;
+}
+
+void
+Input::message(String message_str)const
+{
+    String str = "";
+    Source_file* sourcefile_l=0;
+    
+    if (sources_l_) 
+       sourcefile_l = sources_l_->sourcefile_l( defined_ch_C_ );
+    
+    if ( sourcefile_l ) {
+       str += sourcefile_l->file_line_no_str(defined_ch_C_) + String(": ");
+    }
+    
+    str += message_str;
+    if ( sourcefile_l ) {
+       str += ":\n";
+       str += sourcefile_l->error_str( defined_ch_C_);
+    }
+    /*
+    if ( busy_parsing() )
+       cerr << endl;
+       */
+    cerr << str << endl;
+}
+
+void
+Input::warning( String message_str)const
+{
+    message( "warning: " + message_str);
+}
+void
+Input::error(String s)const
+{
+    message("error: "+ s);
+    exit (1);
+}
+
+String
+Input::location_str()const
+{
+    Source_file * sourcefile_l=0;
+    if (sources_l_)
+       sourcefile_l = sources_l_->sourcefile_l (defined_ch_C_);
+    if (sourcefile_l) 
+       return sourcefile_l->file_line_no_str(defined_ch_C_);
+    else
+       return "(location unknown)";
+}
index 83fb84c0cdd7db4ee4a799a084532d396c0975c5..ca98995b1cf3d865c8ae4282640068a7f290f0d8 100644 (file)
@@ -39,7 +39,7 @@ Key_register::acknowledge_element(Staff_elem_info info)
 {
     Command_req * r_l = info.req_l_->command() ;
     if (r_l && r_l->clefchange() && !kit_p_) {
-       int c0_i= *get_staff_info().c0_position_i_;
+       int c0_i= *get_staff_info().c0_position_i_l_;
         kit_p_ = new Key_item(c0_i);
         kit_p_->read(*this);
         announce_element(Staff_elem_info(kit_p_, keyreq_l_));
@@ -57,7 +57,7 @@ Key_register::process_requests()
     }
 
      if ( default_key_b_ || keyreq_l_) {
-        int c0_i= *get_staff_info().c0_position_i_;
+        int c0_i= *get_staff_info().c0_position_i_l_;
         kit_p_ = new Key_item(c0_i);
         kit_p_->read(*this);
         announce_element(Staff_elem_info(kit_p_, keyreq_l_));
@@ -98,3 +98,4 @@ Key_register::post_move_processing()
     kit_p_ = 0;
 }
 IMPLEMENT_STATIC_NAME(Key_register);
+ADD_THIS_REGISTER(Key_register);
index ea7e66b7d7af42a4d8dba74cdf09b1f1bbf3ef57..876a0ecf01aa5955e99c847c6a27908d612948f6 100644 (file)
@@ -40,7 +40,7 @@ Local_key_register::acknowledge_element(Staff_elem_info info)
        
 
            if (!key_item_p_) {
-               key_item_p_ = new Local_key_item(*get_staff_info().c0_position_i_);
+               key_item_p_ = new Local_key_item(*get_staff_info().c0_position_i_l_);
            }
            
            key_item_p_->add(note_l_);
@@ -64,7 +64,8 @@ Local_key_register::process_requests()
        if (key_C_)  
            local_key_.reset(*key_C_);
        else if( time_C_->when_ >Moment(0))
-           warning ("Help me! can't figure  current key", 0);
+           warning ("Help me! can't figure  current key", (const char*)0);
     }
 }
 IMPLEMENT_STATIC_NAME(Local_key_register);
+ADD_THIS_REGISTER(Local_key_register);
index 1a54f12bcaa118bb62dd28b6cd7ece7caf676b2b..8bca62e9c939ddf7ba4f97d726157e1f30a9cdad 100644 (file)
@@ -22,5 +22,5 @@ Lyric_item::do_pre_processing()
 
     // test context-error
     if ( tdef_l()->text_str_.index_i( "Gates" ) >=0)// :-)
-       warning( "foul word", tdef_l()->defined_ch_C_ );
+       tdef_l()->warning( "foul word");
 }
diff --git a/lily/lyric-register.cc b/lily/lyric-register.cc
new file mode 100644 (file)
index 0000000..73f0def
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  lyric-register.cc -- implement Lyric_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "staff-walker.hh"
+#include "lyric-register.hh"
+#include "lyric-item.hh"
+#include "musical-request.hh"
+
+Lyric_register::Lyric_register()
+{
+    
+}
+
+bool
+Lyric_register::try_request(Request*r)
+{
+    Musical_req * m =r->musical();
+    if (!m || ! m->lreq_l()) 
+       return false;
+    lreq_arr_.push(m->lreq_l());
+
+    return true;
+}
+
+void
+Lyric_register::process_requests()
+{
+    for (int i=0; i < lreq_arr_.size(); i++) {
+       Item *lp = new Lyric_item(lreq_arr_[i],i);
+       typeset_element(lp);
+    }
+    get_staff_info().walk_l_->allow_break();
+}
+
+void
+Lyric_register::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);
+ADD_THIS_REGISTER(Lyric_register);
diff --git a/lily/lyric-staff.cc b/lily/lyric-staff.cc
deleted file mode 100644 (file)
index 77d2761..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "musical-request.hh"
-#include "voice.hh"
-#include "staff-walker.hh"
-#include "debug.hh"
-#include "staff.hh"
-#include "lyric-staff.hh"
-#include "lyric-walker.hh"
-#include "p-score.hh"
-
-void
-Lyric_staff::set_output(PScore*pscore_l)
-{
-    pstaff_l_ = new PStaff(pscore_l);
-    pscore_l_ = pscore_l;
-    pscore_l_->add(pstaff_l_);
-}
-
-Staff_walker*
-Lyric_staff::get_walker_p()
-{
-    return new Lyric_walker(this);
-}
diff --git a/lily/lyric-walker.cc b/lily/lyric-walker.cc
deleted file mode 100644 (file)
index 6643215..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  lyricwalker.cc -- implement Lyric_walker
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
-*/
-
-#include "musical-request.hh"
-#include "voice.hh"
-#include "p-score.hh"
-#include "lyric-staff.hh"
-#include "lyric-walker.hh"
-#include "debug.hh"
-#include "lyric-item.hh"
-#include "staff-column.hh"
-
-void
-Lyric_walker::process_requests()
-{
-    allow_break();
-    
-    int req_count=0;
-    for (int i = 0; i < ptr()->musicalreq_l_arr_.size(); i++)  {
-       Lyric_req * lreq_l = ptr()->musicalreq_l_arr_[i]->lreq_l();
-       if (!lreq_l)
-           continue;
-       Item *lp = new Lyric_item(lreq_l,req_count++);
-       ptr()->typeset_musical_item( lp);
-    }
-}
-
-Lyric_walker::Lyric_walker(Lyric_staff* lstaff_l)
-    : Staff_walker(lstaff_l, lstaff_l->pstaff_l_->pscore_l_)
-{
-
-}
-
-
index dd38e5cad5604a3072e3f2729ad477911464174f..1576773e860582bfc50b6c3969d48930087a55df 100644 (file)
@@ -21,7 +21,6 @@
 
 Sources* source_l_g = 0;
 bool only_midi = false;
-extern void parse_file(String,String);
 
 
 void
@@ -96,33 +95,35 @@ notice()
        "USA.\n";
 }
 
-static File_path * path =0;
-struct Main_init {
-    Main_init() {
-       path = new File_path(String(DIR_DATADIR)+"/init/");
-       path->push(DIR_DATADIR );
-       debug_init();
-    }
-    ~Main_init() {
-       delete path;
-    }
-} main_init;
+static File_path * path_l =0;
 
 void
 do_one_file(String init_str, String file_str)
 {
-    source_l_g = new Sources;
-    source_l_g->set_path(path);
-    My_lily_parser parser(source_l_g);
-    parser.parse_file(init_str, file_str);
+    Sources sources;
+    source_l_g = &sources; 
+    source_l_g->set_path(path_l);
+    {
+       My_lily_parser parser(source_l_g);
+       parser.parse_file(init_str, file_str);
+    }
     do_scores();
-    delete source_l_g;
     source_l_g = 0;
 }
 
 int
 main (int argc, char **argv)
 {    
+    debug_init();              // should be first
+    File_path path(String(DIR_DATADIR)+"/init/") ;
+    path_l = & path;
+    path_l->push(DIR_DATADIR );
+
+    char const * env_l=getenv("LILYINCLUDE");
+    if (env_l) {
+       path.add(env_l);
+    }
+    
     Getopt_long oparser(argc, argv,theopts);
     cout << get_version_str() << endl;
     String init_str("symbol.ini");
@@ -137,7 +138,7 @@ main (int argc, char **argv)
            exit(0);
            break;
        case 'I':
-           path->push(oparser.optarg);
+           path.push(oparser.optarg);
            break;
        case 'i':
            init_str = oparser.optarg;
@@ -172,11 +173,6 @@ main (int argc, char **argv)
 
     return 0;
 }
-String
-find_file(String f)
-{
-    return path->find(f);
-}
 
 /// make input file name: add default extension. "" is stdin.
 void
index 3c500e6042733a8a6ef03dba3ceb6a9acea64d18..c4ef7b9bb17fe2321742ffe00e97b3159e463703 100644 (file)
@@ -63,3 +63,4 @@ Meter_register::post_move_processing()
     meter_p_ =0;
 }
 IMPLEMENT_STATIC_NAME(Meter_register);
+ADD_THIS_REGISTER(Meter_register);
index 5992cf9505e05d71cdbc904e7e1e5660811b938d..c239e82af5a1e2ed87f2cfc329c0a45bf1d7ef01 100644 (file)
@@ -83,12 +83,15 @@ Midi_output::header()
     str += ",\n";
     Midi_text generate( Midi_text::TEXT, str );
     midi_track.add( Moment( 0 ), &generate );
+
+#if 0 // TODO!
     Source_file* sourcefile_l = source_l_g->sourcefile_l( score_l_->defined_ch_C_ );
     if ( sourcefile_l ) {
-       str = "from musical definition: " 
+       str += "from musical definition: " 
            + sourcefile_l->file_line_no_str(score_l_->defined_ch_C_);
 
     }
+#endif
     Midi_text from( Midi_text::TEXT, str );
     midi_track.add( Moment( 0 ), &from );
 
index ef1ea8382a4d3bf6e4746b89af67388a5a4cae36..a024458349b22e55828f3e42c6e9dd41c5876d58 100644 (file)
@@ -82,7 +82,7 @@ Midi_walker::process_requests()
        Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
        Meter_change_req* meter_l = c_l->meterchange();
        if ( meter_l )
-           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), 0 );
+           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ),  0 );
        Key_change_req* key_l = c_l->keychange();
        if ( key_l ) {
            int sharps_i = key_l->sharps_i();
index c7a848a18f071a584c703bb8ef188e05a6daf837..1ba4fd7801d1306efb1d05b8969528fa5198b736 100644 (file)
@@ -65,12 +65,11 @@ Span_req::do_print() const
 Request::Request()
 {
     elt_l_ = 0;
-    defined_ch_C_ = 0;
 }
 Request::Request(Request const&src)
+    :Input(src)
 {
     elt_l_ = 0;
-    defined_ch_C_ = src.defined_ch_C_;
 }
 /* *************** */
 Spacing_req::Spacing_req()
@@ -115,8 +114,7 @@ Melodic_req::transpose(Melodic_req const & delta)
     }
     accidental_i_ += delta.accidental_i_;
     if (abs(accidental_i_) > 2) {
-       warning("transposition makes accidental larger than 2", 
-               delta.defined_ch_C_);
+       delta.warning("transposition makes accidental larger than 2");
     }
 }
 
@@ -363,7 +361,7 @@ Request::voice_l()
     if (!elt_l_)
        return 0;
     else
-       return (Voice*)elt_l_->voice_l_;
+       return (Voice*)elt_l_->voice_C_;
 }
 /* *************** */
 
index 57909e87086413edc856c826600e7ab32b0f5e8c..2bb88b7448bffa53d59cbb0d49c31cdab2d77025 100644 (file)
@@ -26,9 +26,11 @@ static Keyword_ent the_key_tab[]={
     "clef", CLEF,
     "cm", CM_T,
     "duration", DURATIONCOMMAND,
-    "dynamic", DYNAMIC,
+    "absdynamic", ABSDYNAMIC,
+    "group", GROUP,
     "geometric", GEOMETRIC,
     "in", IN_T,
+    "inputregister", INPUT_REGS,
     "lyric", LYRIC,
     "key", KEY,
     "melodic" , MELODIC,
@@ -51,6 +53,7 @@ static Keyword_ent the_key_tab[]={
     "start", START_T,
     "stem", STEM,
     "table", TABLE,
+    "spandynamic", SPANDYNAMIC, 
     "symboltables", SYMBOLTABLES,
     "tempo", TEMPO,
     "texid", TEXID,
@@ -103,7 +106,7 @@ My_lily_lexer::~My_lily_lexer()
        mtor << "deleting: " << ai.key()<<'\n';
        Identifier *i_p = ai.val();
        if (!i_p->accessed_b_ && !i_p->init_b_)
-           warning("Variable not used", i_p->defined_ch_C_);
+           i_p->warning("Variable not used");
        
        delete ai.val();
     }
index 9924a78a7e39f2405ff44c5c5d24c0c89abf962e..0696d91912cb74dfbfb9a8ed6d8c9b27c2a61881 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  my-lily-parser.cc -- implement 
+  my-lily-parser.cc -- implement My_lily_parser
 
   source file of the LilyPond music typesetter
 
@@ -45,18 +45,20 @@ My_lily_parser::parse_file(String init, String s)
     lexer_p_ = new My_lily_lexer;
 
     set_debug();
+    init_parse_b_ = true;
 
     lexer_p_->new_input(init, source_l_);
     do_yyparse();
     print_declarations();
    
     init_parse_b_ = false;
+    set_debug();
     lexer_p_->new_input(s, source_l_);
     do_yyparse();
 
 
     if(!define_spot_array_.empty())
-       warning("Braces don't match.",0);
+       warning("Braces don't match.");
 }
 
 My_lily_parser::~My_lily_parser()
@@ -67,7 +69,7 @@ My_lily_parser::~My_lily_parser()
 void
 My_lily_parser::remember_spot()
 {
-    define_spot_array_.push(here_ch_C());
+    define_spot_array_.push(here_input());
 }
 
 char const * 
@@ -109,7 +111,7 @@ My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
     Lyric_req* lreq_p = new Lyric_req(tdef_p);
 
     lreq_p->duration_ = *duration_p;
-     lreq_p->defined_ch_C_ = here_ch_C();
+    lreq_p->set_spot( here_input());
 
     velt_p->add(lreq_p);
 
@@ -121,11 +123,11 @@ Voice_element *
 My_lily_parser::get_rest_element(String,  Duration * duration_p )
 {    
     Voice_element* velt_p = new Voice_element;
-    velt_p->defined_ch_C_ = lexer_p_->here_ch_C();
+    velt_p->set_spot( here_input());
 
     Rest_req * rest_req_p = new Rest_req;
     rest_req_p->duration_ = *duration_p;
-     rest_req_p->defined_ch_C_ = here_ch_C();
+    rest_req_p->set_spot( here_input());
 
     velt_p->add(rest_req_p);
     delete duration_p;
@@ -136,18 +138,18 @@ Voice_element *
 My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
 {
     Voice_element*v = new Voice_element;
-    v->defined_ch_C_ = here_ch_C();
+    v->set_spot( here_input());
     
     if (duration_p->type_i_ >= 2) {
        Stem_req * stem_req_p = new Stem_req();
        stem_req_p->duration_ = *duration_p;
        
-       stem_req_p->defined_ch_C_ = here_ch_C();
+       stem_req_p->set_spot( here_input());
        v->add(stem_req_p);
     }
 
     rq->set_duration(*duration_p);
-    rq->defined_ch_C_ = here_ch_C();
+    rq->set_spot( here_input());
 
 
     v->add(rq);
@@ -199,7 +201,7 @@ My_lily_parser::get_parens_request(char c)
        break;
     }
 
-    req_p->defined_ch_C_ = here_ch_C();
+    req_p->set_spot( here_input());
     return req_p;
 }
 
@@ -212,7 +214,6 @@ My_lily_parser::My_lily_parser(Sources * source_l)
     textstyle_str_="roman";            // in lexer?
     error_level_i_ = 0;
     last_duration_mode = false;
-    defined_ch_C_ = 0;
     fatal_error_i_ = 0;
 }
 
@@ -228,3 +229,15 @@ My_lily_parser::add_requests(Voice_element*v)
     }
     post_reqs.set_size(0);
 }
+
+Input
+My_lily_parser::pop_spot()
+{
+    return define_spot_array_.pop();
+}
+
+Input
+My_lily_parser::here_input()const
+{
+    return Input(source_l_, here_ch_C());
+}
index 3ace8fba82341f3a0d35ffd87020385919d118f3..c47a4b2d275d446374b28e4883a28aeef3295594 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  p-col.cc -- implement PCol
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "p-col.hh"
 #include "p-score.hh"
 #include "p-staff.hh"
@@ -10,7 +18,7 @@ PCol::width() const
 
     for (iter_top(its,i); i.ok(); i++)
        w.unite(i->width());
-    if (w.empty())
+    if (w.empty_b())
        w.unite(Interval(0,0));
     return w;
 }
@@ -18,15 +26,6 @@ PCol::width() const
 int
 PCol::rank() const
 {
-#if 0
-    if(!pscore_l_)
-       return -1;
-    PCursor<PCol*> me=pscore_l_->find_col( (PCol*)this);
-    if (!me.ok())
-       return -1;
-    PCursor<PCol*> bot(pscore_l_->cols.top());
-    return me - bot;
-#endif
     assert(rank_i_ != -1);
     return rank_i_;
 }
@@ -47,8 +46,7 @@ PCol::print() const
 #ifndef NPRINT
     mtor << "PCol {";
 
-    if (rank() >= 0)
-       mtor << "rank: " << rank_i_ << '\n';
+    mtor << "rank: " << rank_i_ << '\n';
 
     mtor << "# symbols: " << its.size() ;
     if (breakable_b()){
index 800d3287cf5292a26a7c9cb04d95365f693e0988..d31762e54ae94c317a1ea91b1580abe43336044c 100644 (file)
@@ -220,10 +220,10 @@ PScore::find_col(PCol const *c)const
 void
 PScore::add_broken(Spanner*s)
 {
-    assert(s->left->line_l_ == s->right->line_l_);
+    assert(s->left_col_l_->line_l_ == s->right_col_l_->line_l_);
     broken_spans.bottom().add(s);
-    s->left->starters.bottom().add (s);
-    s->right->stoppers.bottom().add (s);
+    s->left_col_l_->starters.bottom().add (s);
+    s->right_col_l_->stoppers.bottom().add (s);
 }
 
 void
index a4f0103fb4db89ac74cc82c48f8a77df0a23a664..69ef223a4e499eac6a1a4d62f75818a3434ec057 100644 (file)
@@ -23,6 +23,7 @@
 #include "voice-element.hh"
 #include "my-lily-parser.hh"
 #include "text-def.hh"
+#include "input-register.hh"
 
 #ifndef NDEBUG
 #define YYDEBUG 1
@@ -46,6 +47,7 @@
     Box *box;
     Duration *duration;
     Identifier *id;    
+    Input_register * iregs;
     Input_music *music;
     Input_score *score;
     Input_staff *staff;    
@@ -96,10 +98,12 @@ yylex(YYSTYPE *s,  void * v_l)
 %token CLEF
 %token CM_T
 %token DURATIONCOMMAND
-%token DYNAMIC
+%token ABSDYNAMIC
 %token END
 %token GEOMETRIC
 %token GROUPING
+%token GROUP
+%token INPUT_REGS
 %token IN_T
 %token LYRIC
 %token KEY
@@ -119,6 +123,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token SCORE
 %token SCRIPT
 %token SKIP
+%token SPANDYNAMIC
 %token STAFF
 %token START_T
 %token STEM
@@ -134,6 +139,7 @@ yylex(YYSTYPE *s,  void * v_l)
 
 %token <i>     DOTS
 %token <i>     INT
+%token <id>    REGS_IDENTIFIER
 %token <id>    IDENTIFIER
 %token <id>    MELODIC_REQUEST_IDENTIFIER 
 %token <id>    CHORD_IDENTIFIER
@@ -173,7 +179,8 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <paper>  paper_block paper_body
 %type <real>   dim real
 %type <real>   unit
-%type <request>        post_request pre_request command_req pure_post_request
+%type <request>        post_request pre_request command_req 
+%type <request>        pure_post_request pure_post_request_choice
 %type <request>        script_req textscript_req dynamic_req 
 %type <score>  score_block score_body
 %type <script> script_definition script_body mudela_script
@@ -184,7 +191,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <symbol> symboldef
 %type <symtable>       symtable symtable_body
 %type <textdef>        mudela_text
-
+%type <iregs>  input_regs input_regs_body
 
 %left PRIORITY
 
@@ -207,7 +214,7 @@ mudela:     /* empty */
 add_declaration: declaration   {
                THIS->lexer_p_->add_identifier($1);
                $1->init_b_ = THIS->init_parse_b_;
-               $1->defined_ch_C_ = THIS->define_spot_array_.pop();
+               $1->set_spot(THIS->pop_spot());
        }
        ;
 
@@ -219,7 +226,7 @@ declarable_identifier:
        | old_identifier { 
                THIS->remember_spot();
                $$ = new String($1->name); 
-               warning("redeclaration of `" + *$$ + "'", THIS->here_ch_C());
+               THIS->here_input().warning("redeclaration of `" + *$$ + "'");
        }
        ;
 
@@ -235,6 +242,7 @@ old_identifier:
        |       REAL_IDENTIFIER
        |       SCORE_IDENTIFIER
        |       REQUEST_IDENTIFIER
+       |       REGS_IDENTIFIER
        ;
 
 declaration:
@@ -279,9 +287,36 @@ 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_regs_body:
+       REGS_IDENTIFIER         {
+               $$ = $1->iregs(true);
+       }
+       |STRING { 
+               $$ = new Input_register;
+               $$->name_str_ = *$1;
+       }
+       | input_regs_body input_regs {
+               $$->add($2);
+       }
+       ;
+
 /*
        SCORE
 */
@@ -289,7 +324,7 @@ score_block:
        SCORE { THIS->remember_spot(); }
        /*cont*/ '{' score_body '}'     {
                $$ = $4;
-               $$->defined_ch_C_ = THIS->define_spot_array_.pop();
+               $$->set_spot(THIS->pop_spot());
                if (!$$->paper_p_ && ! $$->midi_p_)
                        $$->paper_p_ = THIS->default_paper();
 
@@ -377,24 +412,25 @@ staff_block:
        STAFF   { THIS->remember_spot(); }
 /*cont*/       '{' staff_body '}'      {
                $$ = $4; 
-               $$-> defined_ch_C_ = THIS->define_spot_array_.pop();
+               $$-> set_spot(THIS->pop_spot());
        }
        | { THIS->remember_spot(); }
 /*cont*/       STAFF_IDENTIFIER        { 
                $$ = $2->staff(true); 
-               $$-> defined_ch_C_ = THIS->define_spot_array_.pop();
+               $$-> set_spot(THIS->pop_spot());
        }
        ;
 
 
 
 staff_init:
-       /* empty */ {
-               $$ = new Input_staff( "melodic" );
+       REGS_IDENTIFIER {
+               $$ = new Input_staff;
+               $$->ireg_p_ = $1->iregs(true);
        }
-       | STRING                {
-               $$ = new Input_staff(*$1);
-               delete $1;
+       | input_regs    {
+               $$ = new Input_staff;
+               $$->ireg_p_ = $1;
        }
        ;
 
@@ -526,11 +562,11 @@ full_element:     pre_requests voice_elt post_requests {
 command_elt:
 /* empty */    {
                $$ = new Voice_element;
-               $$-> defined_ch_C_ = THIS->here_ch_C();
+               $$-> set_spot( THIS->here_input());
        }
 /* cont: */
        command_req     {
-               $2-> defined_ch_C_ = $$->defined_ch_C_;
+               $2-> set_spot( THIS->here_input());
                $$->add($2);
 
        }
@@ -584,6 +620,11 @@ command_req:
        | GROUPING '{' intastint_list '}' {
                $$ = get_grouping_req(*$3); delete $3;
        }
+       | GROUP STRING          {
+               $$ = new Group_change_req;
+               $$ -> command()->groupchange()->newgroup_str_ = *$2;
+               delete $2;
+       }
        ;
 
 post_requests:
@@ -591,7 +632,7 @@ post_requests:
                assert(THIS->post_reqs.empty());
        }
        | post_requests post_request {
-               $2->defined_ch_C_ = THIS->here_ch_C();
+               $2->set_spot( THIS->here_input());
                THIS->post_reqs.push($2);
        }
        | post_requests close_plet_parens INT '/' INT { 
@@ -607,7 +648,13 @@ post_request:
        }
        ;
 
-pure_post_request:
+pure_post_request: 
+       pure_post_request_choice        {
+               $$ = $1;
+               $$->set_spot( THIS->here_input());
+       }
+       ;
+pure_post_request_choice:
        close_request_parens    { 
                $$ = THIS->get_parens_request($1); 
        }
@@ -657,16 +704,21 @@ melodic_request:
        ;
 
 dynamic_req:
-       DYNAMIC '{' int '}'     {
+       ABSDYNAMIC '{' int '}'  {
                Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
                ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
                $$ =ad_p;
        }
+       |SPANDYNAMIC '{' int int '}' {
+               Span_dynamic_req * sp_p = new Span_dynamic_req;
+               sp_p->spantype = $4;
+               sp_p-> dynamic_dir_i_  = $3;
+               $$ = sp_p;
+       }
        ;
 
 close_plet_parens:
        ']' {
-               //req_defined_ch_C = THIS->here_ch_C();
                $$ = ']';
        }
        ;
@@ -706,7 +758,6 @@ textscript_req:
 
 mudela_text:
        STRING                  { 
-               //defined_ch_C = THIS->here_ch_C();
                $$ = new Text_def;
                $$->text_str_ = *$1; 
                delete $1;
@@ -728,7 +779,7 @@ script_abbreviation:
        | '>'           { $$ = get_scriptdef('>'); }
        | DOTS          {
                if ( $1 > 1 ) 
-                   warning( "too many staccato dots", THIS->here_ch_C() );
+                   THIS->here_input().warning( "too many staccato dots"  );
                $$ = get_scriptdef('.');
        }
        ;
@@ -751,13 +802,12 @@ script_dir:
 pre_requests:
        | pre_requests pre_request {
                THIS->pre_reqs.push($2);
-               $2->defined_ch_C_ = THIS->here_ch_C();
+               $2->set_spot( THIS->here_input());
        }
        ;
 
 pre_request: 
        open_request_parens     { 
-               //defined_ch_C = THIS->here_ch_C();
                $$ = THIS->get_parens_request($1); 
        }
        ;
index 0725d6c16b8b7dbd850875e11bb64e8b80e7a029..18be472825ab366b1d7a76b27f2725e24149faf4 100644 (file)
@@ -12,7 +12,7 @@
 #include "register.hh"
 
 bool
-Register_group_register::acceptable_request_b(Request* r)
+Register_group_register::acceptable_request_b(Request* r)const
 {
     for (iter_top(reg_list_, i); i.ok(); i++) {
        if (i->acceptable_request_b(r))
@@ -65,7 +65,7 @@ Register_group_register::acknowledge_element(Staff_elem_info info)
 }
 
 bool
-Register_group_register::contains_b(Request_register* reg_l)
+Register_group_register::contains_b(Request_register* reg_l)const
 {
     bool parent_b = Request_register::contains_b(reg_l);
     
@@ -93,6 +93,12 @@ Register_group_register::try_request(Request*req_l)
     }
     return false;
 }
+void
+Register_group_register::add(Array<Request_register*> p_arr)
+{
+    for (int i =0; i<p_arr.size(); i++)
+       add(p_arr[i]);
+}
 
 void
 Register_group_register::add(Request_register *reg_p)
@@ -122,6 +128,7 @@ Register_group_register::terminate_register(Request_register*r_l)
 }
 
 IMPLEMENT_STATIC_NAME(Register_group_register);
+ADD_THIS_REGISTER(Register_group_register);
 
 void
 Register_group_register::do_print()const
index b9edcf9d584486528e01577396c45588977bf00b..2c3f2ec1af3b9d2c9077d925d02ef031d1433105 100644 (file)
@@ -61,7 +61,7 @@ Request_register::acceptable_request_b(Request*)const
 }
 
 bool
-Request_register::contains_b(Request_register *reg_l)
+Request_register::contains_b(Request_register *reg_l)const
 {
     return this == reg_l;
 }
@@ -76,9 +76,9 @@ void
 Request_register::print() const
 {
 #ifndef NPRINT
-    mtor << name() << " {";
+    mtor << "\n" << name() << " {";
     do_print();
-    mtor << "}\n";
+    mtor << "}";
 #endif
 }
 
index b6a3f2cd839e2e54da79668ca8ddf5957a02cea2..88f7dee6df606dd0a60e2929f5a10cfc1477292e 100644 (file)
@@ -27,7 +27,7 @@ Score::setup_music()
     *mlog << "\nSetting up music ..." << flush;
     if (last() == Moment(0)) {
        errorlevel_i_ |= 1;
-       error("Need to have music in a score.", defined_ch_C_);
+       input_.error("Need to have music in a score.");
     }
 
     for (iter_top(staffs_,i); i.ok(); i++) {
@@ -234,7 +234,6 @@ Score::Score()
     paper_p_ = 0;
     midi_p_ = 0;
     errorlevel_i_ = 0;
-    defined_ch_C_ = 0;
 }
 
 Score::~Score()
@@ -261,9 +260,9 @@ Score::paper_output()
     Tex_stream the_output(paper_p_->outfile);
     
     the_output << "% outputting Score, defined at: " <<
-       source_l_g->
-       sourcefile_l (defined_ch_C_)->file_line_no_str(defined_ch_C_) << "\n";
+       input_.location_str() << "\n";
     pscore_p_->output(the_output);
+    
 }
 
 void
index 3115cb50072409d290ee74dd801570f65e67c79c..22526b42bd3cddc7173edbe98a7eae007ea5b9be 100644 (file)
@@ -14,8 +14,7 @@ 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_) {
-           warning("Score contains errors. Will not process it. ",
-                   is_p->defined_ch_C_);
+           is_p->warning("Score contains errors. Will not process it. ");
            delete is_p;
            continue;
        } 
index b782066c31453eb696fdb6e6362f903e27c4da4b..cd7b0814297cfa106d81ea349397697fec6d75e8 100644 (file)
@@ -75,3 +75,4 @@ Script_register::set_feature(Features i)
        dir_i_ = i.direction_i_;
 }
 IMPLEMENT_STATIC_NAME(Script_register);
+ADD_THIS_REGISTER(Script_register);
index 935a86468c82c001ed5c8bd076588a7de5bbabda..8acf6a1fec944100ff2276340d20ccd8c84498f2 100644 (file)
@@ -57,8 +57,8 @@ Slur_register::process_requests()
        // end slur: move the slur to other array
        if (slur_req_l->spantype == Span_req::STOP) {
            if (slur_l_stack_.empty())
-               warning("can't find slur to end",
-                     slur_req_l->defined_ch_C_);
+               
+                     slur_req_l->warning("can't find slur to end");
            else {
                end_slur_l_arr_.push(slur_l_stack_.pop());
                requests_arr_.pop();
@@ -95,7 +95,8 @@ Slur_register::post_move_processing()
 Slur_register::~Slur_register()
 {
     for (int i=0; i < requests_arr_.size(); i++) {
-       warning("unterminated slur", requests_arr_[i]->defined_ch_C_);
+       requests_arr_[i]->warning("unterminated slur");
     }
 }
 IMPLEMENT_STATIC_NAME(Slur_register);
+ADD_THIS_REGISTER(Slur_register);
index 8de13e023aeb59937b11f89a52c82cba23fc47b1..6e8e9e5f69495ce23884e49762c6e2d27e46c80f 100644 (file)
@@ -59,8 +59,8 @@ Slur::set_default_dir()
 void
 Slur::do_pre_processing()
 {
-    right  = encompass.top()->pcol_l_;
-    left = encompass[0]->pcol_l_;    
+    right_col_l_  = encompass.top()->pcol_l_;
+    left_col_l_ = encompass[0]->pcol_l_;    
 }
 
 Spanner*
@@ -74,9 +74,9 @@ Slur::do_break_at(PCol*l, PCol*r) const
        if (encompass[i]->pcol_l_->line_l_==l->line_l_)
            ret->encompass.push(encompass[i]);
     }
-    if (right != r)
+    if (right_col_l_ != r)
        ret->open_right = true;
-    if (left != l)
+    if (left_col_l_ != l)
        ret->open_left = true;
 
 
index 87a01078aa675e08e805cd2624610e63960ef980..d2a8c2bc756a59224670a4155cdc7d1cb033f895 100644 (file)
@@ -17,28 +17,29 @@ Spanner::broken_at(PCol*c1, PCol *c2)const
 {
     Spanner *span_p = do_break_at(c1,c2);
 
-    for (int i=0; i < dependants.size(); i++) {
-       dependants[i]->substitute_dependency((Staff_elem*)this, span_p); 
+    for (int i=0; i < dependant_l_arr_.size(); i++) {
+       dependant_l_arr_[i]->
+           substitute_dependency((Staff_elem*)this, span_p); 
     }
     
-    span_p->left = c1;
-    span_p->right = c2;
+    span_p->left_col_l_ = c1;
+    span_p->right_col_l_ = c2;
     
     return span_p;
 }
 
 Spanner::Spanner()
 {
-    left = right = 0;
+    left_col_l_ = right_col_l_ = 0;
 }
 
 
 Interval
 Spanner::width()const
 {
-    Real r = right->hpos;
-    Real l = left->hpos;
-    assert(*left < *right);
+    Real r = right_col_l_->hpos;
+    Real l = left_col_l_->hpos;
+    assert(*left_col_l_ < *right_col_l_);
     assert(r>=l);
        
     return Interval(0, r-l);
index baca3a0a98f3cfb8e99cbbbda0e9573d610cf83d..96c837fb573a512c2704dec3e5400edf98144aae 100644 (file)
@@ -121,6 +121,9 @@ 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));
index 9a6283e373a34a982da3db9925e74ab3c6460a5b..1bb9db32d4224379d12ad0726c99e38f7d133413 100644 (file)
@@ -36,3 +36,5 @@ Features::dir(int d) return f;
     f.initialiser_b_ = true;
     f.direction_i_ = d;
 }
+
+
index d623d3b49a0518466791fd3c6e9d5d1397441396..4db170e0853f87d14f3fd286c6b16737fb58f102 100644 (file)
@@ -14,8 +14,8 @@ Staff_elem::TeXstring() const
 }
 
 Staff_elem::Staff_elem(Staff_elem const&s)
-    : dependants(s.dependants),
-      dependencies(s.dependencies)
+      :dependancy_l_arr_(s.dependancy_l_arr_),
+        dependant_l_arr_(s.dependant_l_arr_)
 {
     status = s.status;
     assert(!s.output);
@@ -25,7 +25,7 @@ Staff_elem::Staff_elem(Staff_elem const&s)
 }
 /**
   TODO:
-  If deleted, then remove dependants depency!
+  If deleted, then remove dependant_l_arr_ depency!
   */
 Staff_elem::~Staff_elem()
 {
@@ -49,7 +49,7 @@ Staff_elem::width() const
     } else
        r = output->extent().x;
   
-    if (!r.empty()) // float exception on DEC Alpha
+    if (!r.empty_b()) // float exception on DEC Alpha
        r+=offset_.x;
 
     return r;
@@ -66,7 +66,7 @@ Staff_elem::height() const
     } else
        r = output->extent().y;
     
-    if (!r.empty())
+    if (!r.empty_b())
        r+=offset_.y;
 
   
@@ -121,9 +121,9 @@ Staff_elem::pre_processing()
     assert(status != PRECALCING); // cyclic dependency
     status = PRECALCING;
 
-    for (int i=0; i < dependencies.size(); i++)
-       if (dependencies[i])
-           dependencies[i]->pre_processing();
+    for (int i=0; i < dependancy_l_arr_.size(); i++)
+       if (dependancy_l_arr_[i])
+           dependancy_l_arr_[i]->pre_processing();
 
     
     do_pre_processing();
@@ -137,9 +137,9 @@ Staff_elem::post_processing()
     assert(status != POSTCALCING);// cyclic dependency
     status=POSTCALCING;        
 
-    for (int i=0; i < dependencies.size(); i++)
-       if (dependencies[i])
-           dependencies[i]->post_processing();
+    for (int i=0; i < dependancy_l_arr_.size(); i++)
+       if (dependancy_l_arr_[i])
+           dependancy_l_arr_[i]->post_processing();
     do_post_processing();
     status=POSTCALCED;
 }
@@ -150,9 +150,9 @@ Staff_elem::molecule_processing()
     if (status >= OUTPUT)
        return;
     status = OUTPUT;           // do it only once.
-    for (int i=0; i < dependencies.size(); i++)
-       if (dependencies[i])
-           dependencies[i]->molecule_processing();
+    for (int i=0; i < dependancy_l_arr_.size(); i++)
+       if (dependancy_l_arr_[i])
+           dependancy_l_arr_[i]->molecule_processing();
 
     output= brew_molecule_p();
 }
@@ -176,26 +176,26 @@ void
 Staff_elem::substitute_dependency(Staff_elem * old, Staff_elem * newdep)
 {
     bool hebbes_b=false;
-    for (int i=0; i < dependencies.size(); i++) {
-       if (dependencies[i] == old){
-           dependencies[i] = newdep;
+    for (int i=0; i < dependancy_l_arr_.size(); i++) {
+       if (dependancy_l_arr_[i] == old){
+           dependancy_l_arr_[i] = newdep;
            hebbes_b = true;
-       } else if (dependencies[i] == newdep) {
+       } else if (dependancy_l_arr_[i] == newdep) {
            hebbes_b = true;
        }
     }
     if (!hebbes_b)
-       dependencies.push(newdep);
+       dependancy_l_arr_.push(newdep);
 }
 
 void
 Staff_elem::add_dependency(Staff_elem * p)
 {
-    for (int i=0; i < dependencies.size(); i ++)
-       if (dependencies[i] == p)
+    for (int i=0; i < dependancy_l_arr_.size(); i ++)
+       if (dependancy_l_arr_[i] == p)
            return;
     
-    dependencies.push(p);
-    p->dependants.push(p);
+    dependancy_l_arr_.push(p);
+    p->dependant_l_arr_.push(p);
 }
 IMPLEMENT_STATIC_NAME(Staff_elem);
diff --git a/lily/staff-info.cc b/lily/staff-info.cc
new file mode 100644 (file)
index 0000000..b6fb13d
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+  staff-info.cc -- implement Staff_info
+
+  source file of the LilyPond music typesetter
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "staff.hh"
+#include "proto.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_;
+}
+Staff_info::Staff_info()
+{
+    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_;
+}
+
+Score_column*
+Staff_info::command_l()
+{
+    return column_l() -> command_column_l_;
+}
+PCol*
+Staff_info::command_pcol_l()
+{
+    return command_l()->pcol_l_;
+}
+
+Moment
+Staff_info::when()
+{
+    return walk_l_->when();
+}
+
diff --git a/lily/staff-regs.cc b/lily/staff-regs.cc
new file mode 100644 (file)
index 0000000..e22d328
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+  staff-regs.cc -- implement Staff_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "staff-sym.hh"
+#include "voice-group-regs.hh"
+#include "voice-regs.hh"
+#include "staff-regs.hh"
+#include "command-request.hh"
+#include "bar.hh"
+#include "debug.hh"
+#include "input-register.hh"
+
+Staff_info
+Staff_registers::get_staff_info() return inf;
+{
+    inf = Request_register::get_staff_info();
+    inf.c0_position_i_l_ = &c0_position_i_;
+}
+
+Staff_registers::Staff_registers(Input_register const*ireg_C)
+{
+    c0_position_i_ = 0;
+    base_position_i_ =0;
+    add( ireg_C->get_nongroup_p_arr());
+    ireg_C_ =ireg_C;
+}
+
+/** 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)
+{
+
+    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);
+    
+    mtor << "processed change_group " << get_staff_info().when()<<"\n";
+    print();
+}
+
+Voice_group_registers *
+Staff_registers::get_group(String id)
+{
+    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;
+}
+
+
+void
+Staff_registers::terminate_register(Request_register * reg)
+{
+    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);
+}
+
+bool
+Staff_registers::try_request(Request * r)
+{
+    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;
+}
+
+IMPLEMENT_STATIC_NAME(Staff_registers);
+
+bool
+Staff_registers::acceptable_request_b(Request*r)const
+{
+    return Register_group_register::acceptable_request_b(r) ||
+       (r->command() && r->command()->groupchange());
+}
+
diff --git a/lily/staff-sym-reg.cc b/lily/staff-sym-reg.cc
new file mode 100644 (file)
index 0000000..34a53a5
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+  staff-sym-reg.cc -- implement Staff_sym_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "staff-sym-reg.hh"
+#include "staff-sym.hh"
+#include "score.hh"
+#include "p-col.hh"
+
+const NO_LINES = 5;
+
+Staff_sym_register::Staff_sym_register()
+{
+   span_p_ = 0;
+   last_mom_ =0;
+}
+
+void
+Staff_sym_register::post_move_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_; // GUH
+    }
+    if (!last_mom_) {
+       last_mom_ = get_staff_info().score_l()->last();
+    }
+}
+
+
+void
+Staff_sym_register::pre_move_processing()
+{
+    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;
+    }
+}
+
+IMPLEMENT_STATIC_NAME(Staff_sym_register);
+ADD_THIS_REGISTER(Staff_sym_register);
+Staff_sym_register::~Staff_sym_register()
+{
+    assert(!span_p_);
+    delete span_p_;
+}
diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc
new file mode 100644 (file)
index 0000000..9eb0e76
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+  staffsym.cc -- implement Staff_symbol
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "staff-sym.hh"
+#include "lookup.hh"
+#include "paper-def.hh"
+#include "debug.hh"
+
+
+
+Staff_symbol::Staff_symbol(int l)
+{
+    no_lines_i_ = l;
+}
+
+IMPLEMENT_STATIC_NAME(Staff_symbol);
+
+void
+Staff_symbol::do_print()const
+{
+    mtor << "lines: " << no_lines_i_;
+}
+
+Molecule*
+Staff_symbol::brew_molecule_p() const
+{
+    Atom a  = paper()->lookup_l()->linestaff(no_lines_i_, width().length());
+    return new Molecule(a);
+}
+
+Spanner*
+Staff_symbol::do_break_at(PCol*p1, PCol*p2)const
+{
+    Staff_symbol *span_p=new Staff_symbol(*this);
+    return span_p;
+}
+
+void
+Staff_symbol::set_extent(PCol*p1, PCol*p2)
+{
+    assert(p1&&p2);
+    left_col_l_ = p1;
+    right_col_l_ = p2;
+}
index 32cd6dab1f64fc4f12234bb1fb0d66d5b7c8145f..ea37d9d63eaf2ce87b43e422784eb3f0677e15a9 100644 (file)
@@ -57,7 +57,11 @@ Staff_walker::process_timing_reqs()
        if (tr_l->meterchange()) {
            int b_i=tr_l->meterchange()->beats_i_;
            int o_i = tr_l->meterchange()->one_beat_i_;
-           time_.set_meter(b_i, o_i);
+           if (! time_.allow_meter_change_b() )
+               
+                       tr_l->warning("Meterchange should be at start of measure");
+           else
+               time_.set_meter(b_i, o_i);
                        
            *default_grouping = Rhythmic_grouping(
                MInterval(0,Moment(b_i, o_i)), b_i);
@@ -69,7 +73,7 @@ Staff_walker::process_timing_reqs()
        if (tr_l->partial()) {
            time_.setpartial(tr_l->partial()->duration_);
        } else if (tr_l->barcheck() && time_.whole_in_measure_) {
-           warning( "Barcheck failed", tr_l->defined_ch_C_ );
+           tr_l ->warning( "Barcheck failed");
        } else if (tr_l->cadenza()) {
            time_.set_cadenza(tr_l->cadenza()->on_b_);
        } else if (tr_l->measuregrouping()) {
index b23f163d29fd8f8eb4886e93178d31de2be56628..d9623fe4363380b443e5fc7933eed5a47fabb795 100644 (file)
@@ -5,20 +5,17 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "input-register.hh"
 #include "proto.hh"
-#include "plist.hh"
 #include "staff.hh"
 #include "score.hh"
 #include "voice.hh"
-#include "staff-walker.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 "midi-stream.hh"
 #include "pqueue.hh"
 
 
@@ -163,12 +160,14 @@ Staff::print() const
     for (iter_top(voice_list_,i); i.ok(); i++) {
        i->print();     
     }
+    ireg_p_->print();
     mtor <<"}\n";
 #endif
 }
 
 Staff::Staff()
 {    
+    ireg_p_ =0;
     score_l_ =0;
     pscore_l_ =0;
     pstaff_l_ =0;
index a0ac8a6f99d27aba974d6d9d115ad6575e76c419..742cee60c2653398a9090e4609a6e68440c3803e 100644 (file)
@@ -11,7 +11,9 @@
 static String
 make_vbox(Interval i)
 {
-    Real r = (i.empty()) ? 0.0 : i.length();
+    if (i.empty_b()) 
+       i = Interval(0,0);
+    Real r = i.length();
     String s("\\vbox to ");
     s += print_dimen(r);
     s += "{\\vskip "+print_dimen(i.right)+" ";
@@ -64,8 +66,8 @@ Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
     PCol *linestop = sc->cols.bottom();
     
     for (iter_top(pstaff_l_->spans,i); i.ok(); i++) {
-       PCol *brokenstart = &max(*linestart, *i->left);
-       PCol *brokenstop = &min(*linestop, *i->right);
+       PCol *brokenstart = &max(*linestart, *i->left_col_l_);
+       PCol *brokenstop = &min(*linestop, *i->right_col_l_);
        if ( *brokenstart < *brokenstop) {
            Spanner*span_p =i->broken_at(brokenstart,brokenstop);
            line_of_score_l_->pscore_l_-> // higghl
diff --git a/lily/staffsym.cc b/lily/staffsym.cc
deleted file mode 100644 (file)
index 0ad2411..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  staffsym.cc -- implement Staff_symbol
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "staffsym.hh"
-#include "lookup.hh"
-#include "paper-def.hh"
-#include "debug.hh"
-
-
-
-Staff_symbol::Staff_symbol(int l)
-{
-    no_lines_i_ = l;
-}
-
-IMPLEMENT_STATIC_NAME(Staff_symbol);
-
-void
-Staff_symbol::do_print()const
-{
-    mtor << "lines: " << no_lines_i_;
-}
-
-Molecule*
-Staff_symbol::brew_molecule_p() const
-{
-    Atom a  = paper()->lookup_l()->linestaff(no_lines_i_, width().length());
-    return new Molecule(a);
-}
-
-Spanner*
-Staff_symbol::do_break_at(PCol*p1, PCol*p2)const
-{
-    Staff_symbol *span_p=new Staff_symbol(*this);
-    return span_p;
-}
-
-void
-Staff_symbol::set_extent(PCol*p1, PCol*p2)
-{
-    assert(p1&&p2);
-    left = p1;
-    right = p2;
-}
index 9169f785995d30ca0164cf3ee3217a33532cfa8b..80aa4507719754bb67a977aea59e3f5cf4d73387 100644 (file)
@@ -88,8 +88,8 @@ Stem_beam_register::process_requests()
 
        if (beam_p_) {
            if (stem_req_l_->duration_.type_i_<= 4)
-               warning( "stem doesn't fit in Beam",
-                        stem_req_l_->defined_ch_C_);
+               
+                        stem_req_l_->warning( "stem doesn't fit in Beam");
            else
                beam_p_->add(stem_p_);
            stem_p_->print_flag = false;
@@ -146,7 +146,7 @@ Stem_beam_register::post_move_processing()
 Stem_beam_register::~Stem_beam_register()
 {
     if (beam_p_)
-       warning("unterminated beam", start_req_l_->defined_ch_C_);
+       start_req_l_->warning("unterminated beam");
 }
 
 void
@@ -156,3 +156,4 @@ Stem_beam_register::set_feature(Features i)
 }
 
 IMPLEMENT_STATIC_NAME(Stem_beam_register);
+ADD_THIS_REGISTER(Stem_beam_register);
index 5e6592c482e4b5ce82ea99cc3d066cbf77d8baf9..047aec7b9f21a86516d4997ead7d38d34f9c116e 100644 (file)
@@ -42,7 +42,7 @@ Stem::set_stemend(Real se)
 
     // todo: margins
     if (!  ((dir > 0 && se >= maxnote) || (se <= minnote && dir <0))  )        
-       warning("Weird stem size; check for narrow beams",0);
+       warning("Weird stem size; check for narrow beams");
     
     top = (dir < 0) ? maxnote           : se;
     bot = (dir < 0) ? se  : minnote;
@@ -107,7 +107,7 @@ void
 Stem::set_default_extents()
 {
     if (minnote > maxnote) {
-       warning("Empty stem. Ugh!", 0);
+       warning("Empty stem. Ugh!");
        minnote = -10;
        maxnote = 20;
     }
diff --git a/lily/swallow-reg.cc b/lily/swallow-reg.cc
new file mode 100644 (file)
index 0000000..24a20ef
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  swallow-reg.cc -- implement Swallow_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "swallow-reg.hh"
+
+IMPLEMENT_STATIC_NAME(Swallow_register);
+ADD_THIS_REGISTER(Swallow_register);
+
+bool
+Swallow_register::acceptable_request_b(Request*) const
+{
+    return true;
+}
+
+bool
+Swallow_register::try_request(Request*) 
+{
+    return true;
+}
index 4881783f5c84ddd5a0fff28bf6275f0ac1b8adfe..50208175e56ada7fd86c8fca7dba5cd193d3612b 100644 (file)
@@ -2,6 +2,7 @@
 #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"
@@ -10,3 +11,4 @@
 IPL_instantiate(Atom);
 IPL_instantiate(Input_staff);
 IPL_instantiate(Input_music);
+IPL_instantiate(Input_register);
index 22affae7edbc6a29546f2d0ea61c2344849eafdd..71fb743886a7dd877a2a22041f7db224c96acb7d 100644 (file)
@@ -8,7 +8,6 @@ Text_def::Text_def()
 {   
     align_i_ = 1;                      // right
     style_str_ = "roman";
-    defined_ch_C_ = 0;
 }
 bool
 Text_def::compare(Text_def const &def)
index fbe54a5db4e0f7e19769c581e1debde379c663e9..5c61f6179dcc97e0451ae291efaec10b29fa1705 100644 (file)
@@ -58,3 +58,4 @@ Text_register::post_move_processing()
     text_req_l_ = 0;
 }
 IMPLEMENT_STATIC_NAME(Text_register);
+ADD_THIS_REGISTER(Text_register);
index 77ab800bdbd080e53c7e9f7771216c98e391808d..fbc04ca4c605be3f90cf9ba6f4dbd8502a923ea6 100644 (file)
@@ -55,9 +55,9 @@ Text_spanner::brew_molecule_p() const
 void
 Text_spanner::do_pre_processing()
 {
-    right = support->right;
-    left = support->left;
-    assert(left && right);
+    right_col_l_ = support->right_col_l_;
+    left_col_l_ = support->left_col_l_;
+    assert(left_col_l_ && right_col_l_);
 }
 
 Interval
index cdc0071a926e5f5181635d5d116612c050623ff5..2266b61b334e4ecbd0a05accca2ed4c33f99e6fd 100644 (file)
@@ -85,7 +85,11 @@ Time_description::set_meter(int l, int o)
     if(whole_in_measure_)
        error_t("Meterchange should be at start of measure", *this);
 }
-
+bool
+Time_description::allow_meter_change_b()
+{
+    return!(whole_in_measure_);
+}
 void
 Time_description::setpartial(Moment p)
 {
diff --git a/lily/voice-element.cc b/lily/voice-element.cc
new file mode 100644 (file)
index 0000000..b499e3d
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+  voice-elt.cc -- implement Voice_element
+
+  source file of the 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(reqs,i); i.ok(); i++) {
+       i->transpose(d);
+      }
+}
+
+void
+Voice_element::print() const
+{
+#ifndef NPRINT
+    mtor << "voice_element { dur :"<< duration_ <<"\n";
+    for (iter_top(reqs,rc); rc.ok(); rc++) {
+       rc->print();
+    }
+    mtor << "}\n";
+#endif
+}
+
+void
+Voice_element::add(Request*r)
+{
+    if (r->duration()) {
+       assert (!duration_  || duration_ == r->duration());
+       duration_ = r->duration();
+    }
+    
+    r->elt_l_ = this;
+    reqs.bottom().add(r);
+}
+
+
+Voice_element::Voice_element()
+{
+    voice_C_ = 0;
+    duration_ = 0;
+}
+
+Voice_element::Voice_element(Voice_element const&src)
+    : Input(src)
+{
+  
+    voice_C_=0;
+    for (iter_top(src.reqs, i); i.ok(); i++)
+       add(i->clone());
+
+}
+bool
+Voice_element::find_plet_start_b(char c, Moment& moment_r)// b unused?
+{
+    assert( c == ']' );
+    moment_r += duration_;
+    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
+       if (i->beam() && i->beam()->spantype == Span_req::START )
+           return true;
+    }
+    return false;
+}
+
+void
+Voice_element::set_default_group(String s)
+{
+    for (iter_top(reqs, 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);
+}
+
+void
+Voice_element::set_plet_backwards(Moment& now_moment_r,
+                                 Moment until_moment, int num_i, int den_i)
+{
+    now_moment_r += duration_;
+    if ( now_moment_r > until_moment )
+       return;
+    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
+       if (i->beam() && i->beam()->spantype == Span_req::START )
+           i->beam()->nplet = den_i;
+       if (i->rhythmic()) {
+           i->rhythmic()->duration_.plet_.type_i_ = den_i;
+           i->rhythmic()->duration_.plet_.iso_i_  = num_i;
+           
+       }
+    }
+}
diff --git a/lily/voice-elt.cc b/lily/voice-elt.cc
deleted file mode 100644 (file)
index 4e33437..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-  voice-elt.cc -- implement Voice_element
-
-  source file of the 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(reqs,i); i.ok(); i++) {
-       i->transpose(d);
-      }
-}
-
-void
-Voice_element::print() const
-{
-#ifndef NPRINT
-    mtor << "voice_element { dur :"<< duration_ <<"\n";
-    for (iter_top(reqs,rc); rc.ok(); rc++) {
-       rc->print();
-    }
-    mtor << "}\n";
-#endif
-}
-
-void
-Voice_element::add(Request*r)
-{
-    if (r->duration()) {
-       assert (!duration_  || duration_ == r->duration());
-       duration_ = r->duration();
-    }
-    
-    r->elt_l_ = this;
-    reqs.bottom().add(r);
-}
-
-
-Voice_element::Voice_element()
-{
-    voice_l_ = 0;
-    duration_ = 0;
-    defined_ch_C_ = 0;
-}
-
-Voice_element::Voice_element(Voice_element const&src)
-{
-    defined_ch_C_ = src.defined_ch_C_;
-
-    voice_l_=0;
-    for (iter_top(src.reqs, i); i.ok(); i++)
-       add(i->clone());
-
-}
-bool
-Voice_element::find_plet_start_b(char c, Moment& moment_r)
-{
-    assert( c == ']' );
-    moment_r += duration_;
-    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
-       if (i->beam() && i->beam()->spantype == Span_req::START )
-           return true;
-    }
-    return false;
-}
-
-void
-Voice_element::set_default_group(String s)
-{
-    for (iter_top(reqs, i); i.ok(); i++)
-       if (i->groupchange())
-           return ;
-    Group_change_req *greq = new Group_change_req;
-    greq->newgroup_str_ = s;
-    add(greq);
-}
-
-void
-Voice_element::set_plet_backwards(Moment& now_moment_r,
-                                 Moment until_moment, int num_i, int den_i)
-{
-    now_moment_r += duration_;
-    if ( now_moment_r > until_moment )
-       return;
-    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
-       if (i->beam() && i->beam()->spantype == Span_req::START )
-           i->beam()->nplet = den_i;
-       if (i->rhythmic()) {
-           i->rhythmic()->duration_.plet_.type_i_ = den_i;
-           i->rhythmic()->duration_.plet_.iso_i_  = num_i;
-           
-       }
-    }
-}
index b9351bd8e8edb923abed6703947a64f4ad749ac0..476b204a53c73920be2b4363c94620d57e313b53 100644 (file)
 #include "voice-regs.hh"
 #include "voice-group-regs.hh"
 #include "register.hh"
-#include "text-reg.hh"
-#include "stem-beam-reg.hh"
-#include "script-reg.hh"
 #include "complex-walker.hh"
 #include "command-request.hh"
 #include "debug.hh"
-#include "dynamic-reg.hh"
+#include "input-register.hh"
 
 static int temp_id_count;
 
-Voice_group_registers::Voice_group_registers(String id)
+Voice_group_registers::Voice_group_registers(String id,
+                                            Input_register const *ireg_C)
 {
-    add(new Dynamic_register);
-    add(new Text_register);
-    add(new Stem_beam_register);
-    add(new Script_register);
-    
+    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;
@@ -44,35 +39,15 @@ Voice_group_registers::try_request(Request*r_l)
     }
     return false;
 gotcha:
-    if (r_l->groupfeature()) {
-       set_feature(Features::dir(r_l->groupfeature()->stemdir_i_));
+    Command_req* c_l = r_l->command();
+    if (c_l&& c_l->groupfeature()) {
+       set_feature(Features::dir(c_l->groupfeature()->stemdir_i_));
        return true;
     }
     return Register_group_register::try_request(r_l);
 }
 
 
-bool
-Voice_group_registers::static_acceptable_request_b(Request*r)
-{
-    return (r->stem() || r->beam() || r->text() || r->script() ||
-           r->groupfeature());
-}
-
-void
-Voice_group_registers::terminate_register(Request_register*r_l)
-{
-    if (r_l->name() == Voice_registers::static_name()) {
-       for (int i=0; i <voice_regs_l_.size(); i++) {
-           if (r_l == voice_regs_l_[i])
-               voice_regs_l_.del(i);
-           mtor << "Terminating voice_reg " ;
-           Register_group_register::terminate_register(r_l);
-           return;
-       }
-    }
-    assert(false);
-}
 IMPLEMENT_STATIC_NAME(Voice_group_registers);
 
 void
@@ -107,3 +82,15 @@ Voice_group_registers::post_move_processing()
     }
     Register_group_register::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_regs_l_.size(); i++) {
+           if (reg_l == voice_regs_l_[i])
+               voice_regs_l_.del(i);
+       }
+     }
+     return Register_group_register::get_register_p(reg_l);
+}
index 2aa7f18eb002d600d0f58cf2b6c127d943694815..55732e52a24065a8af2fc04e7b95f1fe38244f70 100644 (file)
 #include "musical-request.hh"
 #include "voice-regs.hh"
 #include "register.hh"
-#include "slur-reg.hh"
-#include "headreg.hh"
-#include "walk-regs.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)
+Voice_registers::Voice_registers(Voice *v_p, Input_register const*ireg_C)
 {
+    ireg_C_ = ireg_C;
     voice_l_ = v_p;
-    add(new Notehead_register);
-    add(new Slur_register);
+    add(ireg_C->get_nongroup_p_arr());
 }
 
 void
@@ -42,8 +42,12 @@ Voice_registers::try_request(Request*r_l)
        daddy_reg_l_->terminate_register(this);
        return true;            // scary. We're deleted now.. 
     } else if (c&&c->groupchange()) {
-
-       ((Walker_registers*)daddy_reg_l_->daddy_reg_l_)->       // scary.
+       /* 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_); // UGR!
        return true;
@@ -56,7 +60,7 @@ bool
 Voice_registers::acceptable_request_b(Request*r)
 {
     Command_req *  c_l = r->command();
-    return  r->groupchange() || (c_l&&c_l->terminate())
+    return   (c_l&&(c_l->terminate()||c_l->groupchange()))
        || Register_group_register::acceptable_request_b(r);
 }
 IMPLEMENT_STATIC_NAME(Voice_registers);
index d76b3ebe83f975e7f3e49e21ef8ccef1e9ae7b01..a5e10f7fd985847ca067cff56322ac6d6f94be6b 100644 (file)
@@ -65,7 +65,7 @@ Voice::Voice()
 void
 Voice::add(Voice_element*v)
 {
-    v->voice_l_ = this;
+    v->voice_C_ = this;
     elts.bottom().add(v);
 }
 
index b258bd559d23b42ebcabe28b4eb30b1d68da02da..e0221462e793d430711379f25befa4a578287d72 100644 (file)
@@ -5,32 +5,26 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
 #include "debug.hh"
-#include "clef-reg.hh"
-#include "local-key-reg.hh"
-#include "key-reg.hh"
-#include "meter-reg.hh"
-#include "bar-reg.hh"
-#include "bar.hh"
 #include "walk-regs.hh"
+#include "staff-regs.hh"
 #include "staff-elem.hh"
 #include "staff.hh"
 #include "complex-walker.hh"
 #include "staff-column.hh"
-#include "voice-group-regs.hh"
-#include "voice-regs.hh"
-#include "command-request.hh"
 #include "score-walker.hh"
+#include "bar.hh"              // needed for Bar::static_name
+#include "input-register.hh"
 
 Walker_registers::Walker_registers(Complex_walker *w)
 {
     walk_l_ = w;
-    add( new Bar_register);
-    add( new Clef_register);
-    add( new Key_register);
-    add( new Meter_register);
-    add( new Local_key_register);
+    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
@@ -101,70 +95,12 @@ Walker_registers::post_move_processing()
     Register_group_register::post_move_processing();
 }
 
-void
-Walker_registers::change_group(Group_change_req * greq_l,
-                              Voice_registers *voice_regs_l,
-                              Voice_group_registers * old_group)
-{
-    Voice_registers *regs_p = (old_group)
-       ? (Voice_registers*) old_group->get_register_p(voice_regs_l)
-       : new Voice_registers(greq_l->voice_l());
-    Voice_group_registers * new_group_l = get_group(greq_l->newgroup_str_);
-    new_group_l->add(regs_p);
-    
-    mtor << "processed change request";
-    print();
-}
-
-Voice_group_registers *
-Walker_registers::get_group(String id)
-{
-    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);
-    group_l_arr_.push(group_p);
-    add(group_p);
-    return group_p;
-}
-
-void
-Walker_registers::terminate_register(Request_register * reg)
-{
-    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);
-}
-
-bool
-Walker_registers::try_request(Request * r)
-{
-    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);
-       } else 
-           warning("junking request: "  + String(r->name()),
-                   r->defined_ch_C_);
-    }
-    return b;
-}
-
 
 Staff_info
 Walker_registers::get_staff_info() return inf;
 {
     if (walk_l_->score_walk_l_)        // we get called ctors
        inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
-    inf.c0_position_i_ = &walk_l_->c0_position_i_;
     inf.walk_l_ = walk_l_;
     inf.time_C_ = &walk_l_->time_;
     inf.rhythmic_C_ = walk_l_->default_grouping;
index 2b9f1db767d265d4a5a2cfcef701e71834aab139..4240aa04b5459a6da8f2b0f6d64c3bd28a8320f8 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  warn.cc -- implement warning and error messages. Needs cleanup.
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "proto.hh"
 #include "plist.hh"
 #include "debug.hh"
 #include "source-file.hh"
 #include "source.hh"
 #include "main.hh"
+#include "input.hh"
 
 ostream &warnout (cerr);
 ostream *mlog(&cerr);
-/*
-void
-warning(String s)
-{
-    WARN << s;
-}
-*/
+
 
 void
 error(String s)
@@ -44,7 +47,7 @@ error_t(String const & s, Time_description const &t_tdes)
 void
 message( String message_str, char const* context_ch_C )
 {
-    String str = "";           //"lilypond: ";// GNU format messages!
+    String str = "";
     Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_C );
     if ( sourcefile_l ) {
        str += sourcefile_l->file_line_no_str(context_ch_C) + String(": ");
@@ -76,3 +79,16 @@ error( String message_str, char const* context_ch_C )
         lexer->errorlevel_i_ |= 1;*/
 //    exit( 1 );
 }
+
+
+void
+warning(String m)
+{
+    warning(m, (char*)0);
+}
+
+void
+message(String m)
+{
+    error(m, (char*)0);
+}
index ba1d2e37625f70d0fd53afc769a84dec6d0b0e68..7c2bf11c1f248ae1e2fa2849694baac6fa6b09d5 100644 (file)
@@ -1,3 +1,13 @@
+# project  LilyPond -- the musical typesetter
+# title           automatic file variables
+# file    make/Files.make
+# abstract mmm, brr.
+#          
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
 # list of c++ header files:
 # 
 HHFILES = $(wildcard *.hh)
@@ -5,24 +15,26 @@ HHFILES = $(wildcard *.hh)
 
 # list of c++ inline files:
 # 
-INLFILES = $(wildcard *.inl)
+INLFILES = $(wildcard *.icc)
 #
 
 # list of c++ template files:
 # 
-
 TCCFILES = $(wildcard *.tcc)
+#
 
+# list plain c++ source files:
+# 
+CCFILES = $(wildcard *.cc)
 #
+
 # list of other source files:
 #
-
 EXTRA_SOURCE_FILES = $(wildcard *.y *.l)
-
 #
+
 PODFILES = $(wildcard *.pod)
 
-CCFILES = $(wildcard *.cc)
 MAKEFILES = $(wildcard *.make)
 
 ALL_SOURCES=$(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES) $(INLFILES) \
index 0928f016e26c02b3bc6b55e57f9ffd44371bc283..0d51e646b0ab78d1792aa5f49afe3204bed4f2d3 100644 (file)
@@ -35,5 +35,8 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
-lilypond.spec: lilypond.spec.in $(depth)/.version
-       sed 's/@TOPLEVEL_VERSION@/${TOPLEVEL_VERSION}/g'< $< > $@
+spec: $(outdir)/lilypond.spec
+
+rpm-docs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/$(outdir)/*.text)))
+$(outdir)/lilypond.spec: lilypond.spec.in $(depth)/.version
+       cat $< | sed 's/@TOPLEVEL_VERSION@/${TOPLEVEL_VERSION}/g'|sed 's#@TEXT_DOCS@#$(rpm-docs)#g' > $@
diff --git a/make/Sources.make b/make/Sources.make
deleted file mode 100644 (file)
index 6411aa2..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-# kept in dist bo stripping stable stuff, still to copy...
-
-# Sources.make
-# sourcefiles to be shipped. Also used for dependencies
-
-hdr=bar.hh barreg.hh beam.hh\
-       binary-source-file.hh\
-       boxes.hh break.hh clefreg.hh clefitem.hh\
-       colhpos.hh  commandrequest.hh   \
-       complexwalker.hh complexstaff.hh\
-       const.hh debug.hh dimen.hh directionalspanner.hh\
-       glob.hh grouping.hh headreg.hh idealspacing.hh\
-       identifier.hh identparent.hh \
-       inputmusic.hh inputscore.hh inputstaff.hh\
-       inputfile.hh\
-       item.hh key.hh keyitem.hh\
-       keyreg.hh\
-       keyword.hh leastsquares.hh lexer.hh linespace.hh \
-       localkeyitem.hh localkeyreg.hh lookup.hh \
-       lyricitem.hh lyricstaff.hh lyricwalker.hh\
-       main.hh  meter.hh meterreg.hh\
-       mididef.hh midiitem.hh midioutput.hh midistream.hh\
-       midiwalker.hh\
-       misc.hh\
-       molecule.hh moment.hh musicalrequest.hh\
-       notehead.hh notename.hh offset.hh paperdef.hh\
-       parseconstruct.hh pcol.hh proto.hh\
-       pscore.hh pstaff.hh qlp.hh\
-       qlpsolve.hh register.hh registergroup.hh reqtodo.hh \
-       request.hh rest.hh scorecolumn.hh score.hh\
-       scoreline.hh scorewalker.hh script.hh scriptdef.hh scriptreg.hh \
-       slur.hh slurreg.hh source.hh sourcefile.hh\
-       spanner.hh staff.hh\
-       staffelem.hh staffeleminfo.hh staffline.hh staffsym.hh stembeamreg.hh\
-       staffcolumn.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
-       tex.hh textdef.hh \
-       textitem.hh textreg.hh textspanner.hh timedescription.hh \
-       tstream.hh voice.hh\
-       voiceregs.hh voicegroupregs.hh walkregs.hh
-
-mycc=bar.cc barreg.cc beam.cc \
-       binary-source-file.cc\
-       boxes.cc break.cc calcideal.cc clefreg.cc\
-       clefitem.cc colhpos.cc  commandrequest.cc\
-       complexstaff.cc complexwalker.cc \
-       debug.cc dimen.cc\
-       directionalspanner.cc\
-       grouping.cc groupregs.cc headreg.cc\
-       idealspacing.cc identifier.cc\
-       inputmusic.cc inputscore.cc\
-       inputstaff.cc\
-       inputfile.cc\
-       item.cc key.cc keyitem.cc \
-       keyreg.cc keyword.cc\
-       leastsquares.cc lexerinit.cc linespace.cc \
-       localkeyitem.cc localkeyreg.cc lookup.cc\
-       lyricitem.cc lyricstaff.cc lyricwalker.cc\
-       main.cc  meter.cc meterreg.cc\
-       mididef.cc  midiitem.cc midioutput.cc midistream.cc\
-       midiwalker.cc misc.cc molecule.cc mylexer.cc note.cc\
-       notehead.cc  notename.cc\
-       paperdef.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
-       register.cc registergroup.cc request.cc rest.cc\
-       scorecolumn.cc score.cc\
-       scoreline.cc scores.cc scorewalker.cc script.cc\
-       scriptdef.cc scriptreg.cc slur.cc\
-       slurreg.cc source.cc sourcefile.cc\
-       spanner.cc staff.cc\
-       staffelem.cc staffline.cc staffsym.cc\
-       stembeamreg.cc staffcolumn.cc stem.cc\
-       staffeleminfo.cc staffwalker.cc symbol.cc\
-       symtable.cc tex.cc texbeam.cc\
-       texslur.cc textdef.cc textitem.cc textreg.cc textspanner.cc\
-       timedescription.cc tstream.cc voice.cc voiceelt.cc \
-       voiceregs.cc voicegroupregs.cc\
-       walkregs.cc warn.cc windhoos-suck-suck-suck-thank-you-cygnus.cc wordwrap.cc\
-       template1.cc template2.cc template3.cc template4.cc\
-       template5.cc template6.cc version.cc
-
-# a bit of a hack to keep exec size under control.
-stablecc=request.cc bar.cc boxes.cc break.cc  \
-       item.cc keyword.cc leastsquares.cc \
-       lookup.cc molecule.cc meter.cc\
-       paperdef.cc parser.cc lexer.cc pstaff.cc qlp.cc qlpsolve.cc\
-       template1.cc template2.cc template3.cc template4.cc\
-       template5.cc template6.cc version.cc tstream.cc  tex.cc\
-       voice.cc wordwrap.cc spanner.cc 
-
-
-# mi2mu headers
-#
-mymi2muhh=\
- duration.hh\
- lily-stream.hh\
- midi-event.hh\
- midi-main.hh\
- midi-score.hh\
- midi-track.hh\
- my-midi-lexer.hh\
- my-midi-parser.hh\
- track-column.hh\
-
-#
-
-# mi2mu shared headers
-#
-mymi2musharedhh=\
- binary-source-file.hh\
-
-#
-
-# mi2mu source
-#
-mymi2mucc=\
- duration.cc\
- lily-stream.cc\
- midi-event.cc\
- midi-main.cc\
- midi-score.cc\
- midi-template.cc\
- midi-track.cc\
- my-midi-lexer.cc\
- my-midi-parser.cc\
- track-column.cc\
-
-#
-
-# mi2mu shared source
-#
-mymi2musharedcc=\
- binary-source-file.cc\
- inputfile.cc\
- sourcefile.cc\
- source.cc\
-
-# 
-
index de89f3d4173a427d0e1c325fad6b2b943fc863b2..2ab80134cab5c7c2363dd3a5564635cbfd18a539 100644 (file)
@@ -32,7 +32,9 @@ EXECUTABLE = $(lily_bindir)/$(NAME)
 $(EXECUTABLE): $(build) $(OFILES) $(CUSTOMLIBES) 
        $(INCREASE_BUILD)
        $(MAKE) -S $(OFILES)  $(SILENT_LOG)
-#      $(STRIPDEBUG) $(STABLEOBS)
+ifdef STABLEOBS
+       $(DO_STRIP) $(STABLEOBS)
+endif
        $(LD_COMMAND) $(OFILES) $(LOADLIBES)
 
 exe: $(EXECUTABLE)
@@ -61,8 +63,12 @@ ifdef SUBDIRS
        set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
 endif
 
-distclean: clean
-       rm -rf Makefile $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen)
+distclean: localdistclean 
+ifdef SUBDIRS
+       set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i localdistclean; done
+endif
+
+localdistclean:
 
 
 # configure:
@@ -107,7 +113,7 @@ doc:
 
 # doc++ documentation of classes
 doc++: $(progdocs)     
-       doc++ -kp -d $(DOCDIR) $^
+       doc++ -k -p -d $(DOCDIR) $^
 
 dist:
        -mkdir $(distdir)
@@ -193,3 +199,14 @@ $(LIBLILY): dummy
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
 #
 
+# RedHat rpm package:
+#
+#rpm:  dist
+#      mv ./$(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
+rpm:
+       cp ./$(depth)/../releases/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
+       cp $(doc-dir)/*.gif $(rpm-sources)
+       $(MAKE) -C $(make-dir) spec
+       rpm -ba $(makeout)/lilypond.spec
+#
+
index e9b0ef58d6609a6de594ab8d2bddb7f8956f8818..ae4e131c1a58e56a33cd20b9661075370f9a4d19 100644 (file)
@@ -56,6 +56,11 @@ INSTALL.text: check-doc-deps
        rm -f INSTALL.text
        ln `find -name INSTALL.text|head -1` .
 
+localdistclean:
+       rm -rf Makefile $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen) config.cache config.status
+
+
+
 localclean:
        rm -f $(allexe) core config.cache config.log config.status 
        rm -f $(outdir)/*.{class,html,gif}
index 05fac713f5d2518ec3d73864b8d9a88bcf1d0955..2a9fd5e36f13d46d7c9128fa3d36873c965b69a6 100644 (file)
@@ -26,7 +26,10 @@ DEBUGFLAG=-g
 
 # turn off -pipe if linker doesn't support it
 # 
-USER_CXXFLAGS=-pipe -Wall -W   -Wmissing-prototypes
+# USER_CXXFLAGS=-pipe -Wall -W   -Wmissing-prototypes
+# added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
+# huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
+USER_CXXFLAGS=-pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
 
 #
 # -lefence = ElectricFence.
index d1ca0485813e9a05f39b5a4f426a252f7e906cc1..8c3ab6f49729ed1f12335d61d8def93e3cf6b014 100644 (file)
@@ -3,7 +3,7 @@
 # title           generic variables
 # file    make/Variables.make
 # abstract do not change this file for site-wide extensions;
-# please edit settings in User.make 
+#          please edit settings in User.make 
 #
 # Copyright (c) 1997 by    
 #      Jan Nieuwenhuizen <jan@digicash.com>
@@ -15,6 +15,10 @@ include ./$(depth)/.version
 #
 include ./$(depth)/make/out/Configure_variables.make
 
+# ugh, for win32 make
+# leave me up here, or i won-t work
+export CXX
+
 ifeq (0,${MAKELEVEL})
 MAKE:=$(MAKE) --no-builtin-rules
 endif
@@ -33,6 +37,7 @@ libdir = $(outdir)
 lilyout = ./$(depth)/lily/$(outdir)
 mi2muout = ./$(depth)/mi2mu/$(outdir)
 makeout = ./$(depth)/make/$(outdir)
+doc-dir = ./$(depth)/Documentation
 flower-dir = ./$(depth)/flower
 lib-dir = ./$(depth)/lib
 lily-dir = ./$(depth)/lily
@@ -41,6 +46,8 @@ make-dir = ./$(depth)/make
 include-lib = ./$(depth)/lib/include
 include-flower = ./$(depth)/flower/include
 #
+rpm-sources = /usr/src/redhat/SOURCES
+#
 
 # user settings:
 #
@@ -53,9 +60,6 @@ BUILD = $(shell cat $(build))
 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
 #
 
-# ugh, for win32 make
-export CXX
-
 # the version:
 #
 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
@@ -122,7 +126,7 @@ CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
 CXX_OUTPUT_OPTION = $< -o $@
 LDFLAGS = $(EXTRA_LDFLAGS)
-LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES)
+LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++ # need lg++ for win32, really!
 #
 
 # librarian:
@@ -171,7 +175,14 @@ STRIPDEBUG=true #replace to do stripping of certain objects
 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
 DOCDIR=$(depth)/$(outdir)
 
-
-progdocs=$(allhh) $(allcc) 
+# .hh should be first. Don't know why
+progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
        --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
+STRIP=strip --strip-debug
+ifdef stablecc
+ STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
+endif
+stablecc=
+DO_STRIP=true
+
index 600f62b6173bc1db38b08694f414989605df0343..ed2fe175b7f910524371f5a7f2a1d147f3b4e385 100644 (file)
@@ -11,9 +11,9 @@ Icon: lelie_icon.gif
 
 %description
 LilyPond is a program which converts a music-script (mudela) into
-TeX output, or MIDI to produce multi-staff scores. Feature include multiple
+TeX output, or MIDI to produce multi-staff scores. Features include multiple
 meters, clefs, keys, lyrics, versatile input-language, cadenzas
-beams, slurs, triplets
+beams, slurs, triplets.
 
 %prep
 %setup
@@ -24,14 +24,11 @@ make all
 make install
 strip /usr/bin/lilypond /usr/bin/mi2mu 
 %files
-%doc Documentation/out/index.text Documentation/out/CodingStyle.text
-%doc Documentation/out/lilygut.text Documentation/out/lilyinput.text
-%doc Documentation/out/error.text Documentation/out/faq.text
-%doc Documentation/out/INSTALL.text
-%doc Documentation/out/language.text Documentation/lelie_logo.gif
+%doc @TEXT_DOCS@ Documentation/lelie_logo.gif
 /usr/bin/lilypond
 /usr/bin/mi2mu
 /usr/man/man1/lilypond.1
+/usr/man/man5/mudela.5
 /usr/lib/texmf/texmf/tex/lilypond/
 /usr/share/lilypond/
 
index 18de844098b55da6ee090175ad65210f27c577cc..ecf889bba652dfdd31a662b88e18248ada1b24cd 100644 (file)
@@ -143,7 +143,7 @@ Midi_track::output_mudela( Lily_stream& lily_stream_r )
                        tor( NORMAL_ver ) << '[' << flush; 
 
                if ( bars_i > bar_i ) { 
-                       Moment into_bar_mom = now_mom - ( bars_i - 1 ) * bar_mom;
+                       Moment into_bar_mom = now_mom - Moment( bars_i - 1 ) * bar_mom;
                        if ( bars_i > 1 ) {
                                if ( !into_bar_mom )
                                        lily_stream_r << "|";
index 2237f638066816e15026d8f63f64ec630e1f6993..3325743dbe5f722206d7ea4e58c1ecc34685ea09 100644 (file)
@@ -41,6 +41,7 @@
         \font\hslurdfont=xslhd20
         \font\hslurhfont=xslhz20
         \font\musicfnt=musix20
+        \font\musicdraw=musixsps
         \font\italicfont=cmti10
         \font\dynfont=cmbxti10 scaled \magstep1
         \balkhoog=20pt
@@ -63,6 +64,7 @@
         \font\hslurhfont=xslhz20
         \font\musicfnt=musix16
         \font\dynfont=cmbxti10
+        \font\musicdraw=musixsps
         \balkhoog=16pt
         \staffrulethickness=0.4pt
         \notewidth=5pt
 
 \def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}}
 \def\rulesym#1#2{\vrule height #1 width #2}
-\def\crescendosym#1{\count0=84\advance\count0 by #1}
-\def\decrescendosym#1{\count0=116\advance\count0 by #1}
+\def\crescendosym#1{\count0=84\advance\count0 by #1\musicdraw\char\count0}
+\def\decrescendosym#1{\count0=116\advance\count0 by #1\musicdraw\char\count0}
 \def\settext#1{\textfont #1}
 \def\setitalic#1{\italicfont #1}
 \def\setdynamic#1{\dynfont #1}