]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.41 release/0.0.41
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 12 Mar 1997 13:45:33 +0000 (14:45 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 12 Mar 1997 13:45:33 +0000 (14:45 +0100)
196 files changed:
.dstreamrc
.version
Documentation/CodingStyle.pod
Documentation/language.pod
INSTALL
NEWS
TODO
configure
flower/.version
flower/Makefile
flower/NEWS
flower/Sources.make [deleted file]
flower/TODO
flower/Variables.make [deleted file]
flower/assoc-iter.hh [deleted file]
flower/assoc.hh [deleted file]
flower/choleski.cc [deleted file]
flower/choleski.hh [deleted file]
flower/compare.hh [deleted file]
flower/cursor.hh [deleted file]
flower/cursor.inl [deleted file]
flower/cursor.tcc [deleted file]
flower/data-file.cc [deleted file]
flower/data-file.hh [deleted file]
flower/dstream.cc [deleted file]
flower/dstream.hh [deleted file]
flower/fproto.hh [deleted file]
flower/handle.hh [deleted file]
flower/interval.hh [deleted file]
flower/interval.tcc [deleted file]
flower/iterate.hh [deleted file]
flower/lgetopt.cc [deleted file]
flower/lgetopt.hh [deleted file]
flower/lib/Makefile
flower/lib/dstream.cc
flower/lib/include/flower-config.hh [new file with mode: 0644]
flower/lib/include/fproto.hh
flower/lib/include/pqueue.hh
flower/lib/include/string-convert.hh
flower/lib/string-convert.cc
flower/libc-extension.cc [deleted file]
flower/libc-extension.hh [deleted file]
flower/link.hh [deleted file]
flower/link.inl [deleted file]
flower/list.hh [deleted file]
flower/list.inl [deleted file]
flower/list.tcc [deleted file]
flower/make_version [deleted file]
flower/matdebug.cc [deleted file]
flower/matrix.cc [deleted file]
flower/matrix.hh [deleted file]
flower/path.cc [deleted file]
flower/path.hh [deleted file]
flower/pcursor.hh [deleted file]
flower/pcursor.tcc [deleted file]
flower/plist.hh [deleted file]
flower/plist.inl [deleted file]
flower/plist.tcc [deleted file]
flower/pqueue.hh [deleted file]
flower/rational.hh [deleted file]
flower/real.hh [deleted file]
flower/scalar.cc [deleted file]
flower/scalar.hh [deleted file]
flower/smat.cc [deleted file]
flower/smat.hh [deleted file]
flower/string-convert.cc [deleted file]
flower/string-convert.hh [deleted file]
flower/string-data.hh [deleted file]
flower/string-data.inl [deleted file]
flower/string-handle.hh [deleted file]
flower/string-handle.inl [deleted file]
flower/string.cc [deleted file]
flower/string.hh [deleted file]
flower/stringtest.cc [deleted file]
flower/stringutil.cc [deleted file]
flower/text-db.cc [deleted file]
flower/text-db.hh [deleted file]
flower/text-stream.cc [deleted file]
flower/text-stream.hh [deleted file]
flower/unionfind.cc [deleted file]
flower/unionfind.hh [deleted file]
flower/varray.hh [deleted file]
flower/vector.cc [deleted file]
flower/vector.hh [deleted file]
flower/vsmat.hh [deleted file]
init/dutch.ini
init/dynamic.ini
init/swedish.ini
input/fugue1.midi.ly
input/pre1.midi.ly
input/standchen.ly
lib/duration.cc
lib/include/duration.hh
lib/include/proto.hh
lily/bar-reg.cc
lily/beam.cc
lily/break.cc
lily/calcideal.cc
lily/clef-reg.cc
lily/command-request.cc [new file with mode: 0644]
lily/commandrequest.cc [deleted file]
lily/complex-staff.cc
lily/complex-walker.cc
lily/crescendo.cc [new file with mode: 0644]
lily/dynamic-reg.cc
lily/headreg.cc
lily/idealspacing.cc
lily/identifier.cc
lily/include/command-request.hh [new file with mode: 0644]
lily/include/commandrequest.hh
lily/include/crescendo.hh [new file with mode: 0644]
lily/include/identifier.hh
lily/include/identparent.hh
lily/include/input-music.hh
lily/include/lexer.hh
lily/include/midi-def.hh
lily/include/midi-item.hh
lily/include/midi-output.hh
lily/include/musical-request.hh [new file with mode: 0644]
lily/include/musicalrequest.hh [deleted file]
lily/include/p-col.hh [new file with mode: 0644]
lily/include/p-score.hh [new file with mode: 0644]
lily/include/parseconstruct.hh
lily/include/pcol.hh [deleted file]
lily/include/pscore.hh [deleted file]
lily/include/pstaff.hh [deleted file]
lily/include/slur.hh
lily/include/staffline.hh
lily/input-music.cc
lily/key-reg.cc
lily/lexer.l
lily/linespace.cc
lily/local-key-item.cc
lily/local-key-reg.cc
lily/lyric-item.cc
lily/lyric-staff.cc
lily/lyric-walker.cc
lily/meter-reg.cc
lily/midi-def.cc
lily/midi-item.cc
lily/midi-output.cc
lily/midi-walker.cc
lily/molecule.cc
lily/musical-request.cc [new file with mode: 0644]
lily/mylexer.cc
lily/note.cc
lily/notehead.cc
lily/notename.cc
lily/p-col.cc [new file with mode: 0644]
lily/p-score.cc [new file with mode: 0644]
lily/p-staff.cc [new file with mode: 0644]
lily/parser.y
lily/pcol.cc [deleted file]
lily/pscore.cc [deleted file]
lily/pstaff.cc [deleted file]
lily/register.cc
lily/request.cc [deleted file]
lily/score-column.cc
lily/score.cc
lily/scoreline.cc
lily/script-reg.cc
lily/script.cc
lily/slur-reg.cc
lily/slur.cc
lily/spanner.cc
lily/staff-column.cc
lily/staff-elem.cc
lily/staff-walker.cc
lily/staff.cc
lily/staffline.cc
lily/stem-beam-reg.cc
lily/stem.cc
lily/template1.cc
lily/template2.cc
lily/text-item.cc
lily/text-reg.cc
lily/voice-elt.cc
lily/voice-group-regs.cc
lily/voice-regs.cc
lily/voice.cc
lily/walk-regs.cc
lily/wordwrap.cc
make/Rules.make
make/configure.in
mi2mu/.version
mi2mu/include/midi-event.hh
mi2mu/include/midi-global.hh
mi2mu/include/midi-track.hh
mi2mu/include/my-midi-parser.hh
mi2mu/lily-stream.cc
mi2mu/main.cc
mi2mu/midi-event.cc
mi2mu/midi-parser.y
mi2mu/midi-score.cc
mi2mu/midi-track.cc
mi2mu/my-midi-parser.cc

index 2b36f415449e3174887323e13c18a7b64ab8ec00..c7b8c24c7701b001462656df759bc49e81c7938e 100644 (file)
@@ -1,4 +1,5 @@
 # class name           silence?
+Dstream                        1
 
 My_flex_lexer          1
 yyFlexLexer            1
@@ -23,9 +24,9 @@ Lexer                 1
 parse_duration         1
 parse_pitchmod         1
 Col_configuration      1
-Request                        1
-Note_req               1
-Rhythmic_req           1
+Request                        0
+Note_req               0
+Rhythmic_req           0
 Rest_req               1
 delete_identifiers     1
 Command                        1
@@ -39,7 +40,7 @@ Input_cursor          1
 Commands_at            1
 Input_command          1
 Time_description       1
-Melodic_req            1
+Melodic_req            0
 Midi_walker            1
 Stem_req               1
 Group_change_req       1
index 60504f184743373c9328d58862468aa059bf815f..6bdeb2687759dd2599e3e975da423c63aa35100a 100644 (file)
--- a/.version
+++ b/.version
@@ -1,6 +1,6 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 40
+TOPLEVEL_PATCH_LEVEL = 41
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
index 9bf71c38100fcf962a3b8fb698d17f2cd6c57944..a23cd5f46e7d5c67e75e04eb77b70130bf84fa93 100644 (file)
@@ -211,7 +211,7 @@ with the parts of the names separated by underscores.
 =item C<byte>
 unsigned char. (The postfix _by is ambiguous)
 
-=item C<bo>
+=item C<b>
 bool
 
 =item C<bi>
index e316fdc14e9c969ed5132154bfd460a8555ae550..88a008ca2351353bbdc688f2d6d34b3dd38f3396 100644 (file)
@@ -1,3 +1,4 @@
+
 =head1 NAME
 
 language.pod -- state of the art mudela-vapourware.
@@ -129,6 +130,17 @@ voices on one staff?
 We might be able to do without the staff{} construct, but I doubt if
 it will make things easier.
 
+=head1 CONCRETE PROPOSAL
+
+Any optional request/modifier should follow the note/rest-name/lyric:
+
+       old             new
+       ''!a            a!''
+       [a()a]()a       a[( a)]( a) 
+
+the []() construct doesn't look nice. We might make an exception for
+spanning requests.
+
 =head1 THOUGHTS
 
 =head2 Typing
diff --git a/INSTALL b/INSTALL
index e6fe95267ad2255177f2894cc5412cdc7b760215..c36823be781c069abe210faf033814ad20fca77c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -41,7 +41,8 @@ SUPPORT
        * linux 2.0.28, g++ 2.7.2[.1]
        * aix 4.1, g++ 2.7.2
        * windows-nt 4.0, cygnus gnu-win32 beta17.1 (~=g++ 2.7.2)
-       * linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2)
+       * linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2), but segfaults 
+         in 16 bit subsystem %-/
 
 Have fun!
 
diff --git a/NEWS b/NEWS
index 999d01b5a61e56f9cb5c8fa15700772c1be7db69..d62e32a4d2d2f900728de1020059ec3c1741430e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,42 @@
+pl 41
+       - release
+pl 40.3
+       - all of the above
+       - hw's configure.in
+       - p-name.xx fixes
+
+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.
+       - mi2mu starts to look promising, see examples
+Examples
+       - pre1.midi.ly, fugue.midi.ly
+Internal
+       - Duration handles blonde midi-durations
+       - More settings for Duration_convert
+       - lily writes meter too (ugh, howto?)
+Bugfix
+       - mi2mu auto track number fix
+       - mi2mu / lily Midi_tempo fixed/added
+
+pl 40.1
+Bugfix
+       - lily midi output track 0 name
+       - mi2mu tempo fixed
+       - make out/make and out/make/Site.make in configure script!
+       - mi2mu double newline fix
+
+
+******
 pl 40
        - release
 
 pl 39-5
-       - own versioning for mi2mu
+       - own versioning for mi2mu: 0.0.10
        - some file renaming mi2mu
 pl 39-4
        - all of the above
diff --git a/TODO b/TODO
index b3d03f91ba5704e96dfc1766f2dd24140eb2437a..89b5570bf1a421e4ca6488e35a60f2a25bb89b61 100644 (file)
--- a/TODO
+++ b/TODO
@@ -14,12 +14,12 @@ before 0.1
 
        * caching of Register_group_register hierarchies.
 
-       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
-
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
 STUFF
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
        * generate all (.hh) files into out dirs
 
        * sort out headers, see m2m
@@ -29,9 +29,6 @@ STUFF
        * make install.
        
 BUGS
-
-       * barf if no score_wde_music
-
        * plet bugs: scales.ly
 
        * key at clef change.
@@ -46,12 +43,12 @@ BUGS
 
        * Group_feature at start of music. 
 
+       * parser error handling (can you say Segfault?)
+
 SEVERELY LACKING:
 
        * grace notes
 
-       * dynamics (hairpins) 
-
 INPUTLANGUAGE
 
        * lose the $ and @ ?
@@ -134,7 +131,9 @@ FUTURE
 
        * implement better breaking algorithm
 
-       * Implement all requests
+       * Text_crescendo
+
+       * clean solution for staffsize in items.
 
        * merge key{item} & localkey{item}?
 
index 2e50a3fbf4eca38774f10f5909562a51a397f981..bf45d5782752ff4cf52d86fc4a2bd7f6b8427d52 100755 (executable)
--- a/configure
+++ b/configure
@@ -2,7 +2,7 @@
 #
 # project  LilyPond -- the musical typesetter
 # title           (bash/sh/ksh) script to setup library and auto generated files
-# file    configure
+# file    configure-broken-system
 #
 # Copyright (c) 1997 by    
 #      Han-Wen Nienhuys <hanwen@stack.nl>
@@ -32,6 +32,7 @@ fi
 do_outdir() {
        if [ \! -d $1/out ]
        then
+               touch $1/.GENERATE
                mkdir $1/out
                echo 0 > $1/.build
        fi
@@ -39,17 +40,8 @@ do_outdir() {
 
 echo using PREFIX=$PREFIX
 
-#ugh # dist ze dan!, nou stiekem wordt "out" later toch "loes" of "doze"
-# do_outdir flower/lib
-# now all make rules!
-
-echo Configuring Flower Library
-
-#ugh, now all make rules
-# the _real_ config stuff should be generated here, though.
-# echo '#define LIBDIR "'$PREFIX'/"'> lib/out/config.hh
-# touch flower/lib/out/flower-config.hh
-# touch make/out/Site.make
+do_outdir make
+touch make/out/Site.make
 
 $MAKE -C make -f Initial.make
 
index 45d4ace49282eada95c2aff9d7f143aca304f50e..6c589619a0487fba38fd7f495045d4757538e909 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 7
+PATCH_LEVEL = 6
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index f4ab0e668f304d9016c4a6f89419845afaf6d4e5..abca493fbd94cc344ed62807f314fc69aa35cd4c 100644 (file)
@@ -1,54 +1,56 @@
-include Variables.make
+#
+# project  FlowerSoft C++ library
+# title           top level makefile for FlowerLib
+# file    flower/Makefile
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#              ...your sort order here, or how to comment-out a comment
+
+# subdir level:
+#
+depth = ..
+#
+
+# identify module:
+#
+NAME = flower
+MODULE_NAME = flower
+#
+# edit .version only
+include ./$(depth)/flower/.version
+include ./$(depth)/.version
+build = ./$(depth)/flower/lib/.build
+#
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
+# descent order into subdirectories:
+#
+SUBDIRS = lib
+#
+
+# list of distribution files:
+#
+SCRIPTS = # make_version make_patch genheader clearlily configure
+README_FILES = NEWS README TODO
+DISTFILES= Makefile .version $(README_FILES) $(SCRIPTS)
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+# include ./$(depth)/make/Rules.make
+#
+
+# version:
+#
+flower-version: $(flower-version)
+$(flower-version): ./$(depth)/flower/.version ./$(bindir)/make_fversion $(build)
+       ./$(bindir)/make_fversion "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
+#
 
-$(staticlib): $(obs) fversion.hh
-       $(AR) cr libflower.a $(obs)
-
-include deps/*.dep
-
-flower-config.hh:
-       touch flower-config.hh
-
-deps/*.dep:
-       touch deps/dummy.dep
-
-depend: Sources.make
-       $(CXX) $(CXXFLAGS) -MM $(cc) > depend
-
-
-$(OBJECTDIR)/%.o: $(CCDIR)/%.cc
-       $(DODEP)\
-       $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) 
-
-
-clean:
-       rm -f $(obs) $(staticlib) fversion.hh
-
-realclean: clean
-       rm -f depend
-
-fversion.hh: Variables.make make_version
-       make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) "$(CXX) `$(CXXVER)`" > $@
-
-.PHONY: docxx
-docxx: $(hh) $(cc) $(templatecc) $(inl)
-       doc++ -p -d docxx $(hh) $(cc) $(templatecc) $(inl)
-
-dist:
-       -mkdir $(DDIR)
-       ln $(DFILES) $(DDIR)/
-       -for SUBDIR in $(SUBDIRS); \
-       do      mkdir $(DDIR)/$$SUBDIR; \
-               $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR dist;\
-       done
-       tar cfz $(DNAME).tar.gz $(DNAME)/
-       rm -rf $(DDIR)/
-
-TAGS: $(ALLSOURCES)
-       etags -CT $(inl) $(cc) $(hh)
-
-
-
-test: stringtest
-
-stringtest: $(OBJECTDIR)/stringtest.o 
-       g++ -o $@ $< -L. -lflower
\ No newline at end of file
index faa08528d73cdced2145437b9e24c32ebd163ff0..836eccbee0e80a518f3b3fd0682293c03a5edd58 100644 (file)
@@ -1,7 +1,15 @@
+pl 1.1.6
+       - all of 1.1.4-1 and 1.1.5
+Bugfix 
+       - null_terminated -> is_binary test
+
 pl 1.1.5
        - memmem interface, conditional compilation
        - snprintf
 
+pl 1.1.4-1
+       - included in new make structure
+       
 pl 1.1.4
        - great file-renaming.
        - String cleanup (binary <-> null terminate), several bugfixes
diff --git a/flower/Sources.make b/flower/Sources.make
deleted file mode 100644 (file)
index 4e08bec..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-
-cc=choleski.cc data-file.cc dstream.cc lgetopt.cc libc-extension.cc matdebug.cc\
-       matrix.cc\
-       path.cc scalar.cc smat.cc string.cc string-convert.cc stringutil.cc\
-       text-db.cc text-stream.cc unionfind.cc vector.cc 
-
-templatecc=cursor.tcc list.tcc plist.tcc interval.tcc\
-       pcursor.tcc
-
-inl=link.inl list.inl  cursor.inl plist.inl string-data.inl string-handle.inl
-
-hh=assoc.hh assoc-iter.hh choleski.hh compare.hh cursor.hh data-file.hh \
-       dstream.hh\
-       fproto.hh handle.hh interval.hh iterate.hh lgetopt.hh \
-       libc-extension.hh link.hh list.hh\
-       matrix.hh path.hh pcursor.hh plist.hh rational.hh real.hh scalar.hh\
-       smat.hh string.hh string-convert.hh string-handle.hh string-data.hh\
-       text-db.hh text-stream.hh unionfind.hh pqueue.hh\
-       varray.hh vector.hh vsmat.hh 
-
-extra=stringtest.cc
index 26061b740c59cf948a24c0a88976a5d4ade9fa1e..822cd0287f52babac46867485ec95c58b99a2687 100644 (file)
@@ -2,8 +2,6 @@
 
        * LGPL?
 
-       * integrate Make mechanisms of flower & lily
-
        * disable this auto conv: const pointer -> bool -> string
 
        * PointerVec ?
diff --git a/flower/Variables.make b/flower/Variables.make
deleted file mode 100644 (file)
index 23a14e9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-MAJVER=1
-MINVER=1
-PATCHLEVEL=5
-
-PACKAGENAME=flower
-
-#PROFILEFLAG=-pg
-#DEBUGFLAG= -g
-OPTIFLAG= -DNPRINT -O2 -DSTRING_UTILS_INLINED # -DNDEBUG 
-
-#########################################
-
-ifdef PROFILEFLAG
-       DEFINES+=$(OPTIFLAG) $(PROFILEFLAG)
-       EXTRALIB+=-pg
-endif
-
-ifndef DEBUGFLAG
-       DEFINES+=$(OPTIFLAG)
-else
-       DEFINES+=$(DEBUGFLAG)
-endif
-
-
-CXXFLAGS+=$(DEFINES)  -Wall -W 
-CXXVER=$(CXX) --version
-
-VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
-DNAME=$(PACKAGENAME)-$(VERSION)
-
-include Sources.make
-OBJECTDIR=objects
-CCDIR=.
-obs=$(addprefix $(OBJECTDIR)/,$(cc:.cc=.o)) 
-
-staticlib=libflower.a
-ALLSOURCES=$(hh) $(cc) $(inl) $(templatecc) $(extra)
-DFILES=$(ALLSOURCES) Makefile Variables.make make_version\
-       Sources.make TODO README NEWS
-DDIR=$(DNAME)
-
-depfile=deps/$(subst .o,.dep,$(notdir $@)) 
-DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(OBJECTDIR)/$(notdir $@)"
-OUTPUT_OPTION=$< -o $@
-SUBDIRS=deps objects
diff --git a/flower/assoc-iter.hh b/flower/assoc-iter.hh
deleted file mode 100644 (file)
index 34b88df..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  associter.hh -- part of flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef ASSOCITER_HH
-#define ASSOCITER_HH
-
-#include "assoc.hh"
-
-/// an iterator for the #Assoc# class
-template<class K, class V>
-struct Assoc_iter {
-    int i;
-    Assoc<K,V> &assoc_;
-    /// we don't want to be bothered by const correctness
-    Assoc_iter(const Assoc<K,V> &a) :
-       assoc_((Assoc<K,V> &)a)
-    {  
-       i= next(0);
-    }
-    int next(int j) {
-       while (j < assoc_.arr.size() && assoc_.arr[j].free)
-           j++;
-       return j;
-    }
-    bool ok() const {
-       return i < assoc_.arr.size();
-    }
-    void OK()const {
-       assert(!ok() || !assoc_.arr[i].free);
-    }
-    void operator++(int) { i++; i = next(i); }
-    K key() { return assoc_.arr[i].key; }
-    V &val() { return assoc_.arr[i].val; }    
-};
-
-#endif
diff --git a/flower/assoc.hh b/flower/assoc.hh
deleted file mode 100644 (file)
index 99e2091..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef ASSOC_HH
-#define ASSOC_HH
-
-#include "varray.hh"
-#include <assert.h>
-
-/**
-  A helper for Assoc
- */
-template<class K, class V>
-struct Assoc_ent_ {
-    bool free;
-    K key;
-    V val;
-};
-
-
-/** mindblowingly stupid Associative array implementation.
-  Hungarian: map
- */
-template<class K, class V>
-struct Assoc {
-    Array< Assoc_ent_<K,V> > arr;
-
-    /* ************** */
-    
-    int find(K key) const {
-       for (int i = 0; i < arr.size(); i++) {
-           if (!arr[i].free && key == arr[i].key)
-               return i;
-       }
-       return -1;
-    }
-    int find_creat(K key) {
-       int free = -1;
-       for (int i = 0; i < arr.size(); i++) {
-           if (key == arr[i].key) {            
-               return i;
-           } else if (arr[i].free ) {
-               free = i;
-           }
-       }
-       if (free >= 0){
-           arr[free].free = false;
-           arr[free].key = key;
-           return free;
-       }
-
-       Assoc_ent_<K,V> ae;
-       ae.free = false;
-       ae.key = key;
-       arr.push(ae);
-       return arr.size() -1;
-    }
-public:
-    bool elt_query(K key) const {
-       return find(key) >= 0;
-    }
-    void del(K key) {
-       assert(elt_query(key));
-       int i= find(key);
-       arr[i].free = true;
-    }
-    void
-    add(K key, V val) {
-       int i = find_creat(key);
-       arr[i].val = val;
-    }
-    V& operator[](K key) {
-       return arr[find_creat(key)].val;
-    }
-    const V& operator[](K key) const {
-       assert(elt_query(key));
-       return arr[find(key)].val;
-    }
-};
-
-#endif
diff --git a/flower/choleski.cc b/flower/choleski.cc
deleted file mode 100644 (file)
index 1d64f94..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#include "choleski.hh"
-const Real EPS = 1e-7;         // so sue me. Hard coded
-
-Vector
-Choleski_decomposition::solve(Vector rhs)const
-{
-    int n= rhs.dim();
-    assert(n == L.dim());
-    Vector y(n);
-
-    // forward substitution
-    for (int i=0; i < n; i++) {
-       Real sum(0.0);
-       for (int j=0; j < i; j++)
-           sum += y(j) * L(i,j);
-       y(i) = (rhs(i) - sum)/L(i,i);
-    }
-    for (int i=0; i < n; i++)
-       y(i) /= D(i);
-
-    // backward subst
-    Vector &x(rhs);            // using input as return val.
-    for (int i=n-1; i >= 0; i--) {
-       Real sum(0.0);
-       for (int j=i+1; j < n; j++)
-           sum += L(j,i)*x(j);
-       x(i) = (y(i) - sum)/L(i,i);
-    }
-    return x;
-}
-
-/*
-  Standard matrix algorithm.
-  */
-
-Choleski_decomposition::Choleski_decomposition(Matrix P)
-    : L(P.dim()), D(P.dim())
-{
-    int n = P.dim();
-    assert((P-P.transposed()).norm()/P.norm() < EPS);
-
-    L.unit();
-    for (int k= 0; k < n; k++) {
-       for (int j = 0; j < k; j++){
-           Real sum(0.0);
-           for (int l=0; l < j; l++)
-               sum += L(k,l)*L(j,l)*D(l);
-           L(k,j) = (P(k,j) - sum)/D(j);
-       }
-       Real sum=0.0;
-       
-       for (int l=0; l < k; l++)
-           sum += sqr(L(k,l))*D(l);
-       Real d = P(k,k) - sum;
-       D(k) = d;
-    }
-
-#ifdef NDEBUG
-    assert((original()-P).norm() / P.norm() < EPS);
-#endif
-}
-
-Matrix
-Choleski_decomposition::original() const
-{
-    Matrix T(L.dim());
-    T.set_diag(D);
-    return L*T*L.transposed();
-}
-
-Matrix
-Choleski_decomposition::inverse() const
-{
-    int n=L.dim();
-    Matrix invm(n);
-    Vector e_i(n);
-    for (int i = 0; i < n; i++) {
-       e_i.set_unit(i);
-       Vector inv(solve(e_i));
-       for (int j = 0 ; j<n; j++)
-           invm(i,j) = inv(j);
-    }
-    
-#ifdef NDEBUG
-    Matrix I1(n), I2(original());
-    I1.unit();
-    assert((I1-original()*invm).norm()/original.norm() < EPS);
-#endif
-    
-    return invm;
-}
diff --git a/flower/choleski.hh b/flower/choleski.hh
deleted file mode 100644 (file)
index f5e9fb4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef CHOLESKI_HH
-#define CHOLESKI_HH
-
-#include "matrix.hh"
-
-/**
-  Choleski decomposition of a matrix
-    structure for using the LU decomposition of a positive definite matrix.
-
-    #P# is split  into
-
-    LD transpose(L)
-    */
-struct Choleski_decomposition {
-
-    /// lower triangle of Choleski decomposition
-    Matrix L;
-
-    /// diagonal 
-    Vector D;
-
-    /** Create decomposition of P. 
-    PRE
-    P needs to be symmetric positive definite
-    */
-    
-    Choleski_decomposition(Matrix P);
-
-    /**
-    solve Px = rhs
-    */
-    Vector solve(Vector rhs) const;
-
-    Vector operator * (Vector rhs) const { return solve (rhs); }
-  /**
-    return the inverse of the matrix P.
-    */
-    Matrix inverse() const;
-    /**
-    return P,  calc'ed from L and D
-    */
-    Matrix original() const;
-  
-        
-};
-#endif
diff --git a/flower/compare.hh b/flower/compare.hh
deleted file mode 100644 (file)
index 203ba01..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-  */
-#ifndef COMPARE_HH
-#define COMPARE_HH
-
-#define one_operator(type, function, op) \
-inline bool \
-operator op (type t1, type t2) {\
-    return function(t1, t2) op 0;\
-}\
-
-#define gpp_minmax_operator(type, op, opp) \
-inline type \
-operator op(type t1, type t2)\
-{\
-     return (t1 opp t2) ? t1 :  t2;\
-}\
-
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-#define gpp_minmax(type, prefix)\
-       prefix gpp_minmax_operator(type, <?, <)\
-       prefix gpp_minmax_operator(type, >?, >)
-#else
-#define gpp_minmax(type, prefix)
-#endif
-
-/**  handy notations for a signed comparison. 
-    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
-    Please fill a & in the type argument if necessary.    
-    */
-#define template_instantiate_compare(type, function, prefix) \
-prefix one_operator(type, function, >)\
-prefix one_operator(type, function, >=)\
-prefix one_operator(type, function, ==)\
-prefix one_operator(type, function, !=)\
-prefix one_operator(type, function, <)\
-prefix one_operator(type, function, <=)\
-gpp_minmax(type, prefix)\
-prefix inline type max(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
-prefix inline type min(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
-  \
-prefix  bool operator<(type t1, type t2) /* stupid fix to allow ; */
-
-
-    
-#define instantiate_compare(type, func) template_instantiate_compare(type,func, )
-     
-
-     
-#endif
-     
diff --git a/flower/cursor.hh b/flower/cursor.hh
deleted file mode 100644 (file)
index 0ea9903..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// cursor.hh
-
-#ifndef __CURSOR_HH
-#define __CURSOR_HH
-
-#include "link.hh"
-template<class T> class List;
-
-/**  iterator to List.  
-  add and insert extend the list
-  items are always stored as copies in List, but:
-  List<String> :  copies of String stored 
-  List<String*> : copies of String* stored!
-
-    the operations add and insert actually delegate the work to List class.
- */
-template<class T>
-class Cursor 
-{
- public:
-    /** create cursor, set at top. The const part isn't true, actually, #list#
-      surely isn't const, but I get tired of the warning messages.  */
-    Cursor( const List<T>& list, Link<T>* pointer = 0 );
-    
-    Cursor( const Cursor<T>& cursor );
-
-    T& thing();
-
-    /// return current T
-    T& operator *() { return thing(); }
-    operator T() { return thing(); }
-    Cursor<T> operator =( const Cursor<T>& c );
-
-    /// make cursor with #no# items back
-    Cursor<T> operator -( int no) const;
-
-    /// make cursor with #no# items further
-    Cursor<T> operator +( int no) const;
-    int operator -(Cursor<T> op) const;
-    Cursor<T> operator -=(int);
-    Cursor<T> operator +=(int);
-    
-    /// return current and move one down
-    Cursor<T> operator ++( int );
-    
-    /// return current and move one up
-    Cursor<T> operator --( int ); 
-
-    /// point to link?
-    bool ok();                  
-
-    /// ++ items left?
-    bool forward();            
-
-    /// -- items left?
-    bool backward();
-
-    /**  put (copy) after me in List. 
-      analogously to editor. ok() interpreted as at end
-      of line.
-
-      PRE: !ok, POST: added to bottom()
-
-      PRE: ok, POST: added after me
-
-      cursor points to same object, cursor.next() is newly added
-      object.
-      */
-    void add( const T& thing );
-
-    /**  put (copy) before me in List. 
-      analogously to editor. ok() interpreted as at begin of
-      line.
-      
-      PRE: !ok, POST: add to top()
-
-      PRE: ok, POST: add before me
-
-      cursor points to same object, cursor.previous()
-      is newly inserted object.
-      */
-    
-    void insert( const T& thing );
-    ///
-    void backspace();
-
-    /// 
-    void del();
-    
-    /// access the list this came from
-    List<T>& list() const ;
-    Link<T>* pointer();
-    static   int compare(Cursor<T> a,Cursor<T>b) { return a-b; }
-private:
-    List<T>& list_;
-    Link<T>* pointer_;
-};
-
-
-/*
-  comparisons.
-  */
-#include "compare.hh"
-
-
-template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
-
-#include "pcursor.hh"
-#include "list.hh"
-#include "cursor.inl"
-#include "iterate.hh"
-
-#endif // CURSOR_HH 
diff --git a/flower/cursor.inl b/flower/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
diff --git a/flower/cursor.tcc b/flower/cursor.tcc
deleted file mode 100644 (file)
index 3d2116c..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef CURSOR_CC
-#define CURSOR_CC
-
-#include "cursor.hh"
-#include <assert.h>
-
-template<class T>
- void
-Cursor<T>::backspace()
-{
-    Cursor<T> c(*this);
-    c--;        
-    list_.remove( *this );
-}
-
-template<class T>
- void
-Cursor<T>::del()
-{
-    Cursor<T> c(*this);
-    c++;
-    list_.remove( *this );    
-    *this = c;
-}
-
-
-template<class T>
-Cursor<T> 
-Cursor<T>::operator -=( int j )    
-{
-    while (j--)
-       (*this)--;
-    return *this;
-}
-template<class T>
-Cursor<T> 
-Cursor<T>::operator +=( int j )    
-{
-    while (j++)
-       (*this)++;
-    return *this;
-}
-
-template<class T>
-Cursor<T> 
-Cursor<T>::operator +( int i ) const    
-{
-    Cursor<T> r = *this;
-
-    if (i<0)
-       return r -(-i);
-
-    while (i--)
-       r++;
-
-    return r;
-}
-
-template<class T>
-Cursor<T>
-Cursor<T>::operator -( int i ) const
-{
-    Cursor<T> r = *this;
-    if (i<0)
-       return r +(-i);
-
-    while (i--)
-       r--;
-    
-    return r;
-}
-/*
-  warning:  can't use Cursor::operator == (Cursor),
-  since it uses Cursor::operator-(Cursor)
- */
-template<class T>
-int
-Cursor<T>::operator-(Cursor<T> rhs) const
-{
-    assert(rhs.list == list);
-    int dif = 0;
-
-    // search from *this on further up (positive difference)
-    Cursor<T> c(*this);
-    while (c.ok() && c.pointer_ != rhs.pointer_) {
-       c--;
-       dif++;
-    }
-    
-    if (c.ok())
-       goto gotcha;            // so, sue me.
-
-    // search in direction of bottom. (negative diff)
-    dif =0;
-    c=*this;    
-    while (c.ok() && c.pointer_ !=rhs.pointer_) {
-       dif --;
-       c++;
-    }
-    assert(c.ok());
-
-gotcha:
-    assert((*this - dif).pointer_ == c.pointer_);
-    return dif;
-}
-
-#endif
diff --git a/flower/data-file.cc b/flower/data-file.cc
deleted file mode 100644 (file)
index 0dad79c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <fstream.h>
-#include <ctype.h>
-
-#include "data-file.hh"
-
-void 
-Data_file::gobble_white()
-{
-    char c;
-    
-    while ((c=data_get()) == ' ' ||c == '\t')
-       if (eof()) 
-           break;
-
-    data_unget(c);
-}
-
-String
-Data_file::get_word() 
-{// should handle escape seq's
-    String s;
-
-    while (1) 
-       {
-       char    c  = data_get();
-       
-       if (isspace(c) || eof()) 
-           {
-           data_unget(c);
-           break;
-           }
-       
-       
-       if (c == '\"')
-           {
-           rawmode= true;
-
-           while ((c  = data_get()) != '\"')
-               if (eof())
-                   error("EOF in a string");           
-               else
-                   s += c;
-           
-
-           rawmode= false;
-           }       
-       else
-           s += c;             
-       }
-    
-    return s;        
-}
-
-/**  get a char 
-   Only class member who uses text_file::get
-   */
-char
-Data_file::data_get() {
-    char c =  get(); 
-    if (!rawmode && c == '#') // gobble comment
-       {       
-       while ((c = get()) != '\n' && !eof()) 
-           ;
-           return '\n';
-       }    
-
-    return c;
-}
-
-/// read line, gobble '\n'    
-String Data_file::get_line()     
-{
-    char c; 
-    String s;
-
-    while ((c  = data_get()) != '\n' && !eof())
-       s += c;
-    return s;  
-}
-
-/// gobble stuff before first entry on a line.    
-void
-Data_file::gobble_leading_white() 
-{
-    // eat blank lines.
-    while (!eof()) {
-       char c = data_get();                
-       if (!isspace(c)) {
-           data_unget(c);
-           break;
-       }
-    }
-}
-
-
diff --git a/flower/data-file.hh b/flower/data-file.hh
deleted file mode 100644 (file)
index dae9e56..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  data-file.hh -- declare Data_file
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef DATAFILE_HH
-#define DATAFILE_HH
-
-#include "text-stream.hh"
-
-/// read a data file
-class Data_file : private Text_stream
-{
-    
- public:
-    bool rawmode;
-
-    Text_stream::line;    
-    Text_stream::eof;
-    Text_stream::get_name;    
-
-    char data_get();    
-    void data_unget(char c) {
-       unget(c);
-    }
-
-    /// read line, eat #\n#
-    String get_line();
-    
-    /// read a word till next space, leave space. Also does quotes
-    String get_word();
-
-    /// gobble horizontal white stuff.
-    void gobble_white();
-
-    /// gobble empty stuff before first field.
-    void gobble_leading_white();
-    Data_file(String s) : Text_stream(s) {
-       //*mlog << "(" << s << flush;   
-       rawmode=  false;        
-    }
-
-    ~Data_file()  {
-       //      *mlog << ")"<<flush;    
-    }    
-
-    warning(String s) {
-       message("warning: " + s);
-    }
-    error(String s){
-       message(s);
-       exit(1);    
-    }
-};
-#endif // DATAFILE_HH
diff --git a/flower/dstream.cc b/flower/dstream.cc
deleted file mode 100644 (file)
index e6fdbc0..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#include <fstream.h>
-#include "assoc.hh"
-#include "dstream.hh"
-#include "scalar.hh"
-#include "text-db.hh"
-#include "string-convert.hh"
-
-/// indent of each level 
-const INDTAB = 2;
-
-/*
-  should use Regexp library.
-  */
-static String
-strip_pretty(String pretty_str)
-{
-    int i = pretty_str.index_i('(');
-    if (i>=0)
-       pretty_str = pretty_str.left_str(i);
-    
-    int l = pretty_str.index_last_i(' '); // strip until last ' '
-    if (l>=0)
-       pretty_str = pretty_str.nomid_str(0,l+1);
-    return pretty_str;
-}
-
-static String
-strip_member(String pret)
-{
-    int l=pret.index_last_i(':')-1;
-    if (l>=0)
-       pret = pret.left_str(l );
-    return pret;
-}
-
-Dstream&
-Dstream::identify_as(String name)
-{
-    if (!os)
-       return *this;
-    
-    String mem(strip_pretty(name));
-    String cl(strip_member(mem));
-    String idx = cl;
-    
-    if (silent->elt_query(mem))
-       idx  = mem;
-    else if (silent->elt_query(cl))
-       idx = cl;
-    else {
-       (*silent)[idx] = false;
-    }
-    local_silence = (*silent)[idx];
-    if (classname != idx && !local_silence) {
-       classname=idx;
-//     *os << "[" << classname << ":]"; // messy.
-    }
-    return *this;
-}
-
-bool
-Dstream::silence(String s)
-{
-    if (!silent->elt_query(s))
-       return false;
-    return (*silent)[s];
-}
-
-/** Output a string via the Dstream. This is the only output
- interface. It delegates all conversion to String class.  */
-Dstream &
-Dstream::operator<<(String s)
-{
-    output(s);
-    return *this;
-}
-
-Dstream &
-Dstream::operator<<(const void *v_l)
-{
-    output(String_convert::pointer_str(v_l));
-    return *this;
-}
-
-Dstream &
-Dstream::operator<<(const char *ch_l)
-{
-    output(ch_l);
-    return *this;
-}
-
-void
-Dstream::output(String s)
-{
-    if (local_silence|| !os)
-       return ;
-    
-    for (const char *cp = s  ; *cp; cp++)
-       switch(*cp) {
-           case '{':
-           case '[':
-           case '(': indentlvl += INDTAB;
-               *os << *cp;             
-               break;
-               
-           case ')':
-           case ']':
-           case '}':
-               indentlvl -= INDTAB;
-               *os << *cp              ;
-               
-               assert  (indentlvl>=0) ;
-               break;
-               
-           case '\n':
-               *os << '\n' << String (' ', indentlvl) << flush;
-               break;        
-           default:
-               *os << *cp;
-               break;
-           }
-    return ;    
-}
-
-
-Dstream::Dstream(ostream *r, const char * cfg_nm )
-{
-    os = r;
-    silent = new Assoc<String,bool>;
-    indentlvl = 0;
-    if (!os)
-       return;
-    
-    const char * fn =cfg_nm ? cfg_nm : ".dstreamrc";
-    {
-       ifstream ifs(fn);       // can't open
-       if (!ifs)
-           return;
-    }
-
-    Text_db cfg(fn);
-    while (! cfg.eof()){            
-        Text_record  r(  cfg++);
-        if (r.size() != 2) {
-            r.message("not enough fields in Dstream init.");
-            continue;
-        }
-        (*silent)[r[0]] = (bool)(int)(Scalar(r[1]));
-    }
-
-}
-
-
-Dstream::~Dstream()
-{    
-    delete silent;
-    assert(!indentlvl) ;
-}
diff --git a/flower/dstream.hh b/flower/dstream.hh
deleted file mode 100644 (file)
index 5375304..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-
-#ifndef DSTREAM_HH
-#define DSTREAM_HH
-
-#include "string.hh"
-
-const char eol= '\n';
-
-template<class K,class V>
-struct Assoc;
-
-/**  debug stream. 
-   a class for providing debug output of nested structures,
-   with indents according to \{\}()[].
-
-   One can turn on and off specific messages using the Assoc silent.
-   This can be done automatically:
-
-   #define DEBUG  dstream_.identify_as(__PRETTY_FUNCTION__) 
-
-   DEBUG << "a message\n";
-   
-   Init for the class names which should be silent can be given in a rc file. 
-   
-  */
-class Dstream
-{
-    ostream *os;
-    int indentlvl;
-    bool local_silence;
-    String classname;
-    void output(String s);
-    Assoc<String, bool> *silent;
-public:
-
-    bool silence(String);
-    
-    /**
-      if rcfile == 0, then do not read any rc file.
-      */
-      
-    Dstream(ostream *r, const char  * rcfile);
-    virtual ~Dstream();
-    Dstream &identify_as(String s);
-
-    Dstream &operator << (String s);
-    /**
-      Output memory locations.
-     */
-    Dstream &operator << (void const *);
-    Dstream &operator << (char const *);
-};
-#endif
-
diff --git a/flower/fproto.hh b/flower/fproto.hh
deleted file mode 100644 (file)
index 8c6fda6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  fproto.hh -- typenames in flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef FPROTO_HH
-#define FPROTO_HH
-
-#include "flower-config.hh"
-
-template<class T> struct Array;
-template<class T> struct sstack;
-template<class T,class K> struct Assoc;
-template<class T> struct List;
-template<class T> struct PointerList;
-template<class T> struct IPointerList;
-template<class T> struct Cursor;
-template<class T> struct PCursor;
-template<class T> struct Link;
-template<class T> struct Handle;
-template<class T>struct Interval_t;
-#include "real.hh"
-
-typedef Interval_t<Real> Interval;
-
-struct Choleski_decomposition;
-
-struct Long_option_init;
-struct Getopt_long;
-struct Matrix;
-struct String_data;
-struct String_handle;
-struct String_convert;
-struct String;
-struct virtual_smat;
-struct Vector ;
-struct Text_stream;
-struct Data_file;
-struct Text_db;
-struct Scalar;
-typedef unsigned char Byte;
-#endif // FPROTO_HH
-
diff --git a/flower/handle.hh b/flower/handle.hh
deleted file mode 100644 (file)
index 63c17ef..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef HANDLE_HH
-#define HANDLE_HH
-
-/// reference counting handle
-template<class T>
-class Handle {
-    T *obj;
-    int *refs;
-
-    /// let go of ref. Delete if necessary
-    void down() {
-       if (!(*refs--)) {
-           delete obj;
-           delete refs;
-       }
-       obj = 0;
-       refs = 0;
-    }
-    /// point to new object. 
-    void up(T *t, int *r) {
-       if (!r) {
-           refs = new int;
-           *refs = 1;
-       } else {
-           refs =r;
-           *refs++;
-       }
-       obj = t;
-    }
-    /// POST: *refs == 1
-    void copy() {
-       if(*refs != 1){
-           T * newobj = new T(*obj );
-           down();
-           up(newobj);
-       }
-    }
-    Handle(Handle const &src) {
-       up(src.obj, src.refs);
-    }
-    Handle(T & o) {
-       up (&o);
-    }
-    void operator=(Handle const& src) {
-       if (this == &src)
-           return;
-       down();
-       up(src.o, src.refs);
-    }
-    operator const T&() {
-       return *obj;
-    }
-    operator T&() {
-       copy();
-       return *obj;
-    }
-}
-#endif
diff --git a/flower/interval.hh b/flower/interval.hh
deleted file mode 100644 (file)
index aae1638..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  interval.hh -- part of flowerlib
-  
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef INTERVAL_HH
-#define INTERVAL_HH
-
-#include <assert.h> 
-#include "fproto.hh"
-#include "real.hh"
-
-
-/**  a T interval. 
-  this represents the closed interval [left,right].
-  No invariants. T must be a totally ordered ring
-  */
-template<class T>
-struct Interval_t {
-    T left, right;
-
-    /* ************** */
-    
-    T center() { return (left + right) / T(2);}
-    void translate(T t) {
-       left += t;
-       right += t;
-    }
-    T& idx(int j) {
-       if (j==-1)
-           return left;
-       else if (j==1)
-           return right;
-       else
-           assert(false);
-       return left;            
-    }
-    T& operator[](int j) {
-       return idx(j);
-    }
-    T operator[](int j) const {
-       return ((Interval_t<T> *)this)->idx(j);
-    }
-    T &max() { return right;}
-    T max()const { return right;}
-    T min()const{ return left; }
-    T &min(){ return left; }
-    /**
-      PRE
-      *this and h are comparable
-      */
-    void unite(Interval_t<T> h);
-    void intersect(Interval_t<T> h);
-
-    T length() const;
-    void set_empty() ;
-    bool empty() const { return left > right; }
-    Interval_t() {
-       set_empty();
-    }
-    Interval_t(T m, T M) {
-       left =m;
-       right = M;
-    }
-    Interval_t<T> &operator += (T r) {
-       left += r;
-       right +=r;
-       return *this;
-    }
-    String str() const;    
-    bool elt_q(T r);
-};
-
-
-/**
-  inclusion ordering. Crash if not comparable.
-  */
-template<class T>
-int Interval__compare(const Interval_t<T>&,Interval_t<T> const&);
-
-/*
-  INLINE
- */
-
-#include "compare.hh"
-
-template_instantiate_compare(Interval_t<T>&, Interval__compare, template<class T>);
-
-
-template<class T>
-inline Interval_t<T>
-intersection(Interval_t<T> a, Interval_t<T> const&b)
-{
-    a.intersect(b);
-    return a;
-    
-}
-
-
-template<class T>
-inline
-Interval_t<T> operator +(T a,Interval_t<T> i )
-{
-    i += a;
-    return i;
-}
-
-template<class T>
-inline
-Interval_t<T> operator +(Interval_t<T> i,T a ){
-    return a+i;
-}
-
-typedef Interval_t<Real> Interval;
-
-
-#define Interval__instantiate(T) template struct Interval_t<T>;\
-  template  int Interval__compare(const Interval_t<T>&,Interval_t<T> const&)
-
-
-#endif // INTERVAL_HH
-
-
-
diff --git a/flower/interval.tcc b/flower/interval.tcc
deleted file mode 100644 (file)
index 6e7b0b1..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <assert.h> 
-#include <math.h>
-#include "interval.hh"
-#include "string.hh"
-
-
-template<class T>
-int
-_Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
-{
-    if (a.left == b.left && a.right == b.right)
-       return 0;
-    
-    if (a.left <= b.left && a.right >= b.right)
-       return 1;
-
-    if (a.left >= b.left && a.right <= b.right)
-       return -1;
-
-    return -2;
-}
-
-
-template<class T>
-int
-Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
-{
-    int i = _Interval__compare(a,b);
-    if (i < -1)
-       assert(false);
-    return i;
-}
-
-#ifdef AIX
-const Real INFTY = 1e8;        // ARGh. AIX sucks
-#else
-const Real INFTY = HUGE_VAL;
-#endif
-
-template<class T>
-void
-Interval_t<T>::set_empty()
-{
-    left = INFTY;
-    right = -INFTY;
-}
-
-template<class T>
-T
-Interval_t<T>::length() const {
-    assert(right >= left);
-    return right-left;
-}
-
-template<class T>
-void
-Interval_t<T>::unite(Interval_t<T> h)
-{
-    if (h.left<left)
-       left = h.left;
-    if (h.right>right)
-       right = h.right;
-}
-
-/**
-  smallest Interval which includes *this and #h#
- */
-
-template<class T>
-void
-Interval_t<T>::intersect(Interval_t<T> h)
-{
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-    left = h.left >? left;
-    right = h.right <?right;
-#else
-    left = max(h.left, left);
-    right = min(h.right, right);
-#endif
-}
-
-template<class T>
-Interval_t<T>
-intersect(Interval_t<T> x, Interval_t<T> const &y)
-{
-    x.intersect(y);
-    return x;
-}
-
-template<class T>
-String
-Interval_t<T>::str() const
-{
-    if (empty())
-       return "[empty]";
-    String s("[");
-    return s + left + "," + right +"]";
-}
-
-template<class T>
-bool
-Interval_t<T>::elt_q(T r)
-{
-    return r >= left && r <= right;
-}
diff --git a/flower/iterate.hh b/flower/iterate.hh
deleted file mode 100644 (file)
index 1e924f0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  iterate.hh -- define some list macros
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef ITERATE_HH
-#define ITERATE_HH
-
-
-
-#define iterator(set)          typeof((set).top())
-#define iterator_bot(set)              typeof((set).bottom())
-
-// should use top()
-#define iter_top(set,var)      iterator(set) var(set)
-#define iter_bot(set,var)      iterator(set) var(set.bottom())
-
-#endif // ITERATE_HH
diff --git a/flower/lgetopt.cc b/flower/lgetopt.cc
deleted file mode 100644 (file)
index a56c64c..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-   process command line, GNU style.
-
-   this is (Copyleft) 1996, Han-Wen Nienhuys, <hanwen@stack.nl>
- */
-#include <stdio.h>
-#include <iostream.h>
-#include <assert.h>
-#include "lgetopt.hh"
-
-long
-Getopt_long::intarg()
-{
-    long l;
-    if (sscanf(optarg, "%ld", &l) != 1)
-       report(E_ILLEGALARG);
-    
-    return l;
-}
-
-Long_option_init *
-Getopt_long::parselong()
-{
-    const char *optnm = argv[optind] + 2 ;
-    assert(*optnm);
-    
-    char *endopt = strchr(optnm, '=');
-    int searchlen  = (endopt) ? endopt - optnm : strlen(optnm);
-    
-    beet=0;
-    for (int i=0; i< table_len; i++) {
-       const char *ln = the_opts[i].longname;
-
-       if (ln && !strncmp(ln, optnm, searchlen)) {
-           beet = the_opts+i;
-           break;
-       }
-    }  
-
-    if (!beet) {
-       report(E_UNKNOWNOPTION);
-       return 0;
-    }
-    optind++;
-    optindind = 0;
-
-    
-    if (beet->take_arg) {
-       if (endopt)
-           optarg = endopt +1; // a '='
-       else {
-           optarg = argv[optind];
-           optind++;
-       }
-       if (!optarg)
-           report(E_ARGEXPECT);
-
-    } else {
-       optarg = 0;
-       if (endopt)
-           report(E_NOARGEXPECT);
-    }
-    
-    return beet;
-}
-
-
-ostream &
-Long_option_init::printon(ostream &errorout)
-{
-    if (shortname)     
-       errorout <<"-" << shortname;
-    if (shortname && longname)
-       errorout << ", ";
-    if (longname)      
-       errorout << "`--" << longname << "'";
-    return errorout;
-}
-
-// report an error, GNU style.
-void
-Getopt_long::report(Errorcod c)
-{
-    error = c;
-    if (!errorout)
-       return;
-
-    *errorout << argv[0] << ": ";
-    switch (c) {
-    case E_ARGEXPECT:
-       *errorout<< "option ";
-       beet->printon(*errorout);
-       *errorout << "requires an argument"<<endl;
-       break;
-    case  E_NOARGEXPECT:
-       *errorout << "option `--" <<
-           beet->longname << "' does not allow an argument"<<endl;
-       break;
-       
-    case E_UNKNOWNOPTION:
-       *errorout << "unrecognized option ";
-       if (optindind)
-           *errorout << "-" << argv[optind][optindind] << endl;
-       else
-           *errorout << argv[optind] << endl;
-
-       break;
-    case E_ILLEGALARG:
-       *errorout << "illegal argument `" << optarg << "\'to option ";
-       beet->printon(*errorout);
-       *errorout << '\n';
-    default:
-       assert(false);
-    }
-    exit(2); 
-}
-    
-Long_option_init *
-Getopt_long::parseshort()
-{
-    char c=argv[optind][optindind];
-    beet=0;
-    assert(c);
-    
-    for (int i=0; i < table_len; i++)
-       if (the_opts[i].shortname == c) {
-           beet  = the_opts+i;
-           break;
-       }
-
-    if (!beet){
-       report(E_UNKNOWNOPTION);
-       return 0;
-    }
-
-    optindind++;
-    if (!beet->take_arg){
-       optarg = 0;
-       return beet;
-    }
-    optarg = argv[optind] + optindind;
-
-    optind ++;
-    optindind = 0;
-    
-    if (!optarg[0]) {
-       optarg = argv[optind];
-       optind ++;
-    }
-    if (!optarg) {
-       report(E_ARGEXPECT);
-    }
-    
-    return beet;
-}
-
-Long_option_init *
-Getopt_long::operator()() {
-    if (!next())
-       return 0;
-    
-    if (optindind)
-       return parseshort();
-    
-    if (argv[optind][0] != '-')
-       return 0;
-
-    if (argv[optind][1] == '-') {// what to do with "command  --  bla"
-       return parselong();
-    } else {
-       optindind = 1;
-       return parseshort();
-    }
-}
-
-Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
-{
-    the_opts = lo;
-    errorout = &cerr;
-    argv = v;
-    argc = c;
-    optind = 1;
-    optindind = 0;
-
-    //    reached end of option table?
-    int i;
-    for (i = 0;  the_opts[i].longname ||the_opts[i].shortname; i++)
-       ;
-    table_len = i;
-}
-
-bool
-Getopt_long::next()
-{
-
-    error = E_NOERROR;
-    while (optind < argc && !argv[optind][optindind]) {
-       optind++;
-       optindind = 0;
-    }
-    return (optind < argc);
-}
-   
-char *
-Getopt_long::current_arg()
-{
-    if (optind >= argc)
-       return 0;
-    char * a = argv[optind];
-    return a + optindind;
-}
-
-char *
-Getopt_long::get_next_arg()
-{
-    char * a = current_arg();
-    if ( a) {
-       optind ++;
-       optindind = 0;
-    }
-    return a;
-}
diff --git a/flower/lgetopt.hh b/flower/lgetopt.hh
deleted file mode 100644 (file)
index 3b2b034..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef LGETOPT_HH
-#define LGETOPT_HH
-
-#include <string.h>
-
-
-class ostream;
-
-/**
-  a struct this for initialising the commandline options.
- */
-struct Long_option_init {
-    bool take_arg;
-    const char* longname;
-    char        shortname;
-
-    ostream &printon(ostream &errorout);
-};
-
-
-/** C++ for version of long_getopt.  For processing GNU style command
-  line arguments.  No pointer (return values, arguments) contents are
-  copied.  */
-class Getopt_long {
-public:
-    /** errorcodes: no error, argument expected, no argument expected,
-      unknown option, illegal argument (eg. int expected).  */
-    enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
-               E_ILLEGALARG } ;
-
-
-private:
-
-    /// the option info.
-    Long_option_init *the_opts;
-    int table_len;
-    
-    /// if doing short option, argv[optind][optindind] is processed next.
-    int optindind;
-
-    /// the option found
-    Long_option_init *beet;
-
-    /// get ready for processing next error.
-    bool next();
-    Long_option_init *parselong();
-    Long_option_init *parseshort();
-    
-    ostream *errorout;
-
-    /// report an error and abort
-    void report(Errorcod c);
-public:
-
-    /// argument. Set to 0 if not present
-    char* optarg;
-
-    /// current error status
-    Errorcod error;
-
-    /// return an integer (with err. detect)
-    long intarg();
-    /// argv[optind] will be processed next.
-    int optind;
-
-    /// the arguments
-    char **argv;
-
-    /// the arg. count
-    int argc;
-    
-    /* *************** */
-    
-    /**
-      What to do with  errors. 
-       report messages on  #*os#, and abort.
-       if #os# is null, then do not report nor abort, just set #error#
-      */
-       
-    void seterror(ostream *os);
-
-    /// construct: pass arguments and option info.
-    Getopt_long(int c,  char **v, Long_option_init *lo);
-
-    /**  get the next option. 
-      @return pointer to next option found.
-      0 if error occurred, or next argument is no option.
-      */
-    Long_option_init *operator()();
-
-    char *current_arg();
-    char * get_next_arg();
-};
-#endif
index 9bb2cfff69406350b325439601879e6198d74fdf..893c30f922f46be1265f59cbf7ccbe5d5ca789e1 100644 (file)
 depth = ../..
 #
 
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
 # identify module:
 #
 NAME = flower
@@ -26,29 +21,34 @@ include ./$(depth)/flower/.version
 build = ./$(depth)/flower/lib/.build
 #
 
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
 # descent order into subdirectories:
 #
-SUBDIRS = include 
+SUBDIRS = include
 #
 
 # to be remade each build:
 #
-VERSION_DEPENDENCY =#
+VERSION_DEPENDENCY = include/fversion.hh
 #
 
 # list of c++ header files:
 # 
-HHFILES = $(shell ls *.hh $(ERROR_LOG))
+HHFILES = # $(shell ls include/*.hh)
 #
 
 # list of c++ source files:
 #
-CCFILES = $(shell ls *.cc $(ERROR_LOG))
+CCFILES = $(shell ls *.cc)
 #
 
 # list of other source files:
 #
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
+EXTRA_SOURCE_FILES =# $(shell ls *.y *.l)
 #
 
 # list of distribution files:
@@ -75,9 +75,9 @@ MAINTARGET = $(libdir)/$(LIBRARY)# huh?
 default: $(MAINTARGET)
 #
 
-# sic.
-$(include-flower)/flower-config.hh:
-#      touch $@
+# sic.
+$(include-flower)/flower-config.hh:
+       touch $@
  
 # generic targets and rules:
 #
@@ -85,13 +85,8 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
-# list of depend files:
-#
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
-#
-
 # auto dependencies:
 #
--include $(DEPFILES)
+-include ./$(outdir)/*.dep
 #
 
index 1197dd79e71c20e13dd4d24bec14e7f52efc14be..e6fdbc0e4dbf2d9a9a827a569559bd038893040a 100644 (file)
@@ -1,5 +1,3 @@
-
-
 #include <fstream.h>
 #include "assoc.hh"
 #include "dstream.hh"
@@ -55,8 +53,7 @@ Dstream::identify_as(String name)
     local_silence = (*silent)[idx];
     if (classname != idx && !local_silence) {
        classname=idx;
-       if (!(*silent)["Dstream"])
-           *os << "[" << classname << ":]"; // messy.
+//     *os << "[" << classname << ":]"; // messy.
     }
     return *this;
 }
diff --git a/flower/lib/include/flower-config.hh b/flower/lib/include/flower-config.hh
new file mode 100644 (file)
index 0000000..e69de29
index bf8a22211c1c327bdec4d8ce0446b5361fe3a493..8c6fda680ef111acb3db33771fb9e546fcb70f76 100644 (file)
@@ -7,13 +7,6 @@
 #ifndef FPROTO_HH
 #define FPROTO_HH
 
-// what the F*** is "int" ?
-// depreciate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
-/// (i32)
-typedef int i32;
-/// (i64)
-typedef long long I64;
-
 #include "flower-config.hh"
 
 template<class T> struct Array;
@@ -26,9 +19,7 @@ template<class T> struct Cursor;
 template<class T> struct PCursor;
 template<class T> struct Link;
 template<class T> struct Handle;
-template<class T> struct Interval_t;
-template<class T,class Q> struct PQueue;
-
+template<class T>struct Interval_t;
 #include "real.hh"
 
 typedef Interval_t<Real> Interval;
index c8dfe1bea6754f8786e8460e9b91231c02733b01..195232317e17f58e268833afe3bbb9db1817e02f 100644 (file)
@@ -15,8 +15,6 @@
 /**
   Stupid Prioq. Should use Lists and STL.
   Smallest is put at the front.
-
-Actually, this sux. Should use a template struct PQuee_ent<V,I>
  */
 
 template<class V, class I>
@@ -24,47 +22,23 @@ struct PQueue
 {
     Array<V> value_arr_;
     Array<I> indices_arr_;
-    void OK() const 
-    {
-       
-       assert(value_arr_.size() == indices_arr_.size());
-    }
-    
+
     void enter(V v, I idx) {
        int j=0;
        for (; j < value_arr_.size(); j++)
            if (indices_arr_[j] > idx) 
                break;
 
-       insert(j,v,idx);
-       
+       value_arr_.insert(v, j);
+       indices_arr_.insert(idx, j);
     }
     int size() { return value_arr_.size(); }
     V front_val() { return value_arr_[0]; }
     I front_idx() { return indices_arr_[0]; }
-    void del(int i) 
-    {
-       value_arr_.del(i);
-       indices_arr_.del(i);
-    }
-    int size() const
-    {
-       OK();
-       return value_arr_.size();
-    }
-    
-
-    void insert(int j, V v, I idx)
-    {
-       value_arr_.insert(v, j);
-       indices_arr_.insert(idx, j);
-    }
-    
-
-
     V get() {
        V retval = front_val();
-       del(0);
+       value_arr_.del(0);
+       indices_arr_.del(0);
        return retval;
     }
     
index f6bcfa7faeea590baf744a7e3256be16f59d8879..bcf461f8f3f6a32c734f49716d6bef0ecbfd0666 100644 (file)
@@ -30,16 +30,14 @@ public:
     static int dec2_i( String dec_str );
     static double dec2_f( String dec_str );
     static String double_str(double f, char const* fmt=0);
-    static int hex2_i( String str );
-    static unsigned hex2_u( String str );
+    static int hex2int_i( String str );
     static String hex2bin_str( String str );
     static String int_str(int i, char const *fmt=0  );
     static String i2hex_str( int i, int length_i, char ch );
-    static String u2hex_str( unsigned u, int length_i, char ch );
     static String i2dec_str( int i, int length_i, char ch );
     static String rational_str(Rational);
     static String pointer_str(const void *);
-    static String i64_str(I64, char const * fmt = 0);
+    static String longlong_str(long long , char const * fmt = 0);
 };
 
 #endif // __STRING_CONVERT_HH //
index 0e2566f087f3938cecd1b1de9ad626830f1ebe7b..47649dcc8878e672250bc33b47e8cde2e2101c1c 100644 (file)
@@ -6,7 +6,6 @@
 
 
 #include <assert.h>
-#include <limits.h>
 #include "libc-extension.hh"
 #include "string.hh"
 #include "string-convert.hh"
@@ -63,11 +62,11 @@ String_convert::dec2_i( String dec_str )
 }
 
 String
-String_convert::i64_str( I64 i64, char const* fmt)
+String_convert::longlong_str(long long ll, char const* fmt)
 {
     char buffer[STRING_BUFFER_LEN];
     snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%Ld"), i64 );     // assume radix 10
+            (fmt ? fmt : "%Ld"), ll );     // assume radix 10
     return String(buffer);
 
 }
@@ -144,34 +143,20 @@ String_convert::i2dec_str( int i, int length_i, char ch )
 
 // stupido.  Should use int_str()
 String 
-String_convert::u2hex_str( unsigned u, int length_i, char fill_ch )
+String_convert::i2hex_str( int i, int length_i, char ch )
 {
     String str;
-    if ( !u )
+    if ( !i )
        str = "0";
-
-#if 1 // both go...
-    while ( u ) {
-       str = String( (char)( ( u % 16 )["0123456789abcdef"] ) ) + str;
-       u /= 16;
+    while ( i ) {
+       str = String( ( i % 16 )["0123456789abcdef"] ) + str;
+       i /= 16;
     }
-#else
-    str += int_str( u, "%x" );
-#endif
-
-    str = String( fill_ch, length_i - str.length_i() ) + str;
-    while ( ( str.length_i() > length_i ) &&  ( str[ 0 ] == 'f' ) )
-       str = str.mid_str( 2, INT_MAX );
-
+    if ( str.length_i() < length_i )
+       str = String( ch, length_i - str.length_i() ) + str;
     return str;
 }
 
-String 
-String_convert::i2hex_str( int i, int length_i, char fill_ch )
-{
-    return u2hex_str( (unsigned)i, length_i, fill_ch );
-}
-
 Byte
 String_convert::nibble2hex_byte( Byte byte )
 {
@@ -245,6 +230,6 @@ String_convert::rational_str(Rational r)
 String
 String_convert::pointer_str(const void *l)
 {
-    I64 i64 = (I64)l;
-    return String_convert::i64_str(i64,  "0x%0Lx");
+    long long int ill = (long long int )l;
+    return String_convert::longlong_str(ill,  "0x%0Lx");
 }
diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc
deleted file mode 100644 (file)
index f9a2556..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  libc-extension.cc -- implement some string.h extensions
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include "libc-extension.hh"
-
-/*
-  compensate for lacking libc functions.
- */
-char* 
-strnlwr( char* start_l ,int n)
-{
-    char * p = start_l + n;
-    while ( --p >= start_l) {
-       *p = tolower( *p );    /* a macro on some compilers */
-    }
-    return start_l;
-}
-
-char* 
-strnupr( char* start_l, int n)
-{
-    char * p = start_l + n;
-    while ( --p >= start_l) {
-       *p = toupper( *p );    /* a macro on some compilers */
-    }
-    return start_l;
-}
-
-#ifndef HAVE_MEMMEM
-
-/** locate a substring. #memmem# finds the first occurrence of
-  #needle# in #haystack#
-  */
-
-char *
-memmem(const Byte * haystack, int haystack_len,
-       const Byte *needle,int needle_len)
-{
-    const Byte * end_haystack = haystack + haystack_len - needle_len;
-    const Byte * end_needle = needle + needle_len ;
-
-    /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
-      is the spice of life */
-    while (haystack < end_haystack) {
-       const Byte *subneedle_l = needle;
-       const Byte *subhaystack_l = haystack;
-       while (subneedle_l < end_needle) {
-           if (*subneedle_l++ != *subhaystack_l++)
-               goto next;      // yeah. I should be prosecuted.
-       }
-       
-       // completed the needle. Gotcha.
-       return (char*) haystack;
-    next:
-       haystack++;
-    }
-    return 0;
-}
-#endif
-
-Byte *
-memrchr(const Byte * p, int n, char c)
-{
-    const    Byte * q = p+n;
-    while (q > p) {
-       if (*--q == c)
-           return (Byte*)q;
-    }
-    return 0;
-}
-
-
-template<class T>
-inline void
-my_swap(T &t1, T &t2, T &tmp)
-{
-    tmp = t1;
-    t1 = t2;
-    t2 = tmp;
-}
-
-Byte*
-strrev( Byte* byte_l, int length_i )
-{
-  Byte tmp_byte;
-  
-  Byte* left_l = byte_l;
-  Byte* right_l = byte_l + length_i;
-
-  while ( right_l > left_l ) {
-      my_swap(*right_l-- , *left_l++ , tmp_byte);
-  }
-  return byte_l;
-}
-
-#ifndef HAVE_SNPRINTF
-int snprintf ( char *str, size_t n,
-              const char *format, ... )
-{
-    va_list ap;
-    va_start(ap, format);
-    int i = vsprintf(str, format, ap);
-    va_end(ap);
-    return i;
-}
-#endif
diff --git a/flower/libc-extension.hh b/flower/libc-extension.hh
deleted file mode 100644 (file)
index e71037c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  libc-extension.hh -- declare some string.h extensions
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef LIBC_EXTENSION_HH
-#define LIBC_EXTENSION_HH
-#include "fproto.hh"
-
-char* strnlwr( char* start_l ,int n);
-char* strnupr( char* start_l, int n);
-
-#ifndef HAVE_MEMMEM            // GNU extension.
-char *memmem(const Byte * haystack, int haystack_len,
-            const Byte *needle, int needle_len);
-#endif HAVE_MEMMEM
-
-#ifndef HAVE_SNPRINTF          // GNU extension.
-int snprintf (char *str, size_t n,
-             const char *format, ... );
-#endif
-
-
-Byte *memrchr(const Byte * p, int n, char c);
-Byte *strrev( Byte* byte_l, int length_i );
-
-
-#endif // LIBC_EXTENSION_HH
diff --git a/flower/link.hh b/flower/link.hh
deleted file mode 100644 (file)
index 6f9c75a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// link.hh
-
-#ifndef __LINK_HH
-#define __LINK_HH
-template<class T>
-class List;
-
-
-/// class for List 
-template<class T>
-class Link
-{
-//    friend class Cursor<T>;
-public:    
-    Link( const T& thing );
-    
-    Link<T>* previous();
-    Link<T>* next();
-
-    /// put new Link item after me in list
-    void add( const T& thing );
-    /// put new Link item before me in list
-    void insert( const T& thing );     
-    void remove(List<T> &l);
-    
-    T& thing();
-    void OK() const;
-private:    
-    Link( Link<T>* previous, Link<T>* next, const T& thing );
-
-    T thing_;
-    Link<T>* previous_;
-    Link<T>* next_;
-};
-
-#include "link.inl"
-
-#endif // __LINK_HH //
diff --git a/flower/link.inl b/flower/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
diff --git a/flower/list.hh b/flower/list.hh
deleted file mode 100644 (file)
index ec59fbf..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef __LIST_HH
-#define __LIST_HH
-
-class ostream;
-template<class T> class Cursor;
-template<class T> class Link;
-
-/**  all-purpose doubly linked list. 
-
-  List can be seen as all items written down on paper,
-  from top to bottom
-
-  class Cursor is used to extend List
-
-   items are always stored as copies in List, but:
-   #List<String># :  copies of #String# stored 
-   #List<String*># : copies of #String*# stored! 
-   (do not use, use \Ref{PointerList} #<String*># instead.)
-   {\bf note:} 
-   retrieving "invalid" cursors, i.e. 
-   #top()/bottom()# from empty list, #find()# without success,
-    results in a nonvalid Cursor ( #!ok()# )
-
-
-    INVARIANTEN!
-*/
-
-template<class T>
-class List
-{
- public:
-    List(List const&src);
-
-    /// construct empty list                
-    List();    
-    virtual ~List();
-       
-    int size() const;
-
-    Cursor<T> bottom() const;  // const sucks.
-    Cursor<T> top() const;
-
-    void OK() const;           // check list
-    
- protected:
-    friend class Cursor<T>;
-    friend class Link<T>;
-
-    void concatenate(List<T> const &s);
-    
-    /**  make *this empty. 
-
-      POST:
-      size == 0
-      
-      WARNING:
-      contents lost, and not deleted.
-      */
-     void set_empty();
-  
-    void add( const T& thing, Cursor<T> &after_me );
-
-    /// put thing before #before_me#
-    void insert( const T& thing, Cursor<T> &before_me );
-
-    /** Remove link pointed to by me. Destructor of contents called
-      (nop for pointers)
-
-      POST
-      none;
-
-
-      WARNING: do not use #me# after calling
-      */
-    void remove( Cursor<T> me );
-   
-
-    /* ************** */
-    
-    int size_;
-    Link<T>* top_;
-    Link<T>* bottom_;
-};
-
-#include "list.inl"
-#include "cursor.hh"
-
-// instantiate a template:  explicit instantiation.
-#define L_instantiate(a)  template class List<a>; template class Cursor<a>; \
-  template class Link<a>
-
-
-#endif // __LIST_HH //
-    
-   
-
-
diff --git a/flower/list.inl b/flower/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/list.tcc b/flower/list.tcc
deleted file mode 100644 (file)
index 16e12a3..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef LIST_CC
-#define LIST_CC
-
-#include "list.hh"
-
-template<class T>
-List<T>::List(List const&src)
-{
-    set_empty();
-    // probably el stupido
-    for (Cursor<T> c(src); c.ok(); c++)
-       bottom().add(c);
-}
-
-template<class T>
-void
-List<T>::OK() const
-{
-    int i = size_;
-    Link<T> *lp = top_;
-    while (i--) {
-       assert(lp);
-       lp->OK();
-       lp = lp->next();
-    }
-    assert(!lp);
-     i = size_;
-    lp = bottom_;
-    while (i--) {
-       assert(lp);
-       lp->OK();
-       lp = lp->previous();
-    }
-    assert(!lp);
-}
-
-
-template<class T>
-List<T>::~List()
-{
-    Cursor<T> c(*this);
-    while (c.ok())
-       c.del();
-}
-
-/** 
-
-  add after after_me.
-
-  Procedure:
-  \begin{itemize}
-  \item if #after_me# is #ok()#, add after #after_me#, else
-  \item if list !empty simply add to bottom, else
-  \item list is empty: create first \Ref{Link} and initialize 
-  #bottom_# and #top_#.
-  \end{itemize}
-*/
-template<class T>
-void
-List<T>::add( const T& thing, Cursor<T> &after_me )
-{
-    if (!size_) {              // not much choice if list is empty
-        bottom_ = top_ = new Link<T>( thing );
-       if (!after_me.ok())
-           after_me = bottom();
-    } else {                   // add at aprioprate place
-       if (!after_me.ok())
-           after_me = bottom();
-       Link<T> *p =after_me.pointer();
-       p->add(thing);
-       if (p == bottom_)       // adjust bottom_ if necessary.
-           bottom_ = p->next();
-    }
-
-    size_++;
-}
-
-template<class T>
-void
-List<T>::insert( const T& thing, Cursor<T> &before_me )
-{
-    if (!size_) {
-       bottom_ = top_ = new Link<T>( thing );
-       if (!before_me.ok())
-           before_me = top();
-       
-    } else {
-       if (!before_me.ok())
-           before_me = top();
-       
-       Link<T> *p = before_me.pointer() ;
-
-       p->insert(thing);
-       if (p == top_)
-           top_ = p->previous();
-    }
-
-    size_++;
-}
-
-
-template<class T>
-void
-List<T>::concatenate(List<T> const&s)
-{
-    Cursor<T> b(bottom());
-    for (Cursor<T> c(s); c.ok(); c++) {
-       b.add(c);
-       b++;
-    }
-}
-#endif
diff --git a/flower/make_version b/flower/make_version
deleted file mode 100755 (executable)
index f584d27..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-echo '#ifndef FVERSION_HH'
-echo '#define FVERSION_HH'
-
-echo '#define FMAJORVERSION ' $1
-echo '#define FMINORVERSION ' $2
-echo '#define FPATCHLEVEL ' $3
-echo '#define FVERSIONSTR "'$1.$2.$3'"'
-echo '#define FCOMPILER "'$4'"'
-echo '#endif'
diff --git a/flower/matdebug.cc b/flower/matdebug.cc
deleted file mode 100644 (file)
index bcc2843..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "dstream.hh"
-#include "matrix.hh"
-
-static Dstream *dout = 0;
-
-/**
-  Set the debugging output. Will not delete/swallow argument.
- */
-void set_matrix_debug(Dstream&ds)
-{
-    dout = &ds;
-}
-
-Matrix::operator String() const
-{
-    String s;
-#ifndef NPRINT
-    s="matrix {\n";
-    for (int i=0; i< rows(); i++){
-       for (int j = 0; j < cols(); j++) {
-           s+= String(dat->elem(i,j), "%6f ");
-       }
-       s+="\n";
-    }
-    s+="}\n";
-#endif
-    return s;
-}
-
-
-void
-Matrix::print() const
-{
-#ifndef NPRINT
-    if (!dout)
-       return;
-    *dout << *this;
-#endif
-}
-
-Vector::operator String() const
-{
-    String s;
-#ifndef NPRINT
-    s="vector [";
-    for (int i=0; i < dim(); i++) {
-       s += String(dat[i], "%6f") + String(' ');
-    }
-    s+="]";
-#endif
-    return s;
-}
-
-
-void
-Vector::print() const
-{
-#ifndef NDEBUG
-    if (!dout)
-       return;
-    *dout << *this<<'\n';
-#endif
-}
diff --git a/flower/matrix.cc b/flower/matrix.cc
deleted file mode 100644 (file)
index 63bd85a..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#include "matrix.hh"
-
-Real
-Matrix::norm() const
-{
-    Real r =0.0;
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       r += sqr(dat->elem(i,j));
-    return sqrt(r);
-}
-
-void
-Matrix::fill(Real r)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j)=r;
-}
-
-void
-Matrix::set_diag(Real r)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
-       dat->elem(i,j)=(i==j) ? r: 0.0;
-}
-
-void
-Matrix::set_diag(Vector d)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
-       dat->elem(i,j)=(i==j) ? d(i): 0.0;
-}
-
-void
-Matrix::operator+=(const Matrix&m)
-{
-    assert(m.cols() == cols());
-    assert(m.rows() == rows());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) += m(i,j);
-}
-void
-Matrix::operator-=(const Matrix&m)
-{
-    assert(m.cols() == cols());
-    assert(m.rows() == rows());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) -= m(i,j);
-}
-
-
-void
-Matrix::operator*=(Real a)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) *= a;
-}
-
-void
-Matrix::operator=(const Matrix&m)
-{
-    if (&m == this)
-       return ;
-    delete dat;
-    dat = m.dat->clone();
-}
-    
-Matrix::Matrix(const Matrix &m)
-{
-    m.OK();
-    
-    dat = m.dat->clone();
-}
-
-
-Matrix::Matrix(int n, int m)
-{
-    dat = virtual_smat::get_full(n,m);
-    fill(0);
-}
-
-Matrix::Matrix(int n)
-{
-    dat = virtual_smat::get_full(n,n);
-    fill(0);
-}
-
-Matrix::Matrix(Vector v, Vector w)
-{   
-    dat = virtual_smat::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);
-}
-
-
-Vector
-Matrix::row(int k) const
-{
-    int n=cols();
-
-    
-    Vector v(n);
-    for(int i=0; i < n; i++)
-       v(i)=dat->elem(k,i);
-
-    return v;
-}
-
-Vector
-Matrix::col(int k) const
-{
-    int n=rows();
-    Vector v(n);
-    for(int i=0; i < n; i++)
-       v(i)=dat->elem(i,k);
-    return v;
-}
-
-Vector
-Matrix::left_multiply(const Vector& v) const
-{
-     Vector dest(v.dim());
-    assert(dat->cols()==v.dim());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dest(i)+= dat->elem(j,i)*v(j);
-    return dest;
-}
-
-Vector
-Matrix::operator *(const Vector& v) const
-{
-    Vector dest(rows());
-    assert(dat->cols()==v.dim());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dest(i)+= dat->elem(i,j)*v(j);
-    return dest;
-}
-
-Matrix
-operator /(Matrix const& m1,Real a)
-{
-    Matrix m(m1);
-    m /= a;
-    return  m;
-}
-
-void
-Matrix::transpose()            // delegate to storage?
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j)) {
-       if (i >= j)
-           continue;
-       Real r=dat->elem(i,j);
-       dat->elem(i,j) = dat->elem(j,i);
-       dat->elem(j,i)=r;
-    }
-}
-
-Matrix
-Matrix::operator-() const
-{
-    OK();
-    Matrix m(*this);
-    m*=-1.0;    
-    return m;
-}
-
-Matrix
-Matrix::transposed() const
-{
-    Matrix m(*this);
-    m.transpose();
-    return m;
-}
-
-
-/* should do something smarter: bandmatrix * bandmatrix is also banded matrix.  */
-Matrix
-operator *(const Matrix &m1, const Matrix &m2)
-{
-    Matrix result(m1.rows(), m2.cols());
-    result.set_product(m1,m2);
-    return result;
-}
-
-void
-Matrix::set_product(const Matrix &m1, const Matrix &m2)
-{
-    assert(m1.cols()==m2.rows());
-    assert(cols()==m2.cols() && rows()==m1.rows());
-    
-    for (int i=0, j=0; dat->mult_ok(i,j);
-        dat->mult_next(i,j)) {
-       Real r=0.0;
-       for (int k = 0; k < m1.cols(); k++)
-           r += m1(i,k)*m2(k,j);
-       dat->elem(i,j)=r;
-    }
-}
-
-void
-Matrix::insert_row(Vector v, int k)
-{
-    assert(v.dim()==cols());
-    dat->insert_row(k);
-    for (int j=0; j < cols(); j++)
-       dat->elem(k,j)=v(j);
-}
-
-
-void
-Matrix::swap_columns(int c1, int c2)
-{
-    assert(c1>=0&& c1 < cols()&&c2 < cols() && c2 >=0);
-    for (int i=0; i< rows(); i++) {
-       Real r=dat->elem(i,c1);
-       dat->elem(i,c1) = dat->elem(i,c2);
-       dat->elem(i,c2)=r;
-    }
-}
-
-void
-Matrix::swap_rows(int c1, int c2)
-{
-    assert(c1>=0&& c1 < rows()&&c2 < rows() && c2 >=0);
-    for (int i=0; i< cols(); i++) {
-       Real r=dat->elem(c1,i);
-       dat->elem(c1,i) = dat->elem(c2,i);
-       dat->elem(c2,i)=r;
-    }
-}
-
-
-int
-Matrix::dim() const
-{
-    assert(cols() == rows());
-    return rows();
-}
-
diff --git a/flower/matrix.hh b/flower/matrix.hh
deleted file mode 100644 (file)
index a633d66..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef MATRIX_HH
-#define MATRIX_HH
-
-
-#include "vsmat.hh"
-#include "vector.hh"
-
-/**  a Real matrix.  This is a class for a nonsquare block of #Real#s.  The
-    implementation of sparse matrices is done in the appropriate #smat#
-    class. Matrix only does the mathematical actions (adding,
-    multiplying, etc.)
-
-    
-    TODO
-    implement ref counting?  */
-
-
-class Matrix {
-    virtual_smat *dat;
-    
-public:
-    void OK() const { dat->OK(); }
-    int cols() const { return dat->cols(); }
-    int rows() const { return dat->rows(); }
-
-    /**  return the size of a matrix. 
-      PRE
-      the matrix needs to be square.
-    */
-    int dim() const;
-     
-    // Matrix() { dat = 0; } 
-    ~Matrix() { delete dat; }
-
-    /// set entries to r 
-    void fill(Real r);
-
-    /// set diagonal to d
-    void set_diag(Real d);
-
-    void set_diag(Vector d);
-    /// set unit matrix
-    void unit() { set_diag(1.0); }
-
-    void operator+=(const Matrix&m);
-    void operator-=(const Matrix&m);    
-    void operator*=(Real a);
-    void operator/=(Real a) { (*this) *= 1/a; }
-    
-    /**  add a row. 
-      add a row to the matrix before  row k
-
-      PRE
-      v.dim() == cols()
-      0 <= k <= rows()
-    */
-    void insert_row(Vector v,int k);
-    /** . 
-      delete a row from this matrix.
-
-      PRE
-      0 <= k < rows();
-    */
-    void delete_row(int k) { dat->delete_row(k); }
-    void delete_column(int k) { dat->delete_column(k); }
-
-    /**
-      square n matrix, initialised to null
-    */
-    Matrix(int n);
-
-    /**
-      n x m matrix, init to 0
-    */
-    Matrix(int n, int m);
-    Matrix(const Matrix &m);
-
-    /// dyadic product: v * w.transpose
-    Matrix(Vector v, Vector w);
-    void operator=(const Matrix&m);
-
-    /// access an element
-    Real operator()(int i,int j) const { return dat->elem(i,j); }
-
-    /// access an element
-    Real &operator()(int i, int j) { return dat->elem(i,j); }
-
-    /// Matrix multiply with vec (from right)
-    Vector operator *(const Vector &v) const;
-
-    /// set this to m1*m2.
-    void set_product(const Matrix &m1, const Matrix &m2);
-
-
-    Vector left_multiply(Vector const &) const;
-    
-    Matrix operator-() const;
-    
-    /// transpose this.
-    void transpose();
-    
-    /// return a transposed copy.
-    Matrix transposed() const ;
-
-    Real norm() const;
-    /**  swap. 
-      PRE
-      0 <= c1,c2 < cols()
-    */
-    void swap_columns(int c1, int c2);
-
-    /**  swap. 
-      PRE
-      0 <= c1,c2 < rows()
-    */
-    void swap_rows(int c1, int c2);
-
-
-    Vector row(int ) const;
-    Vector col(int) const;
-
-    operator String() const;
-    void print() const;
-};
-
-inline Vector
-operator *(Vector &v, const Matrix& m) { return m.left_multiply(v); }
-Matrix operator *(const Matrix& m1,const Matrix &m2);
-Matrix operator /(const Matrix &m1,Real a);
-inline Matrix operator -(Matrix m1,const Matrix m2)
-{
-    m1 -= m2;
-    return m1;
-}
-#endif
diff --git a/flower/path.cc b/flower/path.cc
deleted file mode 100644 (file)
index c79962f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-   path.cc - manipulation of paths and filenames.
-*/
-#include <stdio.h>
-#include "path.hh"
-
-#ifndef PATHSEP
-#define PATHSEP '/'
-#endif
-
-/**
-   @param path the original full filename
-   @return 4 components of the path. They can be empty
-*/
-void
-split_path(String path, 
-          String &drive, String &dirs, String &filebase, String &extension)
-{
-    // peel off components, one by one.
-    int di = path.index_i(':');
-    if (di >= 0) 
-       {
-       drive = path.left_str(di + 1);
-       path = path.right_str(path.len() - di -1);
-       } 
-    else
-       drive = "";
-    
-    di = path.index_last_i(PATHSEP);
-    if (di >=0) 
-       {
-       dirs = path.left_str(di + 1);
-       path = path.right_str(path.len()-di -1);
-       }
-    else
-       dirs = "";
-    
-    di = path.index_last_i('.');
-    if (di >= 0) 
-       {
-       filebase = path.left_str(di);
-       extension =path.right_str(path.len()-di);       
-       } 
-    else 
-       {
-       extension = "";   
-       filebase = path;
-       }
-}
-
-File_path::File_path(String pref)
-{
-    add(".");
-    add(pref);
-}
-
-
-/** find a file. 
-  It will search in the current dir, in the construction-arg, and
-  in any other added path, in this order.
-  */
-String
-File_path::find(String nm)
-{
-     for (int i=0; i < size(); i++) {
-        String path  = (*this)[i];
-        path+= "/"+nm;
-
-
-        FILE *f = fopen(path, "r"); // ugh!
-        if (f) {
-            fclose(f);
-            return path;
-        }
-     }
-     return "";
-}
diff --git a/flower/path.hh b/flower/path.hh
deleted file mode 100644 (file)
index bc4d9f3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef PATH_HH
-#define PATH_HH
-#include "string.hh"
-#include "varray.hh"
-
-
-/**    searching directory for file.
-
-   Abstraction of PATH variable. An interface for searching input files.
-   Search a number of dirs for a file.
-
-   Should use kpathsea?
-   
-*/
-
-class File_path : private Array<String>
-{
-public:
-    /// locate a file in the search path
-    String find(String nm);
-
-    /// construct using prefix. Normally argv[0].
-    File_path(String);
-
-    /// add to end of path.
-    Array<String>::push;
-    void add(String str) { push(str); }
-};
-/// split path into its components
-void split_path(String path, String &drive, String &dirs, String &filebase, String &extension);
-
-#endif
diff --git a/flower/pcursor.hh b/flower/pcursor.hh
deleted file mode 100644 (file)
index ea36007..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  pcursor.hh -- part of flowerlib
-
-  (c) 1996 Han-Wen Nienhuys&Jan Nieuwenhuizen
-*/
-
-#ifndef PCURSOR_HH
-#define PCURSOR_HH
-
-#include "plist.hh"
-#include "cursor.hh"
-
-/**  cursor to go with PointerList. 
-  don't create PointerList<void*>'s.
-  This cursor is just an interface class for Cursor. It takes care of the
-  appropriate type casts
- */
-template<class T>
-class PCursor : private Cursor<void *> {
-    friend class IPointerList<T>;
-
-    /// delete contents
-    void junk();
-public:
-    Cursor<void*>::ok;
-    Cursor<void*>::del;
-    Cursor<void*>::backspace;
-    T get_p() {
-       T p = ptr();
-       Cursor<void*>::del();
-       return p;
-    }
-    T get_prev() {
-       (*this)--;
-       return get_p();
-    }
-    
-    PointerList<T> &list() { return (PointerList<T>&)Cursor<void*>::list(); }
-    PCursor<T> operator++(int) { return Cursor<void*>::operator++(0);}
-    PCursor<T> operator--(int) { return Cursor<void*>::operator--(0); }
-    PCursor<T> operator+=(int i) { return Cursor<void*>::operator+=(i);}
-    PCursor<T> operator-=(int i) { return Cursor<void*>::operator-=(i); }    
-    PCursor<T> operator -(int no) const { return Cursor<void*>::operator-(no);}
-    int operator -(PCursor<T> op) const { return Cursor<void*>::operator-(op);}
-    PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);}    PCursor(const PointerList<T> & l) : Cursor<void*> (l) {}
-
-    PCursor( const Cursor<void*>& cursor ) : Cursor<void*>(cursor) { }
-    void* vptr() const { return *((Cursor<void*> &) *this); }
-
-    // should return T& ?
-    T ptr() const { return (T) vptr(); }
-    T operator ->() const { return  ptr(); }
-    operator T() { return ptr(); }
-    T operator *() { return ptr(); }
-    void add(const T& p ) { Cursor<void*>::add((void*) p); }
-    void insert(const T& p ) { Cursor<void*>::insert((void*) p);}    
-    static int compare(PCursor<T> a,PCursor<T>b) {
-       return Cursor<void*>::compare(a,b);
-    }
-};
-
-
-
-#include "compare.hh"
-template_instantiate_compare(PCursor<T>, PCursor<T>::compare, template<class T>);
-
-#endif
diff --git a/flower/pcursor.tcc b/flower/pcursor.tcc
deleted file mode 100644 (file)
index ffb01bc..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "pcursor.hh"
-
-template<class T>
-void
-PCursor<T>::junk()
-{
-#if !defined(NDEBUG) && defined(PARANOID)
-    list().OK();
-#endif
-
-    delete ptr();
-#if !defined(NDEBUG)&&defined(PARANOID)
-    thing() = 0;
-    list().OK();
-#endif
-}
diff --git a/flower/plist.hh b/flower/plist.hh
deleted file mode 100644 (file)
index 426b861..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  list.hh -- part of flowerlib
-
-  (c) 1996 Han-Wen Nienhuys & Jan Nieuwenhuizen
-*/
-
-#ifndef PLIST_HH
-#define PLIST_HH
-
-#include "list.hh"
-
-/**
-  A list of pointers.
-  
-  Use for list of pointers, e.g. PointerList<AbstractType*>. 
-  This class does no deletion of the pointers, but it knows how to
-  copy itself (shallow copy). We could have derived it from List<T>,
-  but this design saves a lot of code dup; for all PointerLists in the
-  program only one parent List<void*> is instantiated.
-  */
-template<class T>
-class PointerList : public List<void *>
-{
- public:
-    PCursor<T> top() const{
-       return PCursor<T> (List<void*>::top());
-    }
-    PCursor<T> bottom() const {
-       return PCursor<T> (List<void*>::bottom());
-    }
-    PCursor<T> find(T) const;
-    void concatenate(PointerList<T> const &s) { List<void*>::concatenate(s); }
-    PointerList() {}
-};
-
-/**   PointerList which deletes pointers given to it. 
-  NOTE:
-  
-  The copy constructor doesn't do what you'd want:
-  Since T might have a virtual ctor, we don't try to do a
-
-    new T(*cursor)
-
-  You have to copy this yourself, or use the macro PointerList__copy
-  
-  */
-template<class T>
-class IPointerList : public PointerList<T> {
-public:
-    IPointerList(const IPointerList&) { set_empty(); }
-    IPointerList() { }
-    ~IPointerList();
-};
-
-#define IPointerList__copy(T, to, from, op)   \
-  for (PCursor<T> _pc_(from); _pc_.ok(); _pc_++)\
-      to.bottom().add(_pc_->op)\
-  \
-
-
-template<class T>
-void PL_copy(IPointerList<T*> &dst,IPointerList<T*> const&src);
-
-
-#define PL_instantiate(a)  template class PointerList<a*>; \
-       template class PCursor<a*>;
-#define IPL_instantiate(a) PL_instantiate(a); \
-       template class IPointerList<a*>
-
-#include "plist.inl"
-
-#endif
diff --git a/flower/plist.inl b/flower/plist.inl
deleted file mode 100644 (file)
index 82be364..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*-c++-*-
-  plist.inl -- part of flowerlib
-
-  (c) 1996 Han-Wen Nienhuys& Jan Nieuwenhuizen
-*/
-
-#ifndef PLIST_INL
-#define PLIST_INL
-
-template<class T>
-void
-PL_copy(IPointerList<T*> &to, IPointerList<T*> const&src)
-{
-    for (PCursor<T*> pc(src); pc.ok(); pc++) {
-       T *q = pc;
-       T *p=new T(*q) ; 
-       to.bottom().add(p);
-    }
-}
-
-#endif
diff --git a/flower/plist.tcc b/flower/plist.tcc
deleted file mode 100644 (file)
index 2ceed2e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "plist.hh"
-
-template<class T>
-IPointerList<T>::~IPointerList()
-{
-    PCursor<T> c( *this );
-    while (c.ok()) {
-       delete c.get_p();
-    }
-}
-
-template<class T>
-PCursor<T> 
-PointerList<T>::find(T what ) const
-{
-    PCursor<T> i(*this);
-    for (; i.ok(); i++)
-       if (i.ptr() == what)
-          break;
-    return i;    
-}
diff --git a/flower/pqueue.hh b/flower/pqueue.hh
deleted file mode 100644 (file)
index 1952323..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  pqueue.hh -- declare 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef PQUEUE_HH
-#define PQUEUE_HH
-
-#include "varray.hh"
-
-/**
-  Stupid Prioq. Should use Lists and STL.
-  Smallest is put at the front.
- */
-
-template<class V, class I>
-struct PQueue
-{
-    Array<V> value_arr_;
-    Array<I> indices_arr_;
-
-    void enter(V v, I idx) {
-       int j=0;
-       for (; j < value_arr_.size(); j++)
-           if (indices_arr_[j] > idx) 
-               break;
-
-       value_arr_.insert(v, j);
-       indices_arr_.insert(idx, j);
-    }
-    int size() { return value_arr_.size(); }
-    V front_val() { return value_arr_[0]; }
-    I front_idx() { return indices_arr_[0]; }
-    V get() {
-       V retval = front_val();
-       value_arr_.del(0);
-       indices_arr_.del(0);
-       return retval;
-    }
-    
-};
-#endif // PQUEUE_HH
diff --git a/flower/rational.hh b/flower/rational.hh
deleted file mode 100644 (file)
index 30fa2cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <Rational.h>
diff --git a/flower/real.hh b/flower/real.hh
deleted file mode 100644 (file)
index 0533af2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef REAL_HH
-#define REAL_HH
-
-
-#include <builtin.h>
-#include <minmax.h>
-#include <math.h>
-
-typedef double Real;
-
-inline Real
-distance(Real x,Real y)
-{
-    return abs(x-y);
-}
-#endif
diff --git a/flower/scalar.cc b/flower/scalar.cc
deleted file mode 100644 (file)
index 5edd9e9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include "scalar.hh"
-
-Scalar::Scalar(Rational r)
-    :String(r)
-{
-
-}
-
-Scalar::operator Rational()
-{
-    int p = index_i('/');
-    if (p == -1)
-       return int(*this);
-    
-    String s2 = right_str(len()-p-1);
-    String s1 = left_str(p);
-
-    return Rational(s1.value_i(), s2.value_i());
-}
-
-bool
-Scalar::isnum()
-{
-    int conv = false;
-    if (len()) {
-       long l =0;
-       conv = sscanf(strh_.ch_c_l(), "%ld", &l);
-    }
-    return len() && conv;
-}
-
-Scalar::operator Real()
-{
-    assert (isnum());
-    return value_f();
-}
-
-Scalar::operator int()
-{
-    assert (isnum());
-    return value_i();
-}
-
-
-Scalar::operator bool() const
-{
-    if (!len())
-       return false;
-    if (*this == "0")
-       return false;
-    String u (*this);
-    if ( u.upper_str() == "FALSE")
-       return false;
-    return true;
-}
diff --git a/flower/scalar.hh b/flower/scalar.hh
deleted file mode 100644 (file)
index 5cdfa42..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  scalar.hh -- part of LilyPond
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef SCALAR_HH
-#define SCALAR_HH
-#include "string.hh"
-#include "real.hh"
-
-/// Perl -like scalar type.
-struct Scalar : public String {
-    
-    Scalar(Real r) : String(r) {}
-    Scalar(int i) : String(i) {}
-    Scalar(char c) : String(c) {}
-    Scalar(const char *c) : String(c) {}    
-    Scalar(String s ):String(s) {}
-    Scalar(Rational );
-    operator Rational();
-    Scalar() {}
-    bool isnum();
-    operator Real();
-    operator int();
-
-    /**   perl -like string to bool conversion.
-     */
-    operator bool() const;
-
-};
-
-#endif // SCALAR_HH
-
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);
-}
diff --git a/flower/smat.hh b/flower/smat.hh
deleted file mode 100644 (file)
index 9b0987c..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 const Real& 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/string-convert.cc b/flower/string-convert.cc
deleted file mode 100644 (file)
index 36c98dd..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-  PROJECT: FlowerSoft C++ library
-  FILE   : string-convert.cc
-
---*/
-
-
-#include <assert.h>
-#include "string.hh"
-#include "string-convert.hh"
-
-/**
-   a safe length for stringconversion buffers
-
-   worst case would be %f printing HUGE (or 1/HUGE), which is approx
-   2e318, this number would have approx 318 zero's in its string.
-
-   Should enlarge buff dynamically.
-   @see
-   man 3 snprintf
-   */
-static const int STRING_BUFFER_LEN=1024;
-
-String
-String_convert::bin2hex_str( String bin_str )
-{
-    String str;
-    Byte const* byte_c_l = bin_str.byte_c_l();
-    for ( int i = 0; i < bin_str.length_i(); i++ ) {
-       str += (char)nibble2hex_byte( *byte_c_l >> 4 );
-       str += (char)nibble2hex_byte( *byte_c_l++ );
-    }
-    return str;
-}
-
-int
-String_convert::bin2_i( String bin_str )
-{
-    assert( bin_str.length_i() <= 4 );
-
-    int result_i = 0;
-    for ( int i = 0; i < bin_str.length_i(); i++ ) {
-       result_i <<= 8;
-       result_i += (Byte)bin_str[ i ];
-    }
-    return result_i;
-}
-
-// breendet imp from String
-int
-String_convert::dec2_i( String dec_str )
-{
-    if ( !dec_str.length_i() )
-       return 0;
-
-    long l = 0;
-    int conv = sscanf( dec_str.ch_c_l(), "%ld", &l );
-    assert( conv );
-
-    return (int)l;
-}
-
-String
-String_convert::longlong_str(long long ll, char const* fmt)
-{
-    char buffer[STRING_BUFFER_LEN];
-    snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%Ld"), ll );     // assume radix 10
-    return String(buffer);
-
-}
-// breendet imp from String
-double
-String_convert::dec2_f( String dec_str )
-{
-    if ( !dec_str.length_i() )
-       return 0;
-    double d = 0;
-    int conv = sscanf( dec_str.ch_c_l(), "%lf", &d );
-    assert( conv );
-    return d;
-}
-
-int
-String_convert::hex2bin_i( String hex_str, String& bin_str_r )
-{
-    if ( hex_str.length_i() % 2 )
-        hex_str = "0" + hex_str;
-
-    bin_str_r = "";
-    Byte const* byte_c_l= hex_str.byte_c_l();
-    int i = 0;
-    while ( i < hex_str.length_i() ) {   
-        int high_i = hex2nibble_i( *byte_c_l++ );
-        int low_i = hex2nibble_i( *byte_c_l++ );
-        if ( high_i < 0 || low_i < 0 )
-            return 1; // illegal char
-        bin_str_r += String( (char)( high_i << 4 | low_i ), 1 );
-        i += 2;
-    }
-    return 0;
-}
-
-String 
-String_convert::hex2bin_str( String hex_str )
-{
-    String str;
-//  silly, asserts should alway be "on"!
-//    assert( !hex2bin_i( hex_str, str ) );
-    int error_i = hex2bin_i( hex_str, str );
-    assert( !error_i );
-    return str;
-}
-
-int 
-String_convert::hex2nibble_i( Byte byte )
-{
-    if ( byte >= '0' && byte <= '9' )
-        return byte - '0';
-    if ( byte >= 'A' && byte <= 'F' )
-        return byte - 'A' + 10;
-    if ( byte >= 'a' && byte <= 'f')
-        return byte - 'a' + 10;
-    return -1;
-}
-
-// stupido.  Should use int_str()
-String 
-String_convert::i2dec_str( int i, int length_i, char ch )
-{
-    char fill_ch = ch;
-    if ( fill_ch)
-        fill_ch = '0';
-
-    // ugh
-    String dec_str( i );
-    
-    // ugh
-    return String( fill_ch, length_i - dec_str.length_i() ) + dec_str;
-}
-
-
-// stupido.  Should use int_str()
-String 
-String_convert::i2hex_str( int i, int length_i, char ch )
-{
-    String str;
-    if ( !i )
-       str = "0";
-    while ( i ) {
-       str = ( i % 16 )["0123456789abcdef"] + str;
-       i /= 16;
-    }
-    if ( str.length_i() < length_i )
-       str = String( ch, length_i - str.length_i() ) + str;
-    return str;
-}
-
-Byte
-String_convert::nibble2hex_byte( Byte byte )
-{
-    if ( ( byte & 0x0f ) <= 9 )
-       return ( byte & 0x0f ) + '0';
-    else
-       return ( byte & 0x0f ) - 10 + 'a';
-}
-/**
-  Convert an integer to a string
-
-  @param
-  #fmt# is a printf style format, default assumes "%d" as format. 
-  */
-String
-String_convert::int_str(int i, char const* fmt)
-{
-    char buffer[STRING_BUFFER_LEN];
-    snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%d"), i );     // assume radix 10
-    return String(buffer);
-}
-
-/**
-  Convert a double to a string.
-
-  @param #fmt# is a printf style format, default assumes "%lf" as format
- */
-String
-String_convert::double_str(double f, char const* fmt)
-{
-    char buf[STRING_BUFFER_LEN]; 
-
-    snprintf(buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
-    return buf;
-}
-
-/**
-  Make a string from a single character.
-
-  @param
-    #n# is a repetition count, default value is 1
- */
-String
-String_convert::char_str(char c, int n)
-{
-    n = n >= 0 ? n : 0;
-    char* ch_p = new char[ n ];
-    memset( ch_p, c, n );
-    String s((Byte*)ch_p, n);
-    delete ch_p;
-    return s;
-}
-
-String
-String_convert::rational_str(Rational r)
-{
-    char * n = Itoa(r.numerator()); // LEAK????
-    
-    String s = n;
-    if (r.denominator() != 1) {
-       char * d = Itoa(r.denominator());
-       s +=  String( '/' ) + String(d);
-       //delete d;
-    }
-/*    delete n;
-    */
-    return s;
-}
-
-String
-String_convert::pointer_str(const void *l)
-{
-    long long int ill = (long long int )l;
-    return String_convert::longlong_str(ill,  "0x%0Lx");
-}
diff --git a/flower/string-convert.hh b/flower/string-convert.hh
deleted file mode 100644 (file)
index bcf461f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  PROJECT: FlowerSoft C++ library
-  FILE   : string-convert.hh
-
-*/
-
-#ifndef STRING_CONVERT_HH
-#define STRING_CONVERT_HH
-
-/*
-  ///a class which only has functions.
-//#define functor class // cute. docxx fucks up
-*/
-
-/**
-       The functor String_convert handles all conversions to/from String (some 
-       time, anyway).
-       The class is quite empty from data view.
-  */
-class String_convert {
-    static int hex2bin_i( String hex_str, String& bin_str_r );
-    static int hex2nibble_i( Byte byte );
-    static Byte nibble2hex_byte( Byte byte );
-public:
-    static String bin2dec_str( String bin_str );
-    static String bin2hex_str( String bin_str );
-    static String dec2bin_str( String str );
-    static int bin2_i( String str );
-    static String char_str(char c, int n);
-    static int dec2_i( String dec_str );
-    static double dec2_f( String dec_str );
-    static String double_str(double f, char const* fmt=0);
-    static int hex2int_i( String str );
-    static String hex2bin_str( String str );
-    static String int_str(int i, char const *fmt=0  );
-    static String i2hex_str( int i, int length_i, char ch );
-    static String i2dec_str( int i, int length_i, char ch );
-    static String rational_str(Rational);
-    static String pointer_str(const void *);
-    static String longlong_str(long long , char const * fmt = 0);
-};
-
-#endif // __STRING_CONVERT_HH //
diff --git a/flower/string-data.hh b/flower/string-data.hh
deleted file mode 100644 (file)
index d4f4b6b..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  string-data.hh -- declare  String_data
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STRINGDATA_HH
-#define STRINGDATA_HH
-
-
-/**Internal String struct.
-   the data itself. Handles simple tasks (resizing, resetting)
-   */
-class String_data {
-    // GNU malloc: storage overhead is 8 bytes anyway.
-
-friend class String_handle;
-    int maxlen;        // maxlen is arraysize-1
-    
-    int length_i_;
-    Byte* data_byte_p_;
-    int references;
-
-    /// init to ""
-    String_data();
-
-    /// init from src. Conservative allocation.
-    String_data(String_data const &src); 
-    
-    ~String_data();
-
-    /** POST: maxlen >= j.
-      @param j, maximum stringlength_i_.    
-      contents thrown away.
-    */
-    void setmax(int j);
-    
-    /** POST: maxlen >= j.
-      @param j, maximum stringlength_i_.
-      contents are kept if it grows.
-      */
-    void remax(int j);
-
-    /// check if writeable.
-    void OKW();
-
-    /// check state.
-    void OK();
-
-    /// reduce memory usage.
-    void tighten();
-
-    // assignment.
-    void set( Byte const* byte_c_l, int length_i );
-
-    void set( char const* ch_c_l );
-    
-    /// concatenation.
-    void append( Byte const* byte_c_l, int length_i );
-
-    void operator += ( char const* ch_c_l );
-
-    char const* ch_c_l() const; 
-
-    char* ch_l();
-
-    Byte const* byte_c_l() const;
-
-    // idem, non const
-    Byte* byte_l();
-
-    void trunc(int j);
-
-    /** access element. not really safe. Can alter length_i_ without
-      #String_data# knowing it.  */
-    Byte &operator [](int j);
-    Byte operator [](int j) const;
-    bool null_terminated_b()const;
-};
-
-
-
-#ifdef STRING_UTILS_INLINED
-#ifndef INLINE
-#define INLINE inline
-#endif
-#include "string-data.inl"
-
-#endif
-
-
-#endif // STRING_DATA_HH
diff --git a/flower/string-data.inl b/flower/string-data.inl
deleted file mode 100644 (file)
index f5bdc86..0000000
+++ /dev/null
@@ -1,209 +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_l, int length_i ) 
-{
-    OKW();
-
-    assert( byte_c_l && byte_c_l != data_byte_p_);
-
-    length_i_ = length_i;
-    remax( length_i_ );     // copies too
-    memcpy( data_byte_p_, byte_c_l, length_i_ );
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::set( char const* ch_c_l ) 
-{
-    set( (Byte const*)ch_c_l, strlen( ch_c_l ) );
-}
-
-
-/// concatenation.
-INLINE void 
-String_data::append( Byte const* byte_c_l, 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_l, length_i );        
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::operator += ( char const* ch_c_l ) 
-{
-    append( (Byte const*)ch_c_l, strlen( ch_c_l ) );
-}
-
-
-
-INLINE
-char const*
-String_data::ch_c_l() 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_l() 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::null_terminated_b()const
-{
-    return !memchr(data_byte_p_, length_i_, 0);
-}
-
-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/string-handle.hh b/flower/string-handle.hh
deleted file mode 100644 (file)
index fe109d8..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  string-handle.hh -- declare String_handle
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STRINGHANDLE_HH
-#define STRINGHANDLE_HH
-#include "fproto.hh"
-
-
-/**
-  Reference counting for strings.
-  
-   handles ref. counting, and provides a very thin interface using
-   Byte *
-
-   */
-class String_handle {
-    String_data* data;
-    
-    /// decrease ref count. Named kind of like a Tanenbaum semafore 
-    void down();
-
-    /// increase ref count
-    void up(String_data *d);
-    
-    /** make sure data has only one reference.      
-       POST: data->references == 1
-      */
-    void copy();
-    
-public:
-    String_handle();
-    ~String_handle();
-    String_handle(String_handle const & src);
-
-    Byte const* byte_c_l() const;
-    char const* ch_c_l() const;
-    Byte* byte_l();
-    char* ch_l();    
-    bool null_terminated_b()const;
-    void operator =(String_handle const &src);
-    void operator += (char const *s);
-    Byte operator[](int j) const;
-
-    /** Access elements. WARNING: NOT SAFE
-       don't use this for loops. Use byte_c_l()
-       */
-    Byte &operator[](int j);
-    void append( Byte const* byte_c_l, int length_i );
-    void set( Byte const* byte_c_l, int length_i );
-    void operator = (char const *p);
-    void trunc(int j);
-    int length_i() const;
-};
-
-#ifdef STRING_UTILS_INLINED
-#ifndef INLINE
-#define INLINE inline
-#endif
-#include "string-handle.inl"
-/* we should be resetting INLINE. oh well. */
-#endif
-
-
-#endif // STRINGHANDLE_HH
diff --git a/flower/string-handle.inl b/flower/string-handle.inl
deleted file mode 100644 (file)
index 7286fd6..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_l() const 
-{
-    return data->byte_c_l();
-}
-
-INLINE char const* 
-String_handle::ch_c_l() const 
-{
-    return (char const*)data->byte_c_l();
-}
-
-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_l()
-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_l, int length_i ) 
-{
-    copy();
-    data->append( byte_c_l, length_i );
-}
-                          
-INLINE void 
-String_handle::set( Byte const* byte_c_l, int length_i ) 
-{
-    copy();
-    data->set( byte_c_l, 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::null_terminated_b() const {
-    return data->null_terminated_b();
-}
-
-#endif
diff --git a/flower/string.cc b/flower/string.cc
deleted file mode 100644 (file)
index 60038f6..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
-
- string.cc - implement String
- (c) 1997 Han-Wen Nienhuys & Jan Nieuwenhuizen
-
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <assert.h>
-#include <string.h>
-
-#include "string.hh"
-#include "libc-extension.hh"
-#include "string-convert.hh"
-
-#ifdef STRING_DEBUG
-void* mymemmove( void* dest, void const* src, size_t n );
-#define memmove mymemmove
-#endif
-
-// return array, alloced with new.
-Byte*
-String::copy_byte_p() const
-{
-    Byte const* src = strh_.byte_c_l();
-    Byte* dest = new Byte[strh_.length_i() + 1];
-    memcpy( dest, src, strh_.length_i() + 1 );
-    return dest;    
-}
-void
-String::print_on(ostream& os) const
-{
-    if (strh_.null_terminated_b())
-        os << ch_c_l();
-    else
-       for ( int i = 0; i < length_i(); i++ )
-           os << (Byte)(*this)[ i ];
-}
-\f
-/*
-  copying, constructing.
- */
-String&
-String::operator = (String const&source )
-{
-    strh_ = source.strh_;
-    return *this;
-}
-
-
-String::String(Rational r)
-{
-    *this = String_convert::rational_str(r);
-}
-
-String::String (double f, char const* fmt)
-{
-    *this= String_convert::double_str(f,fmt);
-}
-
-String::String( char c,  int n )
-{
-    *this = String_convert::char_str (c,n);
-}
-
-/**
-  @see
-  String_convert::int_str
- */
-String::String(int i, const char * format )
-{
-    *this = String_convert::int_str(i,format);
-}
-
-String::String (bool b)
-{
-    *this = (char const* ) (b ? "true" : "false");
-}
-
-String::String( char const* source )
-{   
-    assert(source);    
-    strh_ = source;    
-}
-
-String::String( Byte const* byte_l, int length_i )
-{   
-    strh_.set( byte_l, length_i );    
-}
-\f
-void
-String::append(String s)
-{
-    strh_.append( s.byte_c_l(), s.length_i() );
-}
-void
-String::operator +=(String s)
-{
-    append(s);
-}
-
-void
-String::prepend(String s)
-{
-    s += *this;
-    *this = s;
-}
-
-int
-String::length_i() const
-{
-    return strh_.length_i();
-}
-
-Byte const*
-String::byte_c_l() const
-{
-    return strh_.byte_c_l();
-}
-
-char const*
-String::ch_c_l() const
-{
-    return strh_.ch_c_l();
-}
-
-Byte*
-String::byte_l()
-{
-    return strh_.byte_l();
-}
-
-char*
-String::ch_l()
-{
-    return strh_.ch_l();
-}
-
-/**
-  Do a signed comparison,  analogous to memcmp;
- */
-int
-String::compare_i(String const& s1, String const& s2 ) 
-{
-    Byte const* p1 = s1.byte_c_l();
-    Byte const* p2 = s2.byte_c_l();
-    if ( p1 == p2 )
-       return 0;
-
-    int i1 = s1.length_i();
-    int i2 = s2.length_i();
-
-    int result=  memcmp( p1, p2, i1 <? i2 );
-    return result ? result : i1-i2;
-}
-
-\f
-int
-String::index_last_i( char const c ) const
-{
-    if ( !length_i() ) 
-       return -1;
-
-    char const* me = strh_.ch_c_l();
-    char const* p = memrchr(me, length_i(), c );
-    if ( p )
-       return p - me;
-    return -1;
-}
-
-int
-String::index_last_i( char const* string ) const // UGK!
-{
-    assert(false);             // broken
-    int length = strlen( string ); // ugrh
-    if ( !length_i() || !length ) 
-       return -1;
-    
-    int next_i = index_i( string );
-    if ( next_i == -1 )
-       return -1;
-    
-    int index_i = 0;
-    while( next_i >= 0 ) {
-       index_i += next_i;
-       next_i = right_str( length_i() - index_i - length ).index_i( string );
-    }
-    return index_i;
-}
-
-/** find  a character.
-
-  @return
-  the index of the leftmost character #c# (0 <= return < length_i()),
-  or   -1 if not found. 
-
-  ? should return length_i()?, as in string.left_str(index_i(delimiter))
-*/
-int
-String::index_i(char c ) const
-{
-    char const* me = strh_.ch_c_l();
-    char const* p = (char const *) memchr( me,c,  length_i());
-    if ( p )
-       return p - me;
-    return -1;
-}
-
-/**
-  find the substring.
-
-  @return
-  index of leftmost occurrence of #searchfor#
- */
-int
-String::index_i( String searchfor ) const
-{
-    char const* me = strh_.ch_c_l();
-    char const* p = (char const *) memmem(
-       me, length_i(), searchfor.ch_c_l(), searchfor.length_i());
-    
-    if ( p )
-       return p - me;
-    else
-       return -1;
-}
-
-/** find chars of a set.
-
-  @return
-  the index of the leftmost occurance of an element of #set#
-  */
-int
-String::index_any_i( String set ) const
-{
-    int n = length_i();
-    if ( !n )
-       return -1;
-
-    const void * me_l = (const void*) strh_.ch_c_l();
-    for (int i=0; i  < set.length_i(); i++) {
-       char * found=(char*) memchr(me_l, set[i], n  );
-       if (found) {
-           return found - me_l;
-       }
-    }
-    return -1;
-}
-\f
-String
-String::left_str( int n ) const
-{
-    if (n >= length_i())
-       return *this;
-
-    String retval;     
-    if (n < 1)
-        return retval;
-    
-    retval = *this;
-    retval.strh_.trunc(n);
-    return retval;
-}
-
-String
-String::right_str( int n ) const
-{
-    if (n > length_i())
-       return *this;
-    
-    if ( n < 1)
-        return "";
-    
-    return String( strh_.byte_c_l() + length_i() - n, n ); 
-}
-
-
-String
-String::nomid_str( int index_i, int n ) const
-{
-    if ( index_i < 0 ) {
-       n += index_i;
-       index_i = 0;
-    }
-    if ( n <= 0)
-       return *this;
-    
-    return
-       left_str( index_i )   +
-       right_str( length_i() - index_i - n ) ;
-}
-
-/*
-  proposal: change to "cut()"
- */
-String
-String::mid_str( int index_i, int n ) const
-{
-    if (index_i <0) {
-       n += index_i;
-       index_i=0;
-    }
-    
-    if ( !length_i() || ( index_i < 0 ) || ( index_i >= length_i() ) || ( n < 1 ) )
-       return String();
-
-    if ( ( n > length_i() ) ||  ( index_i + n > length_i() ) )
-       n = length_i() - index_i;
-
-    return String( byte_c_l() + index_i, n );
-}
-\f
-String
-String::upper_str() const
-{
-    String str = *this;
-    str.to_upper();
-    return str;
-}
-void
-String::to_upper()
-{
-    char *s = (char*)strh_.byte_l();
-    strnupr( s ,length_i());
-}
-
-void
-String::to_lower()
-{
-    char* s = strh_.ch_l();
-    strnlwr(s,length_i());    
-}
-
-
-String 
-String::lower_str() const
-{
-    String str = *this;
-    str.to_lower();
-    return str;
-}
-String 
-String::reversed_str() const
-{
-    String str = *this;
-    strrev( str.byte_l(), str.length_i() );
-    return str;    
-}
-
-int
-String::value_i() const
-{
-    return String_convert::dec2_i( *this );
-}
-
-double
-String::value_f() const
-{
-    return String_convert::dec2_f( *this );
-}
-
-
diff --git a/flower/string.hh b/flower/string.hh
deleted file mode 100644 (file)
index 8cef141..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-
-  FILE   : string.hh -- declare String
-  Rehacked by HWN 3/nov/95
-  removed String & 's
-  introduced Class String_handle
- */
-
-#ifndef STRING_HH
-#define STRING_HH
-
-
-#include <string.h>
-#include <iostream.h>
-#include <Rational.h>
-
-#include "string-handle.hh"
-
-/** 
-  Intuitive string class. provides 
-\begin{itemize}
-\item
-  ref counting through #String_handle#
-\item
-  conversion from bool, int, double, char* , char.  
-\item
-  to be moved to String_convert:
-  conversion to int, upcase, downcase 
-
-\item
-  printable. 
-
-\item
-  indexing (index_i, index_any_i, last_index_i)
-
-\item
-  cutting (left_str, right_str, mid_str)
-
-\item
-  concat (+=, +)
-
-\item
-  signed comparison (<, >, ==, etc)
-
-\item
-  No operator[] is provided, since this would be enormously  slow. If needed,
-  convert to char const* .
-\end{itemize}
-
-*/
-class String
-{
-protected:
-    String_handle strh_; 
-
-    bool null_terminated();
-    
-public:
-
-    /** init to empty string. This is needed because other
-      constructors are provided.*/
-    String() {  }                  
-    String(Rational);
-
-    /// String s = "abc";
-    String( char const* source ); 
-    String( Byte const* byte_c_l, int length_i ); 
-    
-    /// "ccccc"
-    String( char c, int n = 1 );
-
-    String( int i , char const *fmt=0);
-    String ( double f , char const* fmt =0);
-    /// 'true' or 'false'
-    String(bool );
-
-    ///  return a "new"-ed copy of contents
-    Byte* copy_byte_p() const; //  return a "new"-ed copy of contents
-
-    char const* ch_c_l() const;
-    Byte const* byte_c_l() const;
-    char* ch_l();
-    Byte* byte_l();
-
-    /// deprecated; use ch_c_l()
-    operator char const* () const { return ch_c_l(); }
-    
-    String &operator =( const String & source );
-
-    /// concatenate s
-    void operator += (char const* s) { strh_ += s; }
-    void operator += (String s);
-
-    void append(String);
-    void prepend(String);
-
-    char operator []( int n ) const { return strh_[n]; }
-
-    /// return n leftmost chars
-    String left_str( int n ) const;
-
-    /// return n rightmost chars
-    String right_str( int n ) const;
-
-    /// return uppercase of *this
-    String upper_str() const;
-
-    /// return lowercase of *this
-    String lower_str() const;
-
-    /// return the "esrever" of *this
-    String reversed_str() const;
-
-
-    /// return a piece starting at index_i (first char = index_i 0), length n
-    String mid_str(int index_i, int n ) const;
-
-    /// cut out a middle piece, return remainder
-    String nomid_str(int index_i, int n ) const;
-
-    /// signed comparison,  analogous to memcmp;
-    static int compare_i(const String& s1,const  String& s2);
-       
-    /// index of rightmost c 
-    int index_last_i( char c) const;
-
-    /// index of rightmost element of string 
-    int index_last_i( char const* string ) const;
-
-    int index_i(char c ) const;
-    int index_i(String ) const;
-    int index_any_i(String ) const;
-
-    void to_upper();
-    void to_lower();
-    /// provide Stream output
-    void print_on(ostream& os) const;
-
-    /// the length of the string
-    int length_i() const;
-
-    // ***** depreciated
-    int len() const {
-       return length_i();
-    }
-
-    /// convert to an integer
-    int value_i() const;
-
-    /// convert to a double
-    double value_f() const;
-};
-
-#include "compare.hh"
-
-instantiate_compare(const String &, String::compare_i);
-
-// because char const* also has an operator ==, this is for safety:
-inline bool operator==(String s1, char const* s2){
-    return s1 == String(s2);
-}
-inline bool operator==(char const* s1, String s2)
-{
-    return String(s1)==s2;
-}
-inline bool operator!=(String s1, char const* s2  ) {
-    return s1!=String(s2);
-}
-inline bool operator!=(char const* s1,String s2) {
-    return String(s2) !=s1;
-}
-
-
-inline String
-operator  + (String s1, String  s2)
-{
-    s1 += s2;
-    return s1;
-}
-
-inline ostream &
-operator << ( ostream& os, String d )
-{
-    d.print_on(os);
-    return os;
-}
-
-
-// String quoteString(String message, String quote);
-
-#endif
diff --git a/flower/stringtest.cc b/flower/stringtest.cc
deleted file mode 100644 (file)
index 2f085a2..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-  stupid test program to verify stringlib
-  stringtest.cc
-  */
-#include <iostream.h>
-#include "string.hh"
-#include "varray.hh"
-#include "string-convert.hh"
-
-void
-ctors()
-{
-    cout << "constructors"<<endl;
-
-    String str( "hai" );
-    String def;
-    String fromi(10);
-    String fromc('c');
-    String fromf(1.32e-2, "%g");
-
-    cout << str << endl;
-    cout << def << endl;
-    cout << fromi<< endl;
-    cout << fromc<< endl;       
-    cout << fromf<< endl;
-}
-
-void
-cmp()
-{
-    Array<String> a;
-    a.push("abcd");
-    a.push("zxy");
-    a.push("abc");
-    a.push("");
-    a.sort(String::compare_i);
-    cout << "compares: "<<endl;
-    for (int i=0; i < a.size(); i++)
-       cout << a[i] << endl;
-}
-
-
-void
-searching()
-{
-    String hay = "foobarbazblub";
-
-    char c =   'b';
-    String cstr =c;
-    String set = "bar";
-    cout << "hay = \"" << hay << "\" len="<< hay.length_i()<<endl;
-    cout << "index_i('"<< c<<"') " << c << "= " << hay.index_i(c) <<endl;
-    cout << "last_index_i('"<< c<<"') " << c << "= " << hay.index_last_i(c) <<endl;    
-//    cout << "last index of cstr " << c << ": " << hay.index_last_i(cstr) <<endl;    
-//    cout << "index_last_i(\""<<set<<"\"): " << hay.index_last_i(set) <<endl;
-    cout << "index_i(\""<<set<<"\"): " << hay.index_i(set) <<endl;    
-    cout << "index_any(\"" << set << "\"): " << cstr << ": " << hay.index_any_i(cstr) <<endl;
-
-    
-    
-}
-
-
-void
-kutenpeer()
-{
-    String str( "hai" );
-    for (int i=-1; i < str.length_i()+2; i++) {
-       cout<<" left_str(" << i<<"): " << str.left_str( i ) << endl;
-       cout<<" right_str( "<<i<<"): " << str.right_str( i ) << endl;
-    }
-    str = "blonde haren";
-    cout << str<<endl;
-    cout << "mid(2,6)="<<str.mid_str(2,3)<<endl;
-    cout << "nomid(2,6)="<<str.nomid_str(2,3)<<endl;
-}
-
-int 
-main()
-{
-    ctors();
-    cmp();
-    searching();
-    kutenpeer();
-    String str( "hai" );
-    cout <<  str << endl;
-    cout << "left" << endl;
-    str += " daar";
-    cout << str << endl;
-
-    str = String( "Hallo" ) + " daaR" + '!';
-    cout << str << endl;
-
-    cout << "up: " << str.upper_str() << " down: " << str.lower_str()<<endl;
-    
-    if ( str == String( "" ) )
-        cout << str << " is empty" << endl;
-    else
-       cout << str << " is not empty"<<endl;
-
-    
-    String fn = "";
-    if ( fn == "" )
-        cout << fn << " is empty" << endl;
-    else
-       assert(false);
-    
-    fn = "";
-    fn += "";
-    delete fn.copy_byte_p();
-    delete str.copy_byte_p();
-
-    cout << String_convert::bin2hex_str( String( (char)0xff ) ) << endl;
-}
diff --git a/flower/stringutil.cc b/flower/stringutil.cc
deleted file mode 100644 (file)
index 43c8e15..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  stringutil.cc -- generate non-inline members. 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifdef STRING_DEBUG 
-#include <sys/types.h>
-#include <memory.h>
-void* 
-mymemmove( void* dest, void const* src, size_t n )
-{
-       return memcpy( dest, src, n ); // wohltempererit: 69006
-}
-#define memmove mymemmove
-#endif
-
-#ifdef STRING_UTILS_INLINED
-#undef STRING_UTILS_INLINED
-#endif
-
-#ifdef INLINE
-#undef INLINE
-#endif
-
-#define INLINE
-
-#include "string-handle.hh"
-#include "string-data.hh"
-#include "string-data.inl"
-#include "string-handle.inl"
diff --git a/flower/text-db.cc b/flower/text-db.cc
deleted file mode 100644 (file)
index ebfc992..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "text-db.hh"
-bool
-Text_db::eof()
-{
-    Data_file::gobble_leading_white();
-    return  Data_file::eof();
-}
-
-void
-Text_db::gobble_leading_white()
-{
-    while (1) {
-       Data_file::gobble_leading_white();
-       if (eof())
-           return ;
-       char c;
-       if  ((c = data_get()) !='\n'){
-           data_unget (c);
-           return ;
-       }       
-    }  
-}
-
-
-Text_record
-Text_db::get_record() 
-{
-   while (1) {
-       String s;
-       Array<String> fields;
-       assert(!eof());
-       
-       while ((s = get_word()) != "")
-           {
-           fields.push(s);     
-           gobble_white();
-           }
-            
-
-       if (get_line() != "")
-           assert(false);
-      
-       assert (fields.size());
-       return Text_record(fields, get_name(), line());
-   }
-}
-
-
diff --git a/flower/text-db.hh b/flower/text-db.hh
deleted file mode 100644 (file)
index 3535a84..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef TEXTDB_HH
-#define TEXTDB_HH
-
-#include "data-file.hh"
-
-/**a "const" Array. Contents can't be changed. do "#" comments, read quote enclosed  fields */
-
-class Text_record : Array<String>  
-{
-    int line_no;
-    String filename;
-    
-public:
-    Text_record() { } // needed because of other ctor
-
-    /// report an error in this line.
-    message(String s) {
-       cerr << '\n'<< filename << ": "<< line_no << s << "\n";
-    }         
-    String operator[](int j) {
-       return Array<String>::operator[](j);
-    }
-
-    Text_record(Array<String> s, String fn, int j) : Array<String>(s) { 
-       filename = fn; line_no = j; 
-    }
-    Array<String>::size;           
-};
-
-/** abstraction for a datafile.
-    add a subrec/fieldsep/record separator
-    */
-
-class Text_db : private Data_file
-{
-    void gobble_leading_white();
-public:
-    /// get a line with records
-    Text_record    get_record();
-
-    Text_db(String fn):Data_file(fn) { }
-    Data_file::error;
-    bool eof();
-
-    /// get next line.
-    Text_record operator++(int) {
-       return get_record();
-    }
-    /// are we done yet?
-    operator bool() {
-       return !eof();
-    }
-};
-
-#endif
diff --git a/flower/text-stream.cc b/flower/text-stream.cc
deleted file mode 100644 (file)
index a2d3e4b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "text-stream.hh"
-
-Text_stream::Text_stream(String fn)
-{
-    ios::sync_with_stdio();
-    if (fn == "") 
-           {
-           name = "<STDIN>";       
-           f = stdin;
-           }
-       
-       else 
-           {
-           name = fn;      
-           f = fopen(fn, "r");
-           }
-       
-       if (!f) {
-           cerr <<__FUNCTION__<< ": can't open `" << fn << "'\n";
-           exit(1);
-       }
-
-       line_no = 1;
-    }
-
-void
-Text_stream::message(String s)
-{
-    cerr << "\n"<<get_name() << ": " << line()<<": "<<s<<endl;
-}
-
diff --git a/flower/text-stream.hh b/flower/text-stream.hh
deleted file mode 100644 (file)
index 437f869..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#ifndef TEXTSTR_HH
-#define TEXTSTR_HH
-
-#include <stdio.h>
-#include <ctype.h>
-#include "string.hh"
-#include "varray.hh"
-
-/**
-  line counting input stream. 
-  a stream for textfiles. linecounting. Thin interface getchar and
-  ungetchar.  (ungetc is unlimited) 
-  
-  should protect get and unget against improper use
-*/
-
-
-class Text_stream
-{
-    int line_no;
-
-    // could just have used streams. 
-    FILE *f;  
-    Array<char> pushback;
-    String name;
-    
- public:
-    Text_stream(String fn);
-    String get_name() { return name; }
-    bool eof() {
-       return feof(f);
-    }
-    bool eol() {
-       return (peek() == '\n');
-    }
-    char peek() {
-       char c = get();
-       unget(c);
-       return c;
-    }
-    int line(){
-       return line_no;
-    }
-
-    char    get() {
-       char c;
-       
-       if (pushback.empty())
-           c = getc(f);        
-       else 
-           c = pushback.pop();
-
-       if (c =='\n')
-           line_no++;
-       return c;       
-    }
-    void unget(char c) {
-       if (c =='\n')
-           line_no--;
-       pushback.push(c);
-    }
-    ~Text_stream (){
-       if (!eof()) 
-           cerr <<__FUNCTION__<< ": closing unended file";
-    
-       fclose(f);
-    }
-
-    /// GNU format message.
-    void message(String s); 
-};
-
-#endif
diff --git a/flower/unionfind.cc b/flower/unionfind.cc
deleted file mode 100644 (file)
index e7b0831..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "unionfind.hh"
-/*
-    see a book on data structures
-    */
-
-Union_find::Union_find(int n)
-{
-    classes.set_size(n);
-
-    for (int i=0; i < n; i++) {
-       classes[i] = i;
-    }
-}
-
-int
-Union_find::find(int i)
-{
-    int rep = i;
-    while (classes[rep] != rep)
-       rep = classes[rep];
-    while (classes[i] != rep) {
-       int next =classes[i];
-       classes[i] = rep;
-       i = next;
-    }
-    return rep;
-}
-
-void
-Union_find::connect(int i, int j)
-{
-    i = find(i);
-    j = find(j);
-    classes[i] = j;    
-}
diff --git a/flower/unionfind.hh b/flower/unionfind.hh
deleted file mode 100644 (file)
index fbaa51e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef UNIONFIND_HH
-#define UNIONFIND_HH
-#include "varray.hh"
-
-/*
-    which points of a graph are connected?.
-    Union find, a standard algorithm:
-
-    Union_find represents an undirected graph of N points. You can
-    connect two points using #connect()#. #find(i)# finds a uniquely
-    determined representant of the equivalence class of points
-    connected to #i#.
-    
-    */
-struct Union_find {    
-    void connect(int i, int j);
-    int find(int i);
-    bool equiv(int i, int j) { return find(i) == find(j); }
-    Union_find(int sz);
-
-private:
-    Array<int> classes;
-
-};
-#endif
diff --git a/flower/varray.hh b/flower/varray.hh
deleted file mode 100644 (file)
index febf3e7..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-  (c) Han-Wen Nienhuys 1995,96
-
-  Distributed under GNU GPL  
-*/
-
-#ifndef ARRAY_H
-#define ARRAY_H
-#include <assert.h>
-
-/// copy a bare (C-)array from #src# to #dest# sized  #count#
-template<class T>
-inline void arrcpy(T*dest, T*src, int count) {
-    for (int i=0; i < count ; i++)
-       *dest++ = *src++;
-}
-
-
-/**
-  Scaleable array/stack template, for a type T with default constructor.
-  
-  
-  This template implements a scaleable vector. With (or without) range
-  checking. It may be flaky for objects with complicated con- and
-  destructors. The type T should have a default constructor. It is
-  best suited for simple types, such as int, double or String, it
-  provides a paranoidly safe replacement for the new T[int] construct.
-
-  It uses stack terminology, (push, pop, top), and  can be used as a stack.
-
-  
-  */
-template<class T>
-class Array {
-protected:
-    /// maximum length of array.
-    int max;
-
-    /// the data itself
-    T *thearray;
-
-    /// stretch or shrink  array.
-    void remax(int newmax) {    
-       T* newarr = new T[newmax];
-       size_ = (newmax < size_) ? newmax : size_;
-       arrcpy(newarr, thearray, size_);
-       
-       delete[] thearray;
-       thearray = newarr;
-       max = newmax;
-    }
-    int size_;
-
-public:
-    /// check invariants
-    void OK() const {
-       assert(max >= size_ && size_ >=0);
-       if (max) assert(thearray);
-    }
-    /** report the size_.
-      @see {setsize_}
-      */
-    int size() const  { return size_; }
-    
-    /// POST: size() == 0
-    void clear() { size_ = 0; }
-
-    Array() { thearray = 0; max =0; size_ =0; }
-
-
-    /** set the size_ to #s#.
-      POST: size() == s.
-    Warning: contents are unspecified */
-    void set_size(int s) {
-       if (s >= max) remax(s);
-       size_ = s;    
-    }
-    
-    ~Array() { delete[] thearray; }
-
-    /// return a  "new"ed copy of array 
-    T* copy_array() const {
-       T* Tarray = new T[size_];
-       arrcpy(Tarray, thearray, size_);
-       return Tarray;
-    }
-    // depracated
-    operator T* () const {
-       return copy_array();    
-    }
-    void operator=(Array const & src) {
-       set_size (src.size_);
-       arrcpy(thearray,src.thearray, size_);
-    }
-    Array(const Array & src) {
-       thearray = src.copy_array();
-       max = size_ = src.size_;        
-    }
-
-    /// tighten array size_.
-    void precompute () { remax(size_); }
-
-    /// this makes Array behave like an array
-    T &operator[] (const int i) const {
-       assert(i >=0&&i<size_);
-       return ((T*)thearray)[i];       
-    }
-
-    /// add to the end of array
-    void push(T x) {
-       if (size_ == max)
-           remax(2*max + 1);
-
-       // T::operator=(T &) is called here. Safe to use with automatic
-       // vars
-       thearray[size_++] = x;
-    }
-    /// remove and return last entry 
-    T pop() {
-       assert(!empty());
-       T l = top(0);
-       set_size(size()-1);
-       return l;
-    }
-    /// access last entry
-    T& top(int j=0) {
-       return (*this)[size_-j-1];
-    }
-     /// return last entry
-    T top (int j=0) const {
-       return (*this)[size_-j-1];
-    }
-
-
-    void swap (int i,int j) {
-       T t((*this)[i]);
-       (*this)[i]=(*this)[j];
-       (*this)[j]=t;
-    }
-    bool empty() { return !size_; }
-    void insert(T k, int j) {
-       assert(j >=0 && j<= size_);
-       set_size(size_+1);
-       for (int i=size_-1; i > j; i--)
-           thearray[i] = thearray[i-1];
-       thearray[j] = k;
-    }
-    void del(int i) {
-       assert(i >=0&& i < size_);
-       arrcpy(thearray+i, thearray+i+1, size_-i-1);
-       size_--;
-    }
-    // quicksort.
-    void sort (int (*compare)( T const&,T const&),
-              int lower = -1, int upper = -1 ) {
-       if (lower < 0) {
-           lower = 0 ;
-           upper = size()-1;
-       }
-       if (lower >= upper)
-           return;
-       swap(lower, (lower+upper)/2);
-       int last = lower;
-       for (int i= lower +1; i <= upper; i++)
-           if (compare(thearray[i], thearray[lower]) < 0 )
-               swap( ++last,i);
-       swap(lower, last);
-       sort(compare, lower, last-1);
-       sort(compare, last+1, upper);
-    }
-    void concat(Array<T> const &src) {
-       int s = size_;
-       set_size(size_ + src.size_);
-       arrcpy(thearray+s,src.thearray, src.size_);     
-    }
-    Array<T> subvec(int lower, int upper) {
-       assert(lower >= 0 && lower <=upper&& upper <= size_);
-       Array<T> r;
-       int s =upper-lower;
-       r.set_size(s);
-       arrcpy(r.thearray, thearray  + lower, s);
-       return r;
-    }
-};
-
-#endif
diff --git a/flower/vector.cc b/flower/vector.cc
deleted file mode 100644 (file)
index 5cc76bf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "vector.hh"
-Vector::Vector(Array<Real> d)
-       : dat(d)
-{
-}
-Vector::Vector(const Vector&n)
-    : dat(n.dat)
-{
-}    
-
-Vector
-Vector::operator-() const
-{
-    Vector v(*this);
-    v*=-1;
-    return v;
-}
-
-void
-Vector::set_unit(int j)
-{
-    fill(0.0);
-    dat[j] = 1.0;
-}
diff --git a/flower/vector.hh b/flower/vector.hh
deleted file mode 100644 (file)
index 4d91397..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef VECTOR_HH
-#define VECTOR_HH
-
-#include <math.h>
-#include "real.hh"
-#include "varray.hh"
-
-class Dstream;
-class String;
-void set_matrix_debug(Dstream&ds);
-
-/**  a row of numbers. 
-    a vector. Storage is handled in Array, Vector only does the mathematics.
- */
-class Vector  {
-    Array<Real> dat;
-public:
-    void OK() const { dat.OK();}
-    int dim() const { return dat.size(); }
-    Vector() { }
-    Vector(Array<Real> d );
-    Vector(const Vector&n);
-    Vector(int n) {
-       dat.set_size(n);
-       fill(0);
-    }
-    void insert(Real v, int i) {
-       dat.insert(v,i);
-    }
-    void del(int i) { dat.del(i); }
-    operator String() const;
-    void fill(Real r) {
-       for (int i=0; i < dim(); i++)
-           dat[i] =r;
-    }
-
-    void operator +=(Vector v) {
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           dat[i] += v.dat[i];
-    }
-    
-    void operator /=(Real a) {
-       (*this) *= 1/a;
-    }
-
-    void operator *=(Real a) {
-       for (int i=0; i < dim(); i++)
-           dat[i] *= a;
-    }
-
-    void operator -=(Vector v) {
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           dat[i] -= v(i);     
-    }
-
-    Real &operator()(int i) { return dat[i]; }
-    Real operator()(int i) const { return dat[i]; }
-    Real elem(int i) { return dat[i]; }
-    Real operator *(Vector v) const {
-       Real ip=0;
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           ip += dat[i] *v(i);
-       return ip;
-    }
-    Vector operator-() const;
-    Real norm() {
-       return sqrt(norm_sq() );
-    }
-    Real norm_sq() {
-       return ((*this) * (*this));
-    }
-    operator Array<Real> () { return dat; }
-    void print() const;
-    /// set to j-th element of unit-base
-    void set_unit(int j) ;
-};
-
-inline Vector
-operator+(Vector a, Vector const &b) {
-    a += b;
-    return a;
-}
-
-inline Vector
-operator-(Vector a, Vector const &b) {
-    a -= b;
-    return a;
-}
-
-inline Vector
-operator*(Vector v, Real a) {
-    v *= a;
-    return v;
-}
-
-inline Vector
-operator*( Real a,Vector v) {
-    v *= a;
-    return v;
-}
-
-inline Vector
-operator/(Vector v,Real a) {
-    v *= 1/a;
-    return v;
-}
-
-#endif
diff --git a/flower/vsmat.hh b/flower/vsmat.hh
deleted file mode 100644 (file)
index 283b1e5..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 const Real& 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 6502ec445206602136b64b1397b3daa883bf7b48..884dfd0df748581d4b5381dc05442c699e9b8353 100644 (file)
@@ -2,17 +2,82 @@
 % common dutch names for notes. "es" means flat, "is" means sharp
 %
 
+ceses  = melodic { 0 0 -2 0 }
+ces    = melodic { 0 0 -1 0 }
+c      = melodic { 0 0 0 0 }
+cis    = melodic { 0 0 1 0 }
+cisis  = melodic { 0 0 2 0 }
+deses  = melodic { 0 1 -2 0 }
+des    = melodic { 0 1 -1 0 }
+d      = melodic { 0 1 0 0 }
+dis    = melodic { 0 1 1 0 }
+disis  = melodic { 0 1 2 0 }
+eses   = melodic { 0 2 -2 0 }
+es     = melodic { 0 2 -1 0 }
+e      = melodic { 0 2 0 0 }
+eis    = melodic { 0 2 1 0 }
+eisis  = melodic { 0 2 2 0 }
+feses  = melodic { 0 3 -2 0 }
+fes    = melodic { 0 3 -1 0 }
+f      = melodic { 0 3 0 0 }
+fis    = melodic { 0 3 1 0 }
+fisis  = melodic { 0 3 2 0 }
+geses  = melodic { 0 4 -2 0 }
+ges    = melodic { 0 4 -1 0 }
+g      = melodic { 0 4 0 0 }
+gis    = melodic { 0 4 1 0 }
+gisis  = melodic { 0 4 2 0 }
+ases   = melodic { 0 5 -2 0 }
+as     = melodic { 0 5 -1 0 }
+a      = melodic { 0 5 0 0 }
+ais    = melodic { 0 5 1 0 }
+aisis  = melodic { 0 5 2 0 }
+beses  = melodic { 0 6 -2 0 }
+bes    = melodic { 0 6 -1 0 }
+b      = melodic { 0 6 0 0 }
+bis    = melodic { 0 6 1 0 }
+bisis  = melodic { 0 6 2 0 }
 
-dutch_names = 
-notenames {
-       "ceses" 0 -2 "ces" 0 -1         "c" 0 0         "cis" 0 1 "cisis" 0 2
-       "deses" 1 -2 "des" 1 -1         "d" 1 0         "dis" 1 1 "disis" 1 2
-       "eses"  2 -2 "es"  2 -1         "e" 2 0         "eis" 2 1 "eisis" 2 2
-       "feses" 3 -2 "fes" 3 -1         "f" 3 0         "fis" 3 1 "fisis" 3 2
-       "geses" 4 -2 "ges" 4 -1         "g" 4 0         "gis" 4 1 "gisis" 4 2
-       "ases"  5 -2 "as"  5 -1         "a" 5 0         "ais" 5 1 "aisis" 5 2
-       "beses" 6 -2 "bes" 6 -1         "b" 6 0         "bis" 6 1 "bisis" 6 2
-}
+
+%
+% upper case: 1 octave lower.
+%
+
+
+Ceses  = melodic { -1 0 -2 0 }
+Ces    = melodic { -1 0 -1 0 }
+C      = melodic { -1 0 0 0 }
+Cis    = melodic { -1 0 1 0 }
+Cisis  = melodic { -1 0 2 0 }
+Deses  = melodic { -1 1 -2 0 }
+Des    = melodic { -1 1 -1 0 }
+D      = melodic { -1 1 0 0 }
+Dis    = melodic { -1 1 1 0 }
+Disis  = melodic { -1 1 2 0 }
+Eses   = melodic { -1 2 -2 0 }
+Es     = melodic { -1 2 -1 0 }
+E      = melodic { -1 2 0 0 }
+Eis    = melodic { -1 2 1 0 }
+Eisis  = melodic { -1 2 2 0 }
+Feses  = melodic { -1 3 -2 0 }
+Fes    = melodic { -1 3 -1 0 }
+F      = melodic { -1 3 0 0 }
+Fis    = melodic { -1 3 1 0 }
+Fisis  = melodic { -1 3 2 0 }
+Geses  = melodic { -1 4 -2 0 }
+Ges    = melodic { -1 4 -1 0 }
+G      = melodic { -1 4 0 0 }
+Gis    = melodic { -1 4 1 0 }
+Gisis  = melodic { -1 4 2 0 }
+Ases   = melodic { -1 5 -2 0 }
+As     = melodic { -1 5 -1 0 }
+A      = melodic { -1 5 0 0 }
+Ais    = melodic { -1 5 1 0 }
+Aisis  = melodic { -1 5 2 0 }
+Beses  = melodic { -1 6 -2 0 }
+Bes    = melodic { -1 6 -1 0 }
+B      = melodic { -1 6 0 0 }
+Bis    = melodic { -1 6 1 0 }
+Bisis  = melodic { -1 6 2 0 }
 
 
-notenames { dutch_names }
\ No newline at end of file
index 000439dce6dea0133d0ac4518bca84d7c43e0e2c..da3725b2edffd39f06fb4e35a0a373cc91a76676 100644 (file)
@@ -4,7 +4,7 @@ pp = dynamic { 6 }
 p = dynamic { 5 }
 mp = dynamic { 4 }
 mf = dynamic { 3 }
-f = dynamic { 2 }
+df = dynamic { 2 } % f is a notename too.
 ff = dynamic { 1 }
 fff = dynamic { 0 }
 
index b3c26940dab844c39c86f71a0f66cd5c2a4019eb..f120a6a701e97aac4ff3928105ce8c5c811a7e66 100644 (file)
@@ -3,17 +3,39 @@
 %
 % by Mats Bengtsson.
 
-swedish_names = 
-notenames {
-       "cessess" 0 -2 "cess" 0 -1      "c" 0 0         "ciss" 0 1 "cississ" 0 2
-       "dessess" 1 -2 "dess" 1 -1      "d" 1 0         "diss" 1 1 "dississ" 1 2
-       "essess"  2 -2 "ess"  2 -1      "e" 2 0         "eiss" 2 1 "eississ" 2 2
-       "fessess" 3 -2 "fess" 3 -1      "f" 3 0         "fiss" 3 1 "fississ" 3 2
-       "gessess" 4 -2 "gess" 4 -1      "g" 4 0         "giss" 4 1 "gississ" 4 2
-       "assess"  5 -2 "ass"  5 -1      "a" 5 0         "aiss" 5 1 "aississ" 5 2
-       "hessess" 6 -2 "b" 6 -1         "h" 6 0         "hiss" 6 1 "hississ" 6 2
-}
-
-
-notenames { swedish_names }
 
+cessess        = melodic { 0 0 -2 0 }
+cess   = melodic { 0 0 -1 0 }
+c      = melodic { 0 0 0 0 }
+ciss   = melodic { 0 0 1 0 }
+cississ        = melodic { 0 0 2 0 }
+dessess        = melodic { 0 1 -2 0 }
+dess   = melodic { 0 1 -1 0 }
+d      = melodic { 0 1 0 0 }
+diss   = melodic { 0 1 1 0 }
+dississ        = melodic { 0 1 2 0 }
+essess         = melodic { 0 2 -2 0 }
+ess    = melodic { 0 2 -1 0 }
+e      = melodic { 0 2 0 0 }
+eiss   = melodic { 0 2 1 0 }
+eississ        = melodic { 0 2 2 0 }
+fessess        = melodic { 0 3 -2 0 }
+fess   = melodic { 0 3 -1 0 }
+f      = melodic { 0 3 0 0 }
+fiss   = melodic { 0 3 1 0 }
+fississ        = melodic { 0 3 2 0 }
+gessess        = melodic { 0 4 -2 0 }
+gess   = melodic { 0 4 -1 0 }
+g      = melodic { 0 4 0 0 }
+giss   = melodic { 0 4 1 0 }
+gississ        = melodic { 0 4 2 0 }
+assess         = melodic { 0 5 -2 0 }
+ass    = melodic { 0 5 -1 0 }
+a      = melodic { 0 5 0 0 }
+aiss   = melodic { 0 5 1 0 }
+aississ        = melodic { 0 5 2 0 }
+hessess        = melodic { 0 6 -2 0 }
+b      = melodic { 0 6 -1 0 }
+h      = melodic { 0 6 0 0 }
+hiss   = melodic { 0 6 1 0 }
+hississ        = melodic { 0 6 2 0 }
index b2c091fc8b622205b528b573e8043677de8b4f1d..1c730a67834f1aff2d32e9b92af8bd52da1003f6 100644 (file)
-% Creator: This is m2m 0.0.36-2/FlowerLib 1.1.3-1 of Feb 27 1997 02:41:23
-% Automatically generated, at Thu Feb 27 08:38:27 1997
-% from input file: 
+% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:11:21
+% Automatically generated, at Wed Mar 12 02:22:22 1997
+% from input file: fugue1.midi
 
 track0 = music { $
-       % \Time: 4/8, 96: 8 % \Tempo: 967742: 61 4 per minute 
-       % \Tempo: 1000000: 60 4 per minute 
-       % \Tempo: 1052632: 56 4 per minute 
-       % \Tempo: 1132075: 53 4 per minute 
-       % \Tempo: 1200000: 50 4 per minute 
-       % \Tempo: 1463415: 40 4 per minute 
-       % \Tempo: 1578947: 38 4 per minute 
+       % midi copyright:
+       % instrument:
        
 $} % track0
 
 track1 = music { $
-       g8 a8 b8 c8. d32 c32 b8 e8 a8 d8. e16 d16 c16 
-       b16 g16 a16 b16 c16 b16 c16 d16 e16 d16 e16 
-       fis16 g8 b8 c8 a8 d16 c16 b16 a16 g8. g16 f16 
-       e16 f16 g16 a16 g16 a16 b16 c2 b4 c8 d8 e8 f8. 
-       g32 f32 e8 a8 d8 g8. a16 g16 f16 e8 a8. b16 a16 
-       g16 f2 e8. fis16 g2 fis4 g16 f16 e16 d16 c16 
-       d16 c16 b16 a16 c16 b16 a16 c16 a16 gis8 e8 
-       d8 c16 b16 a16 gis16 a16 b16 c16 fis16 gis16 
-       a16 b8 a16 b16 c8 f8 e8 d4 c16 b16 c64 b64 c64 
-       b64 c64 b64 c64 b64 c64 b32. a32. a4 g8 a8 b8 
-       c8. d32 c32 b8 c8 d8 e8 f8. g32 f32 e8 a8 d8 g8. 
-       a16 g16 f16 e8 a8 d8 ais8 a8 g16 f16 g16 f16 
-       g16 e16 f16 g16 g64 a64 g32 f32 g32 a16 cis16 
-       d16 g16 f64 e64 f64 e64 f64 e16. d32. d8. g8 
-       a8 b8 c8. d32 c32 b8 e8 a8 d8. e16 d16 c16 b16 
-       c16 d16 e16 f16 g16 a16 g16 f16 e16 d16 c16 
-       c64 b64 c64 b8. c8 d8 g8 c4 b8 c4 b8 ais8 a8 d4 
-       c8 d8 e8 f8.. a32. g32. f32. e32. f32. e32. 
-       d32. c2 g32 a32 b16 c16 d16 e16 f8. c32 d32 
-       e32 f16 g16 a8. b16 c2 
+       % midi copyright:
+       % instrument:
+       g8 a8 b8 'c8. { \music{ 'd16 } } { \music{ 'c16 } } 
+       { \music{ b8 } } 'e8 a8 { \music{ 'd8. } } 'e16 
+       'd16 'c16 b16 g16 a16 b16 'c16 b16 'c16 'd16 'e16 
+       'd16 'e16 'fis16 'g8 b8 'c8 a8 'd16 'c16 b16 a16 { 
+       \music{ g8. } } g16 f16 e16 f16 g16 a16 g16 a16 b16 
+       'c2 b4 'c8 'd8 'e8 'f8. { \music{ 'f16 } \music{ 
+       'g16 } } 'e8 'a8 'd8 'g8. 'a16 'g16 'f16 'e8 'a8. 
+       'b16 'a16 'g16 'f2 'e8. 'fis16 'g2 'fis4 'g16 'f16 
+       'e16 'd16 'c16 'd16 'c16 b16 a16 'c16 b16 a16 'c16 
+       a16 gis8 'e8 'd8 'c16 b16 a16 gis16 a16 b16 'c16 
+       fis16 gis16 a16 b8 a16 b16 'c8 'f8 'e8 'd4 'c16 b16 
+       { \music{ 'c16 } } { \music{ b16 } } { \music{ b16 
+       b16 } \music{ 'c16 'c16 } \music{ b16 } \music{ 
+       'c16 'c16 } } { } { \music{ b16 } } { \music{ a16 } 
+       } a4 g8 a8 b8 'c8. { \music{ 'd16 } } { \music{ 
+       'c16 } } { \music{ b8 } } 'c8 'd8 'e8 'f8. { \music{
+        'g16 } } { \music{ 'f16 } } { \music{ 'e8 } } 'a8 
+       'd8 'g8. 'a16 'g16 'f16 'e8 'a8 'd8 'ais8 'a8 'g16 
+       'f16 'g16 'f16 'g16 'e16 'f16 { \music{ 'g16 } } { 
+       \music{ 'g16 } } { \music{ 'a16 } } { \music{ 'g16 }
+        } { } { } { \music{ 'f16 } } { \music{ 'g16 } } { 
+       \music{ 'a16 } } 'cis16 'd16 'g16 { \music{ 'f16 } 
+       } { \music{ 'e16 } } { \music{ 'f16 } } { \music{ 
+       'e16 } } { } { \music{ 'f16 } } { } { } { } { 
+       \music{ 'e8 } } { } 'd16 'd8 g8 a8 b8 'c8 'd16 { 
+       \music{ 'c16 } } { \music{ b8 } } 'e8 a8 { \music{ 
+       'd8. } } 'e16 'd16 'c16 b16 'c16 'd16 'e16 'f16 
+       'g16 'a16 'g16 'f16 'e16 'd16 'c16 { \music{ 'c16 } 
+       } { \music{ b16 } } { \music{ 'c16 } } { } { } { 
+       \music{ b8. } } 'c8 'd8 g8 { \music{ 'c4 } } b8 'c4 
+       b8 ais8 a8 { \music{ 'd4 } } 'c8 'd8 'e8 'f4 'a16 { 
+       \music{ 'g16 } } 'f16 'e16 { \music{ 'f16 } } { 
+       \music{ 'e16 } } 'd16 'c2 g16 { \music{ a16 } } b16 
+       'c16 'd16 'e16 { \music{ 'f8. } } { \music{ 'd16 } 
+       \music{ 'c16 'e16 } } 'f16 { \music{ 'g16 } } { 
+       \music{ 'a8. } } 'b16 ''c2 
 $} % track1
 
 track2 = music { $
-       c8 d8 e8 f8. g32 f32 e8 a8 d8 g8. a16 g16 f16 
-       e16 f16 e16 d16 c16 d16 c16 b16 a8 fis8 g4. 
-       f16 e16 f8 d8 g8 f8 e8 d8 g4 f16 e16 f8.. f16 
-       e8 d4 c8 f8 g16 f16 e16 f8 d8 g4.. g8 a8 b8 c8. 
-       d32 c32 b8 e8 a8 d8. e16 d16 c16 b16.. d8 e8 
-       fis8 g8. a32 g32 f8 b8 e8 a8. b16 a16 gis16 
-       fis8 f8 e8 d8. e16 fis16 gis16 a16 gis16 a16 
-       b16 gis16 fis16 gis16 a16 b8 c8 d8 e8 f8. g32 
-       f32 e8 a8 d8 g8. a16 g16 f16 e16. e16. fis16. 
-       g4 fis8 gis8 a4 g8 a8 b8 c8. d32 c32 b16. e8 
-       a8 d8. e16 d16 c16 b8 g8 cis8 d8 e8 cis8 d8 e8 
-       a8 e8 fis8 g8 a8. b32 a32 g8 c8 fis8 b8. c16 
-       b16 a16 g16 fis16 e16 d16 e4 d4. a16 g16 f16 
-       e16 g16 f16 g4. a16 a16 ais8 c4 d8 g8 g4. f4 
-       e8 d4 e16. a4 g4 f8 g8 a8 ais8. c32 ais32 a8 
-       d8 g8 c8. d16 c16 ais16 a16 ais16 a16 g16 f16 
-       g16 f16 e16 g16 a4 f16 d8 e2 
+       % midi copyright:
+       % instrument:
+       c8 d8 e8 f8. { \music{ g16 } } { \music{ f16 } } { 
+       \music{ e8 } } a8 d8 { \music{ g8. } } a16 g16 f16 
+       e16 f16 e16 d16 c16 d16 c16 `b16 `a8 fis8 { \music{ 
+       g4. } } f16 e16 f8 d8 g8 f8 e8 d8 g4 f16 e16 f4 f16 
+       e8 d4 c8 f8 g16 f16 e16 f8 d8 g4.. g8 a8 b8 { 
+       \music{ 'c8. } } { \music{ 'd16 } } { \music{ 'c16 }
+        } { \music{ b8 } } 'e8 a8 { \music{ 'd8. } } 'e16 
+       'd16 'c16 b8 d8 e8 fis8 { \music{ g8. } } { \music{ 
+       a16 } } { \music{ g16 } } { \music{ f8 } } b8 e8 
+       a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 
+       a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 c8 d8 e8 
+       { \music{ f8. } } { \music{ g16 } } { \music{ f16 } 
+       } { \music{ e8 } } a8 d8 g8. a16 g16 f16 e16 e16 
+       fis16 g4 fis8 gis8 { \music{ a4 } } g8 a8 b8 { 
+       \music{ 'c8. } } { \music{ 'd16 } } { \music{ 'c16 }
+        } { \music{ b8 } } 'e8 a8 'd8. 'e16 'd16 'c16 b8 
+       'g8 'cis8 'd8 'e8 'cis8 'd8 'e8 a8 e8 fis8 g8 { 
+       \music{ a8. } } { \music{ b16 } } { \music{ a16 } } 
+       { \music{ g8 } } 'c8 fis8 { \music{ b8. } } 'c16 
+       b16 a16 g16 fis16 e16 d16 e4 d4 a16 g16 f16 e16 g16 
+       f16 a16 g4 a16 ais8 { \music{ 'c4 } } 'd8 g8 { 
+       \music{ g4. } } f4 e8 d4 e16 a4 g4 f8 g8 a8 { 
+       \music{ ais8. } } { \music{ 'c16 } } { \music{ 
+       ais16 } } { \music{ a8 } } 'd8 g8 { \music{ 'c8. } 
+       } 'd16 'c16 ais16 a16 ais16 a16 g16 f16 g16 f16 e16 
+       g16 a4 'f16 'd8 { \music{ 'e2 } \music{ 'g2 } } 
 $} % track2
 
 track3 = music { $
-       g8 a8 b8 c8. d32 c32 b8 e8 a8 d8. e16 d16 c16 
-       b8 c4 ais8 a8 d8 g8 c8 a16 b16 c16 d4 g4 g8 a8 
-       b8 c8. d32 c32 b8 e8 a8 d8. e16 d16 c16 b8 e4. 
-       d4 b16 c16 a16 e16 d16 c16 b16 c16 a16 b16 c16 
-       d16 c16 b16 a16 g4 e8 fis8 gis8 a8. b32 a32 
-       g8 c8 fis8 b8. c16 b16 a16 gis16.. a4 gis8 
-       a4 g8 a8 b8 c8. d32 c32 b8 e8 a8 d4 g8 d4 c8 a8 
-       e4 d8 a8 b8 cis8 d8. e32 d32 c8 f8 b8 e8. f16 
-       e16 d16 cis8 a8 b8 cis8 d8. e32 d32 c8 fis8 
-       b8 e8. fis16 e16 d16 c4.. d16 c16 b16 a16 g16 
-       a16 fis16 g16.. b16.. c16.. d8 e8. f32 e32 
-       d8 g8 c8 f8. g16 f16 e16 d4 e8 d4 g8 g4. c8 d8 
-       e8 f8. g32 f32 e8 a8 d8 g8. a16 g16 f16 e16 d16 
-       e16 f16 g16 a16 ais16 g16 a16 e16 f16 g16 a16 
-       b16 c16 a16 c1 
+       % midi copyright:
+       % instrument:
+       `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 } } 
+       { \music{ `b8 } } e8 `a8 { \music{ d8. } } e16 d16 
+       c16 `b8 c4 `ais8 `a8 d8 `g8 c8 `a16 `b16 c16 d4 `g4 
+       `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 } } 
+       { } `b8 e8 `a8 d8. e16 d16 c16 `b8 e4. d4 `b16 c16 
+       `a16 e16 d16 c16 `b16 c16 `a16 `b16 c16 d16 c16 
+       `b16 `a16 `g4 `e8 `fis8 `gis8 `a8. { \music{ `b16 } 
+       } { \music{ `a16 } } { \music{ `g8 } } c8 `fis8 
+       `b8. c16 `b16 `a16 `gis8 { \music{ `a4 } } `gis8 
+       `a4 `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 
+       } } { \music{ `b8 } } e8 `a8 d4 `g8 d4 c8 `a8 e4 d8 
+       `a8 `b8 cis8 d8. { \music{ e16 } } { \music{ d16 } 
+       } { \music{ c8 } } f8 `b8 e8. f16 e16 d16 cis8 `a8 
+       `b8 cis8 d8. { \music{ e16 } } { \music{ d16 } } { 
+       \music{ c8 } } fis8 `b8 e8. fis16 e16 d16 c4.. d16 
+       c16 `b16 `a16 `g16 `a16 `fis16 `g8 `b8 c8 { \music{ 
+       d8 } } e8. { \music{ f16 } } { \music{ e16 } } { 
+       \music{ d8 } } g8 c8 f8. g16 f16 e16 d4 e8 d4 { 
+       \music{ `g8 } } `g4. `c8 `d8 `e8 `f8. { \music{ 
+       `g16 } } { \music{ `f16 } } { \music{ `e8 } } `a8 
+       `d8 { \music{ `g8. } } `a16 `g16 `f16 `e16 `d16 
+       `e16 `f16 `g16 `a16 `ais16 `g16 `a16 `e16 `f16 `g16 
+       `a16 `b16 c16 { \music{ `a16 } \music{ d2 } } c1 
 $} % track3
 
 track4 = music { $
-       c8 d8 e8 f8. g32 f32 e8 a8 d8 g8. a16 g16 f16 
-       e16 f16 e16 d16 c16 d16 c16 b16 a8 d8 a8 fis8 
-       g16 a16 ais16 g16 cis8 d8 a4 e4 a16 b16 c16 
-       d16 c16 b16 a16 g16 c8 g8 a8 b8 c8. d32 c32 b8 
-       e8 a8 d8. e16 d16 c16 b8 e4 d8 c8 f4 e4 d4 e8 f8 
-       e16 d16 e4 a4 g8 a8 b8 c8. d32 c32 b8 e8 a8 d8. 
-       e16 d16 c16 b8 ais8 a8 g8 a8 fis8 g8 e8 d4 e8 
-       f8 g8. a32 g32 f8 ais8 e8 a8. b16. a16 g16 f16 
-       e16 f16 d16 g8 a8 d4.. e16 d16 c16 b16 a16 g16 
-       fis16 e8 e8 fis8 g4 a16 g16 fis8 d8 g1 a4 b8 
-       c8 f16 a16 g16 f16 e16 d16 c16 b16 c16 d16 e16 
-       f16 g8 g8 b2 c8 
+       % midi copyright:
+       % instrument:
+       `c8 `d8 `e8 `f8. { \music{ `g16 } } { \music{ `f16 }
+        } { \music{ `e8 } } `a8 `d8 { \music{ `g8. } } 
+       `a16 `g16 `f16 `e16 `f16 `e16 `d16 `c16 `d16 `c16 
+       ``b16 ``a8 `d8 `a8 `fis8 `g16 `a16 `ais16 `g16 
+       `cis8 `d8 `a4 `e4 `a16 `b16 c16 d16 c16 `b16 `a16 
+       `g16 c8 ``g8 ``a8 ``b8 `c8. { \music{ `d16 } } { 
+       \music{ `c16 } } { \music{ ``b8 } } `e8 ``a8 `d8. 
+       `e16 `d16 `c16 { \music{ ``b8 } } `e4 `d8 `c8 `f4 
+       `e4 `d4 `e8 `f8 `e16 `d16 `e4 ``a4 ``g8 ``a8 ``b8 
+       `c8. { \music{ `d16 } } { \music{ `c16 } } { \music{
+        ``b8 } } `e8 ``a8 `d8. `e16 `d16 `c16 ``b8 ``ais8 
+       ``a8 ``g8 ``a8 `fis8 `g8 `e8 `d4 `e8 `f8 `g8. { 
+       \music{ `a16 } } { \music{ `g16 } } { \music{ `f8 } 
+       } `ais8 `e8 `a8. `b16 { \music{ `a16 } } `g16 `f16 
+       `e16 `f16 `d16 `g8 `a8 `d4.. `e16 `d16 `c16 ``b16 
+       ``a16 ``g16 ``fis16 ``e8 `e8 `fis8 `g4 `a16 `g16 
+       `fis8 `d8 `g1 `a4 `b8 c8 `f16 `a16 `g16 `f16 `e16 
+       `d16 `c16 ``b16 `c16 `d16 `e16 `f16 `g8 ``g8 `b2 
 $} % track4
 
 score {
@@ -95,6 +137,11 @@ score {
        staff { melodic music { track2 } }
        staff { melodic music { track3 } }
        staff { melodic music { track4 } }
-       commands { meter { 4*4 } }
-       midi { tempo 4:60 }
+
+       commands {
+               meter { 4*4 } 
+       }
+       midi {
+               tempo 4:60 
+       }
 }
index ca6beafb220c3c8855f4539e9832e89cf3a830fa..69ee6feeaadf79541dd5748893574b6bce24f7ff 100644 (file)
-% Creator: This is m2m 0.0.36-2/FlowerLib 1.1.3-1 of Feb 27 1997 02:41:23
-% Automatically generated, at Thu Feb 27 02:54:33 1997
-% from input file: 
+% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:05:36
+% Automatically generated, at Wed Mar 12 02:09:07 1997
+% from input file: pre1.midi
+% jcn: using option -n
 
 track0 = music { $
-       % \Time: 4/8, 96: 8 % \Tempo: 857143: 69 4 per minute 
-       % \Tempo: 882353: 67 4 per minute 
-       % \Tempo: 909091: 65 4 per minute 
-       % \Tempo: 937500: 64 4 per minute 
-       % \Tempo: 967742: 61 4 per minute 
-       % \Tempo: 1000000: 60 4 per minute 
-       % \Tempo: 1200000: 50 4 per minute 
-       % \Tempo: 1224490: 48 4 per minute 
-       % \Tempo: 833333: 72 4 per minute 
-       
+       % midi copyright:
+       % instrument:
+       { } { } { } { } { } { } { } { } 
 $} % track0
 
 track1 = music { $
-       g16 c16 e16 g16 c16 e16 g16 c16 e16 g16 c16 
-       e16 a16 d16 f16 a16 d16 f16 a16 d16 f16 a16 
-       d16 f16 g16 d16 f16 g16 d16 f16 g16 d16 f16 
-       g16 d16 f16 g16 c16 e16 g16 c16 e16 g16 c16 
-       e16 g16 c16 e16 a16 e16 a16 a16 e16 a16 a16 
-       e16 a16 a16 e16 a16 fis16 a16 d16 fis16 a16 
-       d16 fis16 a16 d16 fis16 a16 d16 g16 d16 g16 
-       g16 d16 g16 g16 d16 g16 g16 d16 g16 e16 g16 
-       c16 e16 g16 c16 e16 g16 c16 e16 g16 c16 e16 
-       g16 c16 e16 g16 c16 e16 g16 c16 e16 g16 c16 
-       d16 fis16 c16 d16 fis16 c16 d16 fis16 c16 
-       d16 fis16 c16 d16 g16 b16 d16 g16 b16 d16 g16 
-       b16 d16 g16 b16 e16 g16 cis16 e16 g16 cis16 
-       e16 g16 cis16 e16 g16 cis16 d16 a16 d16 d16 
-       a16 d16 d16 a16 d16 d16 a16 d16 d16 f16 b16 
-       d16 f16 b16 d16 f16 b16 d16 f16 b16 c16 g16 
-       c16 c16 g16 c16 c16 g16 c16 c16 g16 c16 a16 
-       c16 f16 a16 c16 f16 a16 c16 f16 a16 c16 f16 
-       a16 c16 f16 a16 c16 f16 a16 c16 f16 a16 c16 
-       f16 g16 b16 f16 g16 b16 f16 g16 b16 f16 g16 
-       b16 f16 g16 c16 e16 g16 c16 e16 g16 c16 e16 
-       g16 c16 e16 ais16 c16 e16 ais16 c16 e16 ais16 
-       c16 e16 ais16 c16 e16 a16 c16 e16 a16 c16 e16 
-       a16 c16 e16 a16 c16 e16 a16 c16 dis16 a16 c16 
-       dis16 a16 c16 dis16 a16 c16 dis16 b16 c16 
-       d16 b16 c16 d16 b16 c16 d16 b16 c16 d16 g16 
-       b16 d16 g16 b16 d16 g16 b16 d16 g16 b16 d16 
-       g16 c16 e16 g16 c16 e16 g16 c16 e16 g16 c16 
-       e16 g16 c16 f16 g16 c16 f16 g16 c16 f16 g16 
-       c16 f16 g16 b16 f16 g16 b16 f16 g16 b16 f16 
-       g16 b16 f16 a16 c16 fis16 a16 c16 fis16 a16 
-       c16 fis16 a16 c16 fis16 g16 c16 g16 g16 c16 
-       g16 g16 c16 g16 g16 c16 g16 g16 c16 f16 g16 
-       c16 f16 g16 c16 f16 g16 c16 f16 g16 b16 f16 
-       g16 b16 f16 g16 b16 f16 g16 b16 f16 g16 ais16 
-       e16 g16 ais16 e16 g16 ais16 e16 g16 ais16 
-       e16 f16 a16 c16 f16 c16 a16 c16 a16 f16 a16 
-       f16 d16 f16 d16 g16 b16 d16 f16 d16 b16 d16 
-       b16 g16 b16 d16 f16 e64 f64 e32 d16 c1 
+       % midi copyright:
+       % instrument:
+       { \music{ g16 'c16 'e16 g16 'c16 'e16 } } { \music{ 
+       g16 'c16 'e16 g16 'c16 'e16 } } { \music{ a16 'd16 
+       'f16 a16 'd16 'f16 } } { \music{ a16 'd16 'f16 a16 
+       'd16 'f16 } } { \music{ g16 'd16 'f16 g16 'd16 'f16 
+       } } { \music{ g16 'd16 'f16 g16 'd16 'f16 } } { 
+       \music{ g16 'c16 'e16 g16 'c16 'e16 } } { \music{ 
+       g16 'c16 'e16 g16 'c16 'e16 } } { \music{ a16 'e16 
+       'a16 a16 'e16 'a16 } } { \music{ a16 'e16 'a16 a16 
+       'e16 'a16 } } { \music{ fis16 a16 'd16 fis16 a16 
+       'd16 } } { \music{ fis16 a16 'd16 fis16 a16 'd16 } 
+       } { \music{ g16 'd16 'g16 g16 'd16 'g16 } } { 
+       \music{ g16 'd16 'g16 g16 'd16 'g16 } } { \music{ 
+       e16 g16 'c16 e16 g16 'c16 } } { \music{ e16 g16 
+       'c16 e16 g16 'c16 } } { \music{ e16 g16 'c16 e16 
+       g16 'c16 } } { \music{ e16 g16 'c16 e16 g16 'c16 } 
+       } { \music{ d16 fis16 'c16 d16 fis16 'c16 } } { 
+       \music{ d16 fis16 'c16 d16 fis16 'c16 } } { \music{ 
+       d16 g16 b16 d16 g16 b16 } } { \music{ d16 g16 b16 
+       d16 g16 b16 } } { \music{ e16 g16 'cis16 e16 g16 
+       'cis16 } } { \music{ e16 g16 'cis16 e16 g16 'cis16 }
+        } { \music{ d16 a16 'd16 d16 a16 'd16 } } { \music{
+        d16 a16 'd16 d16 a16 'd16 } } { \music{ d16 f16 
+       b16 d16 f16 b16 } } { \music{ d16 f16 b16 d16 f16 
+       b16 } } { \music{ c16 g16 'c16 c16 g16 'c16 } } { 
+       \music{ c16 g16 'c16 c16 g16 'c16 } } { \music{ 
+       `a16 c16 f16 `a16 c16 f16 } } { \music{ `a16 c16 
+       f16 `a16 c16 f16 } } { \music{ `a16 c16 f16 `a16 
+       c16 f16 } } { \music{ `a16 c16 f16 `a16 c16 f16 } } 
+       { \music{ `g16 `b16 f16 `g16 `b16 f16 } } { \music{ 
+       `g16 `b16 f16 `g16 `b16 f16 } } { \music{ `g16 c16 
+       e16 `g16 c16 e16 } } { \music{ `g16 c16 e16 `g16 
+       c16 e16 } } { \music{ `ais16 c16 e16 `ais16 c16 e16 
+       } } { \music{ `ais16 c16 e16 `ais16 c16 e16 } } { 
+       \music{ `a16 c16 e16 `a16 c16 e16 } } { \music{ 
+       `a16 c16 e16 `a16 c16 e16 } } { \music{ `a16 c16 
+       dis16 `a16 c16 dis16 } } { \music{ `a16 c16 dis16 
+       `a16 c16 dis16 } } { \music{ `b16 c16 d16 `b16 c16 
+       d16 } } { \music{ `b16 c16 d16 `b16 c16 d16 } } { 
+       \music{ `g16 `b16 d16 `g16 `b16 d16 } } { \music{ 
+       `g16 `b16 d16 `g16 `b16 d16 } } { \music{ `g16 c16 
+       e16 `g16 c16 e16 } } { \music{ `g16 c16 e16 `g16 
+       c16 e16 } } { \music{ `g16 c16 f16 `g16 c16 f16 } } 
+       { \music{ `g16 c16 f16 `g16 c16 f16 } } { \music{ 
+       `g16 `b16 f16 `g16 `b16 f16 } } { \music{ `g16 `b16 
+       f16 `g16 `b16 f16 } } { \music{ `a16 c16 fis16 `a16 
+       c16 fis16 } } { \music{ `a16 c16 fis16 `a16 c16 
+       fis16 } } { \music{ `g16 c16 g16 `g16 c16 g16 } } { 
+       \music{ `g16 c16 g16 `g16 c16 g16 } } { \music{ 
+       `g16 c16 f16 `g16 c16 f16 } } { \music{ `g16 c16 
+       f16 `g16 c16 f16 } } { \music{ `g16 `b16 f16 `g16 
+       `b16 f16 } } { \music{ `g16 `b16 f16 `g16 `b16 f16 }
+        } { \music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
+       \music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
+       \music{ `f16 `a16 c16 f16 c16 `a16 c16 `a16 `f16 
+       `a16 `f16 `d16 `f16 `d16 } } { \music{ g16 b16 'd16 
+       'f16 'd16 b16 'd16 b16 g16 b16 d16 f16 e64 } } { 
+       \music{ f64 } } { } { \music{ e32 } } { \music{ d16 
+       } } { \music{ 'c1 } \music{ g1 } \music{ e1 } } 
 $} % track1
 
+% jcn: substituted some "2" durations to "4."
 track2 = music { $
-       c2 e4. c2 e4. c2 d4. c2 d4. b2 d4. b2 d4. c2 e4. 
-       c2 e4. c2 e4. c2 e4. c2 d4. c2 d4. b2 d4. b2 d4. 
-       b2 c4. b2 c4. a2 c4. a2 c4. d2 a4. d2 a4. g2 b4. 
-       g2 b4. g2 ais4. g2 ais4. f2 a4. f2 a4. f2 gis4. 
-       f2 gis4. e2 g4. e2 g4. e2 f4. e2 f4. d2 f4. d2 
-       f4. g2 d4. g2 d4. c2 e4. c2 e4. c2 g4. c2 g4. 
-       f2 f4. f2 f4. fis2 c2 fis2 c4. gis2 f4. gis2 
-       f4. g2 f4. g2 f4. g2 e2 g2 e4. g2 d4. g2 d2 g2 
-       d4. g2 d4. g2 dis4. g2 dis4. g2 e4. g2 e4. g2 
-       d4. g2 d4. g2 d4. g2 d4. c2 c4. c2 c4. c1 c1 b1 
-       c1 c1 
-$} % track2
+       % midi copyright:
+       % instrument:
+       { \music{ e4. } } { \music{ e4. } } { \music{ d4. } 
+       } { \music{ d4. } } { \music{ d4. } } { \music{ d4. 
+       } } { \music{ e4. } } { \music{ e4. } } { \music{ 
+       e4. } } { \music{ e4. } } { \music{ d4. } } { 
+       \music{ d4. } } { \music{ d4. } } { \music{ d4. } } 
+       { \music{ c4. } } { \music{ c4. } } { \music{ c4. } 
+       } { \music{ c4. } } { \music{ `a4. } } { \music{ 
+       `a4. } } { \music{ `b4. } } { \music{ `b4. } } { 
+       \music{ `ais4. } } { \music{ `ais4. } } { \music{ 
+       `a4. } } { \music{ `a4. } } { \music{ `gis4. } } { 
+       \music{ `gis4. } } { \music{ `g4. } } { \music{ 
+       `g4. } } { \music{ `f4. } } { \music{ `f4. } } { 
+       \music{ `f4. } } { \music{ `f4. } } { \music{ `d4. }
+        } { \music{ `d4. } } { \music{ `e4. } } { \music{ 
+       `e4. } } { \music{ `g4. } } { \music{ `c4. } } { } { 
+       } { \music{ `g4. } } { } { \music{ ``f4. } } { 
+       \music{ `f4. } } { \music{ ``f4. } } { \music{ `f4. }
+        } { \music{ ``fis4. } } { \music{ ``fis4. } \music{ 
+       `c4. } } { } { \music{ `c4. } } { \music{ ``gis4. } } 
+       { \music{ ``gis4. } \music{ `f4. } } { } { \music{ 
+       `f4. } } { \music{ ``g4. } } { \music{ ``g4. } \music{
+        `f4. } } { } { \music{ `f4. } } { \music{ ``g4. } } 
+       { \music{ ``g4. } \music{ `e4. } } { } { \music{ ``g4. 
+       } \music{ `e4. } } { } { \music{ ``g4. } \music{ 
+       `d4. } } { } { \music{ ``g4. } \music{ `d4. } } { } { 
+       \music{ `d4. } } { \music{ ``g4. } } { \music{ ``g4. }
+        \music{ `d4. } } { } { \music{ `dis4. } } { \music{
+        ``g4. } } { \music{ `dis4. } } { \music{ ``g4. } } { 
+       \music{ `e4. } } { \music{ ``g4. } } { \music{ `e4. }
+        } { \music{ ``g4. } } { \music{ `d4. } } { \music{ 
+       ``g4. } } { \music{ `d4. } } { \music{ ``g4. } } { 
+       \music{ `d4. } } { \music{ ``g4. } } { \music{ `d4. }
+        } { \music{ ``c4. } } { \music{ `c4. } } { \music{ 
+       ``c4. } } { \music{ `c4. } } { \music{ ``c1 } } { 
+       \music{ `c1 } } { \music{ ``c1 } \music{ ``b1 } } { 
+       } { } { } { \music{ ``c1 } \music{ `c1 } } 
+$} % track4.
 
 score {
        staff { melodic music { track0 } }
        staff { melodic music { track1 } }
        staff { melodic music { track2 } }
-       commands { meter { 4*4 } }
-       midi { tempo 4:60 }
+
+       commands {
+               meter { 4*4 } 
+       }
+       midi {
+               tempo 4:60 
+       }
 }
index 672d747bf5aa552ed32bf9ba006769b5ecce2f85..98daf3b69f2501067be93f49630dff386383a7ed 100644 (file)
@@ -93,28 +93,28 @@ melodie = music { $ \clef\violin
 %#%    =f2. |
        f2. |
 %%23
-       [ a8._\mf 'cis16 ] 'f4. 'e |
+       [ a8.\mf 'cis16 ] 'f4. 'e |
 %%24
        [ 'd8. a16 ] fis4. d |
 %%25
 %#%    'cis\grace\stemup
-       [ b_\mf( ) ais b ]2/3 'd4. b |
+       [ b\mf( ) ais b ]2/3 'd4. b |
 %%26
        { a2. fis2. } |
 %#%\tighten\newline
 %%27
-       [ 'e_\f( )'dis 'e ]2/3 'g4. 'cis |
+       [ 'e\df( )'dis 'e ]2/3 'g4. 'cis |
 %%28
        { 'd2. fis2. } |
 %#%\volta1
 %%29
-       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2_\mf [ bes8. bes16 ] } } |
+       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2\mf [ bes8. bes16 ] } } |
 %%30
        { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-. ] } } |
 %%31  
        { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
 %%32
-       { a2 fis2_\pp } { a4 fis4 } |
+       { a2 fis2\pp } { a4 fis4 } |
 %%33
 %#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ] |
        { \music{ b2( [ 'd8.( ) )g16 ] } \music{ g2 [ b8. b16 ] } } |
@@ -141,12 +141,12 @@ melodie = music { $ \clef\violin
        'cis2 r4 |
 %%41
 %#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ]  |
-       { 'fis4. 'cis4.\f } 'e  [ 'e( )'d 'cis ]2/3  |
+       { 'fis4. 'cis4.\df } 'e  [ 'e( )'d 'cis ]2/3  |
 %%42
        [ b8. 'cis16 ] 'd4^> b r |
 %%43
 %#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r |
-       [ b8.\f 'cis16 ] 'd4^> b r |
+       [ b8.\df 'cis16 ] 'd4^> b r |
 %%44
 %#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r |
        [ b8. 'cis16 ] 'd4^> b r |
@@ -157,7 +157,7 @@ melodie = music { $ \clef\violin
 %#%    { =a2. fis2. } |
        { a2. fis2. } |
 %%47
-       [ 'e\f( )'dis 'e ]2/3  'g4.^> 'cis |
+       [ 'e\df( )'dis 'e ]2/3  'g4.^> 'cis |
 %%48
 %#%    { fis2.(v ='d2.\stemup(^ }
 %      { fis2. 'd2. } |
@@ -171,7 +171,7 @@ melodie = music { $ \clef\violin
 %%51
        { a2. cis2. } |
 %%52
-       { fis2 d2 } { a4 fis4_\pp } |
+       { fis2 d2 } { a4 fis4\pp } |
 %%53
 %#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ] |
        { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] } |
index b078b78c85cd80f745ab729230c5f44f7b1ec336..f737d660d16d406cdb693b09be11485c6b07b443 100644 (file)
 #include "duration.hh"
 #include "debug.hh"  //ugh
 
+// statics Duration
+int Duration::division_1_i_s = 384 * 4;
+
 Duration::Duration( int type_i, int dots_i = 0, Plet* plet_l )
 {
        type_i_ = type_i;
        dots_i_ = dots_i;
        plet_p_ = 0;
+       ticks_i_ = 0;
        set_plet( plet_l );
 }
 
@@ -27,6 +31,7 @@ Duration::Duration( Duration const& dur_c_r )
        type_i_ = 0;
        dots_i_ = 0;
        plet_p_ = 0;
+       ticks_i_ = 0;
        *this = dur_c_r;
 }
 
@@ -43,6 +48,7 @@ Duration::operator =( Duration const& dur_c_r )
 
        type_i_ = dur_c_r.type_i_;
        dots_i_ = dur_c_r.dots_i_;
+       ticks_i_ = dur_c_r.ticks_i_;
        set_plet( dur_c_r.plet_p_ );
 
        return *this;
@@ -57,6 +63,15 @@ Duration::set_plet( Plet* plet_l )
                plet_p_ = new Plet( *plet_l );
 }
 
+void
+Duration::set_ticks( int ticks_i )
+{
+       assert( !type_i_ );
+       assert( !dots_i_ );
+       assert( !plet_p_ );
+       ticks_i_ = ticks_i;
+}
+
 Plet::Plet( int iso_i, int type_i )
 {
        iso_i_ = iso_i;
@@ -69,9 +84,18 @@ Plet::Plet( Plet const& plet_c_r )
        type_i_ = plet_c_r.type_i_;
 }
 
+// statics Duration_convert
+bool Duration_convert::be_blonde_b_s = false;
+bool Duration_convert::no_double_dots_b_s = false;
+bool Duration_convert::no_triplets_b_s = false;
+int Duration_convert::no_smaller_than_i_s = 0;
+       
 String 
 Duration_convert::dur2_str( Duration dur )
 {
+       if ( dur.ticks_i_ )
+               return String( "["  ) + String( dur.ticks_i_ ) + "]";
+
        String str( dur.type_i_ );
        str += String( '.', dur.dots_i_ );
        if ( dur.plet_p_ )
@@ -80,17 +104,31 @@ Duration_convert::dur2_str( Duration dur )
        return str;
 }
 
+#if 0
 int
 Duration_convert::dur2_i( Duration dur, int division_1_i )
 {
-    return dur2_mom( dur ) * Moment( division_1_i );
+       return dur2_mom( dur ) * Moment( division_1_i );
+}
+#endif
+
+int
+Duration_convert::dur2ticks_i( Duration dur )
+{
+       if ( dur.ticks_i_ )
+               return dur.ticks_i_;
+       return dur2_mom( dur ) * Moment( Duration::division_1_i_s );
 }
 
 Moment
 Duration_convert::dur2_mom( Duration dur )
 {
+       if ( dur.ticks_i_ )
+               return Moment( dur.ticks_i_, Duration::division_1_i_s );        
+
+       // or simply assert?
        if ( !dur.type_i_ )
-               return 0;
+               return Moment( 0 );
 
        Moment mom = Moment( 1 , dur.type_i_ );
 
@@ -103,6 +141,21 @@ Duration_convert::dur2_mom( Duration dur )
        return mom * plet_factor_mom( dur );    
 }
 
+#if 0
+Moment
+Duration_convert::i2_mom( int time_i, int division_1_i )
+{
+       if ( !time_i )
+               return Moment( 0 );
+
+       if ( division_1_i > 0 )
+               return Moment( time_i, division_1_i );
+       else 
+               return Moment( -division_1_i, time_i );
+}
+#endif
+
+#if 0
 Duration
 Duration_convert::mom2_dur( Moment mom )
 {
@@ -134,6 +187,7 @@ Duration_convert::mom2_dur( Moment mom )
        }
        return Duration( 0 );
 }
+#endif
 
 Moment
 Duration_convert::plet_factor_mom( Duration dur )
@@ -149,21 +203,67 @@ Duration_convert::sync_f( Duration dur, Moment mom )
        return mom / dur2_mom( dur );
 }
 
-Moment
-Duration_convert::i2_mom( int time_i, int division_1_i )
+Duration
+Duration_convert::ticks2_dur( int ticks_i )
 {
-       if ( !time_i )
-               return Moment( 0 );
+       /* this is cute, 
+          but filling an array using Duration_iterator
+          might speed things up, a little
+          */
+       Moment mom( ticks_i, Duration::division_1_i_s );
+       Duration_iterator iter_dur;
+       assert( iter_dur );
+       while ( iter_dur ) {
+               Duration dur = iter_dur++;
+               if ( mom == dur2_mom( dur ) )
+                       return dur;
+       }
+       Duration dur( 0 );
+       dur.set_ticks( ticks_i );
+       return dur;
+}
 
-       if ( division_1_i > 0 )
-               return Moment( time_i, division_1_i );
-       else 
-               return Moment( -division_1_i, time_i );
+Duration
+Duration_convert::ticks2standardised_dur( int ticks_i )
+{
+       /* this is cute, 
+          but filling an array using Duration_iterator
+          might speed things up, a little
+          */
+       Moment mom( ticks_i, Duration::division_1_i_s );
+       Duration_iterator iter_dur;
+       assert( iter_dur );
+       while ( iter_dur ) {
+               Duration lower_dur = iter_dur++;
+//             Duration upper_dur( 0 );
+               Duration upper_dur( 1, 1 );
+               if ( iter_dur )
+                       upper_dur = iter_dur();
+               Moment lower_mom = dur2_mom( lower_dur );
+               Moment upper_mom = dur2_mom( upper_dur );
+               if ( mom < lower_mom )
+                       return lower_dur;
+               if ( mom == lower_mom )
+                       return lower_dur;
+               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 );
+                       if ( abs( mom - lower_mom ) < abs( mom - upper_mom ) )
+                               return lower_dur;
+                       else
+                               return upper_dur;
+               }
+               lower_dur = upper_dur;
+       }
+       return iter_dur();
 }
 
 Duration_iterator::Duration_iterator()
 {
        cursor_dur_.type_i_ = 128;
+       if ( Duration_convert::no_smaller_than_i_s )
+               cursor_dur_.type_i_ = Duration_convert::no_smaller_than_i_s;
        cursor_dur_.set_plet( 0 );
 }
 
@@ -232,8 +332,15 @@ Duration_iterator::forward_dur()
                cursor_dur_.type_i_ /= 2;
        }
                
-       // ugh
-       if ( no_triplets_bo_g && cursor_dur_.plet_p_ && ok() )
+       if ( Duration_convert::no_triplets_b_s && cursor_dur_.plet_p_ && ok() )
+               forward_dur();
+       if ( Duration_convert::no_double_dots_b_s && ( cursor_dur_.dots_i_ == 2 ) && ok() )
+               forward_dur();
+       if ( Duration_convert::no_smaller_than_i_s && ( cursor_dur_.type_i_ > Duration_convert::no_smaller_than_i_s ) && ok() )
+               forward_dur();
+       if ( Duration_convert::no_smaller_than_i_s && cursor_dur_.dots_i_ && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s ) && ok() )
+               forward_dur();
+       if ( Duration_convert::no_smaller_than_i_s && ( cursor_dur_.dots_i_ == 2 ) && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s / 2 ) && ok() )
                forward_dur();
 
        return dur;
index 66bbde1ccd114c391969ad0c01dc436a794dd2c8..c642ce6edadf074f49c64d15d1e64c450a490f77 100644 (file)
@@ -24,11 +24,14 @@ struct Duration {
        Duration const& operator =( Duration const& dur_c_r );
 
        void set_plet( Plet* plet_l ); // handiger: newt zelf
+       void set_ticks( int ticks_i );
 
+       static int division_1_i_s;
 //         int i_;     // balltype -> type!
        int type_i_;
        int dots_i_;
        Plet* plet_p_;
+       int ticks_i_;
 };
 
 /// (plet)
@@ -54,11 +57,19 @@ struct Plet {
        When Staff_column::when(), Moment Voice_element::mom().
 */
 struct Duration_convert {
-       /// Most used division in MIDI, all fine with me.
-       static int const division_1_c_i = 384;
+       static bool be_blonde_b_s;
+       static bool no_double_dots_b_s;
+       static bool no_triplets_b_s;
+       static int no_smaller_than_i_s;
 
-       /// Return (integer, division) representation.
-       static int dur2_i( Duration dur, int division_1_i = division_1_c_i );
+//     /// Most used division in MIDI, all fine with me.
+//     static int const division_1_c_i = 384;
+
+//     /// Return (integer, division) representation.
+//     static int dur2_i( Duration dur, int division_1_i = division_1_c_i );
+
+       /// Return number of ticks in (ticks, division_1) representation
+       static int dur2ticks_i( Duration dur );
        
        /// Return Moment representation (fraction of whole note).
        static Moment dur2_mom( Duration dur );
@@ -66,11 +77,11 @@ struct Duration_convert {
        /// Return Mudela string representation.
        static String dur2_str( Duration dur );
 
-       /// Return Moment from (integer, division) representation.
-       static Moment i2_mom( int i, int division_1_i = division_1_c_i );
+//     /// Return Moment from (integer, division) representation.
+//     static Moment i2_mom( int i, int division_1_i = division_1_c_i );
 
-       /// Return Moment (fraction of whole) representation, best guess.
-       static Duration mom2_dur( Moment mom );
+//     /// Return Moment (fraction of whole) representation, best guess.
+//     static Duration mom2_dur( Moment mom );
 
        /// Return plet factor (not a Moment: should use Rational?).
        static Moment plet_factor_mom( Duration dur );
@@ -79,6 +90,12 @@ struct Duration_convert {
            mom2_dur( mom / sync_f ) will return the duration dur.              
        */ 
        static Real sync_f( Duration dur, Moment mom );
+
+       /// Return exact duration, in midi-ticks if not-exact.
+       static Duration ticks2_dur( int ticks_i );
+
+       /// Return standardised duration, best guess if not exact.
+       static Duration ticks2standardised_dur( int ticks_i );
 };
 
 /// (iter_dur)
index 4b3a8f91c5831d2d87558780ace5b44316e2c134..a58e2969c1cfce33edb2dd6b3bf791cae052caed 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
   proto.hh -- part of LilyPond
 
@@ -100,7 +101,6 @@ struct Command_req;
 struct Note_req;
 struct Notehead;
 struct Notehead_register;
-struct Notename_tab;
 struct Offset;
 struct Output;
 struct PCol;
@@ -135,6 +135,7 @@ struct Source;
 struct Source_file;
 struct Spacing_req ;
 struct Span_req;
+struct Span_dynamic_req;
 struct Spanner;
 struct Subtle_req;
 struct Staff;
index b72eca87550c880d3681a92044dbd159f017fde6..c7c0d05e3d5f61d64a4028c8c1ffa47c4e8518ad 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "bar-reg.hh"
 #include "bar.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "score-column.hh"
 #include "time-description.hh"
 
index b9fbd0a28c80525f3f20e72172798df5f5d0f8ae..87e9114caf10d9355732fe32d64c5f7a3e40361d 100644 (file)
@@ -1,5 +1,6 @@
 #include "varray.hh"
 
+#include "proto.hh"
 #include "dimen.hh"
 #include "beam.hh"
 #include "misc.hh"
@@ -7,7 +8,7 @@
 #include "symbol.hh"
 #include "molecule.hh"
 #include "leastsquares.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "stem.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
index 7d219186372aa1ed179bea4fc310bc3e988c3c64..cc588e6b0f640c7127116c2b928ba42b8f7a0030 100644 (file)
@@ -6,7 +6,7 @@
 #include "linespace.hh"
 #include "debug.hh"
 #include "scoreline.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 
 
 /*
index 5ead08dd396ef25d556d1d8df92031a9bf952c28..474015e3ccb16ed025fc0623ee6e059d7c725dc2 100644 (file)
@@ -1,6 +1,6 @@
 #include "idealspacing.hh"
 #include "score.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "paper-def.hh"
 #include "score-column.hh"
 #include "dimen.hh"
index 2d9dcc112b08fecd50b8c37f9fba505368187b9a..791b72408347d00bc3f8fad4dfaa4738b1db2337 100644 (file)
@@ -10,7 +10,7 @@
 #include "clef-reg.hh"
 #include "clef-item.hh"
 #include "debug.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "time-description.hh"
 #include "staff-column.hh"
 
diff --git a/lily/command-request.cc b/lily/command-request.cc
new file mode 100644 (file)
index 0000000..769d522
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+  commandrequest.cc -- implement Nonmusical reqs
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "command-request.hh"
+#include "debug.hh"
+#include "musical-request.hh"
+
+
+void
+Cadenza_req::do_print()const
+{
+    mtor << on_b_;
+}
+
+Cadenza_req::Cadenza_req(bool b)
+{
+    on_b_ =b;
+}
+/* *************** */
+
+
+int
+Bar_req::compare(const Bar_req &c1)const
+{
+    return type_str_ == c1.type_str_;
+}
+
+void
+Bar_req::do_print() const
+{
+    mtor << type_str_;
+}
+
+Bar_req::Bar_req(String s)
+{
+    type_str_ = s;
+}
+
+Partial_measure_req::Partial_measure_req(Moment m)
+{
+    duration_ =m;
+}
+/* *************** */
+Meter_change_req::Meter_change_req()
+{
+    beats_i_ = 0;
+    one_beat_i_ =0;
+}
+void
+Meter_change_req::set(int b,int o)
+{
+    beats_i_=b;
+    one_beat_i_=o;
+}
+
+void
+Timing_req::do_print()const{}
+
+void
+Command_req::do_print()const{}
+/* *************** */
+void
+Barcheck_req::do_print() const{}
+
+/* *************** */
+void
+Clef_change_req::do_print() const
+{
+    mtor << clef_str_ ;
+}
+
+Clef_change_req::Clef_change_req(String s)
+{
+    clef_str_ = s;
+}
+/* *************** */
+void
+Group_feature_req::do_print() const
+{
+    mtor << "stemdir " << stemdir_i_;
+}
+
+Group_feature_req::Group_feature_req()
+{
+    stemdir_i_ = 0;
+}
+
+void
+Group_change_req::do_print()const
+{
+    mtor << "id : " << newgroup_str_;
+}
+/* *************** */
+void
+Terminate_voice_req::do_print()const
+{
+}
+
+/* *************** */
+void
+Partial_measure_req::do_print() const
+{
+    mtor << duration_;
+}
+
+void
+Meter_change_req::do_print() const
+{
+    mtor << beats_i_ << "*" << one_beat_i_;
+}
+
+/* *************** */
+
+void
+Measure_grouping_req::do_print() const
+{
+    for (int i=0; i < elt_length_arr_.size(); i++) {
+       mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
+    }
+}
+/* *************** */
+void
+Key_change_req::do_print() const
+{
+    for (int i=0; i < melodic_p_arr_.size(); i++) {
+       melodic_p_arr_[i]->print();
+    }
+}
+
+Key_change_req::Key_change_req()
+{
+}
+Key_change_req::Key_change_req(Key_change_req const&c)
+{
+    for (int i=0; i < c.melodic_p_arr_.size(); i++) {
+       melodic_p_arr_.push( c.melodic_p_arr_[i]->clone()->melodic() );
+    }
+}
+
+Key_change_req::~Key_change_req()
+{
+    for (int i=0; i < melodic_p_arr_.size(); i++)
+       delete melodic_p_arr_[i];
+}
diff --git a/lily/commandrequest.cc b/lily/commandrequest.cc
deleted file mode 100644 (file)
index 5cf0912..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-  commandrequest.cc -- implement Nonmusical reqs
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "commandrequest.hh"
-#include "debug.hh"
-#include "musicalrequest.hh"
-
-
-void
-Cadenza_req::do_print()const
-{
-    mtor << on_b_;
-}
-
-Cadenza_req::Cadenza_req(bool b)
-{
-    on_b_ =b;
-}
-/* *************** */
-
-
-int
-Bar_req::compare(const Bar_req &c1)const
-{
-    return type_str_ == c1.type_str_;
-}
-
-void
-Bar_req::do_print() const
-{
-    mtor << type_str_;
-}
-
-Bar_req::Bar_req(String s)
-{
-    type_str_ = s;
-}
-
-Partial_measure_req::Partial_measure_req(Moment m)
-{
-    duration_ =m;
-}
-/* *************** */
-Meter_change_req::Meter_change_req()
-{
-    beats_i_ = 0;
-    one_beat_i_ =0;
-}
-void
-Meter_change_req::set(int b,int o)
-{
-    beats_i_=b;
-    one_beat_i_=o;
-}
-
-void
-Timing_req::do_print()const{}
-
-void
-Command_req::do_print()const{}
-/* *************** */
-void
-Barcheck_req::do_print() const{}
-
-/* *************** */
-void
-Clef_change_req::do_print() const
-{
-    mtor << clef_str_ ;
-}
-
-Clef_change_req::Clef_change_req(String s)
-{
-    clef_str_ = s;
-}
-/* *************** */
-void
-Group_feature_req::do_print() const
-{
-    mtor << "stemdir " << stemdir_i_;
-}
-
-Group_feature_req::Group_feature_req()
-{
-    stemdir_i_ = 0;
-}
-
-void
-Group_change_req::do_print()const
-{
-    mtor << "id : " << newgroup_str_;
-}
-/* *************** */
-void
-Terminate_voice_req::do_print()const
-{
-}
-
-/* *************** */
-void
-Partial_measure_req::do_print() const
-{
-    mtor << duration_;
-}
-
-void
-Meter_change_req::do_print() const
-{
-    mtor << beats_i_ << "*" << one_beat_i_;
-}
-
-/* *************** */
-
-void
-Measure_grouping_req::do_print() const
-{
-    for (int i=0; i < elt_length_arr_.size(); i++) {
-       mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
-    }
-}
-/* *************** */
-void
-Key_change_req::do_print() const
-{
-    for (int i=0; i < melodic_p_arr_.size(); i++) {
-       melodic_p_arr_[i]->print();
-    }
-}
-
-Key_change_req::Key_change_req()
-{
-}
-Key_change_req::Key_change_req(Key_change_req const&c)
-{
-    for (int i=0; i < c.melodic_p_arr_.size(); i++) {
-       melodic_p_arr_.push( c.melodic_p_arr_[i]->clone()->melodic() );
-    }
-}
-
-Key_change_req::~Key_change_req()
-{
-    for (int i=0; i < melodic_p_arr_.size(); i++)
-       delete melodic_p_arr_[i];
-}
index bb132744498fbfc2dff709ed5dd1b82d717e306d..661d8332ed4b292ab8b4bf8d52df1220f0dd4465 100644 (file)
@@ -1,7 +1,7 @@
 #include "complex-staff.hh"
 #include "complex-walker.hh"
 #include "score.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "staffsym.hh"
 #include "score-column.hh"
 
index 0a76c81d0e6b8bcc5827b0562d82c0c541390bb9..09773b1503099016efc92c11a3f3a096e9a922bd 100644 (file)
@@ -6,17 +6,17 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "staff-column.hh"
 #include "voice.hh"
-#include "pscore.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 "commandrequest.hh"
+#include "command-request.hh"
 #include "walk-regs.hh"
 
 void
diff --git a/lily/crescendo.cc b/lily/crescendo.cc
new file mode 100644 (file)
index 0000000..9b2a169
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+  crescendo.cc -- implement Crescendo
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "crescendo.hh"
+#include "lookup.hh"
+#include "paper-def.hh"
+
+Crescendo::Crescendo(int s)
+{
+    staff_size_i_ = s;
+    grow_dir_i_ =0;
+    dir_i_ = -1 ;
+}
+
+Spanner*
+Crescendo::do_break_at(PCol*, PCol*)const
+{
+    return new Crescendo(*this);
+}
+
+
+Molecule*
+Crescendo::brew_molecule_p() const return m_p ;
+{
+    m_p = new Molecule;
+    Real w_f = width().length();
+    Symbol s( paper()->lookup_l()->hairpin(w_f, 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 88f0b502f4df06023a1853cafe4b5d5132cc2843..0ea23ac689c86f908dd625caa0d712cf1d6ebeef 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "dynamic-reg.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "text-item.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
index dc5d72d572aa1ab02782c6c2965ab0348794c2fa..7f1a9bbae899ff49d2a56438f7f4681dc70b5670 100644 (file)
@@ -8,7 +8,7 @@
 #include "headreg.hh"
 #include "paper-def.hh"
 #include "complex-walker.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 Notehead_register::Notehead_register()
 {
index 3ceaff1e6d5076e94180596b033cea07498c68e8..805cb3bebb34f9a163b51aefee0886a2552e146d 100644 (file)
@@ -1,7 +1,7 @@
 #include "idealspacing.hh"
-#include "pcol.hh"
-#include "pscore.hh"
-#include "pstaff.hh"
+#include "p-col.hh"
+#include "p-score.hh"
+#include "p-staff.hh"
 #include "debug.hh"
 
 void
index fbf806edf7af918cf1e76e0e00eb5e72535a8f7c..e4712f8a5a9e8b630a98bf52c952679c085c0112 100644 (file)
@@ -49,9 +49,3 @@ Real_id::do_print() const
     mtor << *((Real_id*)this)->real(false)<< "\n";
 }
 
-void
-Notetab_id::do_print() const
-{
-    mtor << "unknown" << "\n";
-}
-
diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh
new file mode 100644 (file)
index 0000000..3d5a1eb
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+  command-request.hh -- declare Non musical requests
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef COMMANDREQUEST_HH
+#define COMMANDREQUEST_HH
+
+#include "request.hh"
+#include "varray.hh"
+
+/** Request which are  assumed to be "happening" before the
+  musical requests. */
+struct Command_req : virtual Request {
+    REQUESTMETHODS(Command_req, command);
+
+    virtual Measure_grouping_req * measuregrouping() { return 0; }
+    virtual Clef_change_req * clefchange() { return 0; }
+    virtual Key_change_req * keychange() { return 0; }
+    virtual Partial_measure_req * partial() { return 0; }
+    virtual Meter_change_req * meterchange() { return 0; }
+    virtual Bar_req *bar() { return 0; }
+    virtual Cadenza_req *cadenza() { return 0; }
+    virtual Timing_req*timing() {  return 0; }
+};
+
+
+/** Baseclass for meter/partial req. It has to be handled by
+  Staff_{walker,column} baseclass.  */
+struct Timing_req : Command_req {
+    REQUESTMETHODS(Timing_req, timing);
+};
+
+
+struct Partial_measure_req : Timing_req {
+    Moment duration_;
+
+    Partial_measure_req(Moment);
+    REQUESTMETHODS(Partial_measure_req, partial);
+};
+
+/**
+  todo: allow C meter
+ */
+struct Meter_change_req : Timing_req {
+    int beats_i_, one_beat_i_;
+
+    Meter_change_req();
+    void set(int,int);
+    REQUESTMETHODS(Meter_change_req, meterchange);
+};
+
+/// toggle Cadenza mode
+struct Cadenza_req : Timing_req {
+    /// turn on?
+    bool on_b_;
+    Cadenza_req(bool);
+    REQUESTMETHODS(Cadenza_req,cadenza);
+};
+
+/// check if we're at start of a  measure.
+struct Barcheck_req : Timing_req {
+
+    REQUESTMETHODS(Barcheck_req,barcheck);
+};
+
+struct Measure_grouping_req: Timing_req {
+    Array<int> beat_i_arr_;
+    Array<Moment> elt_length_arr_;
+
+    REQUESTMETHODS(Measure_grouping_req, measuregrouping);
+};
+
+struct Group_change_req : Command_req {
+    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 {
+    String type_str_;
+    Bar_req(String);
+    int compare(const Bar_req&)const;
+    REQUESTMETHODS(Bar_req,bar);
+};
+struct Terminate_voice_req : Command_req {
+    REQUESTMETHODS(Terminate_voice_req,terminate);
+};
+
+struct Group_feature_req : Command_req {
+    int stemdir_i_;
+    Group_feature_req();
+    REQUESTMETHODS(Group_feature_req, groupfeature);
+};
+
+
+struct Key_change_req : Command_req {
+    Array<Melodic_req*> melodic_p_arr_;
+
+    Key_change_req();
+    Key_change_req(Key_change_req const&);
+    ~Key_change_req();
+    REQUESTMETHODS(Key_change_req, keychange);
+};
+
+struct Clef_change_req : Command_req {
+    String clef_str_;
+    Clef_change_req(String);
+    REQUESTMETHODS(Clef_change_req, clefchange);
+};
+
+#endif // COMMANDREQUEST_HH
index 71b83316610e27e7d04191ed0c043c678de89b4d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,117 +0,0 @@
-/*
-  commandrequest.hh -- declare Non musical requests
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef COMMANDREQUEST_HH
-#define COMMANDREQUEST_HH
-
-#include "request.hh"
-#include "varray.hh"
-
-/** Request which are  assumed to be "happening" before the
-  musical requests. */
-struct Command_req : virtual Request {
-    REQUESTMETHODS(Command_req, command);
-
-    virtual Measure_grouping_req * measuregrouping() { return 0; }
-    virtual Clef_change_req * clefchange() { return 0; }
-    virtual Key_change_req * keychange() { return 0; }
-    virtual Partial_measure_req * partial() { return 0; }
-    virtual Meter_change_req * meterchange() { return 0; }
-    virtual Bar_req *bar() { return 0; }
-    virtual Cadenza_req *cadenza() { return 0; }
-    virtual Timing_req*timing() {  return 0; }
-};
-
-
-/** Baseclass for meter/partial req. It has to be handled by
-  Staff_{walker,column} baseclass.  */
-struct Timing_req : Command_req {
-    REQUESTMETHODS(Timing_req, timing);
-};
-
-
-struct Partial_measure_req : Timing_req {
-    Moment duration_;
-
-    Partial_measure_req(Moment);
-    REQUESTMETHODS(Partial_measure_req, partial);
-};
-
-/**
-  todo: allow C meter
- */
-struct Meter_change_req : Timing_req {
-    int beats_i_, one_beat_i_;
-
-    Meter_change_req();
-    void set(int,int);
-    REQUESTMETHODS(Meter_change_req, meterchange);
-};
-
-/// toggle Cadenza mode
-struct Cadenza_req : Timing_req {
-    /// turn on?
-    bool on_b_;
-    Cadenza_req(bool);
-    REQUESTMETHODS(Cadenza_req,cadenza);
-};
-
-/// check if we're at start of a  measure.
-struct Barcheck_req : Timing_req {
-
-    REQUESTMETHODS(Barcheck_req,barcheck);
-};
-
-struct Measure_grouping_req: Timing_req {
-    Array<int> beat_i_arr_;
-    Array<Moment> elt_length_arr_;
-
-    REQUESTMETHODS(Measure_grouping_req, measuregrouping);
-};
-
-struct Group_change_req : Command_req {
-    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 {
-    String type_str_;
-    Bar_req(String);
-    int compare(const Bar_req&)const;
-    REQUESTMETHODS(Bar_req,bar);
-};
-struct Terminate_voice_req : Command_req {
-    REQUESTMETHODS(Terminate_voice_req,terminate);
-};
-
-struct Group_feature_req : Command_req {
-    int stemdir_i_;
-    Group_feature_req();
-    REQUESTMETHODS(Group_feature_req, groupfeature);
-};
-
-
-struct Key_change_req : Command_req {
-    Array<Melodic_req*> melodic_p_arr_;
-
-    Key_change_req();
-    Key_change_req(Key_change_req const&);
-    ~Key_change_req();
-    REQUESTMETHODS(Key_change_req, keychange);
-};
-
-struct Clef_change_req : Command_req {
-    String clef_str_;
-    Clef_change_req(String);
-    REQUESTMETHODS(Clef_change_req, clefchange);
-};
-
-#endif // COMMANDREQUEST_HH
diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh
new file mode 100644 (file)
index 0000000..858cd44
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  crescendo.hh -- declare Crescendo
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CRESCENDO_HH
+#define CRESCENDO_HH
+
+#include "spanner.hh"
+
+class Crescendo : public Spanner {
+    int staff_size_i_;
+public:
+    int grow_dir_i_;
+    int dir_i_;
+    Crescendo(int staff_size_i);
+private:
+    Spanner* do_break_at( PCol*, PCol*) const;
+    Molecule*brew_molecule_p()const;
+    NAME_MEMBERS(Crescendo);
+};
+
+#endif // CRESCENDO_HH
index aa8d1100127f13bd2892d17c304603ed08febcd8..6312582bf0d923f13096559b92b7cb2c928b24c6 100644 (file)
@@ -12,7 +12,6 @@
 #include "symtable.hh"
 #include "input-staff.hh"
 #include "input-music.hh"
-#include "notename.hh"
 #include "lookup.hh"
 #include "script-def.hh"
 #include "request.hh"
@@ -38,7 +37,6 @@ make_id_class(Symtables_id, Symtables, symtables);
 make_id_class(Staff_id, Input_staff, staff);
 make_id_class(M_chord_id, Music_general_chord, mchord);
 make_id_class(M_voice_id, Music_voice, mvoice);
-make_id_class(Notetab_id, Notename_tab, notename_tab);
 make_id_class(Request_id, Request, request);
 
 #endif // IDENTIFIER_HH
index 8071dcd4f549b411f0670778daf51b0fc650d670..a8b75b0fd3695473f7fc82681f114c3855405e3a 100644 (file)
@@ -34,7 +34,6 @@ struct Identifier {
     IDACCESSOR(Music_general_chord, mchord)
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
-    IDACCESSOR(Notename_tab, notename_tab)
     IDACCESSOR(Request, request)
        
 protected:
index 1d7a8caa665355087afc4ad4bce9f4c29ec9ed82..7a35bbfd19b037827ac59d040b8a7f097d5460d7 100644 (file)
@@ -61,7 +61,6 @@ struct Simple_music : Input_music {
     virtual Input_music *clone() const {
        return new Simple_music(*this);
     }
-
 };
 
 /// Complex_music consists of multiple voices
@@ -76,7 +75,6 @@ struct Complex_music : Input_music {
     void concatenate(Complex_music*);
     virtual bool find_plet_start_bo(char c, Moment& moment_r);
     virtual void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i);
 };
 
 
index 6a9d21a98ed7314e566ed04e94d3257b7ab4fb42..8a55f1a585d3dc95afc00df68039f1de3304f75c 100644 (file)
@@ -23,15 +23,14 @@ void set_lexer();
 /// lexer with provisions for include files.
 struct My_flex_lexer : yyFlexLexer {
 
-    Array<Input_file*> include_stack;
-    Assoc<String, Identifier*> *the_id_tab;
-    Keyword_table * keytable;
-    Notename_tab * defaulttab;
+    Array<Input_file*> include_stack_;
+    Assoc<String, Identifier*> *identifier_assoc_p_;
+    Keyword_table * keytable_p_;
     int errorlevel_i_;
+
     /* *************** */
-    int ret_notename(int *p, String text, int octave_mod);    
+
     char const* here_ch_c_l();
-    void set(Notename_tab *n);
     int lookup_keyword(String);
     void lookup_notename(int &large, int &small, String s);
     void LexerError(const char *);
index 7a559adf5837b806a7a6ce753fcfa09ad0235ba0..1e04e5df4cbf48f3c4377549839783b04b21fdd6 100644 (file)
 /** 
  */
 struct Midi_def {
+    // ugh!
+    static int den_i_s;
+    static int num_i_s;
+
     /// output file name
     String outfile_str_;
 
index 6f105724578ea4c2e8fc327a7f3a5f3260016363..1aaf181d279df8028bfbd830f358fe53d8fae0a2 100644 (file)
@@ -94,6 +94,17 @@ struct Midi_tempo : Midi_item {
     int per_minute_4_i_;
 };
 
+struct Midi_time : Midi_item {
+    /* *************** */
+    Midi_time( int num_i, int den_i, int clocks_per_1_i );
+
+    virtual String str() const;
+
+    int num_i_;
+    int den_i_;
+    int clocks_per_1_i_;
+};
+
 struct Midi_track : Midi_chunk {
     /* *************** */
     int number_i_;
index 19457172cd8df4c8e3a2f1b62bacebc545616ad3..d5e9481f2500d52c92dddc298a86cebc0faab359 100644 (file)
@@ -9,7 +9,7 @@
 
 #ifndef MIDIOUTPUT_HH
 #define MIDIOUTPUT_HH
-#include "pscore.hh"
+#include "p-score.hh"
 
 struct Midi_output {
     Midi_output(Score* score_l, Midi_def* );
diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh
new file mode 100644 (file)
index 0000000..6d96117
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+  musical-request.hh -- declare Musical requests
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSICALREQUESTS_HH
+#define MUSICALREQUESTS_HH
+
+#include "request.hh"
+
+
+/**
+  A request which is coupled to a #Voice_element# with nonzero duration.
+  Base class only
+ */
+struct Musical_req : virtual Request {
+    
+    virtual Skip_req* skip() { return 0; }
+    virtual Dynamic_req* dynamic() { return 0; }
+    virtual Absolute_dynamic_req * absdynamic() { return 0; }
+    virtual Subtle_req * subtle() { return 0; }
+    virtual Span_dynamic_req * span_dynamic() { return 0; }
+    REQUESTMETHODS(Musical_req, musical);
+};
+
+
+struct Skip_req : Musical_req {
+    Moment duration_;
+    
+    virtual Moment duration() const;
+    REQUESTMETHODS(Skip_req, skip);
+};
+/** a request with a duration.
+  This request is used only a base class.
+ */
+struct Rhythmic_req : virtual Musical_req {
+    int balltype;
+    int dots;
+    Moment plet_factor;
+    /* *************** */
+    static int compare(const Rhythmic_req &, const Rhythmic_req &);
+    virtual Moment duration() const;
+    Rhythmic_req();
+    Rhythmic_req(int,int);
+    REQUESTMETHODS(Rhythmic_req, rhythmic);
+};
+
+struct Spacing_req :virtual Request {
+    Moment next;
+    Real distance;
+    Real strength;
+    /* *************** */
+    Spacing_req();
+    REQUESTMETHODS(Spacing_req, spacing);
+};
+
+struct Blank_req : Spacing_req, Rhythmic_req {
+    REQUESTMETHODS(Spacing_req, spacing);
+    
+};
+
+/// Put a text above or below (?) this staff.
+struct Text_req : virtual Musical_req {
+    /// preferred position (above/below)
+    int dir_i_;
+    /// the characteristics of the text
+    Text_def *tdef_p_;
+    /* *************** */
+    Text_req(int d, Text_def*);
+    ~Text_req();
+    Text_req(Text_req const&);
+    static int compare(const Text_req&,const Text_req&);
+    REQUESTMETHODS(Text_req,text);
+};
+
+/** Put a text in lyric_staff
+  @see Lyric_staff
+  */
+struct Lyric_req : public Rhythmic_req, Text_req {
+    Lyric_req(Text_def* t_p);
+    REQUESTMETHODS(Lyric_req, lreq_l);
+};
+
+/// request which has some kind of pitch
+struct Melodic_req :virtual Musical_req
+{
+    /// 0 is c, 6 is b
+    int notename_i_;
+    /// 0 is central c
+    int octave_i_;
+
+    /// 0 natural, 1 sharp, etc
+    int accidental_i_;
+
+    /// force/supress printing of accidental.
+    bool forceacc_b_;
+
+    /// return height from central c (in halflines)
+    int height()const; 
+    /// return pitch from central c (in halfnotes)
+    int pitch()const; 
+    Melodic_req();
+   
+    REQUESTMETHODS(Melodic_req,melodic);
+};
+
+/// Put a note of specified type, height, and with accidental on the staff.
+struct Note_req : Rhythmic_req, virtual Melodic_req {
+    
+
+    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
+    REQUESTMETHODS(Note_req, note);
+ };
+
+/**
+Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
+*/
+class Rest_req : public Rhythmic_req {
+public:
+    REQUESTMETHODS(Rest_req,rest);
+};
+
+/**
+  attach a stem to the noteball.
+  Rhythmic_req parent needed to  determine if it will fit inside a beam.
+  */
+struct Stem_req : Rhythmic_req {
+    /// preferred direction for the stem
+    int dir_i_;
+    Stem_req(int s, int dots);
+    REQUESTMETHODS(Stem_req,stem);
+};
+
+/**
+  Requests to start or stop something.
+ This type of request typically results in the creation of a #Spanner#
+*/
+struct Span_req : virtual Musical_req {
+    /// should the spanner start or stop, or is it unwanted?
+    enum {
+       NOSPAN, START, STOP
+    } spantype ;
+    static int compare(const Span_req &r1, const Span_req &r2);
+    REQUESTMETHODS(Span_req,span);
+
+    Span_req();
+  
+};
+
+/** 
+ request for backward plet generation.
+
+ ugr. Place in hierarchy?
+ */
+struct Plet_req : virtual Request {
+     char type_c_;
+     int dur_i_;
+     int type_i_;
+     Plet_req();
+     REQUESTMETHODS(Plet_req,plet);
+};
+
+/** 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 {
+    int nplet;
+
+    /* *************** */
+     REQUESTMETHODS(Beam_req,beam);
+
+    Beam_req();
+};
+
+/// a slur
+struct Slur_req : Span_req {
+ REQUESTMETHODS(Slur_req,slur);
+
+};
+
+
+/** 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 {
+    int dir_i_;
+    Script_def *scriptdef_p_;
+
+    /* *************** */
+    static int compare(const Script_req &, const Script_req &);
+    Script_req(int d, Script_def*);
+    REQUESTMETHODS(Script_req,script);
+    ~Script_req();
+    Script_req(Script_req const&);
+};
+
+/** A helper in the hierarchy. Each dynamic is bound to one note ( a
+    crescendo spanning multiple notes is thought to be made of two
+    "dynamics": a start and a stop).  Dynamic changes can occur in a
+    smaller time than the length of its note, therefore fore each
+    Dynamic request carries a time, measured from the start of its
+    note.
+ */
+struct Subtle_req : virtual Musical_req {
+    Moment subtime_;
+    REQUESTMETHODS(Subtle_req, subtle);
+};
+
+struct Dynamic_req : Subtle_req {
+    /// for absolute dynamics
+    enum Loudness {
+       FFF, FF, F, MF, MP, P, PP, PPP
+    };
+    static String loudness_str(Loudness);
+    REQUESTMETHODS(Dynamic_req, dynamic);
+};
+
+struct Absolute_dynamic_req : Dynamic_req {
+    Loudness loudness_;
+    Absolute_dynamic_req();
+    REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
+};
+
+struct Span_dynamic_req : Dynamic_req, Span_req {
+    /// Grow or shrink the volume: 1=cresc, -1 = decresc 
+    int dynamic_dir_i_;
+    Span_dynamic_req();
+    REQUESTMETHODS(Span_dynamic_req, span_dynamic);
+};
+
+#endif // MUSICALREQUESTS_HH
diff --git a/lily/include/musicalrequest.hh b/lily/include/musicalrequest.hh
deleted file mode 100644 (file)
index 208e3dc..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
-  musicalrequests.hh -- declare Musical requests
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef MUSICALREQUESTS_HH
-#define MUSICALREQUESTS_HH
-
-#include "request.hh"
-
-
-/**
-  A request which is coupled to a #Voice_element# with nonzero duration.
-  Base class only
- */
-struct Musical_req : virtual Request {
-    virtual Skip_req* skip() { return 0; }
-    virtual Dynamic_req* dynamic() { return 0; }
-    virtual Absolute_dynamic_req * absdynamic() { return 0; }
-    virtual Subtle_req * subtle() { return 0; }
-    REQUESTMETHODS(Musical_req, musical);
-};
-
-
-struct Skip_req : Musical_req {
-    Moment duration_;
-    
-    virtual Moment duration() const;
-    REQUESTMETHODS(Skip_req, skip);
-};
-/** a request with a duration.
-  This request is used only a base class.
- */
-struct Rhythmic_req : virtual Musical_req {
-    int balltype;
-    int dots;
-    Moment plet_factor;
-    /* *************** */
-    static int compare(const Rhythmic_req &, const Rhythmic_req &);
-    virtual Moment duration() const;
-    Rhythmic_req();
-    Rhythmic_req(int,int);
-    REQUESTMETHODS(Rhythmic_req, rhythmic);
-};
-
-struct Spacing_req :virtual Request {
-    Moment next;
-    Real distance;
-    Real strength;
-    /* *************** */
-    Spacing_req();
-    REQUESTMETHODS(Spacing_req, spacing);
-};
-
-struct Blank_req : Spacing_req, Rhythmic_req {
-    REQUESTMETHODS(Spacing_req, spacing);
-    
-};
-
-/// Put a text above or below (?) this staff.
-struct Text_req : virtual Musical_req {
-    /// preferred position (above/below)
-    int dir_i_;
-    /// the characteristics of the text
-    Text_def *tdef_p_;
-    /* *************** */
-    Text_req(int d, Text_def*);
-    ~Text_req();
-    Text_req(Text_req const&);
-    static int compare(const Text_req&,const Text_req&);
-    REQUESTMETHODS(Text_req,text);
-};
-
-/** Put a text in lyric_staff
-  @see Lyric_staff
-  */
-struct Lyric_req : public Rhythmic_req, Text_req {
-    Lyric_req(Text_def* t_p);
-    REQUESTMETHODS(Lyric_req, lreq_l);
-};
-
-/// request which has some kind of pitch
-struct Melodic_req :virtual Musical_req
-{
-    /// 0 is c, 6 is b
-    int notename_i_;
-    /// 0 is central c
-    int octave_i_;
-
-    /// 0 natural, 1 sharp, etc
-    int accidental_i_;
-
-    /// force/supress printing of accidental.
-    bool forceacc_b_;
-
-    /// return height from central c (in halflines)
-    int height()const; 
-    /// return pitch from central c (in halfnotes)
-    int pitch()const; 
-    Melodic_req();
-   
-    REQUESTMETHODS(Melodic_req,melodic);
-};
-
-/// Put a note of specified type, height, and with accidental on the staff.
-struct Note_req : Rhythmic_req, virtual Melodic_req {
-    
-
-    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
-    REQUESTMETHODS(Note_req, note);
- };
-
-/**
-Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
-*/
-class Rest_req : public Rhythmic_req {
-public:
-    REQUESTMETHODS(Rest_req,rest);
-};
-
-/**
-  attach a stem to the noteball.
-  Rhythmic_req parent needed to  determine if it will fit inside a beam.
-  */
-struct Stem_req : Rhythmic_req {
-    /// preferred direction for the stem
-    int dir_i_;
-    Stem_req(int s, int dots);
-    REQUESTMETHODS(Stem_req,stem);
-};
-
-/**
-  Requests to start or stop something.
- This type of request typically results in the creation of a #Spanner#
-*/
-struct Span_req : Musical_req {
-    /// should the spanner start or stop, or is it unwanted?
-    enum {
-       NOSPAN, START, STOP
-    } spantype ;
-    static int compare(const Span_req &r1, const Span_req &r2);
-    REQUESTMETHODS(Span_req,span);
-
-    Span_req();
-  
-};
-
-/// request for backward plet generation
-struct Plet_req : Request {
-     char type_c_;
-     int dur_i_;
-     int type_i_;
-     Plet_req();
-     REQUESTMETHODS(Plet_req,plet);
-};
-/** 
-*/
-
-/** 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 {
-    int nplet;
-
-    /* *************** */
-     REQUESTMETHODS(Beam_req,beam);
-
-    Beam_req();
-};
-
-/// a slur
-struct Slur_req : Span_req {
- REQUESTMETHODS(Slur_req,slur);
-
-};
-
-
-/** 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 {
-    int dir_i_;
-    Script_def *scriptdef_p_;
-
-    /* *************** */
-    static int compare(const Script_req &, const Script_req &);
-    Script_req(int d, Script_def*);
-    REQUESTMETHODS(Script_req,script);
-    ~Script_req();
-    Script_req(Script_req const&);
-};
-
-/** A helper in the hierarchy. Each dynamic is bound to one note ( a
-    crescendo spanning multiple notes is thought to be made of two
-    "dynamics": a start and a stop).  Dynamic changes can occur in a
-    smaller time than the length of its note, therefore fore each
-    Dynamic request carries a time, measured from the start of its
-    note.
- */
-struct Subtle_req : virtual Musical_req {
-    Moment subtime_;
-    REQUESTMETHODS(Subtle_req, subtle);
-};
-
-struct Dynamic_req : Subtle_req {
-    /// for absolute dynamics
-    enum Loudness {
-       FFF, FF, F, MF, MP, P, PP, PPP
-    };
-    static String loudness_str(Loudness);
-    REQUESTMETHODS(Dynamic_req, dynamic);
-};
-
-struct Absolute_dynamic_req : Dynamic_req {
-    Loudness loudness_;
-    Absolute_dynamic_req();
-    REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
-};
-
-#endif // MUSICALREQUESTS_HH
diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh
new file mode 100644 (file)
index 0000000..2641e64
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef COLS_HH
+#define COLS_HH
+
+#include "glob.hh"
+#include "boxes.hh"
+#include "plist.hh"
+#include "item.hh"
+
+
+/**
+   stuff grouped vertically.
+    This is a class to address items vertically. It contains the data for:
+    \begin{itemize}
+    \item
+    unbroken score
+    \item
+    broken score
+    \item
+    the linespacing problem
+    \end{itemize}
+  */
+
+struct PCol { 
+    PointerList<const Item*> its;
+    PointerList<const Spanner*> stoppers, starters;
+    
+
+
+    /** prebreak is put before end of line.
+    if broken here, then (*this) column is discarded, and prebreak
+    is put at end of line, owned by Col
+    */
+    PCol *prebreak_p_;
+
+    /// postbreak at beginning of the new line
+    PCol *postbreak_p_;
+    
+    /** if this column is pre or postbreak, then this field points to
+     the parent.  */
+    PCol *daddy_l_;
+    
+    /// if lines are broken then this column is in #line#
+    const Line_of_score *line_l_;
+
+    /// if lines are broken then this column x-coord #hpos#
+    Real hpos;
+
+    PScore * pscore_l_;
+
+    /* *************** */
+    /// which  one (left =0)
+    int rank() const;
+
+    /// does this column have items
+    bool used_b() const;
+    
+    void add(Item *i);
+
+    /// Can this be broken? true eg. for bars. 
+    bool breakable_b()const;
+    
+    Interval width() const;
+    ~PCol();
+    PCol(PCol * parent);
+
+    /**
+      which col comes first?.
+      signed compare on columns.
+
+      @return < 0 if c1 < c2.
+    */static int compare(const PCol &c1, const PCol &c2);
+    
+
+    void OK() const;
+    void set_breakable();
+    void print()const;
+private:
+    PCol(PCol const&){}
+};
+
+
+#include "compare.hh"
+instantiate_compare(PCol &, PCol::compare);
+     
+
+#endif
diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh
new file mode 100644 (file)
index 0000000..eeec67e
--- /dev/null
@@ -0,0 +1,106 @@
+// the breaking problem for a score.
+
+#ifndef PSCORE_HH
+#define PSCORE_HH
+
+#include "colhpos.hh"
+#include "varray.hh"
+#include "p-col.hh"
+#include "p-staff.hh"
+
+
+/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways:
+    horizontally (staffwise), and vertically (columns). #PScore#
+    contains the items, the columns and the staffs.
+ */
+
+struct PScore {
+    Paper_def *paper_l_;
+    
+    /// the columns, ordered left to right
+    IPointerList<PCol *> cols;
+
+    /// the idealspacings, no particular order
+    IPointerList<Idealspacing*> suz;
+
+    /// the staffs ordered top to bottom
+    IPointerList<PStaff*> staffs;
+
+    /// all symbols in score. No particular order.
+    IPointerList<Item*> its;
+
+    /// if broken, the different lines
+    IPointerList<Line_of_score*> lines;
+
+    /// crescs etc; no particular order
+    IPointerList<Spanner *> spanners;
+
+    /// broken spanners
+    IPointerList<Spanner*> broken_spans;
+
+    /* *************** */
+    /* CONSTRUCTION */
+    
+    PScore(Paper_def*);
+    /// add a line to the broken stuff. Positions given in #config#
+    void set_breaking(Array<Col_hpositions>);
+
+    void add(PStaff *);
+    
+
+    /** add an item.
+       add the item in specified containers. If breakstatus is set
+       properly, add it to the {pre,post}break of the pcol.
+       */
+    void typeset_item(Item *item_p,  PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1);
+
+    /// add a Spanner
+    void typeset_spanner(Spanner*, PStaff*);
+    ///    add to bottom of pcols
+    void add(PCol*);
+    void add_broken(Spanner*);
+
+    /* INSPECTION */
+    Array<Item*> select_items(PStaff*, PCol*);
+
+     /**
+       @return argument as a cursor of the list
+       */
+    PCursor<PCol *> find_col(const PCol *)const;
+
+    /* MAIN ROUTINES */
+    void process();
+
+    /// last deed of this struct
+    void output(Tex_stream &ts);
+
+    /* UTILITY ROUTINES */
+
+    /// get the spacing between c1 and c2, create one if necessary.
+    Idealspacing* get_spacing(PCol *c1, PCol *c2);
+
+    /// connect c1 and c2
+    void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f);
+
+    /// connect c1 and c2 and any children of c1 and c2
+    void connect(PCol* c1, PCol *c2, Real distance_f,Real  strength_f= 1.0);
+    
+    /* STANDARD ROUTINES */
+    void OK()const;
+    void print() const;
+private:
+    /// before calc_breaking
+    void preprocess();
+
+    /// calculate where the lines are to be broken, and use results
+    void calc_breaking();
+
+    /// after calc_breaking
+    void postprocess();
+    
+    /// delete unused columns
+    void clean_cols();
+};
+
+#endif
index 7b9e3e3ec216c59fd1f4d238c6527e42f6ae1b85..ff47bdcbadf9563a0631a0af621b5e2ea6e6b50f 100644 (file)
@@ -17,7 +17,7 @@ void set_duration_mode(String s);
 void get_default_duration(int *);
 void set_default_octave(String);
 void set_plet(int,int);
-Voice_element * get_note_element(String,int * ,int *);
+Voice_element * get_note_element(Note_req * ,int *);
 Voice_element* get_rest_element(String,int *);
 Voice_element* get_word_element(Text_def*, int*);
 void add_requests( Voice_element*v, Array<Request*>&req);
diff --git a/lily/include/pcol.hh b/lily/include/pcol.hh
deleted file mode 100644 (file)
index 4fac246..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef COLS_HH
-#define COLS_HH
-
-#include "glob.hh"
-#include "boxes.hh"
-#include "plist.hh"
-#include "item.hh"
-
-
-/**
-   stuff grouped vertically.
-    This is a class to address items vertically. It contains the data for:
-    \begin{itemize}
-    \item
-    unbroken score
-    \item
-    broken score
-    \item
-    the linespacing problem
-    \end{itemize}
-  */
-
-struct PCol {
-    PointerList<const Item*> its;
-    PointerList<const Spanner*> stoppers, starters;
-    
-
-
-    /** prebreak is put before end of line.
-    if broken here, then (*this) column is discarded, and prebreak
-    is put at end of line, owned by Col
-    */
-    PCol *prebreak_p_;
-
-    /// postbreak at beginning of the new line
-    PCol *postbreak_p_;
-    
-    /** if this column is pre or postbreak, then this field points to
-     the parent.  */
-    PCol *daddy_l_;
-    
-    /// if lines are broken then this column is in #line#
-    const Line_of_score *line_l_;
-
-    /// if lines are broken then this column x-coord #hpos#
-    Real hpos;
-
-    PScore * pscore_l_;
-
-    /* *************** */
-    /// which  one (left =0)
-    int rank() const;
-
-    /// does this column have items
-    bool used_b() const;
-    
-    void add(Item *i);
-
-    /// Can this be broken? true eg. for bars. 
-    bool breakable_b()const;
-    
-    Interval width() const;
-    ~PCol();
-    PCol(PCol * parent);
-
-    /**
-      which col comes first?.
-      signed compare on columns.
-
-      @return < 0 if c1 < c2.
-    */static int compare(const PCol &c1, const PCol &c2);
-    
-
-    void OK() const;
-    void set_breakable();
-    void print()const;
-private:
-    PCol(PCol const&){}
-};
-
-
-#include "compare.hh"
-instantiate_compare(PCol &, PCol::compare);
-     
-
-#endif
diff --git a/lily/include/pscore.hh b/lily/include/pscore.hh
deleted file mode 100644 (file)
index b7ad49c..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-// the breaking problem for a score.
-
-#ifndef PSCORE_HH
-#define PSCORE_HH
-
-#include "colhpos.hh"
-#include "varray.hh"
-#include "pcol.hh"
-#include "pstaff.hh"
-
-
-/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways:
-    horizontally (staffwise), and vertically (columns). #PScore#
-    contains the items, the columns and the staffs.
- */
-
-struct PScore {
-    Paper_def *paper_l_;
-    
-    /// the columns, ordered left to right
-    IPointerList<PCol *> cols;
-
-    /// the idealspacings, no particular order
-    IPointerList<Idealspacing*> suz;
-
-    /// the staffs ordered top to bottom
-    IPointerList<PStaff*> staffs;
-
-    /// all symbols in score. No particular order.
-    IPointerList<Item*> its;
-
-    /// if broken, the different lines
-    IPointerList<Line_of_score*> lines;
-
-    /// crescs etc; no particular order
-    IPointerList<Spanner *> spanners;
-
-    /// broken spanners
-    IPointerList<Spanner*> broken_spans;
-
-    /* *************** */
-    /* CONSTRUCTION */
-    
-    PScore(Paper_def*);
-    /// add a line to the broken stuff. Positions given in #config#
-    void set_breaking(Array<Col_hpositions>);
-
-    void add(PStaff *);
-    
-
-    /** add an item.
-       add the item in specified containers. If breakstatus is set
-       properly, add it to the {pre,post}break of the pcol.
-       */
-    void typeset_item(Item *item_p,  PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1);
-
-    /// add a Spanner
-    void typeset_spanner(Spanner*, PStaff*);
-    ///    add to bottom of pcols
-    void add(PCol*);
-    void add_broken(Spanner*);
-
-    /* INSPECTION */
-    Array<Item*> select_items(PStaff*, PCol*);
-
-     /**
-       @return argument as a cursor of the list
-       */
-    PCursor<PCol *> find_col(const PCol *)const;
-
-    /* MAIN ROUTINES */
-    void process();
-
-    /// last deed of this struct
-    void output(Tex_stream &ts);
-
-    /* UTILITY ROUTINES */
-
-    /// get the spacing between c1 and c2, create one if necessary.
-    Idealspacing* get_spacing(PCol *c1, PCol *c2);
-
-    /// connect c1 and c2
-    void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f);
-
-    /// connect c1 and c2 and any children of c1 and c2
-    void connect(PCol* c1, PCol *c2, Real distance_f,Real  strength_f= 1.0);
-    
-    /* STANDARD ROUTINES */
-    void OK()const;
-    void print() const;
-private:
-    /// before calc_breaking
-    void preprocess();
-
-    /// calculate where the lines are to be broken, and use results
-    void calc_breaking();
-
-    /// after calc_breaking
-    void postprocess();
-    
-    /// delete unused columns
-    void clean_cols();
-};
-
-#endif
diff --git a/lily/include/pstaff.hh b/lily/include/pstaff.hh
deleted file mode 100644 (file)
index 50a7f0c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef PSTAFF_HH
-#define PSTAFF_HH
-
-#include "proto.hh"
-#include "plist.hh"
-#include "item.hh"
-#include "symbol.hh"
-
-/// items grouped horizontally
-struct PStaff {
-    PScore * pscore_l_;
-    
-    
-    PointerList<const Spanner*> spans;
-    PointerList<Item*> its;
-
-    /* *************** */
-    void add(Item*i);
-    PStaff(PScore*);
-
-private:
-    PStaff(PStaff const&);
-};
-
-#endif
index 87f1fe855ea71bd7fc623a4dd818e8bae80fb26c..c8363075c4569bde2fe96e71f44b5fe628c84111 100644 (file)
@@ -25,8 +25,7 @@ struct Slur : Directional_spanner {
     void add(Notehead*);
     void set_default_dir();
 
-    Spanner* do_break_at( PCol*, PCol*) const;
-    void process();
+    Spanner* do_break_at( PCol*, PCol*) const; 
 private:
     Molecule*brew_molecule_p()const;
     NAME_MEMBERS(Slur);
index 9fbe3ec9177a1964c56c3c7b4815c452a4784ed9..107d360c79860b7a3c86001bf7f097230238b6bd 100644 (file)
@@ -12,7 +12,7 @@
 #include "plist.hh"
 #include "varray.hh"
 #include "glob.hh"
-#include "pstaff.hh"
+#include "p-staff.hh"
 
 /// one broken line of staff.
 struct Line_of_staff {
index f1047e8bf9fbc5312b977d662860e5d7a4340cfb..8ccc9071b8813b8b28d874f1498a3c61f0ad4b28 100644 (file)
@@ -1,7 +1,7 @@
 #include "debug.hh"
 #include "input-music.hh"
 #include "voice.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice-element.hh"
 
 void
index 84b0e268c66592b7774b189cabc865da2b9b9884..24189a532b61d50191418e7f5f9374274f55713f 100644 (file)
 #include "time-description.hh"
 #include "key-reg.hh"
 #include "key-item.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "staff-column.hh"
 #include "local-key-reg.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 Key_register::Key_register()
 {
index 10c5ee6b03c8264f949da3e429f891fb45452380..29738a70aa1f83d59845a4653327cf6609b8bdd3 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "string.hh"
 #include "string-convert.hh"
-#include "notename.hh"
 #include "lexer.hh"
 #include "varray.hh"
 #include "parser.hh"
 #include "main.hh"
 #include "identparent.hh"
 
+#define start_quote()  \
+       yy_push_state(quote);\
+       yylval.string = new String
+
+
 %}
 
 %option c++
@@ -35,8 +39,8 @@ A             [a-zA-Z]
 AA             {A}|_
 N              [0-9]
 AN             {AA}|{N}
-PUNCT          [?!,.:;]
-ACCENT         [\\'"^]
+PUNCT          [?!,.:;']
+ACCENT         \\[`'"^]
 NATIONAL       [\241-\377]
 TEX            {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 
@@ -49,8 +53,6 @@ OPTSIGN               !?
 PITCHMOD       ['`]*{OPTSIGN}
 RESTNAME       r|s|p
 NOTECOMMAND    \\{WORD}
-NOTENAME       [a-z]+
-UNOTENAME      [A-Z][a-z]*
 DOTS           \.+
 LYRICS         {TEX}+
 COMMENT                [%#].*\n
@@ -71,16 +73,18 @@ COMMENT             [%#].*\n
        mtor << "rest:"<< yylval.string;
        return RESTNAME;
 }
-<notes>{UNOTENAME}     {
-       int *p=yylval.ii;
-       return ret_notename(p, YYText(), -1);
-}
+<notes>{ALPHAWORD}     {
+       String str = YYText();
+       mtor << "word: " << str<< eol;
+       Identifier * id = lookup_identifier(str);
+       if (id) {               
+               yylval.id = id;
+               return id->token_code_i_;
+       }
 
-<notes>{NOTENAME}      {
-       int *p=yylval.ii;
-       return ret_notename(p, YYText(), 0);
+       yylval.string=new String( str );
+       return STRING;
 }
-
 <notes>{NOTECOMMAND}   {
        String c = YYText() +1;
        mtor << "\\word: " << YYText()+1<<eol;
@@ -97,12 +101,6 @@ COMMENT             [%#].*\n
        return STRING;
 }
 
-<notes>{PITCHMOD}      {
-       const char *s = YYText();
-       mtor << "pitchmod:"<< YYText()<<eol;
-       yylval.string = new String (s);
-       return PITCHMOD;
-}
 <notes>{DOTS}          {
        yylval.i = strlen(YYText());
        return DOTS;
@@ -119,28 +117,29 @@ COMMENT           [%#].*\n
 <notes>\$      {
        yy_pop_state();
 }
-<notes>\"[^"]*\" {
-       String s (YYText()+1);
-       s = s.left_str(s.length_i()-1);
-       yylval.string = new String(s);
-       return STRING;
+<notes>\" {
+       start_quote();
 }
 <notes>.       {
        return yylval.c = YYText()[0];
 }
 
+
 \"             {
-       yy_push_state(quote);
+       start_quote();
 }
-<quote>[^"]*   {
-       yylval.string = new String (YYText());
+<quote>[^"]+   {
+       *yylval.string += YYText();
 }
 <quote>\"      {
-       mtor << "quoted string\n";
+       mtor << "quoted string: `" << *yylval.string << "'\n";
        yy_pop_state();
        return STRING;
 }
 
+<lyrics>\" {
+       start_quote();
+}
 <lyrics>{DOTS}         {
        yylval.i = strlen(YYText());
        return DOTS;
@@ -157,7 +156,9 @@ COMMENT             [%#].*\n
                return l;
 
 /* let's try passing tex's typesetting macros like \ss \alpha \c */
-       String* str_p = new String(YYText());//huh?
+       String* str_p = new String(YYText());
+       yylval.string=str_p;
+       mtor << "\\word: `" << *str_p << "'\n";
        return STRING;  
 
 /* and skip identifiers...
@@ -169,16 +170,12 @@ COMMENT           [%#].*\n
        String *sp = new String( c);
 
        yylval.string=sp;
+
        return STRING;
 */
 }
-<lyrics>\"[^"]*\" {
-       String s (YYText()+1);
-       s = s.left_str(s.length_i()-1);
-       yylval.string = new String(s);
-       return STRING;
-}
 <lyrics>{LYRICS} {
+       /* ugr. This sux. */
        String s (YYText()); 
        int i = 0;
        while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
@@ -189,6 +186,7 @@ COMMENT             [%#].*\n
                s = s.left_str(i+2) + " " + s.right_str(s.length_i()-i-2);
                }
        yylval.string = new String(s);
+       mtor << "lyric : `" << s << "'\n";
        return STRING;
 }
 <lyrics>\|     {
index a7bfa1df9bd45ea6573ef12512d0b0e9174d161c..750487cff7197515fea0b81ec2197716cf800815 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 #include "linespace.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "debug.hh"
 #include "qlp.hh"
 #include "unionfind.hh"
index a0152c9f3cab4407909421d34785e800de91d6dd..ff0814f21694b1d4919f9a9858f83476f252e1fc 100644 (file)
@@ -3,7 +3,7 @@
 #include "scalar.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "notehead.hh"
 #include "misc.hh"
 
index f13ec98b9fd471f422ff77d95572ebd93a9d1e91..ddbd8dc5f842fe277a70bfe6e6d59f3a215fb3b5 100644 (file)
@@ -4,8 +4,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "local-key-reg.hh"
 #include "local-key-item.hh"
 #include "complex-walker.hh"
index cb8c7547e43d9180264935af3892a95c3714a47f..6e3fdf02b81db8c5e0f60c53c4fdb4eb68881c30 100644 (file)
@@ -1,4 +1,4 @@
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "lyric-item.hh"
 #include "stem.hh"
index 8414f4ecaf147af66e9bbb01c504304feea4d47f..77d276187c2571349ab4d97adb8c34b3307ff9bc 100644 (file)
@@ -1,11 +1,11 @@
-#include "musicalrequest.hh"
+#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 "pscore.hh"
+#include "p-score.hh"
 
 void
 Lyric_staff::set_output(PScore*pscore_l)
index 614e258be751f204e1b9abddf3a7d2214f2007ed..6643215ea3ab13af7eed88a5975aa7dad7a9795b 100644 (file)
@@ -6,9 +6,9 @@
   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "lyric-staff.hh"
 #include "lyric-walker.hh"
 #include "debug.hh"
index a27737c076b8c37e251b45d7f6f0405306c4d562..f15e5ddb0928b9206dd5e1b7fc4c927538645a60 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "meter-reg.hh"
 #include "meter.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 
 Meter_register::Meter_register()
 
index 5bc6b8fa78924104ca9de94942a14e6edfd13cde..163105ab3c3906952420337cf2add5198a948056 100644 (file)
 //     destructor
 //     routines, alphasorted
 
+// statics Midi_def
+// ugh
+int Midi_def::den_i_s = 4;
+int Midi_def::num_i_s = 4;
+
 Midi_def::Midi_def()
 {
     set_tempo( Moment( 1, 4 ), 60 );
index 9a63d93e5a0e602d8b707bddbaf4358e79f4997b..2bc00a3a0fdbd55a995ef29539919bc73c7b13d7 100644 (file)
@@ -8,13 +8,13 @@
 #include <limits.h>
 #include "proto.hh"
 #include "plist.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "debug.hh"
 #include "misc.hh"
 #include "string.hh"
 #include "string-convert.hh"
 #include "request.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
@@ -161,6 +161,24 @@ Midi_tempo::str() const
     return String_convert::hex2bin_str( str );
 }
 
+Midi_time::Midi_time( int num_i, int den_i, int clocks_per_1_i )
+{
+       num_i_ = num_i;
+       den_i_ = den_i;
+       clocks_per_1_i_ = clocks_per_1_i;
+}
+
+String
+Midi_time::str() const
+{
+       String str = "ff5804";
+       str += String_convert::i2hex_str( num_i_, 2, '0' );
+       str += String_convert::i2hex_str( intlog2( den_i_ ) , 2, '0' );
+       str += String_convert::i2hex_str( clocks_per_1_i_, 2, '0' );
+       str += String_convert::i2hex_str( 8, 2, '0' );
+       return String_convert::hex2bin_str( str );
+}
+
 Midi_text::Midi_text( Midi_text::Type type, String text_str )
 {
        type_ = type;
@@ -195,7 +213,8 @@ Midi_track::Midi_track( int number_i )
 
     number_i_ = number_i;
        
-    char const* data_ch_c_l = "00" "ff58" "0404" "0218" "08"
+    char const* data_ch_c_l = ""
+//        "00" "ff58" "0404" "0218" "08"
 //     "00" "ff51" "0307" "a120"
 // why a key at all, in midi?
 // key: C
index ec3b727400756332bbe3efe5059b3572b413cbcf..9d2407244c48ab1e95b98062492d822df3207c94 100644 (file)
@@ -23,7 +23,7 @@
 #include "midi-walker.hh"
 #include "midi-item.hh"
 #include "staff-column.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 
 Midi_output::Midi_output(Score* score_l, Midi_def* midi_l )
@@ -74,6 +74,9 @@ Midi_output::do_staff(Staff*st_l,int track_i)
     Midi_tempo midi_tempo( midi_l_->get_tempo_i( Moment( 1, 4 ) ) );
     midi_track.add( Moment( 0.0 ), &midi_tempo );
 
+    Midi_time midi_time( Midi_def::num_i_s, Midi_def::den_i_s, 18 );
+    midi_track.add( Moment( 0.0 ), &midi_time );
+
     for (Midi_walker w (st_l, &midi_track); w.ok(); w++)
        w.process_requests();
 
@@ -89,24 +92,38 @@ Midi_output::header()
 
     // perhaps multiple text events?
     String str = String( "Creator: " ) + get_version() + "\n";
-    str += "Generated, at ";
-    str += ctime( &t );
-    str += ", from musical definition: " + infile_str_g;
-    str += "\n";    
 
     Midi_text creator( Midi_text::TEXT, str );
     midi_track.add( Moment( 0.0 ), &creator );
 
+    str = "Generated, at ";
+    str += ctime( &t );
+    str = str.left_str( str.length_i() - 1 );
+    str += ",\n";
+    Midi_text generate( Midi_text::TEXT, str );
+    midi_track.add( Moment( 0.0 ), &generate );
+
+    str = "from musical definition: " + infile_str_g + "\n";
+    Midi_text from( Midi_text::TEXT, str );
+    midi_track.add( Moment( 0.0 ), &from );
+
+    // set track name
+    Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( 0, 0, '0' ) );
+    midi_track.add( Moment( 0.0 ), &track_name );
+
     struct tm* tm_l = gmtime( &t );
     String year_str = String_convert::i2dec_str( 1900 + tm_l->tm_year, 4, '0' );
            
     // your copyleft here
-    str = " Copyleft (o) " + year_str;
-    str += " Han-Wen Nienhuys <hanwen@stack.nl>, "
-       " Jan Nieuwenhuizen <jan@digicash.com>\n";
-       
+    str = " Copyleft (o) " + year_str + "by\n";
     Midi_text copyleft( Midi_text::COPYRIGHT, str );
     midi_track.add( Moment( 0.0 ), &copyleft );
+
+    str = " Han-Wen Nienhuys <hanwen@stack.nl>,"
+         " Jan Nieuwenhuizen <jan@digicash.com>\n";
+       
+    Midi_text authors( Midi_text::COPYRIGHT, str );
+    midi_track.add( Moment( 0.0 ), &authors );
     *midi_stream_l_  << midi_track;
 }
 
index 4a1674c7f7a043feb802f2e9058b679997bb8865..88cd6b724d5e88b1aab9659ecbcb708c9aebed9f 100644 (file)
@@ -6,8 +6,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
 */
 
-#include "musicalrequest.hh"
-#include "pscore.hh"
+#include "musical-request.hh"
+#include "p-score.hh"
 #include "staff.hh"
 #include "midi-walker.hh"
 #include "midi-item.hh"
index c52fdc7b329b324a974f625bc2fce765b85095bc..bfd298bfacfb8879ad394d86d099315e675255df 100644 (file)
@@ -30,6 +30,10 @@ Atom::Atom(Symbol s)
 String
 Atom::TeXstring() const
 {
+    /* infinity checks. */
+    assert( abs(off.x) < 100 CM);
+    assert( abs(off.y) < 100 CM);
+    
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
diff --git a/lily/musical-request.cc b/lily/musical-request.cc
new file mode 100644 (file)
index 0000000..be9667c
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+  request.cc -- implement all musical requests.
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "musical-request.hh"
+#include "misc.hh"
+#include "debug.hh"
+#include "script-def.hh"
+#include "text-def.hh"
+#include "voice.hh"
+#include "voice-element.hh"
+
+void
+Stem_req::do_print() const
+{
+    Rhythmic_req::do_print();
+    mtor << "dir : " << dir_i_;
+}
+
+Stem_req::Stem_req(int s, int d)
+    : Rhythmic_req(s,d)
+{
+    dir_i_ = 0;
+}
+
+/* ************** */
+void Musical_req::do_print()const{}
+void Request::do_print() const{}
+
+/* *************** */
+
+void
+Request::print() const
+{
+    mtor << name() << " {";
+    do_print();
+    mtor << "}\n";
+}
+     
+
+
+void
+Span_req::do_print() const    
+{
+#ifndef NPRINT
+    mtor  << spantype ;
+#endif
+}
+
+Request::Request()
+{
+    elt_l_ = 0;
+    defined_ch_c_l_ = 0;
+}
+Request::Request(Request const&src)
+{
+    elt_l_ = 0;
+    defined_ch_c_l_ = src.defined_ch_c_l_;
+}
+/* *************** */
+Spacing_req::Spacing_req()
+{
+    next = 0;
+    distance = 0;
+    strength = 0;
+}
+void
+Spacing_req::do_print()const
+{
+#ifndef NPRINT
+    mtor << "next " << next << "dist " << distance << "strength\n";
+#endif
+}
+
+void
+Blank_req::do_print()const
+{
+    Spacing_req::do_print();
+}
+/* *************** */
+Melodic_req::Melodic_req()
+{
+    notename_i_ = 0;
+    octave_i_ = 0;
+    accidental_i_ = 0;
+    forceacc_b_ = false;
+}
+
+void
+Melodic_req::do_print() const
+{
+    mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+}
+
+int
+Melodic_req::height() const
+{
+    return  notename_i_ + octave_i_*7;
+}
+
+/*
+ should be settable from input to allow "viola"-mode
+ */
+static Byte pitch_byte_a[ 7 ] = { 0, 2, 4, 5, 7, 9, 11 };      
+
+int
+Melodic_req::pitch() const
+{
+    return  pitch_byte_a[ notename_i_ % 7 ] + accidental_i_ + octave_i_ * 12;
+}
+
+Plet_req::Plet_req()
+{
+    type_c_ = ']';
+    dur_i_ = 1;
+    type_i_ = 1;
+}
+
+void
+Plet_req::do_print() const
+{
+    mtor << "plet: " << type_c_ << ": " << dur_i_ << "/" << type_i_;
+}
+
+/* *************** */
+int
+Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
+{
+    return sign(r1.duration() - r2.duration());
+}
+Rhythmic_req::Rhythmic_req(int b, int d)
+{
+    plet_factor = 1;
+    balltype = b;
+    dots = d;
+}
+
+Rhythmic_req::Rhythmic_req()
+{
+    plet_factor = 1;
+    balltype = 1;
+    dots = 0;
+}
+
+void
+Rhythmic_req::do_print() const
+{
+    mtor << "ball: " << balltype ;
+    int d =dots;
+    while (d--)
+       mtor << '.';
+    
+    mtor<<", plet factor"<<plet_factor<<"\n";
+}
+
+
+Moment
+Rhythmic_req::duration() const {    
+    return wholes(balltype,dots)*plet_factor;
+}
+/* *************** */
+
+Lyric_req::Lyric_req(Text_def* def_p)
+    :Text_req(0, def_p)
+{
+    def_p->align_i_ = 0;       // centre
+    dir_i_ = -1;               // lyrics below (invisible) staff
+}
+
+void
+Lyric_req::do_print() const
+{    
+    Rhythmic_req::do_print();
+    Text_req::do_print();
+}
+/* *************** */
+void
+Note_req::do_print() const
+{
+    Melodic_req::do_print();
+    Rhythmic_req::do_print();
+}
+/* *************** */
+void
+Rest_req::do_print() const
+{
+        Rhythmic_req::do_print();
+}
+
+/* *************** */
+Beam_req::Beam_req()
+{
+    nplet = 0;
+}
+
+void Beam_req::do_print()const{}
+/* *************** */
+void Slur_req::do_print()const{}
+/* *************** */
+int
+Span_req:: compare(const Span_req &r1, const Span_req &r2)
+{
+     return r1.spantype - r2.spantype;
+}
+
+Span_req::Span_req()
+{
+    spantype = NOSPAN;
+}
+
+/* *************** */
+Script_req::Script_req(int d , Script_def*def)
+{
+    dir_i_ = d;
+    scriptdef_p_ = def;
+}
+
+int
+Script_req::compare(const Script_req &d1, const Script_req &d2)
+{
+    return d1.dir_i_ == d2.dir_i_ &&
+       d1.scriptdef_p_->compare(*d2.scriptdef_p_);
+}
+
+Script_req::Script_req(Script_req const &s)
+    : Request( s )
+{
+    dir_i_ = s.dir_i_;
+    scriptdef_p_ = new Script_def(*s.scriptdef_p_);
+}
+
+void
+Script_req::do_print() const
+{
+    mtor << " dir " << dir_i_ ;
+    scriptdef_p_->print();
+}
+
+
+Script_req::~Script_req()
+{
+    delete scriptdef_p_;
+}
+/* *************** */
+int
+Text_req:: compare(const Text_req &r1, const Text_req &r2)
+{
+    bool b1 = (r1.dir_i_ == r2.dir_i_);
+    bool b2 = (r1.tdef_p_ ->compare(*r2.tdef_p_));
+    return b1 && b2;
+}
+Text_req::~Text_req()
+{
+    delete tdef_p_;
+    tdef_p_ = 0;
+}
+
+Text_req::Text_req(Text_req const& src)
+{
+    tdef_p_ = new Text_def(*src.tdef_p_);
+    dir_i_ = src.dir_i_;
+}
+
+Text_req::Text_req(int dir_i, Text_def* tdef_p)        
+{
+    dir_i_ = dir_i;
+    tdef_p_ = tdef_p;
+}
+
+void
+Text_req::do_print() const
+{
+    mtor << " dir " << dir_i_ ;
+    tdef_p_->print();
+}
+
+/* *************** */
+
+Moment
+Skip_req::duration() const
+{
+    return duration_;
+}
+
+void
+Skip_req::do_print() const
+{
+    mtor << "duration: " << duration();
+}
+
+Voice *
+Request::voice_l()
+{
+    if (!elt_l_)
+       return 0;
+    else
+       return (Voice*)elt_l_->voice_l_;
+}
+/* *************** */
+
+void
+Subtle_req::do_print() const
+{
+    mtor << " subtime " <<  subtime_;
+}
+
+void
+Dynamic_req::do_print() const
+{
+    Subtle_req::do_print();
+}
+
+void
+Absolute_dynamic_req::do_print() const
+{
+    Dynamic_req::do_print();
+    mtor << " loudness_" <<loudness_;
+}
+
+String
+Dynamic_req::loudness_str(Loudness l) 
+{
+    switch (l) {
+    case FFF: return "fff";
+    case FF: return "ff";
+    case F: return "f";
+    case MF: return "mf";
+    case MP: return "mp";
+    case P: return "p";
+    case PP: return "pp";
+    case PPP: return "ppp";
+    }
+    assert(false);
+    return "";
+}
+
+Absolute_dynamic_req::Absolute_dynamic_req()
+{
+    loudness_ = MF;
+}
+
+
+Span_dynamic_req::Span_dynamic_req()
+{
+    dynamic_dir_i_  = 0;
+}
+
+void
+Span_dynamic_req::do_print()const
+{
+#ifndef NPRINT
+    Span_req::do_print();
+    mtor << "louder/louder: " <<dynamic_dir_i_;
+#endif
+}
index 9c9179c856d4237b5aa65df59d402b5a4bc1873f..2907a339659b00e54fa91fca457e92c1937d5485 100644 (file)
@@ -10,7 +10,7 @@
 #include "assoc.hh"
 #include "lexer.hh"
 #include "debug.hh"
-#include "notename.hh"
+
 #include "source-file.hh"
 #include "parseconstruct.hh"
 
@@ -27,6 +27,7 @@ static Keyword_ent the_key_tab[]={
     "goto", GOTO,
     "in", IN_T,
     "key", KEY,
+    "melodic" , MELODIC,
     "meter", METER,
     "midi", MIDI,
     "mm", MM_T,
@@ -45,7 +46,6 @@ static Keyword_ent the_key_tab[]={
     "stem", STEM,
     "table", TABLE,
     "symboltables", SYMBOLTABLES,
-    "notenames", NOTENAMES,
     "tempo", TEMPO,
     "texid", TEXID,
     "textstyle", TEXTSTYLE,
@@ -58,81 +58,56 @@ static Keyword_ent the_key_tab[]={
     0,0
 };
 
-int
-My_flex_lexer::ret_notename(int *p, String text, int octave_mod)
-{
-    text = text.lower_str();
-    char const* ch_c_l = here_ch_c_l();
-    if ( ch_c_l ) {
-       ch_c_l--;
-       while ( ( *ch_c_l == ' ' )
-               || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
-           ch_c_l--;
-       ch_c_l++;
-    }
-       
-    lookup_notename(p[0], p[1], text);
-    p[2] = octave_mod;
-    mtor << "notename: "<< text <<eol;
-    if (p[0] < 0) {
-
-       errorlevel_i_ |= 1;
-       error( String( "notename does not exist: " ) + YYText(), ch_c_l );
-       p[0] = p[1] = 0;
-    }
-    return NOTENAME;
-}
-
 My_flex_lexer::My_flex_lexer()
 {
-    keytable = new Keyword_table(the_key_tab);
-    the_id_tab = new Assoc<String, Identifier*>;
-    defaulttab = 0;
+    keytable_p_ = new Keyword_table(the_key_tab);
+    identifier_assoc_p_ = new Assoc<String, Identifier*>;
     errorlevel_i_ = 0;
 }
 
 int
 My_flex_lexer::lookup_keyword(String s)
 {
-    return keytable->lookup(s);
+    return keytable_p_->lookup(s);
 }
 
 Identifier*
 My_flex_lexer::lookup_identifier(String s)
 {
-    if (!the_id_tab->elt_query(s))
+    if (!identifier_assoc_p_->elt_query(s))
        return 0;
     
-    return (*the_id_tab)[s];
+    return (*identifier_assoc_p_)[s];
 }
 
 char const*
 My_flex_lexer::here_ch_c_l()
 {
-    return include_stack.top()->sourcefile_l_->ch_c_l() + yyin->tellg();
+    return include_stack_.top()->sourcefile_l_->ch_c_l() + yyin->tellg();
 }
 
 void
 My_flex_lexer::add_identifier(Identifier*i)
 {
     delete lookup_identifier(i->name);
-    (*the_id_tab)[i->name] = i;
+    (*identifier_assoc_p_)[i->name] = i;
 }
 
 My_flex_lexer::~My_flex_lexer()
 {
-    delete keytable;
-    delete defaulttab;
-    for (Assoc_iter<String,Identifier*> ai(*the_id_tab); ai.ok(); ai++) {
+    delete keytable_p_;
+
+    for (Assoc_iter<String,Identifier*>
+            ai(*identifier_assoc_p_); ai.ok(); ai++) {
        mtor << "deleting: " << ai.key()<<'\n';
        delete ai.val();
     }
-    delete the_id_tab;
+    delete identifier_assoc_p_;
 }
 void
 My_flex_lexer::print_declarations()const
 {
-    for (Assoc_iter<String,Identifier*> ai(*the_id_tab); ai.ok(); ai++) {
+    for (Assoc_iter<String,Identifier*> ai(*identifier_assoc_p_); ai.ok(); ai++) {
        ai.val()->print();
     }
 }
@@ -140,13 +115,13 @@ My_flex_lexer::print_declarations()const
 String
 My_flex_lexer::spot()const
 {
-    return include_stack.top()->name +  ": " + String( lineno() );
+    return include_stack_.top()->name +  ": " + String( lineno() );
 }
 
 void
 My_flex_lexer::LexerError(const char *s)
 {
-    if (lexer->include_stack.empty()) {
+    if (lexer->include_stack_.empty()) {
        *mlog << "error at EOF" << s << '\n';
     } else {
        char const* ch_c_l = here_ch_c_l();
@@ -165,14 +140,14 @@ My_flex_lexer::LexerError(const char *s)
 void
 My_flex_lexer::new_input(String s)
 {    
-   if (!include_stack.empty()) {
-       include_stack.top()->line = lineno();
+   if (!include_stack_.empty()) {
+       include_stack_.top()->line = lineno();
             // should this be saved at all?
-       include_stack.top()->defined_ch_c_l_ = defined_ch_c_l;
+       include_stack_.top()->defined_ch_c_l_ = defined_ch_c_l;
    }
 
    Input_file *newin = new Input_file(s);
-   include_stack.push(newin);
+   include_stack_.push(newin);
    switch_streams(newin->is);
 
    yylineno = 1;
@@ -182,12 +157,12 @@ My_flex_lexer::new_input(String s)
 bool
 My_flex_lexer::close_input()
 {
-    Input_file *old = include_stack.pop();
+    Input_file *old = include_stack_.pop();
      bool ok =         true;
-    if (include_stack.empty()) {
+    if (include_stack_.empty()) {
        ok = false;
     } else {
-       Input_file *i = include_stack.top();
+       Input_file *i = include_stack_.top();
        switch_streams(i->is);
        yylineno = i->line;     
        defined_ch_c_l = i->defined_ch_c_l_;
index 496d892e5b872223cb717d22c181a0b527e8e3b1..475e3e08ba0cbd251859c3c631e584a4da9bf3e3 100644 (file)
@@ -6,10 +6,10 @@
 #include "string.hh"
 #include "real.hh"
 #include "debug.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "voice.hh"
-#include "notename.hh"
+
 #include "identparent.hh"
 #include "varray.hh"
 #include "text-def.hh"
@@ -77,30 +77,11 @@ parse_octave (const char *a, int &j, int &oct)
     }
 }
 
-void 
-parse_pitch( const char *a, Melodic_req* mel_l)
-{
-    int j=0;
-
-    // octave
-    mel_l->octave_i_ = default_octave;
-    parse_octave(a,j,mel_l->octave_i_);
-
-    // accidental
-    mel_l->forceacc_b_ = false;
-    
-    if (a[j] == '!'){
-       mel_l->forceacc_b_ = true;
-       j++;
-    }
-}
-
 Voice_element *
-get_note_element(String pitch, int * notename, int * duration )
+get_note_element(Note_req *rq, int * duration )
 {
     Voice_element*v = new Voice_element;
     v->defined_ch_c_l_ = defined_ch_c_l;
-
     
     int dur = duration[0];
     int dots = duration[1];
@@ -115,12 +96,6 @@ get_note_element(String pitch, int * notename, int * duration )
     if ( !defined_ch_c_l )
         defined_ch_c_l = lexer->here_ch_c_l();
 
-    Note_req * rq = new Note_req;
-    rq->notename_i_ =notename[0];
-    rq->accidental_i_ = notename[1];
-    parse_pitch(pitch, rq);
-    rq->octave_i_ += notename[2];
-
     rq->balltype = dur;
     rq->dots = dots;
     rq->plet_factor = Moment(default_plet_dur, default_plet_type);
index 4d0157abe9aa4271b5ee0fcb01c1458cc3517355..fb0c1166c1dd28a7bb7a1cc6905340420b6c00ae 100644 (file)
@@ -5,7 +5,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "molecule.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 
 
index e6d62644b2f12b6adb22342b77d21d8a895ac81f..99abaf605fb04732497273ffa79a45f9f152e749 100644 (file)
@@ -29,6 +29,8 @@ Notename_tab::set(int l, int s, String n)
     notetab[l * 5 + s +2] = n;
 }
 /* *************** */
+
+#if 0
 void
 My_flex_lexer::set(Notename_tab *n)
 {
@@ -45,3 +47,4 @@ My_flex_lexer::lookup_notename(int &large, int &small, String s)
     
     defaulttab->lookup(large, small, s);
 }
+#endif
diff --git a/lily/p-col.cc b/lily/p-col.cc
new file mode 100644 (file)
index 0000000..2bfa097
--- /dev/null
@@ -0,0 +1,121 @@
+#include "p-col.hh"
+#include "p-score.hh"
+#include "p-staff.hh"
+#include "debug.hh"
+
+Interval
+PCol::width() const
+{
+    Interval w;
+
+    for (iter_top(its,i); i.ok(); i++)
+       w.unite(i->width());
+    if (w.empty())
+       w.unite(Interval(0,0));
+    return w;
+}
+
+int
+PCol::rank() const
+{
+    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;
+}
+
+void
+PCol::print() const
+{
+#ifndef NPRINT
+    mtor << "PCol {";
+
+    if (rank() >= 0)
+       mtor << "rank: " << rank() << '\n';
+
+    mtor << "# symbols: " << its.size() ;
+    if (breakable_b()){
+       mtor << "\npre,post: ";
+       prebreak_p_->print();
+       postbreak_p_->print();
+    } else if (daddy_l_) {
+       mtor<<'\n' << ((this == daddy_l_->prebreak_p_) ?
+                      "prebreak" : "postbreak");
+       mtor << '\n';
+    }
+    mtor << "extent: " << width().str() << "\n";
+    mtor << "}\n";
+#endif 
+}
+
+int
+PCol::compare(const PCol &c1, const PCol &c2)
+{
+    PScore*ps_l = c1.pscore_l_;
+    PCursor<PCol*> ac(ps_l->find_col(&c1));
+    PCursor<PCol*> bc(ps_l->find_col(&c2));
+    assert(ac.ok() && bc.ok());
+    return ac - bc;
+}
+
+void
+PCol::OK() const
+{
+#ifndef NDEBUG
+    if (prebreak_p_ || postbreak_p_ ) {
+       assert(prebreak_p_&&postbreak_p_);
+       assert(prebreak_p_->daddy_l_ == this);
+       assert(postbreak_p_->daddy_l_ == this);
+    }
+#endif
+}
+
+void
+PCol::set_breakable()
+{
+    if (breakable_b())
+       return;
+
+    prebreak_p_ = new PCol(this);
+    postbreak_p_ = new PCol(this);
+    prebreak_p_->pscore_l_ = pscore_l_;
+    postbreak_p_->pscore_l_ = pscore_l_;
+}
+
+bool
+PCol::breakable_b() const
+{
+    return prebreak_p_||postbreak_p_;
+}
+
+PCol::PCol(PCol *parent)
+{
+    daddy_l_ = parent;
+    prebreak_p_=0;
+    postbreak_p_=0;
+    line_l_=0;
+    hpos = -1.0;
+    pscore_l_ = 0;
+}
+
+PCol::~PCol()
+{
+    delete prebreak_p_;
+    delete postbreak_p_;       
+}
+
+void
+PCol::add( Item *i)
+{
+    its.bottom().add(i);
+    i->pcol_l_ = this; 
+}
+
+bool
+PCol::used_b()const
+{
+    return breakable_b() || its.size();
+}
diff --git a/lily/p-score.cc b/lily/p-score.cc
new file mode 100644 (file)
index 0000000..582a314
--- /dev/null
@@ -0,0 +1,257 @@
+#include "idealspacing.hh"
+#include "debug.hh"
+#include "lookup.hh"
+#include "spanner.hh"
+#include "paper-def.hh"
+#include "molecule.hh"
+#include "dimen.hh"
+#include "scoreline.hh"
+#include "p-score.hh"
+#include "tex-stream.hh"
+#include "item.hh"
+#include "break.hh"
+
+Idealspacing*
+PScore::get_spacing(PCol*l, PCol*r)
+{
+    assert(l!=r);
+
+    Idealspacing*i_p =new Idealspacing(l,r);
+    suz.bottom().add(i_p);
+
+    return i_p;
+}
+
+
+void
+PScore::clean_cols()
+{
+    for (iter_top(cols,c); c.ok(); )
+       if (!c->used_b()) {
+           delete c.remove_p();
+       } else
+           c++;
+}
+
+
+void
+PScore::add(PStaff *s)
+{
+    assert(s->pscore_l_ == this);
+    staffs.bottom().add(s);
+}
+
+
+void
+PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h)
+{
+    if (!c1 || !c2 )
+       return;
+    Idealspacing*s_l=get_spacing(c1,c2);
+
+    
+    s_l->hooke = h;
+    s_l->space =d;
+}
+
+void
+PScore::connect(PCol* c1, PCol *c2, Real d, Real h)
+{
+    do_connect(c1,c2,d,h);
+    do_connect(c1->postbreak_p_, c2,d,h);
+    do_connect(c1, c2->prebreak_p_,d,h);
+    do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h);
+}
+
+void
+PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
+{
+    assert(c && i && s);
+
+    if (breakstat == 0) {
+       typeset_item(i, c->prebreak_p_, s);
+       return;
+    }
+
+    if (breakstat == 2) {
+       typeset_item(i, c->postbreak_p_, s);
+       return;
+    }
+
+
+    its.bottom().add(i);
+    s->add(i);
+    c->add(i);
+
+    /* first do this, because i->width() may follow the 0-pointer */
+    i->add_processing();    
+}
+
+void
+PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
+{
+    span_p->pstaff_l_ = ps;
+    spanners.bottom().add(span_p);
+    ps->spans.bottom().add(span_p);
+
+    // do not init start/stop fields. These are for broken spans only.
+    span_p->add_processing();
+}
+
+
+void
+PScore::add(PCol *p)
+{
+    p->pscore_l_ = this;
+    if (p->breakable_b()){
+       p->prebreak_p_->pscore_l_ = this;
+       p->postbreak_p_->pscore_l_ = this;
+    }
+    cols.bottom().add(p);
+}
+
+PScore::PScore( Paper_def*p)
+{
+    paper_l_ = p;
+}
+
+void
+PScore::output(Tex_stream &ts)
+{
+    int l=1;
+
+    ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
+    for (iter_top(lines,lic); lic.ok(); lic++) {
+       ts << "% line of score no. " << l++ <<"\n";
+       ts << lic->TeXstring();
+       if ((lic+1).ok())
+           ts << "\\interscoreline\n";
+    }  
+}
+
+
+Array<Item*>
+PScore::select_items(PStaff*ps, PCol*pc)
+{
+    Array<Item*> ret;
+    assert(ps && pc);
+    for (iter_top(pc->its,i); i.ok(); i++){
+       if (i->pstaff_l_ == ps)
+           ret.push((Item*)(const Item*)i);
+    }
+    return ret;
+}
+
+void
+PScore::OK()const
+{
+#ifdef NDEBUG
+    for (iter_top(cols,cc); cc.ok(); cc++)
+       cc->OK();
+    for (iter_top(suz,i); i.ok(); i++)
+       i->OK();
+#endif
+}
+
+void
+PScore::print() const
+{    
+#ifndef NPRINT
+    mtor << "PScore { ";
+    paper_l_->print();
+    mtor << "\ncolumns: ";
+    for (iter_top(cols,cc); cc.ok(); cc++)
+       cc->print();
+    
+    mtor << "\nideals: ";
+    for (iter_top(suz,i); i.ok(); i++)
+       i->print();
+    mtor << "}\n";
+#endif 
+}
+
+void
+PScore::preprocess()
+{
+    for (iter_top(spanners,i); i.ok(); i++) {
+       i->pre_processing();
+    }
+    for (iter_top(its,i); i.ok(); i++){
+       i->pre_processing();
+    }
+}
+
+void
+PScore::postprocess()
+{
+    for (iter_top(broken_spans,i); i.ok(); i++) { // could chase spans as well.
+       i->post_processing();
+    }
+    for (iter_top(its,i); i.ok(); i++){
+       i->post_processing();
+    }
+    
+    for (iter_top(broken_spans,i); i.ok(); i++) {
+       i->molecule_processing();
+    }
+    for (iter_top(its,i); i.ok(); i++){
+       i->molecule_processing();
+    }
+
+    for (iter_top(lines,i); i.ok(); i++)
+       i->process();
+
+}
+
+PCursor<PCol *>
+PScore::find_col(const PCol *c)const
+{
+    const PCol*what = c;
+    if (what->daddy_l_ )
+       what = what->daddy_l_;
+    
+    return cols.find((PCol*)what);
+}
+
+void
+PScore::add_broken(Spanner*s)
+{
+    assert(s->left->line_l_ == s->right->line_l_);
+    broken_spans.bottom().add(s);
+    s->left->starters.bottom().add (s);
+    s->right->stoppers.bottom().add (s);
+}
+
+void
+PScore::set_breaking(Array<Col_hpositions> breaking)
+{
+    for (int j=0; j < breaking.size(); j++) {
+       Array<PCol*> &curline(breaking[j].cols);
+       Array<Real> &config(breaking[j].config);
+       
+       Line_of_score *s_p = new Line_of_score(curline,this);
+       lines.bottom().add(s_p);        
+       for (int i=0; i < curline.size(); i++){
+           curline[i]->hpos = config[i];
+       }
+    }
+}
+
+void
+PScore::calc_breaking()
+{
+    Word_wrap w(*this);
+    set_breaking(w.solve());
+}
+
+void
+PScore::process()
+{
+    clean_cols();
+    *mlog << "Preprocessing ... " <<flush;
+    preprocess();
+    *mlog << "\nCalculating column positions ... " <<flush;
+    calc_breaking();
+    *mlog << "\nPostprocessing ..." << endl;
+    postprocess();
+}
diff --git a/lily/p-staff.cc b/lily/p-staff.cc
new file mode 100644 (file)
index 0000000..f8ba2bb
--- /dev/null
@@ -0,0 +1,14 @@
+#include "p-staff.hh"
+#include "molecule.hh"
+
+PStaff::PStaff(PScore*ps)
+{
+    pscore_l_=ps;
+}
+
+void
+PStaff::add(Item *i)
+{
+    its.bottom().add(i);
+    i->pstaff_l_ = this;
+}
index ebec63fbefe15feddea069cc597865d552392508..bc8876b5e4baea49dffa2119309e314708b9dbd9 100644 (file)
@@ -13,8 +13,8 @@
 #include "parseconstruct.hh"
 #include "dimen.hh"
 #include "identifier.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
 #include "voice-element.hh"
 
 #ifndef NDEBUG
@@ -32,90 +32,127 @@ int fatal_error_i = 0;
 
 
 %union {
-    Request * request;
-    Real real;
-    Identifier *id;    
-   Voice *voice;    
-    Voice_element *el; 
-    String *string;
-    const char *consstr;
-    Paper_def *paper;
-    Midi_def* midi;
-    Input_music *music;
-    Music_general_chord *chord;
-    Music_voice *mvoice; 
-    int i;
-    char c;
-    int ii[10];
-       Moment *moment;
-
+    Array<Melodic_req*> *melreqvec;
     Array<String> * strvec;
     Array<int> *intvec;
-    Array<Melodic_req*> *melreqvec;
-    Input_staff *staff;    
+    Box *box;
+    Identifier *id;    
+    Input_music *music;
     Input_score *score;
-    Symtables * symtables;
-    Symtable * symtable;
-    Symbol * symbol;
-    Lookup*lookup;
+    Input_staff *staff;    
     Interval *interval;
-    Box *box;
-    Notename_tab *notename_tab;
+    Lookup*lookup;
+    Melodic_req * melreq;
+    Midi_def* midi;
+    Moment *moment;
+    Music_general_chord *chord;
+    Music_voice *mvoice;
+    Note_req *notereq;
+    Paper_def *paper;
+    Real real;
+    Request * request;
     Script_def * script;
+    String *string;
+    Symbol * symbol;
+    Symtable * symtable;
+    Symtables * symtables;
     Text_def * textdef;
+    Voice *voice;    
+    Voice_element *el; 
+    char c;
+    const char *consstr;
+    int i;
+    int ii[10];
 }
 
-%token VOICE STAFF SCORE TITLE  BAR  OUTPUT MULTIVOICE DYNAMIC
-%token CM_T IN_T PT_T MM_T PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
-%token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
-%token KEY CLEF  TABLE  VOICES STEM
-%token PARTIAL MUSIC GROUPING CADENZA
-%token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
-%token  GOTO
-%token MIDI TEMPO
-
-%token <id>  IDENTIFIER REAL_IDENTIFIER REQUEST_IDENTIFIER 
-%token <string> PITCHMOD DURATION RESTNAME
-%token <ii> NOTENAME 
-%token <real> REAL 
-%token <string> STRING
-
-%token <i> DOTS INT
-%type <real> unit
-%type <melreqvec> pitch_list 
-%type <c> open_request_parens close_request_parens close_plet_parens
-%type <id> declaration
-%type <string> declarable_identifier
-%type <paper> paper_block paper_body
-%type <midi> midi_block midi_body
-%type <real> dim real
-%type <ii>  default_duration explicit_duration notemode_duration mudela_duration
-%type <ii> notename
-%type <moment> duration_length
-%type <el> voice_elt full_element lyrics_elt command_elt
-
-%type <score> score_block score_body
-%type <staff> staff_block staff_init staff_body
-%type <i> int
-%type <intvec> intastint_list
-%type <request> post_request pre_request command_req 
-%type <string> pitchmod
-%type <music> music 
-%type <chord> music_chord music_chord_body
-
-%type <mvoice>  music_voice_body music_voice 
-
-%type <interval> dinterval
-%type <box> box
-%type <symtable> symtable symtable_body
-%type <lookup> symtables symtables_body
-%type <symbol> symboldef
-%type <notename_tab> notename_tab notename_tab_body
-%type <i> script_dir
-%type <script> script_definition script_body mudela_script
-%type <request> script_req textscript_req dynamic_req basic_request
-%type <textdef> mudela_text
-
+%token BAR
+%token CADENZA
+%token CLEF
+%token CM_T
+%token COMMAND
+%token COMMANDS
+%token DURATIONCOMMAND
+%token DYNAMIC
+%token END
+%token GEOMETRIC
+%token GOTO
+%token GROUPING
+%token IN_T
+%token KEY
+%token MELODIC
+%token METER
+%token MIDI
+%token MM_T
+%token MULTIVOICE
+%token MUSIC
+%token OCTAVECOMMAND
+%token OUTPUT
+%token PAPER
+%token PARTIAL
+%token PLET
+%token PT_T
+%token SCORE
+%token SCRIPT
+%token SKIP
+%token STAFF
+%token START_T
+%token STEM
+%token SYMBOLTABLES
+%token TABLE
+%token TABLE
+%token TEMPO
+%token TEXID
+%token TEXTSTYLE
+%token TITLE
+%token UNITSPACE
+%token VOICE
+%token VOICES
+%token WIDTH
+
+%token <i>     DOTS
+%token <i>     INT
+%token <id>    IDENTIFIER
+%token <id>    MELODIC_REQUEST_IDENTIFIER 
+%token <id>    POST_REQUEST_IDENTIFIER
+%token <id>    REAL_IDENTIFIER
+%token <id>    REQUEST_IDENTIFIER
+%token <real>  REAL 
+%token <string>        DURATION RESTNAME
+%token <string>        STRING
+
+%type <box>    box
+%type <c>      open_request_parens close_request_parens close_plet_parens
+%type <chord>  music_chord music_chord_body
+%type <el>     voice_elt full_element lyrics_elt command_elt
+%type <i>      int
+%type <i>      octave_quotes octave_quote
+%type <i>      script_dir
+%type <id>     declaration
+%type <ii>     default_duration explicit_duration notemode_duration
+%type <ii>     mudela_duration
+%type <interval>       dinterval
+%type <intvec> intastint_list
+%type <lookup> symtables symtables_body
+%type <melreq> melodic_request
+%type <notereq>        steno_note_req
+%type <melreqvec>      pitch_list 
+%type <midi>   midi_block midi_body
+%type <moment> duration_length
+%type <music>  music 
+%type <mvoice>  music_voice_body music_voice 
+
+%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>        script_req textscript_req dynamic_req 
+%type <score>  score_block score_body
+%type <script> script_definition script_body mudela_script
+%type <staff>  staff_block staff_init staff_body
+%type <string> declarable_identifier
+%type <symbol> symboldef
+%type <symtable>       symtable symtable_body
+%type <textdef>        mudela_text
 
 %%
 
@@ -124,12 +161,8 @@ mudela:    /* empty */
                add_score($2);          
        }
        | mudela add_declaration { }
-       | mudela mudela_command  {}
        ;
 
-mudela_command:
-       notename_tab                    { lexer->set($1); }
-       ;
 
 /*
        DECLARATIONS
@@ -140,7 +173,11 @@ add_declaration: declaration       {
        ;
 
 declarable_identifier:
-       STRING { $$ = $1; }
+       STRING { $$ = $1;
+          if (lexer->lookup_identifier(*$1))
+               warning("redeclaration of `" + *$1 + "'",
+                       lexer->here_ch_c_l());
+       }
        | IDENTIFIER { $$ = new String($1->name); }
        ;
 
@@ -165,10 +202,6 @@ declaration:
                $$ = new Lookup_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' notename_tab {
-               $$ = new Notetab_id(*$1, $3, IDENTIFIER);
-               delete $1;
-       }
        | declarable_identifier '=' real        {
                $$ = new Real_id(*$1, new Real($3), REAL_IDENTIFIER);
                delete $1;
@@ -176,28 +209,17 @@ declaration:
        | declarable_identifier error '}' {
 
        }
-       | declarable_identifier '=' basic_request {
-               $$ = new Request_id(*$1, $3, REQUEST_IDENTIFIER);
+       | declarable_identifier '=' pure_post_request {
+               $$ = new Request_id(*$1, $3, POST_REQUEST_IDENTIFIER);
                delete $1;
        }
-       ;
-
-notename_tab:
-       NOTENAMES '{' notename_tab_body '}'     { $$ = $3; }
-       ;
-
-notename_tab_body:                             {
-               $$ = new Notename_tab;
-       }
-       | IDENTIFIER                            {
-               $$ = $1->notename_tab(true);
-       }
-       | notename_tab_body STRING int int                      {
-               $$->set($3, $4, *$2);
-               delete $2;
+       | declarable_identifier '=' melodic_request {
+               $$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER);
+               delete $1;
        }
        ;
 
+
 /*
        SCORE
 */
@@ -212,6 +234,11 @@ score_block:
                /* handle error levels. */
                $$->errorlevel_i_ = lexer->errorlevel_i_;
                lexer->errorlevel_i_ = 0;
+
+               /* unbarf score without global music. */
+               if (!$$-> score_wide_music_p_) {
+                       $$-> score_wide_music_p_ = new Music_voice; 
+               }
        }
        ;
 
@@ -305,6 +332,9 @@ staff_init:
                $$ = new Input_staff(*$1);
                delete $1;
        }
+       | MELODIC {
+               $$ = new Input_staff("melodic");
+       }
        ;
 
 staff_body:
@@ -379,12 +409,6 @@ music_chord_body:
        }
        ;
 
-basic_request:
-       command_req
-       | pre_request
-       | post_request
-       ;
-
 /*
        VOICE ELEMENTS
 */
@@ -425,6 +449,10 @@ command_req:
        | METER '{' int '*' int '}'     {
                Meter_change_req *m = new Meter_change_req;
                m->set($3,$5);
+               // sorry hw, i need meter at output of track,
+               // but don-t know where to get it... statics should go.
+               Midi_def::num_i_s = $3;
+               Midi_def::den_i_s = $5;
                $$ = m;
        }
        | SKIP '{' duration_length '}' {
@@ -474,14 +502,57 @@ post_requests:
        ;
 
 post_request:
+       pure_post_request
+       | POST_REQUEST_IDENTIFIER       {
+               $$ = $1->request(false)->clone();
+       }
+       ;
+
+pure_post_request:
        close_request_parens    { 
                $$ = get_request($1); 
        }
        | script_req
        | textscript_req
        | dynamic_req
-       | REQUEST_IDENTIFIER    {
-               $$ = $1->request(false)->clone();
+       ;
+
+
+octave_quote:
+       '\''            { $$ = 1; }
+       | '`'           { $$ = -1; }
+       ;
+
+octave_quotes:
+       /**/ { $$ = 0; }
+       | octave_quotes octave_quote{ $$ += $2; }
+       ;
+
+/*
+       URG!!
+*/
+steno_note_req:
+       MELODIC_REQUEST_IDENTIFIER      {
+               $$ = new Note_req;
+               * (Melodic_req *) $$ = *$1->request(false)->melodic();
+       }
+       | octave_quote steno_note_req   {  
+               $2-> octave_i_ += $1;
+               $$ = $2; //ugh!!
+       }
+       | '!' steno_note_req            {
+               $$ = $2;
+               $2->forceacc_b_ = ! $2->forceacc_b_;
+       } 
+       ;
+
+melodic_request:
+       MELODIC '{' int int int int '}' {/* ugh */
+               $$ = new Melodic_req;
+               $$->octave_i_ = $3;
+               $$->notename_i_ = $4;
+               $$->accidental_i_ = $5;
+               $$->forceacc_b_ = $6;
        }
        ;
 
@@ -599,9 +670,8 @@ voice_command:
        | DURATIONCOMMAND '{' notemode_duration '}'     {
                set_default_duration($3);
        }
-       | OCTAVECOMMAND '{' pitchmod '}'        {
-               set_default_octave(*$3);
-               delete $3;
+       | OCTAVECOMMAND '{' octave_quotes '}'   {
+               set_default_octave($3);
        }
        | TEXTSTYLE STRING      {
                set_text_style(*$2);
@@ -660,34 +730,19 @@ explicit_duration:
        ;
 
 default_duration:
-       {
+       /* empty */     {
                get_default_duration($$);
        }
        ;
 
-pitchmod:              { 
-               defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = new String; 
-       }
-       | PITCHMOD      { 
-               defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = $1;
-       }
-       ;
-
-notename:
-       NOTENAME
-       ;
 
 voice_elt:
-       pitchmod notename notemode_duration                     {
-               $$ = get_note_element(*$1, $2, $3);
-               delete $1;
+       steno_note_req notemode_duration                {
+               $$ = get_note_element($1, $2);
        }
        | RESTNAME notemode_duration            {
                $$ = get_rest_element(*$1, $2);
                delete $1;
-
        }
        ;
 
@@ -702,11 +757,8 @@ lyrics_elt:
 pitch_list:                    {
                $$ = new Array<Melodic_req*>;
        }
-       | pitch_list NOTENAME   {
-               Melodic_req *m_p = new Melodic_req;
-               m_p->notename_i_ = $2[0];
-               m_p->accidental_i_ = $2[1];
-               $$->push(m_p);
+       | pitch_list MELODIC_REQUEST_IDENTIFIER {
+               $$->push($2->request(false)->clone()->melodic());
        }
        ;
 
@@ -823,7 +875,7 @@ parse_file(String init, String s)
    *mlog << "Parsing ... ";
    lexer = new My_flex_lexer;
 
-#ifdef YYDEBUG
+#ifndef NPRINT
    yydebug = !monitor->silence("InitParser") && check_debug;
    lexer->set_debug( !monitor->silence("InitLexer") && check_debug);
 #endif
@@ -831,13 +883,20 @@ parse_file(String init, String s)
    lexer->new_input(init);
    yyparse();
 
-#ifdef YYDEBUG
+#ifndef NPRINT
+   if (!monitor->silence("InitDeclarations") && check_debug)
+       lexer->print_declarations();
+
    yydebug = !monitor->silence("Parser") && check_debug;
    lexer->set_debug( !monitor->silence("Lexer") && check_debug);
 #endif
 
    lexer->new_input(s);
    yyparse();
+#ifdef NPRINT
+   if (!monitor->silence("Declarations") && check_debug)
+       lexer->print_declarations();
+#endif
    delete lexer;
    lexer = 0;
 
diff --git a/lily/pcol.cc b/lily/pcol.cc
deleted file mode 100644 (file)
index 4f1b65d..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#include "pcol.hh"
-#include "pscore.hh"
-#include "pstaff.hh"
-#include "debug.hh"
-
-Interval
-PCol::width() const
-{
-    Interval w;
-
-    for (iter_top(its,i); i.ok(); i++)
-       w.unite(i->width());
-    if (w.empty())
-       w.unite(Interval(0,0));
-    return w;
-}
-
-int
-PCol::rank() const
-{
-    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;
-}
-
-void
-PCol::print() const
-{
-#ifndef NPRINT
-    mtor << "PCol {";
-
-    if (rank() >= 0)
-       mtor << "rank: " << rank() << '\n';
-
-    mtor << "# symbols: " << its.size() ;
-    if (breakable_b()){
-       mtor << "\npre,post: ";
-       prebreak_p_->print();
-       postbreak_p_->print();
-    } else if (daddy_l_) {
-       mtor<<'\n' << ((this == daddy_l_->prebreak_p_) ?
-                      "prebreak" : "postbreak");
-       mtor << '\n';
-    }
-    mtor << "extent: " << width().str() << "\n";
-    mtor << "}\n";
-#endif 
-}
-
-int
-PCol::compare(const PCol &c1, const PCol &c2)
-{
-    PScore*ps_l = c1.pscore_l_;
-    PCursor<PCol*> ac(ps_l->find_col(&c1));
-    PCursor<PCol*> bc(ps_l->find_col(&c2));
-    assert(ac.ok() && bc.ok());
-    return ac - bc;
-}
-
-void
-PCol::OK() const
-{
-#ifndef NDEBUG
-    if (prebreak_p_ || postbreak_p_ ) {
-       assert(prebreak_p_&&postbreak_p_);
-       assert(prebreak_p_->daddy_l_ == this);
-       assert(postbreak_p_->daddy_l_ == this);
-    }
-#endif
-}
-
-void
-PCol::set_breakable()
-{
-    if (breakable_b())
-       return;
-
-    prebreak_p_ = new PCol(this);
-    postbreak_p_ = new PCol(this);
-    prebreak_p_->pscore_l_ = pscore_l_;
-    postbreak_p_->pscore_l_ = pscore_l_;
-}
-
-bool
-PCol::breakable_b() const
-{
-    return prebreak_p_||postbreak_p_;
-}
-
-PCol::PCol(PCol *parent)
-{
-    daddy_l_ = parent;
-    prebreak_p_=0;
-    postbreak_p_=0;
-    line_l_=0;
-    hpos = -1.0;
-    pscore_l_ = 0;
-}
-
-PCol::~PCol()
-{
-    delete prebreak_p_;
-    delete postbreak_p_;       
-}
-
-void
-PCol::add( Item *i)
-{
-    its.bottom().add(i);
-    i->pcol_l_ = this; 
-}
-
-bool
-PCol::used_b()const
-{
-    return breakable_b() || its.size();
-}
diff --git a/lily/pscore.cc b/lily/pscore.cc
deleted file mode 100644 (file)
index 989a0f9..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-#include "idealspacing.hh"
-#include "debug.hh"
-#include "lookup.hh"
-#include "spanner.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "dimen.hh"
-#include "scoreline.hh"
-#include "pscore.hh"
-#include "tex-stream.hh"
-#include "item.hh"
-#include "break.hh"
-
-Idealspacing*
-PScore::get_spacing(PCol*l, PCol*r)
-{
-    assert(l!=r);
-
-    Idealspacing*i_p =new Idealspacing(l,r);
-    suz.bottom().add(i_p);
-
-    return i_p;
-}
-
-
-void
-PScore::clean_cols()
-{
-    for (iter_top(cols,c); c.ok(); )
-       if (!c->used_b()) {
-           delete c.remove_p();
-       } else
-           c++;
-}
-
-
-void
-PScore::add(PStaff *s)
-{
-    assert(s->pscore_l_ == this);
-    staffs.bottom().add(s);
-}
-
-
-void
-PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h)
-{
-    if (!c1 || !c2 )
-       return;
-    Idealspacing*s_l=get_spacing(c1,c2);
-
-    
-    s_l->hooke = h;
-    s_l->space =d;
-}
-
-void
-PScore::connect(PCol* c1, PCol *c2, Real d, Real h)
-{
-    do_connect(c1,c2,d,h);
-    do_connect(c1->postbreak_p_, c2,d,h);
-    do_connect(c1, c2->prebreak_p_,d,h);
-    do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h);
-}
-
-void
-PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
-{
-    assert(c && i && s);
-
-    if (breakstat == 0) {
-       typeset_item(i, c->prebreak_p_, s);
-       return;
-    }
-
-    if (breakstat == 2) {
-       typeset_item(i, c->postbreak_p_, s);
-       return;
-    }
-
-
-    its.bottom().add(i);
-    s->add(i);
-    c->add(i);
-
-    /* first do this, because i->width() may follow the 0-pointer */
-    i->add_processing();    
-}
-
-void
-PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
-{
-    span_p->pstaff_l_ = ps;
-    spanners.bottom().add(span_p);
-    ps->spans.bottom().add(span_p);
-
-    // do not init start/stop fields. These are for broken spans only.
-    span_p->add_processing();
-}
-
-
-void
-PScore::add(PCol *p)
-{
-    p->pscore_l_ = this;
-    if (p->breakable_b()){
-       p->prebreak_p_->pscore_l_ = this;
-       p->postbreak_p_->pscore_l_ = this;
-    }
-    cols.bottom().add(p);
-}
-
-PScore::PScore( Paper_def*p)
-{
-    paper_l_ = p;
-}
-
-void
-PScore::output(Tex_stream &ts)
-{
-    int l=1;
-
-    ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
-    for (iter_top(lines,lic); lic.ok(); lic++) {
-       ts << "% line of score no. " << l++ <<"\n";
-       ts << lic->TeXstring();
-       if ((lic+1).ok())
-           ts << "\\interscoreline\n";
-    }  
-}
-
-
-Array<Item*>
-PScore::select_items(PStaff*ps, PCol*pc)
-{
-    Array<Item*> ret;
-    assert(ps && pc);
-    for (iter_top(pc->its,i); i.ok(); i++){
-       if (i->pstaff_l_ == ps)
-           ret.push((Item*)(const Item*)i);
-    }
-    return ret;
-}
-
-void
-PScore::OK()const
-{
-#ifdef NDEBUG
-    for (iter_top(cols,cc); cc.ok(); cc++)
-       cc->OK();
-    for (iter_top(suz,i); i.ok(); i++)
-       i->OK();
-#endif
-}
-
-void
-PScore::print() const
-{    
-#ifndef NPRINT
-    mtor << "PScore { ";
-    paper_l_->print();
-    mtor << "\ncolumns: ";
-    for (iter_top(cols,cc); cc.ok(); cc++)
-       cc->print();
-    
-    mtor << "\nideals: ";
-    for (iter_top(suz,i); i.ok(); i++)
-       i->print();
-    mtor << "}\n";
-#endif 
-}
-
-void
-PScore::preprocess()
-{
-    for (iter_top(spanners,i); i.ok(); i++) {
-       i->pre_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->pre_processing();
-    }
-}
-
-void
-PScore::postprocess()
-{
-    for (iter_top(broken_spans,i); i.ok(); i++) { // could chase spans as well.
-       i->post_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->post_processing();
-    }
-    
-    for (iter_top(broken_spans,i); i.ok(); i++) {
-       i->molecule_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->molecule_processing();
-    }
-
-    for (iter_top(lines,i); i.ok(); i++)
-       i->process();
-
-}
-
-PCursor<PCol *>
-PScore::find_col(const PCol *c)const
-{
-    const PCol*what = c;
-    if (what->daddy_l_ )
-       what = what->daddy_l_;
-    
-    return cols.find((PCol*)what);
-}
-
-void
-PScore::add_broken(Spanner*s)
-{
-    assert(s->left->line_l_ == s->right->line_l_);
-    broken_spans.bottom().add(s);
-    s->left->starters.bottom().add (s);
-    s->right->stoppers.bottom().add (s);
-}
-
-void
-PScore::set_breaking(Array<Col_hpositions> breaking)
-{
-    for (int j=0; j < breaking.size(); j++) {
-       Array<PCol*> &curline(breaking[j].cols);
-       Array<Real> &config(breaking[j].config);
-       
-       Line_of_score *s_p = new Line_of_score(curline,this);
-       lines.bottom().add(s_p);        
-       for (int i=0; i < curline.size(); i++){
-           curline[i]->hpos = config[i];
-       }
-    }
-}
-
-void
-PScore::calc_breaking()
-{
-    Word_wrap w(*this);
-    set_breaking(w.solve());
-}
-
-void
-PScore::process()
-{
-    clean_cols();
-    *mlog << "Preprocessing ... " <<flush;
-    preprocess();
-    *mlog << "\nCalculating column positions ... " <<flush;
-    calc_breaking();
-    *mlog << "\nPostprocessing ..." << endl;
-    postprocess();
-}
diff --git a/lily/pstaff.cc b/lily/pstaff.cc
deleted file mode 100644 (file)
index ce7f7b0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "pstaff.hh"
-#include "molecule.hh"
-
-PStaff::PStaff(PScore*ps)
-{
-    pscore_l_=ps;
-}
-
-void
-PStaff::add(Item *i)
-{
-    its.bottom().add(i);
-    i->pstaff_l_ = this;
-}
index 126507cc6b9ecbfaea032b88060490986c934b7d..dfaa3ce05b57bec7de44559aaa2ce2bfb3ead363 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "voice.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "register.hh"
 #include "notehead.hh"
 #include "complex-walker.hh"
diff --git a/lily/request.cc b/lily/request.cc
deleted file mode 100644 (file)
index d6bae87..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
-  request.cc -- implement all musical requests.
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "musicalrequest.hh"
-#include "misc.hh"
-#include "debug.hh"
-#include "script-def.hh"
-#include "text-def.hh"
-#include "voice.hh"
-#include "voice-element.hh"
-
-void
-Stem_req::do_print() const
-{
-    Rhythmic_req::do_print();
-    mtor << "dir : " << dir_i_;
-}
-
-Stem_req::Stem_req(int s, int d)
-    : Rhythmic_req(s,d)
-{
-    dir_i_ = 0;
-}
-
-/* ************** */
-void Musical_req::do_print()const{}
-void Request::do_print() const{}
-
-/* *************** */
-
-void
-Request::print() const
-{
-    mtor << name() << " {";
-    do_print();
-    mtor << "}\n";
-}
-     
-
-
-void
-Span_req::do_print() const    
-{
-#ifndef NPRINT
-    mtor  << spantype ;
-#endif
-}
-
-Request::Request()
-{
-    elt_l_ = 0;
-    defined_ch_c_l_ = 0;
-}
-Request::Request(Request const&src)
-{
-    elt_l_ = 0;
-    defined_ch_c_l_ = src.defined_ch_c_l_;
-}
-/* *************** */
-Spacing_req::Spacing_req()
-{
-    next = 0;
-    distance = 0;
-    strength = 0;
-}
-void
-Spacing_req::do_print()const
-{
-#ifndef NPRINT
-    mtor << "next " << next << "dist " << distance << "strength\n";
-#endif
-}
-
-void
-Blank_req::do_print()const
-{
-    Spacing_req::do_print();
-}
-/* *************** */
-Melodic_req::Melodic_req()
-{
-    notename_i_ = 0;
-    octave_i_ = 0;
-    accidental_i_ = 0;
-    forceacc_b_ = false;
-}
-
-void
-Melodic_req::do_print() const
-{
-    mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
-}
-
-int
-Melodic_req::height() const
-{
-    return  notename_i_ + octave_i_*7;
-}
-
-/*
- should be settable from input to allow "viola"-mode
- */
-static Byte pitch_byte_a[ 7 ] = { 0, 2, 4, 5, 7, 9, 11 };      
-
-int
-Melodic_req::pitch() const
-{
-    return  pitch_byte_a[ notename_i_ % 7 ] + accidental_i_ + octave_i_ * 12;
-}
-
-Plet_req::Plet_req()
-{
-    type_c_ = ']';
-    dur_i_ = 1;
-    type_i_ = 1;
-}
-
-void
-Plet_req::do_print() const
-{
-    mtor << "plet: " << type_c_ << ": " << dur_i_ << "/" << type_i_;
-}
-
-/* *************** */
-int
-Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
-{
-    return sign(r1.duration() - r2.duration());
-}
-Rhythmic_req::Rhythmic_req(int b, int d)
-{
-    plet_factor = 1;
-    balltype = b;
-    dots = d;
-}
-
-Rhythmic_req::Rhythmic_req()
-{
-    plet_factor = 1;
-    balltype = 1;
-    dots = 0;
-}
-
-void
-Rhythmic_req::do_print() const
-{
-    mtor << "ball: " << balltype ;
-    int d =dots;
-    while (d--)
-       mtor << '.';
-    
-    mtor<<", plet factor"<<plet_factor<<"\n";
-}
-
-
-Moment
-Rhythmic_req::duration() const {    
-    return wholes(balltype,dots)*plet_factor;
-}
-/* *************** */
-
-Lyric_req::Lyric_req(Text_def* def_p)
-    :Text_req(0, def_p)
-{
-    def_p->align_i_ = 0;       // centre
-    dir_i_ = -1;               // lyrics below (invisible) staff
-}
-
-void
-Lyric_req::do_print() const
-{    
-    Rhythmic_req::do_print();
-    Text_req::do_print();
-}
-/* *************** */
-void
-Note_req::do_print() const
-{
-    Melodic_req::do_print();
-    Rhythmic_req::do_print();
-}
-/* *************** */
-void
-Rest_req::do_print() const
-{
-        Rhythmic_req::do_print();
-}
-
-/* *************** */
-Beam_req::Beam_req()
-{
-    nplet = 0;
-}
-
-void Beam_req::do_print()const{}
-/* *************** */
-void Slur_req::do_print()const{}
-/* *************** */
-int
-Span_req:: compare(const Span_req &r1, const Span_req &r2)
-{
-     return r1.spantype - r2.spantype;
-}
-
-Span_req::Span_req()
-{
-    spantype = NOSPAN;
-}
-
-/* *************** */
-Script_req::Script_req(int d , Script_def*def)
-{
-    dir_i_ = d;
-    scriptdef_p_ = def;
-}
-
-int
-Script_req::compare(const Script_req &d1, const Script_req &d2)
-{
-    return d1.dir_i_ == d2.dir_i_ &&
-       d1.scriptdef_p_->compare(*d2.scriptdef_p_);
-}
-
-Script_req::Script_req(Script_req const &s)
-    : Request( s )
-{
-    dir_i_ = s.dir_i_;
-    scriptdef_p_ = new Script_def(*s.scriptdef_p_);
-}
-
-void
-Script_req::do_print() const
-{
-    mtor << " dir " << dir_i_ ;
-    scriptdef_p_->print();
-}
-
-
-Script_req::~Script_req()
-{
-    delete scriptdef_p_;
-}
-/* *************** */
-int
-Text_req:: compare(const Text_req &r1, const Text_req &r2)
-{
-    bool b1 = (r1.dir_i_ == r2.dir_i_);
-    bool b2 = (r1.tdef_p_ ->compare(*r2.tdef_p_));
-    return b1 && b2;
-}
-Text_req::~Text_req()
-{
-    delete tdef_p_;
-    tdef_p_ = 0;
-}
-
-Text_req::Text_req(Text_req const& src)
-{
-    tdef_p_ = new Text_def(*src.tdef_p_);
-    dir_i_ = src.dir_i_;
-}
-
-Text_req::Text_req(int dir_i, Text_def* tdef_p)        
-{
-    dir_i_ = dir_i;
-    tdef_p_ = tdef_p;
-}
-
-void
-Text_req::do_print() const
-{
-    mtor << " dir " << dir_i_ ;
-    tdef_p_->print();
-}
-
-/* *************** */
-
-Moment
-Skip_req::duration() const
-{
-    return duration_;
-}
-
-void
-Skip_req::do_print() const
-{
-    mtor << "duration: " << duration();
-}
-
-Voice *
-Request::voice_l()
-{
-    if (!elt_l_)
-       return 0;
-    else
-       return (Voice*)elt_l_->voice_l_;
-}
-/* *************** */
-
-void
-Subtle_req::do_print() const
-{
-    mtor << " subtime " <<  subtime_;
-}
-
-void
-Dynamic_req::do_print() const
-{
-    Subtle_req::do_print();
-}
-
-void
-Absolute_dynamic_req::do_print() const
-{
-    Dynamic_req::do_print();
-    mtor << " loudness_" <<loudness_;
-}
-
-String
-Dynamic_req::loudness_str(Loudness l) 
-{
-    switch (l) {
-    case FFF: return "fff";
-    case FF: return "ff";
-    case F: return "f";
-    case MF: return "mf";
-    case MP: return "mp";
-    case P: return "p";
-    case PP: return "pp";
-    case PPP: return "ppp";
-    }
-    assert(false);
-    return "";
-}
-
-Absolute_dynamic_req::Absolute_dynamic_req()
-{
-    loudness_ = MF;
-}
index 4387630e8da88cbc955a2c81f1961fe1a1a16558..3a699e5dc507b7307a663f8182b3db58be5041ef 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "debug.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "score-column.hh"
 
 int
index 88e2e2f07b00770f00f303f10bf81b784a479fcb..cb764b2f7a014ca395e1c82eb2c23cdf3ff64f45 100644 (file)
@@ -8,7 +8,7 @@
 #include "tex-stream.hh"
 #include "score.hh"
 #include "score-column.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "staff.hh"
 #include "debug.hh"
 #include "paper-def.hh"
index 2f8f0f3a4b398b81ad093aa3226650e8700134fc..65c6546b5a27f77bc4ca0dbedb5b4b7ace82b332 100644 (file)
@@ -4,8 +4,8 @@
 #include "spanner.hh"
 #include "symbol.hh"
 #include "paper-def.hh"
-#include "pcol.hh"
-#include "pscore.hh"
+#include "p-col.hh"
+#include "p-score.hh"
 
 
 String
index 6cfba0f397b41fafd158b57419b21b569263cc06..7ba3212e9216fdfe927e5cf58e1443adb64624dd 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "script-reg.hh"
 #include "script.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "complex-walker.hh"
 #include "stem.hh"
 
index 1bcbd518a8eeb899f6b562d1502d3ab285eac778..46c253588012d03c28ba660271eba8801de00602 100644 (file)
@@ -1,4 +1,4 @@
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "script.hh"
 #include "stem.hh"
index f2b7113ca0cc277ca86647192ecdff15bd8f469b..34bffee73d162c8af81999099d7df9e9b52ad944 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "proto.hh"
 #include "plist.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "complex-walker.hh"
 #include "slur-reg.hh"
 #include "slur.hh"
index 29623c0d0cade9e7d3b3f19415fa7b53a7d44097..1d9bceade8f968b133cb2cd4634a0c6bf0b48921 100644 (file)
@@ -8,7 +8,7 @@
 #include "lookup.hh"
 #include "paper-def.hh"
 #include "notehead.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "molecule.hh"
 #include "debug.hh"
 #include "boxes.hh"
index cc57686393455e9fe4f1cad6196b2315586b2551..d89301bc1086e89b5b5b5e093ddc7ff5ec3e3d6d 100644 (file)
@@ -1,6 +1,6 @@
 #include "debug.hh"
 #include "spanner.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 
 
 
index 87ceab5ebff78c716b66b475f9d33f0296031fb2..baca3a0a98f3cfb8e99cbbbda0e9573d610cf83d 100644 (file)
 #include "time-description.hh"
 #include "score-column.hh"
 #include "staff-column.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
 #include "interval.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "item.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "voice-element.hh"
 #include "pqueue.hh"
 
index b24172fa63df4570c1d370a41a40cc297e3fd43b..0524f08b328b41c6d071483ae56d1f3e06a710da 100644 (file)
@@ -1,6 +1,6 @@
-#include "pscore.hh"
+#include "p-score.hh"
 #include "symbol.hh"
-#include "pstaff.hh"
+#include "p-staff.hh"
 #include "molecule.hh"
 #include "staff-elem.hh"
 #include "debug.hh"
index 74c18f3b18f274fb27dcc8e94cd16cb160f61ef2..9a817f0190e6b7ae8b53fe48ff0c5e62640d5f5f 100644 (file)
 #include "plist.hh"
 #include "grouping.hh"
 #include "staff.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "staff-walker.hh"
 #include "staff-column.hh"
 #include "score-column.hh"
 #include "debug.hh"
 #include "time-description.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "grouping.hh"
 #include "score-walker.hh"
 
index 71fa8a813fa873f744b8005c019dfd24151c8ad0..31cba7801f99e39c19b87fa420f69684bae4638b 100644 (file)
@@ -19,8 +19,8 @@
 #include "score-column.hh"
 #include "voice-element.hh"
 #include "debug.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh" // todo
+#include "musical-request.hh"
+#include "command-request.hh" // todo
 #include "midi-stream.hh"
 #include "pqueue.hh"
 void
index 5d18b219e6c708e9e81edf20443cae0940a7f8f9..a0ac8a6f99d27aba974d6d9d115ad6575e76c419 100644 (file)
@@ -5,8 +5,8 @@
 #include "symbol.hh"
 #include "paper-def.hh"
 #include "molecule.hh"
-#include "pcol.hh"
-#include "pscore.hh"
+#include "p-col.hh"
+#include "p-score.hh"
 
 static String
 make_vbox(Interval i)
index 54579d337d4b7efae1e09095053537b54f4fbdab..67c7b5b54dcd31c0eadf98323f1e6a0254a58c09 100644 (file)
@@ -4,7 +4,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "stem-beam-reg.hh"
 #include "beam.hh"
 #include "stem.hh"
index 0950ada3717f2839e1929c0f4d9c99fcb63a60bd..4b141cb2e88e36029618913634949a3ebf178a4c 100644 (file)
@@ -5,7 +5,7 @@
 #include "notehead.hh"
 #include "lookup.hh"
 #include "molecule.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "misc.hh"
 
 const int STEMLEN=7;
index 5aa1906af601cb213d00c51cd17b25c2d12088eb..23c68dd011caaaf3fe1cb6a3466c815c4f475630 100644 (file)
@@ -1,9 +1,9 @@
 #include "proto.hh"
 #include "idealspacing.hh"
 #include "plist.hh"
-#include "pcol.hh"
+#include "p-col.hh"
 #include "item.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "spanner.hh"
 #include "scoreline.hh" 
 #include "staffline.hh"
index 0f581474c3f1b7f8747f9b999d21f52c4d4364e9..f29c5b9f56bb9c32eae7137b3da33c974c5e038e 100644 (file)
@@ -9,7 +9,7 @@
 #include "symbol.hh"
 #include "voice.hh"
 #include "voice-element.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "staff.hh"
 #include "score-column.hh"
 #include "staff-column.hh"
index b0f6ab410762ed0ee2d4ed2cce16dbb8885cf2bd..adadda663248a70f58701e06ee47a3c86f21114f 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "text-item.hh"
 #include "stem.hh"
index 5461b833682a514adcd57daed84cc5cb778f0dd7..a15e47548ea9a6db1fad24d63e5b2c6cf0977631 100644 (file)
@@ -4,7 +4,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "text-reg.hh"
 #include "text-item.hh"
 
index e932e4d4033fb7863b2e1e77b746089706d579d2..f244327c5fe6b190ba5c4cd52aeefe156960347c 100644 (file)
@@ -11,8 +11,8 @@
 #include "debug.hh"
 #include "voice.hh"
 #include "voice-element.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 
 
 void
index d789fda2b15c92ac20d81d3703bc40d9660d5399..8a602a520152f282713e09afb331244f3d84d7a7 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "proto.hh"
 #include "plist.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice-regs.hh"
 #include "voice-group-regs.hh"
 #include "register.hh"
@@ -16,7 +16,7 @@
 #include "stem-beam-reg.hh"
 #include "script-reg.hh"
 #include "complex-walker.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "debug.hh"
 #include "dynamic-reg.hh"
 
index 5cf14d1a015335b977cff8eedc3ebaa2dada6421..ca39524be0e0969bcec91cb0a3b79998db01546e 100644 (file)
@@ -7,8 +7,8 @@
 */
 #include "proto.hh"
 #include "plist.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
 #include "voice-regs.hh"
 #include "register.hh"
 #include "slur-reg.hh"
index 810a15dd36f2cbf946345f9fe1f09c46a5b70f55..47e9e28378bb80086b0535507360cfa6bcc261ed 100644 (file)
@@ -10,8 +10,8 @@
 #include "plist.hh"
 #include "debug.hh"
 #include "voice.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 #include "voice-element.hh"
index ab242065d54a45426b32e5ba94ce4ebccb9f48c3..425167422f70bdef03dd428df5385a775417f376 100644 (file)
@@ -20,7 +20,7 @@
 #include "staff-column.hh"
 #include "voice-group-regs.hh"
 #include "voice-regs.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "score-walker.hh"
 
 Walker_registers::Walker_registers(Complex_walker *w)
index f217a63b0812da110e012f18fa3615e7d6b23bd3..3738235df9e58b0863ddfde397f497e7eedb0309 100644 (file)
@@ -1,5 +1,5 @@
 #include "break.hh"
-#include "pscore.hh"
+#include "p-score.hh"
 #include "debug.hh"
 
 /** el stupido. This should be done more accurately:
index 6cea96f4ebd2468ff167f6963bacc05b676d0b75..e574fb4ee15786790310290df17cf43a01a07e28 100644 (file)
@@ -84,7 +84,7 @@ $(lily-config): $(lib-dir)/$(genout)
 $(LIBFLOWER): check-flower-version
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/flower/lib
 #
-$(LIBLILY):
+$(LIBLILY): dummy
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
 #
 
index 49cb0233a66baf7500435c36f4785297c8328f82..2e80c14fa87de0f7cb69508647c4c5ce82f68fc5 100644 (file)
@@ -14,7 +14,7 @@ AC_ARG_ENABLE(debug,
 
 dnl COMPILEINFO="$HOST $host $TARGET $target"
 AUTOHEADER="This file was automatically generated by configure"
-CXXFLAGS=""
+CXXFLAGS=${CXXFLAGS:-""}       # don't want -g -O junk
 AC_PROG_CXX
 
 AC_SUBST(DEFINES)
@@ -66,5 +66,20 @@ AC_CHECK_HEADER(FlexLexer.h, true,
 
 
 
-AC_OUTPUT(make/out/ACVariables.make)
+
+AC_OUTPUT(make/out/ACVariables.make:make/ACVariables.make.in)  
+
+
 dnl AC_OUTPUT(config.hh)
+
+
+cat << END
+
+Finished configuring. Please do the following command before
+attempting to build anything:
+
+       make -C make/ -f Initial.make   #make is GNU make, of course.
+
+
+END
+
index 1726cf2dd7d7954b2154d5d31852498bff95a56a..a1f2c4cba620aecd198b67a6578d94a13a57a968 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 2
+PATCH_LEVEL = 12
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index 3f06353c4a13a5b209be52002205f00e3574ae36..df08ce5fed39bd00f9339e100bd259df01983b4c 100644 (file)
@@ -56,6 +56,7 @@ public:
 
        int get_tempo_i( Moment moment );
        virtual String mudela_str( bool command_mode_bo );
+       int useconds_per_4_i();
 
 private:
        int useconds_per_4_i_;
@@ -81,6 +82,8 @@ public:
 
        Duration i2_dur( int time_i, int division_1_i );
        int clocks_1_i();
+       int den_i();
+       int num_i();
        virtual String mudela_str( bool command_mode_bo );
        Moment bar_mom();
 
index 29ba252a831d424cc3838378b2a9887b10974bb2..0e8644376dac424ec2228e54f0b14289d3b34223 100644 (file)
@@ -23,7 +23,6 @@ extern Verbose level_ver;
 #endif
 
 extern Source* source_l_g;
-extern bool no_triplets_bo_g;
 void message( String message_str, char const* context_ch_c_l );
 void warning( String message_str, char const* context_ch_c_l );
 void error( String message_str, char const* context_ch_c_l );
index 22e110b2e530395f26913f4c2cf780d30b9111d7..e917ebe74ffd41de5625b0aed2c1d18a02b09676 100644 (file)
@@ -10,6 +10,7 @@
 class Midi_track {
 public:
        Midi_track( int number_i, String copyright_str, String track_name_str, String instrument_str );
+       ~Midi_track();
 
        void add_event( Moment mom, Midi_event* midi_event_p );
        Moment end_mom();
@@ -18,11 +19,15 @@ public:
        Moment next_begin_mom( Moment now_mom );
        Moment next_end_mom( Moment now_mom );
        void process();
+       void set_tempo( int useconds_i );
+       void set_time( int num_i, int den_i, int clocks_i, int count_32_i );
        Track_column* tcol_l( Moment mom );
 
        String copyright_str_;
        String instrument_str_;
        String name_str_;
+       Midi_tempo* midi_tempo_p_;
+       Midi_time* midi_time_p_;
 
 private:
        void add_begin_at( PointerList<Midi_voice*>& open_voices_r, Moment mom );
index 66de991259599322ac81329c43b70b958e88740e..02bbb843e80b9029c8f8255839086be13f01a364 100644 (file)
@@ -28,7 +28,7 @@ public:
        void reset();
        void set_division_4( int division_4_i );
        void set_key( int accidentals_i, int minor_i );
-       void set_tempo( int useconds_i );
+       void set_tempo( int useconds_per_4_i );
        void set_time( int num_i, int den_i, int clocks_i, int count_32_i );
 
        int bar_i_;
index 244e36f43bfe86a503fe1dc2564c08815267e4a9..da6890aa9756bdbd6ab7aeaa37653ff880dddc23 100644 (file)
@@ -41,32 +41,33 @@ Lily_stream::operator <<( String str )
                        str = str.nomid_str( nl_i, 1 );
                }
 
-               if ( ( i != str.length_i() - 1 ) && ( nl_i == -1 ) )
+               if ( ( i != str.length_i() - 1 ) && ( nl_i == -1 ) ) {
                        while ( i && ( isalnum( str[ i ] ) 
                                || ( nobreak_str.index_i( str[ i ] ) != -1 ) ) )
                                i--;
 
-               if ( !i ) { // no room left
-                       if ( column_i_ > 8 * indent_i_ ) {
-                               newline();
-                               if ( comment_mode_bo_ && ( str[ 0 ] != '%' ) )
-                                       str = '%' + str;
-                               continue;
-                       }
-                       else { // cannot break neatly...
-                               i = max_i;
+                       if ( !i ) { // no room left
+                               if ( column_i_ > 8 * indent_i_ ) {
+                                       newline();
+                                       if ( comment_mode_bo_ && ( str[ 0 ] != '%' ) )
+                                               str = '%' + str;
+                                       continue;
+                               }
+                               else { // cannot break neatly...
+                                       i = max_i;
+                               }
                        }
                }
-                       
+                               
                String line = str.left_str( i + 1 ); 
                str = str.mid_str( i + 1, INT_MAX );
                *os_p_ << line;
+               column_i_ += line.length_i();
                if ( nl_i != -1 )
                         newline();
                else
                        check_comment( line );
-               column_i_ += line.length_i();
-               if ( str.length_i() || ( column_i_ >= wrap_column_i_ ) ) {
+               if ( ( str.length_i() && ( nl_i == -1 ) ) || ( column_i_ >= wrap_column_i_ ) ) {
                        //brr.
                        if ( comment_mode_bo_ )
                                str = "%" + str;
index 4971f451b2f0155b5ca8790b9b73cc25202b0649..023a4fed2646c55170458e9f62dfe699934f50d7 100644 (file)
@@ -11,9 +11,6 @@ Source* source_l_g = &source;
 
 Verbose level_ver = NORMAL_ver;
 
-// ugh
-bool no_triplets_bo_g = false;
-
 //ugh
 char const* defined_ch_c_l = 0;
 
@@ -64,10 +61,11 @@ void
 help()
 {
     btor <<
+       "--be-blonde, -b                use exact, blonde durations, e.g.: a[385]\n"
        "--debug, -d            be really verbose\n"
        "--help, -h             this help\n"
         "--include=DIR, -I DIR add DIR to search path\n"
-        "--no-triplets, -n     assume no triplets\n"
+        "--no-silly, -n                assume no triplets and no smaller than 16\n"
        "--output=FILE, -o FILE set FILE as default output\n"
        "--quiet, -q            be quiet\n"
        "--verbose, -v          be verbose\n"
@@ -112,10 +110,11 @@ int
 main( int argc_i, char* argv_sz_a[] )
 {
        Long_option_init long_option_init_a[] = {
+               0, "be-blonde", 'b',
                0, "debug", 'd',
                0, "help", 'h',
 //             1, "include", 'I',
-               0, "no-triplets", 'n',
+               0, "no-silly", 'n',
                1, "output", 'o',
                0, "quiet", 'q',
                0, "verbose", 'v',
@@ -128,6 +127,9 @@ main( int argc_i, char* argv_sz_a[] )
        String output_str;
        while ( Long_option_init* long_option_init_p = getopt_long() )
                switch ( long_option_init_p->shortname ) {
+                       case 'b':
+                               Duration_convert::be_blonde_b_s = true;
+                               break;
                        case 'd':
                                level_ver = DEBUG_ver;
                                break;
@@ -139,7 +141,9 @@ main( int argc_i, char* argv_sz_a[] )
 //                             path->push( getopt_long.optarg );
 //                             break;
                        case 'n':
-                               no_triplets_bo_g = true;
+                               Duration_convert::no_double_dots_b_s = false;
+                               Duration_convert::no_triplets_b_s = true;
+                               Duration_convert::no_smaller_than_i_s = 16;
                                break;
                        case 'o':
                                output_str = getopt_long.optarg;
index 2317fdb695fdca85ed43893ba7d7b3b65006fead..6bc15a4cf9fc34680fdbe9703534987e93eadf3a 100644 (file)
@@ -125,9 +125,7 @@ Midi_note::mom()
 Midi_tempo::Midi_tempo( int useconds_per_4_i )
 {
        useconds_per_4_i_ = useconds_per_4_i;
-// huh, is it not per 4?
-//     seconds_per_1_f_ = (Real)useconds_per_4_i_ * 4 / 1e6;
-       seconds_per_1_f_ = (Real)useconds_per_4_i_ * 8 / 1e6;
+       seconds_per_1_f_ = (Real)useconds_per_4_i_ * 4 / 1e6;
 }
 
 String
@@ -141,6 +139,12 @@ Midi_tempo::mudela_str( bool command_mode_bo )
        return str;
 }
 
+int 
+Midi_tempo::useconds_per_4_i()
+{
+       return useconds_per_4_i_;
+}
+
 int
 Midi_tempo::get_tempo_i( Moment moment )
 {
@@ -171,14 +175,14 @@ Midi_time::Midi_time( int num_i, int den_i, int clocks_4_i, int count_32_i )
        if ( count_32_i != 8 )
                warning( String( "#32 in quarter: " ) + String( count_32_i ), 0 );
        num_i_ = num_i;
-       den_i_ = 2 << den_i;
+       den_i_ = den_i;
        clocks_1_i_ = clocks_4_i * 4; 
 }
 
 Moment
 Midi_time::bar_mom()
 {
-       return Moment( num_i_ ) * Duration_convert::dur2_mom( Duration( den_i_ ) );
+       return Moment( num_i_ ) * Duration_convert::dur2_mom( Duration( 1 << den_i_ ) );
 }
 
 int
@@ -187,34 +191,23 @@ Midi_time::clocks_1_i()
        return clocks_1_i_;
 }
 
-Duration
-Midi_time::i2_dur( int time_i, int division_1_i )
+int
+Midi_time::den_i()
 {
-       Moment mom = Duration_convert::i2_mom( time_i, division_1_i );
-       mom /= sync_f_;
-
-       dtor << "\n% (" << time_i << ", " << mom << "): "
-               << sync_f_ << endl;
-
-       Duration dur = Duration_convert::mom2_dur( mom );
-       if ( !dur.type_i_ ) {
-               vtor << "\n% resyncing(" << time_i << ", " << mom << "): "
-                       << sync_f_ << " -> ";
-               mom *= sync_f_;
-               sync_f_ = Duration_convert::sync_f( sync_dur_, mom );
-               vtor << sync_f_ << endl;
-               mom /= sync_f_;
-               dur = Duration_convert::mom2_dur( mom );
-       }
+       return den_i_;
+}
 
-       return dur;
+int
+Midi_time::num_i()
+{
+       return num_i_;
 }
 
 String
 Midi_time::mudela_str( bool command_mode_bo )
 {
        String str = "meter { "
-               + String( num_i_ ) + "*" + String( den_i_ ) 
+               + String( num_i_ ) + "*" + String( 1 << den_i_ ) 
                + " }";
        if ( !command_mode_bo )
            str =  String( '\\' ) + str;
index e8bb5e9d35b4bf199d8079f7980afab5ac1df884..2402ee542e4214c785b317bd082290b87f55737e 100644 (file)
@@ -56,6 +56,12 @@ midi_score:
        }
        | midi_score track {
                $$->add_track( $2 );
+               // ugh
+               $2->set_tempo( midi_parser_l_g->midi_tempo_p_->useconds_per_4_i() );
+               $2->set_time( midi_parser_l_g->midi_time_p_->num_i(), 
+                       midi_parser_l_g->midi_time_p_->den_i(), 
+                       midi_parser_l_g->midi_time_p_->clocks_1_i(), 
+                       8 );
                if ( midi_parser_l_g->copyright_str_.length_i() )
                        $2->copyright_str_ = midi_parser_l_g->copyright_str_;
                if ( midi_parser_l_g->track_name_str_.length_i() )
@@ -75,7 +81,7 @@ header:
 
 track: 
        TRACK INT32 {
-               mtor << "\ntrack " << midi_parser_l_g->track_i_++ << ": " << flush;
+               mtor << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush;
                $$ = new Midi_track( midi_parser_l_g->track_i_++,
                        // silly, cause not set yet!
                        midi_parser_l_g->copyright_str_,
index ce4e230a23be466de220b2803ca3fe23ec4e281a..bab5dfabb7c756cf197a8dd19abc20c357422ee1 100644 (file)
@@ -49,13 +49,15 @@ Midi_score::output_mudela( String filename_str )
        lily_stream.indent();
                lily_stream << "commands {";
                lily_stream.indent();
-                       midi_parser_l_g->midi_time_p_->output_mudela( lily_stream, true );
+                       // not use silly 0 track
+                       midi_track_p_list_.bottom()->midi_time_p_->output_mudela( lily_stream, true );
                        lily_stream.tnedni();
                lily_stream << "}";
                lily_stream.newline();
                lily_stream << "midi {";
                        lily_stream.indent();
-                       midi_parser_l_g->midi_tempo_p_->output_mudela( lily_stream, true );
+                       // not use silly 0 track
+                       midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
                        lily_stream.tnedni();
                lily_stream << "}";
                lily_stream.tnedni();
index f94720cf2a4858bba09f2c984e4e4fc1c1fe2f8a..6a20de9d208b4bbce08dd9820b3d5c41aa57c89c 100644 (file)
@@ -14,9 +14,17 @@ Midi_track::Midi_track( int number_i, String copyright_str, String track_name_st
                name_str_ = track_name_str;
        else
                name_str_ = String( "track" ) + String( number_i_ );
+       midi_time_p_ = new Midi_time( 4, 2, 24, 8 );
+       midi_tempo_p_ = new Midi_tempo( 1000000 );
        tcol_p_list_.bottom().add( new Track_column( Moment( 0 ) ) );
 }
 
+Midi_track::~Midi_track()
+{
+       delete midi_time_p_;
+       delete midi_tempo_p_;
+}
+
 void
 Midi_track::add_begin_at( PointerList<Midi_voice*>& open_voices_r, Moment mom )
 {
@@ -91,7 +99,7 @@ void
 Midi_track::process()
 {
        int bar_i = 1;
-       Moment bar_mom = midi_parser_l_g->midi_time_p_->bar_mom();
+       Moment bar_mom = midi_time_p_->bar_mom();
 
        for ( PCursor<Track_column*> i( tcol_p_list_.top() ); i.ok(); i++ ) {
                int bars_i = (int)( i->mom() / bar_mom );
@@ -128,7 +136,7 @@ Midi_track::output_mudela( Lily_stream& lily_stream_r )
        lily_stream_r.newline();
 
        int bar_i = 1;
-       Moment bar_mom = midi_parser_l_g->midi_time_p_->bar_mom();
+       Moment bar_mom = midi_time_p_->bar_mom();
 
        PointerList<Midi_voice*> open_voices;
        Moment now_mom = 0.0;
@@ -172,6 +180,7 @@ void
 Midi_track::remove_end_at( PointerList<Midi_voice*>& open_voices_r, Moment mom )
 {
        for ( PCursor<Midi_voice*> i( open_voices_r.top() ); i.ok(); i++ )
+//             if ( i->end_mom() == mom ) {
                if ( i->end_mom() <= mom ) {
                        dtor << "open_voices (" << open_voices_r.size() << "): -1\n";
                        i.remove_p();  // remove? // no delete; only a copy
@@ -180,6 +189,20 @@ Midi_track::remove_end_at( PointerList<Midi_voice*>& open_voices_r, Moment mom )
                }
 }
 
+void
+Midi_track::set_tempo( int useconds_per_4_i )
+{
+       delete midi_tempo_p_;
+       midi_tempo_p_ = new Midi_tempo( useconds_per_4_i );
+}
+
+void
+Midi_track::set_time( int num_i, int den_i, int clocks_i, int count_32_i )
+{
+       delete midi_time_p_;
+       midi_time_p_ = new Midi_time( num_i, den_i, clocks_i, count_32_i );
+}
+
 Track_column*
 Midi_track::tcol_l( Moment mom )
 {
index e35369abfd81da4f64aa36f82a3a0cf92b44f099..5e6c2ced7d71e8e5549eece8e5e21b97effdc055 100644 (file)
@@ -47,9 +47,9 @@ My_midi_parser::reset()
        midi_key_p_ = new Midi_key( 0, 0 );
        // useconds per 4: 250000 === 60 4 per minute
        delete midi_tempo_p_;
-       midi_tempo_p_ = new Midi_tempo( 250000 );
+       midi_tempo_p_ = new Midi_tempo( 1000000 );
        delete midi_time_p_;
-       midi_time_p_ = new Midi_time( 4, 4, 384, 8 );
+       midi_time_p_ = new Midi_time( 4, 2, 24, 8 );
        now_i64_ = 0;
        bar_i_ = 1;
 
@@ -90,7 +90,7 @@ My_midi_parser::forward( int i )
 Moment
 My_midi_parser::mom()
 {
-       return Duration_convert::i2_mom( now_i64_, division_1_i_ );
+       return Moment( now_i64_, Duration::division_1_i_s );
 }
 
 void
@@ -110,7 +110,12 @@ My_midi_parser::note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i )
 //     running_i64_i64_a_[ channel_i ][ pitch_i ] = -1;
 //     assert( start_i64 != -1 ); // did we start?
 
-       return new Midi_note( midi_key_p_->notename_str( pitch_i ), midi_time_p_->i2_dur( now_i64_ - start_i64, division_1_i_ ) );
+       Duration dur( 0 );
+       if ( Duration_convert::be_blonde_b_s )
+               dur = Duration_convert::ticks2_dur( (I64)now_i64_ - start_i64 );
+       else
+               dur = Duration_convert::ticks2standardised_dur( (I64)now_i64_ - start_i64 );
+       return new Midi_note( midi_key_p_->notename_str( pitch_i ), dur );
 }
 
 int
@@ -133,6 +138,7 @@ void
 My_midi_parser::set_division_4( int division_4_i )
 {
        division_1_i_ = division_4_i * 4;
+       Duration::division_1_i_s = division_1_i_;
        if ( division_4_i < 0 )
                warning( "seconds iso metrical time" , 0 );
 }
@@ -145,10 +151,10 @@ My_midi_parser::set_key( int accidentals_i, int minor_i )
 }
 
 void
-My_midi_parser::set_tempo( int useconds_i )
+My_midi_parser::set_tempo( int useconds_per_4_i )
 {
        delete midi_tempo_p_;
-       midi_tempo_p_ = new Midi_tempo( useconds_i );
+       midi_tempo_p_ = new Midi_tempo( useconds_per_4_i );
 }
 
 void