]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.35 release/0.0.35
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Feb 1997 00:15:13 +0000 (01:15 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Feb 1997 00:15:13 +0000 (01:15 +0100)
72 files changed:
Documentation/index.pod
Documentation/make_website
Generate.make
Makefile
NEWS
Sources.make
TODO
Variables.make
configure
flower/NEWS
flower/Sources.make
flower/Variables.make
flower/pqueue.hh [new file with mode: 0644]
flower/string.cc
flower/stringconversion.cc
flower/stringconversion.hh
flower/stringutil.cc
hdr/clefreg.hh
hdr/commandrequest.hh
hdr/complexstaff.hh
hdr/complexwalker.hh
hdr/keyreg.hh
hdr/localkeyreg.hh
hdr/midiwalker.hh
hdr/proto.hh
hdr/register.hh
hdr/registergroup.hh [new file with mode: 0644]
hdr/request.hh
hdr/sccol.hh [deleted file]
hdr/scorecolumn.hh [new file with mode: 0644]
hdr/staffcolumn.hh [new file with mode: 0644]
hdr/stcol.hh [deleted file]
hdr/voicegroup.hh [deleted file]
hdr/voicegroupregs.hh [new file with mode: 0644]
hdr/voiceregs.hh [new file with mode: 0644]
hdr/walkregs.hh [new file with mode: 0644]
init/table_sixteen.ini
input/maartje.ly
input/wohltemperirt.ly
src/barreg.cc
src/calcideal.cc
src/clefreg.cc
src/commandrequest.cc
src/complexstaff.cc
src/complexwalker.cc
src/inputmusic.cc
src/keyreg.cc
src/localkeyreg.cc
src/lyricitem.cc
src/lyricwalker.cc
src/meterreg.cc
src/midioutput.cc
src/midiwalker.cc
src/register.cc
src/registergroup.cc [new file with mode: 0644]
src/sccol.cc [deleted file]
src/score.cc
src/scorecolumn.cc [new file with mode: 0644]
src/scorewalker.cc
src/staff.cc
src/staffcolumn.cc [new file with mode: 0644]
src/staffeleminfo.cc [new file with mode: 0644]
src/staffwalker.cc
src/stcol.cc [deleted file]
src/template2.cc
src/template4.cc
src/template6.cc
src/voice.cc
src/voicegroup.cc [deleted file]
src/voicegroupregs.cc [new file with mode: 0644]
src/voiceregs.cc
src/walkregs.cc [new file with mode: 0644]

index 06364733d403fea482197e37c882ca23aa709903..f473d9c456146d7aba85e41272557fe14ab2b765 100644 (file)
@@ -74,3 +74,16 @@ PS output
 </a
 >
 
+=item *
+<a href=wohltemperirt.midi
+>
+MIDI output
+</a
+>
+
+=item *
+<a href=docxx/index.html
+>
+The DOC++ documentation of the C++ sources.
+</a
+>
\ No newline at end of file
index 1aede3536704a3feaf6d3a2549d092960ea577d2..d1ec8d4a26445f872c72c4344fa4a97826c4a0e0 100755 (executable)
@@ -25,12 +25,17 @@ foreach $a (<*.html>)
 
 foreach $a (@examples) {
     $texfile="test";
-    system "cd ..; lilypond input/$a; tex $texfile;";
-    system "dvips -o $texfile.ps $texfile;";    
-    system "mv ../$texfile.ps $a.ps;".
-       "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif"
+    system "ln ../input/$a.ly ./$a.ly.txt";
+    system "cd ..; lilypond input/$a; tex $texfile;".
+       "dvips -o $texfile.ps $texfile;";
+
+    # generate the pixmap at twice the size, then rescale (for antialiasing)
+    if ( ! -f "$a.gif" ) {
+    system "mv ../$texfile.ps $a.ps; ".
+       "mv ../lelie.midi $a.midi; ".
+        "gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $a.ps -c quit |pnmscale 0.5| ppmtogif > $a.gif";
+    }   
 }
 
-system "mkdir docxx; make -C.. docxx; ln ../docxx/* ./docxx/;" .
-        "tar cf website.tar *.html *.gif *.png *.ps docxx/;" .
-       "gzip -9 website.tar;"
+system "tar hcf website.tar *.html *.gif lelie_logo.png *.ps *.ly.txt *.midi docxx/;" .
+    "gzip -f9 website.tar;"
index 0b1e6c490d20a11ef254fb584bef536cd57a321a..5be1641e1e4dcbd786650a821f11c8b0e0ae1c0a 100644 (file)
@@ -1,20 +1,19 @@
 # Generate.make ?
-# -> Rules.make: containing all compile/flex/bison/... rules (jcn)
 
 parsheadorig=$(CCDIR)/parser.tab.h
 parsheadnew=$(HEADERDIR)/parser.hh
 
 #
-# take some trouble to avoid overwriting the old y.tab.h
-# why? (jcn)
+# take some trouble to avoid overwriting the old y.tab.h,
+# because otherwise all dependants would be remade.
 $(CCDIR)/parser.cc: $(CCDIR)/parser.y
        $(BISON) -d $<
+       mv $(CCDIR)/parser.tab.c $@
        (if diff  $(parsheadorig) $(parsheadnew)>/dev/null; then \
                echo Ignoring $(parsheadorig);  \
        else \
                mv $(parsheadorig) $(parsheadnew); \
        fi )
-       mv $(CCDIR)/parser.tab.c $@
 
 $(parsheadnew): $(CCDIR)/parser.cc
 
index 3e4a16e51101447a28b094db5a7961b8ecdcc291..c990a7246c1356fc06293bb228f6c8deaa094539 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,18 +17,18 @@ $(m2m):     $(m2mobs)
 .PHONY: clean docxx
 
 clean:
-       rm -f $(allexe) $(DOCDIR)/* core $(allobs) $(ALLDEPS)
+       rm -f $(allexe) $(DOCDIR)/* core $(allobs) 
        for SUBDIR in $(SUBDIRS); \
        do \
                $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR clean;\
        done
 
 distclean: clean
-       rm -f  version.hh $(gencc) .GENERATE *~ $(ALLDEPS)
+       rm -f  version.hh $(gencc) .GENERATE *~ $(ALLDEPS) 
 
 all: $(exe) $(m2m) doc
 
-# value of $(OSTYPE) on windhoos; "make $OSTYPE" if u use bash :-)
+# value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
 win32: 
        $(MAKE) -C . CXX=g++ 
 
@@ -39,13 +39,13 @@ doc:
 docxx: $(progdocs)     
        doc++ -kp -d $(DOCDIR) $^
 
+
+include $(DEPDIR)/*.dep
+
 $(OBJECTDIR)/%.o: $(CCDIR)/%.cc
        $(DODEP)\
        $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) 
 
-
-include $(DEPDIR)/*.dep
-
 $(OBJECTDIR)/version.o: $(obs) $(HEADERDIR)/version.hh
 
 include Generate.make
diff --git a/NEWS b/NEWS
index 9e99b19fe00690cec3ad6c2ebf3398014a4f4acd..bd29eda5ceabebc9160092b9171b1df56ae12c08 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+pl 35
+       - Register_group
+Bugfix
+       - alignment of breakable items.
+
 *******
 pl 34
        - better midi syntax.
index ba5833629c29c4d2f797312e61a683b42d076a23..b255d37e543ba33d9ab326a59db0692aaf3a7fcd 100644 (file)
@@ -1,11 +1,11 @@
 # Sources.make
 # sourcefiles to be shipped. Also used for dependencies
 
-hdr=   bar.hh barreg.hh beam.hh boxes.hh break.hh clefreg.hh clefitem.hh\
+hdr=bar.hh barreg.hh beam.hh boxes.hh break.hh clefreg.hh clefitem.hh\
        colhpos.hh  commandrequest.hh   \
        complexwalker.hh complexstaff.hh\
        const.hh debug.hh dimen.hh directionalspanner.hh\
-        glob.hh  grouping.hh headreg.hh idealspacing.hh\
+       glob.hh grouping.hh headreg.hh idealspacing.hh\
        identifier.hh identparent.hh \
        inputmusic.hh inputscore.hh inputstaff.hh\
        inputfile.hh\
@@ -20,23 +20,23 @@ hdr=   bar.hh barreg.hh beam.hh boxes.hh break.hh clefreg.hh clefitem.hh\
        misc.hh\
        molecule.hh moment.hh musicalrequest.hh\
        notehead.hh notename.hh offset.hh paperdef.hh\
-        parseconstruct.hh pcol.hh proto.hh\
+       parseconstruct.hh pcol.hh proto.hh\
        pscore.hh pstaff.hh qlp.hh\
-       qlpsolve.hh register.hh reqtodo.hh request.hh rest.hh \
-       sccol.hh score.hh\
+       qlpsolve.hh register.hh registergroup.hh reqtodo.hh \
+       request.hh rest.hh scorecolumn.hh score.hh\
        scoreline.hh scorewalker.hh script.hh scriptdef.hh scriptreg.hh \
        slur.hh slurreg.hh source.hh sourcefile.hh\
        spanner.hh staff.hh\
        staffelem.hh staffeleminfo.hh staffline.hh staffsym.hh stembeamreg.hh\
-       stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
+       staffcolumn.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
        tex.hh textdef.hh \
        textitem.hh textreg.hh textspanner.hh timedescription.hh \
        tstream.hh voice.hh\
-       voicegroup.hh
+       voiceregs.hh voicegroupregs.hh walkregs.hh
 
 mycc=bar.cc barreg.cc beam.cc boxes.cc break.cc calcideal.cc clefreg.cc\
        clefitem.cc colhpos.cc  commandrequest.cc\
-        complexstaff.cc complexwalker.cc \
+       complexstaff.cc complexwalker.cc \
        debug.cc dimen.cc\
        directionalspanner.cc\
        grouping.cc groupregs.cc headreg.cc\
@@ -53,19 +53,21 @@ mycc=bar.cc barreg.cc beam.cc boxes.cc break.cc calcideal.cc clefreg.cc\
        mididef.cc  midiitem.cc midioutput.cc midistream.cc\
        midiwalker.cc misc.cc molecule.cc mylexer.cc note.cc\
        notehead.cc  notename.cc\
-        paperdef.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
-       register.cc request.cc rest.cc  sccol.cc score.cc\
+       paperdef.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
+       register.cc registergroup.cc request.cc rest.cc\
+       scorecolumn.cc score.cc\
        scoreline.cc scores.cc scorewalker.cc script.cc\
        scriptdef.cc scriptreg.cc slur.cc\
        slurreg.cc source.cc sourcefile.cc\
        spanner.cc staff.cc\
        staffelem.cc staffline.cc staffsym.cc\
-       stembeamreg.cc stcol.cc stem.cc\
-       staffwalker.cc symbol.cc symtable.cc  tex.cc texbeam.cc\
+       stembeamreg.cc staffcolumn.cc stem.cc\
+       staffeleminfo.cc staffwalker.cc symbol.cc\
+       symtable.cc tex.cc texbeam.cc\
        texslur.cc textdef.cc textitem.cc textreg.cc textspanner.cc\
        timedescription.cc tstream.cc voice.cc voiceelt.cc \
-       voiceregs.cc voicegroup.cc\
-       warn.cc windhoos-suck-suck-suck-thank-you-cygnus.cc wordwrap.cc\
+       voiceregs.cc voicegroupregs.cc\
+       walkregs.cc warn.cc windhoos-suck-suck-suck-thank-you-cygnus.cc wordwrap.cc\
        template1.cc template2.cc template3.cc template4.cc\
        template5.cc template6.cc version.cc
 
diff --git a/TODO b/TODO
index 341f837438e4749f523283eda28f3e57c4976b9d..a00bad0be11e471d296729ef1df3512c8f596ea7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,35 +1,36 @@
-
 before 0.1
 
-
-       * create libmudela, libmidi, or liblily_frontend
-
-       * Register_groups as a baseclass.
+       * remove spurious/outdated comments in .ly
+       
+       * more control in Register_groups
 
        * pushgroup, popgroup.
 
        * basic dynamics
 
+       * basic syntax
+
        * decent TeX page layout
-       
-       * < .. > vs. { .. } syntax? ! 
+
+       * clean split for m2m of sources.
 
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
 BUGS
+
+       * key at clef change.
+
        * key undo
 
-       * c8. c32 c32
+       * key at broken :||:
 
-       * key print if clef change.
+       * [c8. c32 c32]
 
        * $cis ( | ) cis$
 
        * Group_feature at start of music. 
 
-       * size of Key_item
-
 SEVERELY LACKING:
 
        * grace notes
@@ -46,17 +47,21 @@ INPUTLANGUAGE
 
        * rest name configurable
 
+       * < .. > vs. { .. } syntax? ! 
+
        * '*' vs. '/'
 
 SMALLISH PROJECTS
 
+       * fix Staff_elem::width() derivs to use offset_
+
        * parshape
 
        * bar numbers/repetition marks
 
        * read from mmap directly: study yy_scan_buffer
 
-       * binsearch/hash for notenames
+       * binsearch/hash for notenames, id. for identifiers
 
        * stafftypes: voice names/ instrument names.
 
@@ -128,6 +133,12 @@ FUTURE
 
 IDEAS
 
+       * create libmudela,  or liblily_frontend
+
+       * move MIDI io to a ANSI C libmidi library.
+
+       * fold indentifiers and notenames?
+
        * enter Requests directly
 
        * itemcolumns: Use dummy items.
@@ -158,4 +169,4 @@ IDEAS
 
        * caching breakpoints
 
-       * use exceptions?
\ No newline at end of file
+       * use exceptions iso assert?
\ No newline at end of file
index cc697d7c3ccd2dce4c3f414573a0c78da7546bdb..ea71398c058979c79ad34f01f0707c1a6577748d 100644 (file)
@@ -3,7 +3,7 @@
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=34
+PATCHLEVEL=35
 
 
 
@@ -124,4 +124,4 @@ STRIPDEBUG=true #replace to do stripping of certain objects
 LINKER=$(CXX)
 include Site.make
 
-include Site.make
+
index 45a8f9b13ab943f4ea9b49b43d95e52158f507f9..1c611713a579f727fe0dbdf6008ec4baf821a2d3 100755 (executable)
--- a/configure
+++ b/configure
@@ -53,3 +53,6 @@ echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
 touch Site.make
 $MAKE -f Initial.make
 
+echo "The sources are ready for compiling. "
+echo "To make sure that you don't have any stale dependencies: do"
+echo "         make clean"
index 4e397700caa65dec5dd66c1b1622ec386097caaa..a01d6a140bf56399a5f3699e3f59706949c744c9 100644 (file)
@@ -1,10 +1,11 @@
 
+pl 1.1.2 
+       - StringConversio::bin2int_i
+       - dumb prioq
+
 pl 1.1.1
        - separated StringHandle and StringData
-(JCN pl 27-3)
-       - debug memmove code
-       - StringData bugfix
-       - old String::String( char, int ) bugfix
+       - String::compare
 
 1.1.0:
                
@@ -12,6 +13,11 @@ pl 1.1.1
 ------------------
 1.0:
 
+pl 27-3
+       - debug memmove code
+       - StringData bugfix
+       - old String::String( char, int ) bugfix
+
 pl 27-1,2 (not released)
        patches by JCN
        - stringutils.cc included again 
index bfffc6084b6740f25d11979c634c9005df5f3fcf..3964ba9be5fe3a5d3eb0ca6cef4ed74a9d43e16d 100644 (file)
@@ -12,7 +12,7 @@ hh=assoc.hh associter.hh choleski.hh compare.hh cursor.hh dstream.hh\
 fproto.hh handle.hh interval.hh iterate.hh lgetopt.hh link.hh list.hh\
 matrix.hh path.hh pcursor.hh plist.hh rational.hh real.hh scalar.hh\
 smat.hh string.hh stringconversion.hh stringhandle.hh stringdata.hh\
-textdb.hh textstream.hh unionfind.hh\
+textdb.hh textstream.hh unionfind.hh pqueue.hh\
 varray.hh vector.hh vsmat.hh datafile.hh
 
 extra=stringtest.cc
index 91802a52e81f62a010e5c69160ad694b05dd1e45..4e40f2453d148e926381d3ee6352babee84b65f1 100644 (file)
@@ -1,6 +1,6 @@
 MAJVER=1
 MINVER=1
-PATCHLEVEL=1
+PATCHLEVEL=2
 
 PACKAGENAME=flower
 
diff --git a/flower/pqueue.hh b/flower/pqueue.hh
new file mode 100644 (file)
index 0000000..1952323
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+  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
index 1e532a2fadd2930a5b9ae7330891b643411780a7..6e7378fdcc854ef295bd5349ee3f143f66b9f34b 100644 (file)
@@ -92,7 +92,7 @@ String::String( char const* source )
 
 String::String( Byte const* byte_l, int length_i )
 {   
-    assert( !length_i || byte_l );
+//    assert( !length_i || byte_l );// ugh.  Storing null pointers? 
     strh_.set( byte_l, length_i );    
 }
 
index 55ea29ade48074514e37864dbd35fb88de218646..8b9144a9a723d771ea20e75df228eaee96f5ba2a 100644 (file)
@@ -20,6 +20,20 @@ StringConversion::bin2hex_str( String bin_str )
     return str;
 }
 
+int
+StringConversion::bin2int_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 |= bin_str[ i ];
+    }
+    return result_i;
+}
+
+
 int
 StringConversion::hex2bin_i( String hex_str, String& bin_str_r )
 {
index 3ad9bbea4bbd41b51ecfb1b4d15808f8bebff098..0bcd7f5c4c1473692b7d863801962e446919e1ca 100644 (file)
@@ -17,8 +17,9 @@ class StringConversion {
        static Byte nibble2hex_by( Byte by );
 public:
        static String bin2dec_str( String dec_str );
-static String bin2hex_str( String bin_str );
+       static String bin2hex_str( String bin_str );
        static String dec2bin_str( String str );
+       static int bin2int_i( String str );
        static int dec2int_i( String str );
        static int hex2int_i( String str );
        static String hex2bin_str( String str );
index 0596c458adce45430cb32f97f54be3fd2ceb0bdf..9adcd2ea1dbd2ceb04cdcd7811f704a7421c5cf3 100644 (file)
@@ -6,6 +6,13 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#ifdef STRING_DEBUG 
+void* mymemmove( void* dest, void* src, size_t n )
+{
+       return memmove( dest, src, n ); // wohltempererit: 69006
+}
+#define memmove mymemmove
+#endif
 
 #ifdef STRING_UTILS_INLINED
 #undef STRING_UTILS_INLINED
index ff9e5903a7557e328cb775ec1298cb2506396d8e..8f9e25042c8844dcce44524cedb1b2fbd57bf0bc 100644 (file)
@@ -20,7 +20,7 @@ public:
     /* ************** */
     virtual void process_request();
     virtual void do_pre_move_process();
-    virtual bool try_request(Nonmusical_req*);
+    virtual bool try_request(Request*);
     Clef_register(Complex_walker*);
     void read_req(Clef_change_req*);
     bool set_type(String);
index f9eef852fd5759a1d905580f1dbdb6f0b550d8a8..71b83316610e27e7d04191ed0c043c678de89b4d 100644 (file)
 #include "request.hh"
 #include "varray.hh"
 
-/**
-  Request assumed to be "happening" before the musical requests
- */
-struct Nonmusical_req : virtual Request {
-    REQUESTMETHODS(Nonmusical_req, nonmus);
+/** 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; }
@@ -32,7 +31,7 @@ struct Nonmusical_req : virtual Request {
 
 /** Baseclass for meter/partial req. It has to be handled by
   Staff_{walker,column} baseclass.  */
-struct Timing_req : Nonmusical_req {
+struct Timing_req : Command_req {
     REQUESTMETHODS(Timing_req, timing);
 };
 
@@ -58,7 +57,7 @@ struct Meter_change_req : Timing_req {
 /// toggle Cadenza mode
 struct Cadenza_req : Timing_req {
     /// turn on?
-    bool on_b;
+    bool on_b_;
     Cadenza_req(bool);
     REQUESTMETHODS(Cadenza_req,cadenza);
 };
@@ -76,31 +75,31 @@ struct Measure_grouping_req: Timing_req {
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
-struct Group_change_req : Nonmusical_req {
+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 : Nonmusical_req {
+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 : Nonmusical_req {
+struct Terminate_voice_req : Command_req {
     REQUESTMETHODS(Terminate_voice_req,terminate);
 };
 
-struct Group_feature_req : Nonmusical_req {
+struct Group_feature_req : Command_req {
     int stemdir_i_;
     Group_feature_req();
     REQUESTMETHODS(Group_feature_req, groupfeature);
 };
 
 
-struct Key_change_req : Nonmusical_req {
+struct Key_change_req : Command_req {
     Array<Melodic_req*> melodic_p_arr_;
 
     Key_change_req();
@@ -109,7 +108,7 @@ struct Key_change_req : Nonmusical_req {
     REQUESTMETHODS(Key_change_req, keychange);
 };
 
-struct Clef_change_req : Nonmusical_req {
+struct Clef_change_req : Command_req {
     String clef_str_;
     Clef_change_req(String);
     REQUESTMETHODS(Clef_change_req, clefchange);
index b7d0c714d9cdbc008dc74fbc477a25a9c6cdc769..74ecef473221fd36381f45ef42188c3c4a75d528 100644 (file)
@@ -9,7 +9,6 @@
 
 
 #include "key.hh"
-#include "stcol.hh"
 #include "staff.hh"
 #include "staffwalker.hh"
 
index 5f0a8084500cdd6308489a0bffbd8fa09b977c74..a67d5b881a2ee5bae0a14ba7a51fccd4e46824fb 100644 (file)
@@ -8,7 +8,6 @@
 #define COMPLEXWALKER_HH
 
 #include "proto.hh"
-#include "voicegroup.hh"
 #include "assoc.hh"
 #include "staffwalker.hh"
 #include "staffeleminfo.hh"
@@ -18,7 +17,7 @@
   A staff walker which uses registers to decide what to print
  */
 class Complex_walker: public Staff_walker {
-    bool try_command_request(Nonmusical_req *req_l);
+    bool try_command_request(Command_req *req_l);
     void do_change_group( Voice * v, String group_id_str);
     void do_announces();
     void try_request(Request*req);    
@@ -33,14 +32,9 @@ public:
     IPointerList<Voice_registers *> voice_reg_list_;
     IPointerList<Voice_group_registers*> group_reg_list_;
     Assoc<Voice *, Voice_group_registers *> voice_group_map_;
-
-    Clef_register *clef_reg_p_;
-    Local_key_register *local_key_reg_p_;
-    Key_register *key_reg_p_;
-    Bar_register *bar_reg_p_;
-    Meter_register *meter_reg_p_;
     
     Array<Staff_elem_info> announce_info_arr_;
+    Walker_registers *walk_regs_p_;
     
     /* *************** */
 
index cf1923134d5e4cb19d58ff07b107aa9907684af9..6cf6a3724275bcf2d5e81fa12da661bf7ce17a3d 100644 (file)
@@ -24,6 +24,7 @@ struct Key_register : Request_register {
     virtual void process_request();
     virtual void do_pre_move_process();
     virtual void do_post_move_process();
+    virtual void acknowledge_element(Staff_elem_info);
     Key_register(Complex_walker*);
 private:
     
index 48a9b5cbd299749c79fe347590375d1ec12e0e06..07c016678c9d794c8759645c7e1103e38bafe923 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  localkeyreg.hh -- part of LilyPond
+  localkeyreg.hh -- declare Local_key_register
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -13,8 +13,9 @@
 struct Local_key_register : Request_register {
     Local_key local_key_;
     Local_key_item* key_item_p_;
-
+    const Key *key_c_l_;
     /* *************** */
+    virtual void process_request();
     virtual void acknowledge_element(Staff_elem_info);
     virtual void do_pre_move_process();
     Local_key_register(Complex_walker*);
index 2121f57d3aca558b6c45f88ef53d4ad59d3f64d9..3673ae080b5bca9bfcc374df626aa195c9911be2 100644 (file)
@@ -25,8 +25,6 @@ class Midi_walker : public PCursor<Staff_column*> {
     Moment last_moment_;
 
     /* *************** */
-    
-    /// output notestop events
     void do_stop_notes(Moment);
 public:
     
index cfedd6b30f62b550a9c91f7675ce399c04298829..8146e81a6318ad0dd3925e6df2ad9aa4b7bfff54 100644 (file)
@@ -84,7 +84,7 @@ struct Molecule;
 struct Musical_req;
 struct Music_general_chord;
 struct Music_voice;
-struct Nonmusical_req;
+struct Command_req;
 struct Note_req;
 struct Notehead;
 struct Notehead_register;
@@ -98,6 +98,7 @@ struct PStaff;
 struct Paperdef;
 struct Partial_measure_req;
 struct Rational;
+struct Register_group;
 struct Request;
 struct Request_register;
 struct Rest;
@@ -151,5 +152,6 @@ struct Voice_group_registers;
 struct Voice_list;
 struct Voice_registers;
 struct Voicegroup;
+struct Walker_registers;
 typedef Rational Moment;
 #endif // PROTO_HH
index 922d874644f63f6f5c74964cd396890824c4e1f0..95dfe1e67b8e48afc64436a0ab6a6d1a3eb728f5 100644 (file)
    Hungarian postfix: reg
   */
 class Request_register {
-public:
-    Complex_walker * walk_l_;
-    Array<Request*> accepted_req_arr_;
-    
     /**
       Warning: you can't copy a #Request_register#
       */
     Request_register(Request_register const &);
+public:
+    Complex_walker * walk_l_;
+    Array<Request*> accepted_req_arr_;
+    
     Request_register(Complex_walker*);
     Request_register();
     virtual ~Request_register(){}
@@ -59,7 +59,7 @@ public:
     void pre_move_processing();
     /// reset any appropriate data.
     void post_move_processing();
-    
+    virtual bool acceptable_request_b(Request*) const;    
     virtual void set_dir(int){}
 protected:
     /// utility
diff --git a/hdr/registergroup.hh b/hdr/registergroup.hh
new file mode 100644 (file)
index 0000000..c3a4df4
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+  registergroup.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REGISTERGROUP_HH
+#define REGISTERGROUP_HH
+
+
+#include "plist.hh"
+#include "staffeleminfo.hh"
+/**
+  Group a number of registers. Usually delegates everything to its contents.
+  */
+class Register_group {
+public:
+    IPointerList<Request_register*> reg_list_;
+    
+    void set_dir(int i);
+    bool acceptable_request_b(Request*);
+    void pre_move_processing();
+    void post_move_processing();
+    void acknowledge_element(Staff_elem_info info);
+    bool try_request(Request*);
+    void process_requests();
+    virtual ~Register_group();
+    void add(Request_register* reg_p);
+    bool contains_b(Request_register*);
+//    bool contains_b(Register_group*);
+};
+
+#endif // REGISTERGROUP_HH
+
+
index bf94d1a02e8fc561776464f37ca5ed068fca95e1..63929a923bc20869720e3b5860fb7b765920cc44 100644 (file)
@@ -56,7 +56,7 @@ struct Request {
     virtual Spacing_req * spacing() { return 0; }
     virtual Blank_req * blank() { return 0; }
     virtual Musical_req *musical() { return 0; }
-    virtual Nonmusical_req * nonmus() { return 0; }
+    virtual Command_req * command() { return 0; }
 protected:
     virtual void do_print()const ;
 };
diff --git a/hdr/sccol.hh b/hdr/sccol.hh
deleted file mode 100644 (file)
index e961d04..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  sccol.hh -- part of LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef SCCOL_HH
-#define SCCOL_HH
-#include "proto.hh"
-#include "varray.hh"
-#include "moment.hh"
-
-
-/**
-
-    When typesetting hasn't started on PScore yet, the columns which
-    contain data have a rhythmical position. Score_column is the type
-    with a rhythmical time attached to it. The calculation of
-    idealspacing is done with data in these columns. (notably: the
-    #durations# field)
-
-    */
-
-class Score_column {
-    friend class Score;
-    friend class Score_walker;
-
-    bool musical_b_;
-    Moment when_;
-    void set_breakable();
-public:
-    /// indirection to column
-    PCol * pcol_l_;
-
-    /// length of notes/rests in this column
-    Array<Moment> durations;
-    
-    /* *************** */
-
-    Moment when() {  return when_; }
-    Score_column(Moment when);       
-    static int compare(Score_column & c1, Score_column &c2);
-    void add_duration(Moment );
-    void preprocess();
-    bool breakable_b();
-    bool musical_b() { return musical_b_; }
-    bool used_b();
-    void print() const;
-
-
-};
-
-instantiate_compare(Score_column&, Score_column::compare);
-
-#endif // SCCOL_HH
-
-
-
-
diff --git a/hdr/scorecolumn.hh b/hdr/scorecolumn.hh
new file mode 100644 (file)
index 0000000..e961d04
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+  sccol.hh -- part of LilyPond
+
+  (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef SCCOL_HH
+#define SCCOL_HH
+#include "proto.hh"
+#include "varray.hh"
+#include "moment.hh"
+
+
+/**
+
+    When typesetting hasn't started on PScore yet, the columns which
+    contain data have a rhythmical position. Score_column is the type
+    with a rhythmical time attached to it. The calculation of
+    idealspacing is done with data in these columns. (notably: the
+    #durations# field)
+
+    */
+
+class Score_column {
+    friend class Score;
+    friend class Score_walker;
+
+    bool musical_b_;
+    Moment when_;
+    void set_breakable();
+public:
+    /// indirection to column
+    PCol * pcol_l_;
+
+    /// length of notes/rests in this column
+    Array<Moment> durations;
+    
+    /* *************** */
+
+    Moment when() {  return when_; }
+    Score_column(Moment when);       
+    static int compare(Score_column & c1, Score_column &c2);
+    void add_duration(Moment );
+    void preprocess();
+    bool breakable_b();
+    bool musical_b() { return musical_b_; }
+    bool used_b();
+    void print() const;
+
+
+};
+
+instantiate_compare(Score_column&, Score_column::compare);
+
+#endif // SCCOL_HH
+
+
+
+
diff --git a/hdr/staffcolumn.hh b/hdr/staffcolumn.hh
new file mode 100644 (file)
index 0000000..d80b6fa
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+  staffcolumn.hh -- declare Staff_column
+
+  (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef STAFFCOLUMN_HH
+#define STAFFCOLUMN_HH
+#include "proto.hh"
+#include "varray.hh"
+#include "moment.hh"
+
+/// store simultaneous requests
+class Staff_column {
+
+    Staff_column(Staff_column const&);
+
+public:
+    Array<Request*> musicalreq_l_arr_;
+    Array<Request*> commandreq_l_arr_;
+    Staff * staff_l_;
+
+    /// fields to collect timing data vertically.
+    Array<Timing_req*> timing_req_l_arr_;
+    Score_column *musical_column_l_, *command_column_l_;
+
+    /* *************** */
+    
+    Staff_column();
+
+    Moment when() const;
+    void set_cols(Score_column *c1, Score_column *c2);
+    void add(Voice_element*ve);
+    void OK() const;
+    ~Staff_column();
+    void typeset_breakable_items(Array<Item *> &pre_p_arr,
+                                Array<Item *> &nobreak_p_arr,
+                                Array<Item *> &post_p_arr);
+    void typeset_musical_item(Item *i);
+protected:
+     void setup_one_request(Request*);
+};
+
+
+
+#endif // STAFFCOLUMN_HH
+
diff --git a/hdr/stcol.hh b/hdr/stcol.hh
deleted file mode 100644 (file)
index b6ecdb1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  stcol.hh -- declare Staff_column
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STCOL_HH
-#define STCOL_HH
-#include "proto.hh"
-#include "varray.hh"
-#include "moment.hh"
-
-/// store simultaneous requests
-class Staff_column {
-
-    Staff_column(Staff_column const&);
-
-public:
-    Array<Request*> musicalreq_l_arr_;
-    Array<Request*> commandreq_l_arr_;
-    Staff * staff_l_;
-
-    /// fields to collect timing data vertically.
-    Array<Timing_req*> timing_req_l_arr_;
-    Score_column *musical_column_l_, *command_column_l_;
-
-    /* *************** */
-    
-    Staff_column();
-
-    Moment when() const;
-    void set_cols(Score_column *c1, Score_column *c2);
-    void add(Voice_element*ve);
-    void OK() const;
-    ~Staff_column();
-    void typeset_breakable_items(Array<Item *> &pre_p_arr,
-                                Array<Item *> &nobreak_p_arr,
-                                Array<Item *> &post_p_arr);
-    void typeset_musical_item(Item *i);
-protected:
-     void setup_one_request(Request*);
-};
-
-
-#endif // STCOL_HH
-
diff --git a/hdr/voicegroup.hh b/hdr/voicegroup.hh
deleted file mode 100644 (file)
index 2240433..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  voicegroup.hh -- part of LilyPond
-
-  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef VOICEGROUP_HH
-#define VOICEGROUP_HH
-
-#include "proto.hh"
-#include "string.hh"
-
-struct Voice_registers {
-    Notehead_register *head_reg_;
-    Slur_register *slur_reg_;
-    Voice *voice_l_;
-
-    /* *************** */
-    void set_dir(int i);
-    static bool acceptable_request(Request*);
-    void pre_move_processing();
-    void post_move_processing();
-    void acknowledge_element(Staff_elem_info info);
-    Voice_registers(Complex_walker*,Voice*);
-    ~Voice_registers();
-    bool try_request(Request*);
-    void process_requests();
-};
-
-
-struct Voice_group_registers {
-    String group_id_str_;
-    Text_register* text_reg_;
-    Stem_beam_register* stem_beam_reg_;
-    Script_register *script_reg_;
-    Complex_walker * walk_l_;
-    int dir_i_;
-    
-    /* *************** */
-    void set_dir(int i);
-    static bool acceptable_request(Request*);
-    void pre_move_processing();
-    void post_move_processing();
-    void acknowledge_element(Staff_elem_info info);
-    Voice_group_registers(Complex_walker*, String id = "");
-    ~Voice_group_registers();
-    void process_requests();
-    bool try_request(Request*);
-};
-
-#endif
diff --git a/hdr/voicegroupregs.hh b/hdr/voicegroupregs.hh
new file mode 100644 (file)
index 0000000..649be8e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  voicegroupregs.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef VOICEGROUPREGS_HH
+#define VOICEGROUPREGS_HH
+
+#include "registergroup.hh"
+
+struct Voice_group_registers  : Register_group {
+    String group_id_str_;
+    Complex_walker * walk_l_;
+    
+    /* *************** */
+    void set_dir(int i);
+    static bool acceptable_request_b(Request*);
+  
+    void acknowledge_element(Staff_elem_info info);
+    Voice_group_registers(Complex_walker*, String id = "");
+    bool try_request(Request*);
+};
+#endif // VOICEGROUPREGS_HH
diff --git a/hdr/voiceregs.hh b/hdr/voiceregs.hh
new file mode 100644 (file)
index 0000000..c9e809b
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  voiceregs.hh -- declare Voice_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef VOICEREGS_HH
+#define VOICEREGS_HH
+
+#include "registergroup.hh"
+
+struct Voice_registers : Register_group {
+    Voice *voice_l_;
+
+    /* *************** */
+
+    static bool acceptable_request_b(Request*);
+    virtual void acknowledge_element(Staff_elem_info info);
+
+    Voice_registers(Complex_walker*,Voice*);
+};
+
+
+#endif // VOICEREGS_HH
diff --git a/hdr/walkregs.hh b/hdr/walkregs.hh
new file mode 100644 (file)
index 0000000..93801d0
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+  walkregs.hh -- declare Walker_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef WALKREGS_HH
+#define WALKREGS_HH
+
+
+#include "registergroup.hh"
+
+struct Walker_registers : Register_group {
+    Walker_registers(Complex_walker *w);
+};
+
+#endif // WALKREGS_HH
index 689f935b0f3e58f8e00d0c16fe74e278cb7e4a62..1b7b379f67270b5c8585c6e78649928aae9aa7cf 100644 (file)
@@ -39,11 +39,11 @@ symboltables {
 
      "clefs" = table {
             "violin"   "\violinclef"           0pt     12.8pt  -10pt   18pt
-            "bass"     "\bassclef"             0pt     11.2pt  0pt     16pt
+            "bass"     "\bassclef"             0pt     12.8pt  0pt     16pt
             "alto"     "\altoclef"             0pt     12.8pt  0pt     16pt
             "tenor"    "\altoclef"             0pt     12.8pt  0pt     16pt
             "violin_change"    "\cviolinclef"  0pt     11.2pt  -12pt   12pt
-            "bass_change"      "\cbassclef"    0pt     12.8pt  0pt     16pt
+            "bass_change"      "\cbassclef"    0pt     11.2pt  0pt     16pt
             "alto_change"      "\caltoclef"    0pt     11.2pt  0pt     16pt
             "tenor_change"     "\caltoclef"    0pt     11.2pt  0pt     16pt
      }
index 7f35583ae2b2aea8212653b56b861cbed03eaeba..cf77a62bcc68ebdc745be2e16b2ba3e3ab77d217 100644 (file)
@@ -39,6 +39,7 @@ staff {
                \music {  a  () bes eis8 eis8 }
                \music { fis () g gis8 gis8 }
        }
+       \clef\tenor
        { c4 'c4 }
 
        [d8 e8 'f8 g8]  d8 e8 f8 g8
index b5ea0f66542ab07a0ac2764359e8f9f8ee0d5a0e..7d615a4d1bfdeae4f2515eb01d1f5a9f83bf6d98 100644 (file)
@@ -47,7 +47,7 @@ bassdux = music { $
        [G c16 B] [c8 d] [F16 G] As4 [G16 F] | 
 $}
 
-trebstaf =     staff { melodic
+trebstaf = staff { melodic
                % every "music {} " in a staff has its own "voicegroup"
                music { dux }
                music { comes }
@@ -59,8 +59,8 @@ basstaf = staff { melodic
 }
 
 score {
-       staff { basstaf }
        staff { trebstaf }
+       staff { basstaf }
        
        commands {
                meter {4*4}
index 9a10f913b5f0c8e438c11e5fcf9f62f4c05c1aa2..f0b32fd3df53cbfd66ad50232bec9d022705c184 100644 (file)
@@ -10,7 +10,7 @@
 #include "bar.hh"
 #include "commandrequest.hh"
 #include "complexwalker.hh"
-#include "sccol.hh"
+#include "scorecolumn.hh"
 
 
 Bar_register::Bar_register(Complex_walker*w)
@@ -22,11 +22,11 @@ Bar_register::Bar_register(Complex_walker*w)
 bool
 Bar_register::try_request(Request*r_l)
 {
-    if (!r_l->nonmus()->bar()) 
+    if (!r_l->command()->bar()) 
        return false;
 
     assert(!bar_req_l_);
-    bar_req_l_ = r_l->nonmus()->bar();
+    bar_req_l_ = r_l->command()->bar();
 
     return true;
 }
index 08180c64fbc7e4f6f780f298378c13c3beb687d7..1a96243426ee01cbddc793eeda8198ab729ee0fb 100644 (file)
@@ -2,7 +2,7 @@
 #include "score.hh"
 #include "pscore.hh"
 #include "paperdef.hh"
-#include "sccol.hh"
+#include "scorecolumn.hh"
 #include "dimen.hh"
 
 
index 81c87e953a12b97292e6af51b0bd0c706737210a..ed6f78073b91b0b63f948745e6b56c536acd9a23 100644 (file)
@@ -13,7 +13,7 @@
 #include "commandrequest.hh"
 #include "timedescription.hh"
 #include "complexwalker.hh"
-#include "stcol.hh"
+#include "staffcolumn.hh"
 
 Clef_register::Clef_register(Complex_walker*w)
     : Request_register(w)
@@ -48,14 +48,16 @@ Clef_register::read_req(Clef_change_req*c_l)
 }
 
 bool
-Clef_register::try_request(Nonmusical_req* r_l)
+Clef_register::try_request(Request * r_l)
 {
-    if (!r_l->clefchange())
+    
+    Command_req* creq_l= r_l->command();
+    if (!creq_l || !creq_l->clefchange())
        return false;
 
-    accepted_req_arr_.push(r_l);
+    accepted_req_arr_.push(creq_l);
     // do it now! Others have to read c0_pos.
-    read_req(r_l->clefchange()); 
+    read_req(creq_l->clefchange()); 
     return true;
 }
 
index 9af17503f37f90407b36f56a48cfde453c34e56b..5cf0912417e154e601a0604a6d321375b0a4aa8d 100644 (file)
 void
 Cadenza_req::do_print()const
 {
-    mtor << on_b;
+    mtor << on_b_;
 }
 
+Cadenza_req::Cadenza_req(bool b)
+{
+    on_b_ =b;
+}
+/* *************** */
+
+
 int
 Bar_req::compare(const Bar_req &c1)const
 {
@@ -39,12 +46,6 @@ Partial_measure_req::Partial_measure_req(Moment m)
     duration_ =m;
 }
 /* *************** */
-Cadenza_req::Cadenza_req(bool b)
-{
-    on_b =b;
-}
-/* *************** */
-
 Meter_change_req::Meter_change_req()
 {
     beats_i_ = 0;
@@ -61,7 +62,7 @@ void
 Timing_req::do_print()const{}
 
 void
-Nonmusical_req::do_print()const{}
+Command_req::do_print()const{}
 /* *************** */
 void
 Barcheck_req::do_print() const{}
index 9eb84cb59a13d28515c559ce0641dba8d61b5f62..627b5745e20f4c3f6e86465e7fd2d39ac2878649 100644 (file)
@@ -7,7 +7,7 @@
 #include "pscore.hh"
 #include "bar.hh"
 #include "meter.hh"
-#include "sccol.hh"
+#include "scorecolumn.hh"
 #include "commandrequest.hh"
 
 const NO_LINES = 5;
index f85abe8f212091469e9ec713a487ea91021cdbb3..e3bcade138846f7afa1b5961d4d5439237fefe76 100644 (file)
@@ -9,19 +9,17 @@
 #include "associter.hh"
 #include "script.hh"
 #include "musicalrequest.hh"
+#include "staffcolumn.hh"
 #include "voice.hh"
 #include "pscore.hh"
 #include "complexstaff.hh"
 #include "debug.hh"
-#include "voicegroup.hh"
+#include "voicegroupregs.hh"
+#include "voiceregs.hh"
 #include "complexwalker.hh"
 #include "misc.hh"
 #include "commandrequest.hh"
-#include "clefreg.hh"
-#include "localkeyreg.hh"
-#include "keyreg.hh"
-#include "meterreg.hh"
-#include "barreg.hh"
+#include "walkregs.hh"
 
 
 void
@@ -37,21 +35,17 @@ Complex_walker::do_announces()
     Request dummy_req;
     for (int i = 0; i < announce_info_arr_.size(); i++){
        Staff_elem_info info = announce_info_arr_[i];
+
        if (!info.req_l_)
            info.req_l_ = &dummy_req;
-       
+
+       walk_regs_p_->acknowledge_element(info);
        for (iter_top(voice_reg_list_,j); j.ok(); j++) {
            j->acknowledge_element(info);
        }
        for (iter_top ( group_reg_list_, j); j.ok(); j++) {
            j->acknowledge_element(info);
        }
-       bar_reg_p_->acknowledge_element(info);
-       clef_reg_p_->acknowledge_element(info);
-       key_reg_p_->acknowledge_element(info);
-       meter_reg_p_->acknowledge_element(info);
-       
-       local_key_reg_p_->acknowledge_element(info);
     }
 }
 
@@ -127,7 +121,7 @@ Complex_walker::do_change_group(Voice * v, String group_id_str)
 }
 
 bool
-Complex_walker::try_command_request(Nonmusical_req *req_l)
+Complex_walker::try_command_request(Command_req *req_l)
 {
     bool b=false;
     Voice *voice_l = (Voice*)req_l->elt_l_->voice_l_; // ugh
@@ -138,13 +132,7 @@ Complex_walker::try_command_request(Nonmusical_req *req_l)
        Voice_group_registers* reg_l = get_voice_group(voice_l);
        b |= reg_l->try_request(req_l);
     } else {
-       if (!b)
-           b |= bar_reg_p_->try_request(req_l);
-       b |= clef_reg_p_->try_request(req_l);
-       if (!b) 
-           b |= key_reg_p_->try_request(req_l);
-       if (!b)
-           b |= meter_reg_p_->try_request(req_l);
+       b |= walk_regs_p_->try_request(req_l);
     }
     return b;
 }
@@ -155,12 +143,12 @@ Complex_walker::try_request(Request*req)
     bool b=false;
     Voice *voice_l = (Voice*)req->elt_l_->voice_l_; // ahh. This sux
 
-    if (req->nonmus()) {
-       b = try_command_request(req->nonmus());
-    } else if (Voice_registers::acceptable_request(req)) {
+    if (req->command()) {
+       b = try_command_request(req->command());
+    } else if (Voice_registers::acceptable_request_b(req)) {
        Voice_registers *vregs_l = get_voice_reg(voice_l);
        b = vregs_l->try_request(req);
-    } else if (Voice_group_registers::acceptable_request(req)){
+    } else if (Voice_group_registers::acceptable_request_b(req)){
        Voice_group_registers* reg_l = get_voice_group(voice_l);
        b = reg_l->try_request(req);
     } 
@@ -190,18 +178,12 @@ Complex_walker::process_requests()
 void
 Complex_walker::regs_process_requests()
 {
+    walk_regs_p_->process_requests();
     for (iter_top(voice_reg_list_, j); j.ok(); j++) {
        j->process_requests();
     }
     for (iter_top(group_reg_list_, j); j.ok(); j++) 
        j->process_requests();
-    
-    
-    bar_reg_p_->process_request();
-    clef_reg_p_->process_request();
-    key_reg_p_->process_request();
-    meter_reg_p_->process_request();
-    local_key_reg_p_->process_request();
 }
 
 void
@@ -218,23 +200,13 @@ Complex_walker::typeset_element(Staff_elem *elem_p)
 Complex_walker::Complex_walker(Complex_staff*s)
     : Staff_walker(s, s->pstaff_l_->pscore_l_)
 {
-    local_key_reg_p_= new Local_key_register(this);
-    clef_reg_p_= new Clef_register(this);
-    key_reg_p_ = new Key_register(this);
-    bar_reg_p_ = new Bar_register(this);
-    meter_reg_p_ = new Meter_register(this);
-    
+    walk_regs_p_ = new Walker_registers(this);    
     do_post_move();
 }
 
 
 Complex_walker::~Complex_walker()
 {
-    delete local_key_reg_p_;
-    delete clef_reg_p_;
-    delete meter_reg_p_;
-    delete bar_reg_p_;
-    delete key_reg_p_;
 }
 
 int
@@ -259,16 +231,12 @@ Complex_walker::staff()
 void
 Complex_walker::do_pre_move()
 {
+    walk_regs_p_->pre_move_processing();
     for (iter_top(voice_reg_list_,i); i.ok(); i++) {
        i->pre_move_processing();   
     }
     for (iter_top (group_reg_list_, j); j.ok(); j++) 
        j->pre_move_processing();
-    local_key_reg_p_->pre_move_processing();
-    bar_reg_p_->pre_move_processing();
-    clef_reg_p_->pre_move_processing();
-    key_reg_p_->pre_move_processing();
-    meter_reg_p_->pre_move_processing();
 
     ptr()->typeset_breakable_items(prebreak_item_p_arr_,
                                   nobreak_item_p_arr_,
@@ -278,19 +246,13 @@ Complex_walker::do_pre_move()
 void
 Complex_walker::do_post_move()
 {
+    walk_regs_p_->post_move_processing();
     for (iter_top(voice_reg_list_,i); i.ok(); i++) {
        i->post_move_processing();   
     }
     announce_info_arr_.set_size(0);
     for (iter_top (group_reg_list_, j); j.ok(); j++) 
        j->post_move_processing();
-    
-    local_key_reg_p_->post_move_processing();
-    bar_reg_p_->post_move_processing();
-    clef_reg_p_->post_move_processing();
-    key_reg_p_->post_move_processing();
-    meter_reg_p_->post_move_processing();
-
 }
 
 Array<Voice_registers*>
index 8f3ca2cb933bc96e9c8450a69306d30ede325b78..b7ad70b0ab34b61deaa4f0c0540157f9c7ce6e90 100644 (file)
@@ -8,12 +8,12 @@ Input_music::check_plet(Voice_element* velt_l)
 {
     for (iter_top(velt_l->reqs,i); i.ok(); i++)
        if ( i->plet() ) {
-           Moment start_moment = 0.0;
+           Moment start_moment = 0;
            if ( !find_plet_start_bo( i->plet()->type_c_, start_moment ) ) {
                error( "begin of plet not found", i->defined_ch_c_l_ );
                break;
            }
-           Moment moment = 0.0;
+           Moment moment = 0;
            set_plet_backwards( moment, start_moment, i->plet()->dur_i_, i->plet()->type_i_ );
            i.del();
            break;
@@ -209,7 +209,7 @@ Music_general_chord::translate_time(Moment t)
 Moment
 Music_general_chord::length()const
 {
-    Moment l =0.0;
+    Moment l =0;
     
     for (iter_top(elts,i); i.ok(); i++) 
        l = l >? i->length();
index 963ebaf649c914e653dc355dfae35374c6af75da..197a8f6b319a994aac915c7c606da90ae3a2dc01 100644 (file)
@@ -13,7 +13,7 @@
 #include "keyitem.hh"
 #include "complexwalker.hh"
 #include "commandrequest.hh"
-#include "stcol.hh"
+#include "staffcolumn.hh"
 #include "localkeyreg.hh"
 #include "musicalrequest.hh"
 
@@ -27,15 +27,25 @@ Key_register::Key_register(Complex_walker*w)
 bool
 Key_register::try_request(Request * req_l)
 {
-    if (!req_l->nonmus()->keychange())
+    if (!req_l->command()->keychange())
        return false;
     assert(!keyreq_l_);                // todo
-    keyreq_l_ = req_l->nonmus()->keychange();
+    keyreq_l_ = req_l->command()->keychange();
     read_req(keyreq_l_);
-    walk_l_->local_key_reg_p_->local_key_.reset(key_); // ugh
     return true;
 }
 
+void
+Key_register::acknowledge_element(Staff_elem_info info)
+{
+    Command_req * r_l = info.req_l_->command() ;
+    if (r_l && r_l->clefchange() && !kit_p_) {
+        kit_p_ = new Key_item(walk_l_->c0_position_i());
+        kit_p_->read(*this);
+        announce_element(Staff_elem_info(kit_p_, keyreq_l_, this));
+    }
+}
+
 void
 Key_register::process_request()
 {
@@ -46,7 +56,7 @@ Key_register::process_request()
        default_key_b_ = true;
     }
 
-     if (default_key_b_ || keyreq_l_) {
+     if ( default_key_b_ || keyreq_l_) {
         kit_p_ = new Key_item(walk_l_->c0_position_i());
         kit_p_->read(*this);
         announce_element(Staff_elem_info(kit_p_, keyreq_l_, this));
@@ -57,7 +67,7 @@ void
 Key_register::do_pre_move_process()
 {
     if (kit_p_) {
-       if (default_key_b_)
+       if (default_key_b_) 
            typeset_breakable_item(0,0,kit_p_);
        else 
            typeset_breakable_item(
@@ -85,6 +95,4 @@ Key_register::do_post_move_process()
     keyreq_l_ = 0;
     default_key_b_ = false;
     kit_p_ = 0;
-    if (!walk_l_->time_.whole_in_measure_)
-       walk_l_->local_key_reg_p_->local_key_.reset(key_); // ugh
 }
index 56691097862134684307e99afcf138bead95b24f..3817a36ba21be6d4a66d04dd5a59179b2005f642 100644 (file)
@@ -4,14 +4,18 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "musicalrequest.hh"
+#include "commandrequest.hh"
 #include "localkeyreg.hh"
 #include "localkeyitem.hh"
 #include "complexwalker.hh"
+#include "keyreg.hh"
+#include "debug.hh"
 
 Local_key_register::Local_key_register(Complex_walker*w)
     : Request_register(w)
 {
-    key_item_p_ = 0;    
+    key_item_p_ = 0;
+    key_c_l_ = 0;
 }
 
 void
@@ -43,5 +47,21 @@ Local_key_register::acknowledge_element(Staff_elem_info info)
            local_key_.oct(melodic_l_->octave_i_)
                .set(melodic_l_->notename_i_, melodic_l_->accidental_i_);
        }
+    } else if (info.req_l_->command() &&
+              info.req_l_->command()->keychange()) {
+       Key_register * key_reg_l = (Key_register*)info.origin_reg_l_;
+       key_c_l_ = &key_reg_l->key_;
+       local_key_.reset(*key_c_l_);
+    }  
+}
+
+void
+Local_key_register::process_request()
+{
+    if (!walk_l_->time_.whole_in_measure_) {
+       if (key_c_l_)  
+           local_key_.reset(*key_c_l_);
+       else if( walk_l_->when() >0)
+           warning ("Help me! can't figure  current key", 0);
     }
 }
index f8ec193be08636e8cfd50d1a380873350e86fc75..30f49e5bf4b71bc17a8afe13841a3bf4cc5a744f 100644 (file)
@@ -13,7 +13,7 @@
 Lyric_item::Lyric_item(Lyric_req* lreq_l, int voice_count_i)
     : Text_item(lreq_l,0)
 {
-    pos_i_ = voice_count_i * -4 ;      // fontsize dependant. TODO
+    pos_i_ = -voice_count_i * 4 ;      // 4 fontsize dependant. TODO
     dir_i_ = -1;
 }
 
index fbff9a8cd5265ae1f037c8cfedbbc82480145d10..c77b716ec2afefba960dc10c9095eb4f492774a1 100644 (file)
@@ -13,7 +13,7 @@
 #include "lyricwalker.hh"
 #include "debug.hh"
 #include "lyricitem.hh"
-#include "stcol.hh"
+#include "staffcolumn.hh"
 
 void
 Lyric_walker::process_requests()
index e7d8b8e97320b96d4078f716e236a23401c14c60..3aab0fb29149c00a1c8190e007f3ddd03cfbc37b 100644 (file)
@@ -19,11 +19,11 @@ Meter_register::Meter_register(Complex_walker*w)
 bool
 Meter_register::try_request(Request*r_l)
 {
-    if (!r_l->nonmus()->meterchange()) 
+    if (!r_l->command()->meterchange()) 
        return false;
 
     assert(!meter_req_l_);
-    meter_req_l_ = r_l->nonmus()->meterchange();
+    meter_req_l_ = r_l->command()->meterchange();
 
     return true;
 }
index b17486e970c6f8e111f2ba5438db7326dacd4778..d84649fd4949b92ca2759e81c1649c5fc35650ad 100644 (file)
@@ -5,6 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwehuizen <jan@digicash.com> 
 */
+
 #include "plist.hh"
 #include "debug.hh"
 #include "score.hh"
@@ -14,7 +15,7 @@
 #include "midioutput.hh"
 #include "midiwalker.hh"
 #include "midiitem.hh"
-#include "stcol.hh"
+#include "staffcolumn.hh"
 #include "musicalrequest.hh"
 
 
index f1d74d87e47adee94e9d6484ceec854be3e82a6f..036a227686fb8f2eb64d1b7d4639f0dda226f932 100644 (file)
@@ -9,11 +9,11 @@
 #include "musicalrequest.hh"
 #include "pscore.hh"
 #include "staff.hh"
-#include "stcol.hh"
 #include "midiwalker.hh"
 #include "midiitem.hh"
 #include "midistream.hh"
 #include "debug.hh"
+#include "staffcolumn.hh"
 
 Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
     : PCursor<Staff_column*>(st_l->cols_)
@@ -21,7 +21,9 @@ Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
     track_l_ = track_l;
     last_moment_= 0;
 }
-
+/**
+  output notestop events for all notes which end before #max_moment#
+ */
 void
 Midi_walker::do_stop_notes(Moment max_moment)
 {
index d58f2622959d8f3bfeae718808bb51cb65bd8c6a..a1b45a96a5a090617e455c1bbe369c08e567bed2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  register.cc -- implement  Staff_elem_info, Request_register
+  register.cc -- implement Request_register
 
   Sourcefile of LilyPond musictypesetter
 
 #include "localkeyitem.hh"
 #include "complexstaff.hh"
 
-Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l,
-                                Request_register *reg_l)
-{
-    elem_p_ = s_l;
-    voice_l_ =  (r_l)?r_l->elt_l_->voice_l_:0;
-    req_l_ = r_l;
-    group_regs_l_ = 0;
-    origin_reg_l_ = reg_l;
-}
-
-Staff_elem_info::Staff_elem_info()
-{
-    elem_p_ = 0;
-    voice_l_ = 0;
-
-    group_regs_l_ = 0;
-    origin_reg_l_ = 0;
-    req_l_ = 0;
-}
 
-/* *************** */
 bool
 Request_register::try_request(Request*)
 {
@@ -93,3 +73,8 @@ Request_register::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
     walk_l_->typeset_breakable_item(pre_p,  nobreak_p,post_p);
 }
 
+bool
+Request_register::acceptable_request_b(Request*)const
+{
+    return false;
+}
diff --git a/src/registergroup.cc b/src/registergroup.cc
new file mode 100644 (file)
index 0000000..c1bb809
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+  registergroup.cc -- implement Register_group
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "registergroup.hh"
+#include "register.hh"
+
+bool
+Register_group::acceptable_request_b(Request* r)
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) {
+       if (i->acceptable_request_b(r))
+           return true;
+    }
+    return false;
+}
+
+void
+Register_group::set_dir(int d)
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) {
+       i->set_dir(d);
+    }
+}
+
+void
+Register_group::pre_move_processing()
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) 
+       i->pre_move_processing();
+}
+
+void
+Register_group::process_requests()
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) 
+       i->process_request();
+}
+
+void
+Register_group::post_move_processing()
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) 
+       i->post_move_processing();
+}
+
+void
+Register_group::acknowledge_element(Staff_elem_info info)
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) 
+       i->acknowledge_element(info);
+}
+
+
+bool
+Register_group::contains_b(Request_register* reg_l)
+{
+     for (iter_top(reg_list_, i); i.ok(); i++) 
+       if (i.ptr() == reg_l)
+           return true;
+     return false;
+}
+
+
+bool
+Register_group::try_request(Request*req_l)
+{
+    for (iter_top(reg_list_, i); i.ok(); i++) 
+       if (i->try_request(req_l))
+           return true;
+    return false;
+}
+
+
+                           
+void
+Register_group::add(Request_register *reg_p)
+{
+    reg_list_.bottom().add(reg_p);
+}
+
+Register_group::~Register_group()
+{
+}
diff --git a/src/sccol.cc b/src/sccol.cc
deleted file mode 100644 (file)
index 43d549b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-  sccol.cc -- implement Score_column
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "debug.hh"
-#include "pcol.hh"
-#include "sccol.hh"
-
-int
-Score_column::compare(Score_column & c1, Score_column &c2)
-{
-       return sign(c1.when_ - c2.when_);
-}
-
-void
-Score_column::set_breakable()
-{
-    pcol_l_->set_breakable();
-}
-
-Score_column::Score_column(Moment w)
-{
-    when_ = w;
-    pcol_l_ = new PCol(0);
-    musical_b_ = false;
-}
-
-bool
-Score_column::used_b() {
-    return pcol_l_->used_b();
-}
-
-void
-Score_column::print() const
-{
-#ifndef NPRINT
-    mtor << "Score_column { mus "<< musical_b_ <<" at " <<  when_<<'\n';
-    mtor << "durations: [";
-    for (int i=0; i < durations.size(); i++)
-       mtor << durations[i] << " ";
-    mtor << "]\n";
-    pcol_l_->print();
-    mtor << "}\n";
-#endif
-}
-
-int
-Moment_compare(Moment &a , Moment& b)
-{
-    return sign(a-b);
-}
-
-void
-Score_column::preprocess()
-{
-    durations.sort(Moment_compare);
-}
-void
-Score_column::add_duration(Moment d)
-{
-    assert(d);
-    for (int i = 0; i< durations.size(); i++) {
-       if (d == durations[i])
-           return ;
-    }
-    durations.push(d);
-}
-
-bool
-Score_column::breakable_b()
-{
-    return pcol_l_->breakable_b();
-}
index 83bffd72f775038d1a1ce06650d518de92f8a056..4d8ac6329699020e557eaed645594e7bf62d55f6 100644 (file)
@@ -7,7 +7,7 @@
 */
 #include "tstream.hh"
 #include "score.hh"
-#include "sccol.hh"
+#include "scorecolumn.hh"
 #include "pscore.hh"
 #include "staff.hh"
 #include "debug.hh"
@@ -159,15 +159,12 @@ Score::find_col(Moment w, bool mus)
 }
 
 void
-Score::do_cols()
-    
+Score::do_cols()    
 {
-
     iter_top(cols_,i);
     for (; i.ok(); i++) {
        pscore_p_->add(i->pcol_l_);
     }
-
 }
 
 Moment
diff --git a/src/scorecolumn.cc b/src/scorecolumn.cc
new file mode 100644 (file)
index 0000000..80fc804
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+  scorecolumn.cc -- implement Score_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "debug.hh"
+#include "pcol.hh"
+#include "scorecolumn.hh"
+
+int
+Score_column::compare(Score_column & c1, Score_column &c2)
+{
+       return sign(c1.when_ - c2.when_);
+}
+
+void
+Score_column::set_breakable()
+{
+    pcol_l_->set_breakable();
+}
+
+Score_column::Score_column(Moment w)
+{
+    when_ = w;
+    pcol_l_ = new PCol(0);
+    musical_b_ = false;
+}
+
+bool
+Score_column::used_b() {
+    return pcol_l_->used_b();
+}
+
+void
+Score_column::print() const
+{
+#ifndef NPRINT
+    mtor << "Score_column { mus "<< musical_b_ <<" at " <<  when_<<'\n';
+    mtor << "durations: [";
+    for (int i=0; i < durations.size(); i++)
+       mtor << durations[i] << " ";
+    mtor << "]\n";
+    pcol_l_->print();
+    mtor << "}\n";
+#endif
+}
+
+int
+Moment_compare(Moment &a , Moment& b)
+{
+    return sign(a-b);
+}
+
+void
+Score_column::preprocess()
+{
+    durations.sort(Moment_compare);
+}
+void
+Score_column::add_duration(Moment d)
+{
+    assert(d);
+    for (int i = 0; i< durations.size(); i++) {
+       if (d == durations[i])
+           return ;
+    }
+    durations.push(d);
+}
+
+bool
+Score_column::breakable_b()
+{
+    return pcol_l_->breakable_b();
+}
index 1cd9339ce92e59e71de421ac0d2b435b07616657..c79031ab9a62219b7158d49fce5cc9a5567828e4 100644 (file)
@@ -11,7 +11,7 @@
 #include "score.hh"
 #include "staffwalker.hh"
 #include "staff.hh"
-#include "sccol.hh"
+#include "scorecolumn.hh"
 
 Score_walker::Score_walker(Score *s)
     :PCursor<Score_column *> (s->cols_)
index a99696466125b5b3884762f5b92770c270206910..d5c08487abeea758e8bc8753377eff337df3e92c 100644 (file)
@@ -2,8 +2,8 @@
 #include "score.hh"
 #include "voice.hh"
 #include "staffwalker.hh"
-#include "stcol.hh"
-#include "sccol.hh"
+#include "staffcolumn.hh"
+#include "scorecolumn.hh"
 
 #include "debug.hh"
 #include "musicalrequest.hh"
@@ -57,17 +57,17 @@ Staff::get_col(Moment w, PCursor<Staff_column*> *last)
     }
 
 
-    PCursor<Score_column*> sccols(score_l_->find_col(w, false));
-    Staff_column* stcol_p = new Staff_column;
-    stcol_p->staff_l_ = this;
-    Score_column* comcol_l  = sccols++;
-    stcol_p->set_cols(comcol_l, sccols);
+    PCursor<Score_column*> scorecolumns(score_l_->find_col(w, false));
+    Staff_column* staffcolumn_p = new Staff_column;
+    staffcolumn_p->staff_l_ = this;
+    Score_column* comcol_l  = scorecolumns++;
+    staffcolumn_p->set_cols(comcol_l, scorecolumns);
     
     if (!i.ok()) {
-       cols_.bottom().add(    stcol_p);
+       cols_.bottom().add(    staffcolumn_p);
        i = cols_.bottom();
     } else {
-       i.insert(stcol_p);
+       i.insert(staffcolumn_p);
        i--;
     }
     if (last)
@@ -117,7 +117,7 @@ Staff::OK() const
 Moment
 Staff::last() const
 {
-    Moment l = 0.0;
+    Moment l = 0;
     for (iter_top(voice_list_,i); i.ok(); i++) {
        l = l >? i->last();
     }
diff --git a/src/staffcolumn.cc b/src/staffcolumn.cc
new file mode 100644 (file)
index 0000000..229ab69
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+  staffcolumn.cc -- implement Staff_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "staff.hh"
+#include "voice.hh"
+#include "timedescription.hh"
+#include "scorecolumn.hh"
+#include "staffcolumn.hh"
+#include "commandrequest.hh"
+#include "musicalrequest.hh"
+#include "interval.hh"
+#include "pscore.hh"
+#include "item.hh"
+#include "pcol.hh"
+
+void
+Staff_column::OK() const
+{
+#ifndef NDEBUG
+    assert (command_column_l_->when() == musical_column_l_->when());
+#endif
+}
+
+Moment
+Staff_column::when() const
+{
+    return (command_column_l_)?
+       command_column_l_->when():
+       musical_column_l_->when();
+}
+
+void
+Staff_column::add(Voice_element*ve)
+{
+    for (iter_top(ve->reqs,j); j.ok(); j++) {
+       if (j->command()) {
+           Command_req * c_l = j->command();
+           if (c_l->timing()) {
+               timing_req_l_arr_.push(j->command()->timing());
+           }
+           if (!c_l->barcheck() &&  !c_l->partial() &&
+               !c_l->measuregrouping())
+               setup_one_request(j);   // no need to bother children
+       } else {
+           if (j->rhythmic()) {
+               musical_column_l_->add_duration(j->rhythmic()->duration());
+           }
+           if (!j->musical()->skip())
+               setup_one_request(j);
+       }
+    }
+}
+
+Staff_column::Staff_column()
+{
+    musical_column_l_ = 0;
+    command_column_l_ = 0;
+    staff_l_ = 0;
+}
+
+
+
+
+Staff_column::~Staff_column()
+{
+}
+
+void
+Staff_column::set_cols(Score_column*c1, Score_column*c2)
+{
+    command_column_l_ = c1;
+    musical_column_l_ = c2;
+}
+
+void
+Staff_column::setup_one_request(Request * j)
+{
+    if (j->command()) // ugh
+       commandreq_l_arr_.push(j);
+    else if (j->musical())
+       musicalreq_l_arr_.push(j);
+}
+
+void
+Staff_column::typeset_musical_item(Item*i)
+{
+    assert(i);
+    Score_column * scorecolumn_l = musical_column_l_;
+    musical_column_l_->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_,
+                                                       staff_l_->pstaff_l_);
+}
+
+/**
+  align items in #item_l_arr#,
+
+  @return the width of the items after aligning.
+ */
+Interval
+align_items(Array<Item*> item_l_arr)
+{
+    Interval wid(0,0);
+    for  (int i =0; i < item_l_arr.size(); i++) {
+       Interval item_width= item_l_arr[i]->width();
+       Real dx =wid.right - item_width.left;
+       item_width += dx;
+       item_l_arr[i]->translate(Offset(dx ,0));
+       wid.unite(item_width);
+    }
+    return wid;
+}
+
+void 
+translate_items(Real x,  Array<Item*> item_l_arr)
+{
+    for  (int i =0; i < item_l_arr.size(); i++) 
+       item_l_arr[i]->translate(Offset(x, 0));
+}
+/*
+  UGR
+  This still sux
+  */
+void
+Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
+                                     Array<Item *> &nobreak_p_arr,
+                                     Array<Item *> &post_p_arr)
+{
+    PCol * c= command_column_l_->pcol_l_;
+    PScore *ps_l=command_column_l_->pcol_l_->pscore_l_;
+    
+    if (!c->breakable_b()) {     
+       for  (int i =0; i < pre_p_arr.size(); i++)
+           delete pre_p_arr[i];
+       pre_p_arr.set_size(0);
+       for  (int i =0; i < post_p_arr.size(); i++)
+           delete post_p_arr[i];
+       post_p_arr.set_size(0);
+    }
+
+      
+    for  (int i =0; i < pre_p_arr.size(); i++) {
+       ps_l->typeset_item(pre_p_arr[i], c, staff_l_->pstaff_l_,0);
+    }
+    for  (int i =0; i < nobreak_p_arr.size(); i++) {
+       ps_l->typeset_item(nobreak_p_arr[i], c, staff_l_->pstaff_l_,1);
+    }
+    for  (int i =0; i < post_p_arr.size(); i++) {
+       ps_l->typeset_item(post_p_arr[i], c, staff_l_->pstaff_l_,2);
+    }
+
+    Interval pre_wid= align_items(pre_p_arr);
+    translate_items( -pre_wid.right, pre_p_arr);
+    align_items(nobreak_p_arr);
+    Interval post_wid =align_items(post_p_arr);
+    translate_items (-post_wid.left , post_p_arr);
+
+    pre_p_arr.set_size(0);
+    post_p_arr.set_size(0);
+    nobreak_p_arr.set_size(0);
+}
diff --git a/src/staffeleminfo.cc b/src/staffeleminfo.cc
new file mode 100644 (file)
index 0000000..6110005
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  staffeleminfo.cc -- implement Staff_elem_info
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "staffeleminfo.hh"
+#include "request.hh"
+#include "voice.hh"
+
+Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l,
+                                Request_register *reg_l)
+{
+    elem_p_ = s_l;
+    voice_l_ =  (r_l)?r_l->elt_l_->voice_l_:0;
+    req_l_ = r_l;
+    group_regs_l_ = 0;
+    origin_reg_l_ = reg_l;
+}
+
+Staff_elem_info::Staff_elem_info()
+{
+    elem_p_ = 0;
+    voice_l_ = 0;
+
+    group_regs_l_ = 0;
+    origin_reg_l_ = 0;
+    req_l_ = 0;
+}
+
index bba82e38b8b9cee36a37ceb27e8b2f80bba2a37c..c3900d35f21673e831c457643433d34840ac4e36 100644 (file)
@@ -10,8 +10,8 @@
 #include "staff.hh"
 #include "musicalrequest.hh"
 #include "staffwalker.hh"
-#include "stcol.hh"
-#include "sccol.hh"
+#include "staffcolumn.hh"
+#include "scorecolumn.hh"
 #include "debug.hh"
 #include "timedescription.hh"
 #include "commandrequest.hh"
@@ -69,7 +69,7 @@ Staff_walker::process_timing_reqs()
        } else if (tr_l->barcheck() && time_.whole_in_measure_) {
            warning( "Barcheck failed", tr_l->defined_ch_c_l_ );
        } else if (tr_l->cadenza()) {
-           time_.set_cadenza(tr_l->cadenza()->on_b);
+           time_.set_cadenza(tr_l->cadenza()->on_b_);
        } else if (tr_l->measuregrouping()) {
            *default_grouping = parse_grouping(
                tr_l->measuregrouping()->beat_i_arr_,
diff --git a/src/stcol.cc b/src/stcol.cc
deleted file mode 100644 (file)
index c12a0d8..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-  stcol.cc -- implement Staff_column
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "staff.hh"
-#include "voice.hh"
-#include "timedescription.hh"
-#include "sccol.hh"
-#include "stcol.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
-#include "interval.hh"
-#include "pscore.hh"
-#include "item.hh"
-#include "pcol.hh"
-
-void
-Staff_column::OK() const
-{
-#ifndef NDEBUG
-    assert (command_column_l_->when() == musical_column_l_->when());
-#endif
-}
-
-Moment
-Staff_column::when() const
-{
-    return (command_column_l_)?
-       command_column_l_->when():
-       musical_column_l_->when();
-}
-
-void
-Staff_column::add(Voice_element*ve)
-{
-    for (iter_top(ve->reqs,j); j.ok(); j++) {
-       if (j->nonmus()) {
-           Nonmusical_req * c_l = j->nonmus();
-           if (c_l->timing()) {
-               timing_req_l_arr_.push(j->nonmus()->timing());
-           }
-           if (!c_l->barcheck() &&  !c_l->partial() &&
-               !c_l->measuregrouping())
-               setup_one_request(j);   // no need to bother children
-       } else {
-           if (j->rhythmic()) {
-               musical_column_l_->add_duration(j->rhythmic()->duration());
-           }
-           if (!j->musical()->skip())
-               setup_one_request(j);
-       }
-    }
-}
-
-Staff_column::Staff_column()
-{
-    musical_column_l_ = 0;
-    command_column_l_ = 0;
-    staff_l_ = 0;
-}
-
-
-
-
-Staff_column::~Staff_column()
-{
-}
-
-void
-Staff_column::set_cols(Score_column*c1, Score_column*c2)
-{
-    command_column_l_ = c1;
-    musical_column_l_ = c2;
-}
-
-void
-Staff_column::setup_one_request(Request * j)
-{
-    if (j->nonmus()) // ugh
-       commandreq_l_arr_.push(j);
-    else if (j->musical())
-       musicalreq_l_arr_.push(j);
-}
-
-void
-Staff_column::typeset_musical_item(Item*i)
-{
-    assert(i);
-    Score_column * sccol_l = musical_column_l_;
-    musical_column_l_->pcol_l_->pscore_l_->typeset_item(i, sccol_l->pcol_l_,
-                                                       staff_l_->pstaff_l_);
-}
-
-/**
-  align items in #item_l_arr#, return the width.
- */
-Interval
-align_items(Array<Item*> item_l_arr)
-{
-    Interval wid(0,0);
-    for  (int i =0; i < item_l_arr.size(); i++) {
-       Interval item_width= item_l_arr[i]->width();
-       item_l_arr[i]->translate(Offset( wid.right - item_width.left ,0));
-       wid.unite(item_width);
-    }
-    return wid;
-}
-
-void 
-translate_items(Real x,  Array<Item*> item_l_arr)
-{
-    for  (int i =0; i < item_l_arr.size(); i++) 
-       item_l_arr[i]->translate(Offset(x, 0));
-}
-/*
-  UGR
-  This still sux
-  */
-void
-Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
-                                     Array<Item *> &nobreak_p_arr,
-                                     Array<Item *> &post_p_arr)
-{
-    PCol * c= command_column_l_->pcol_l_;
-    PScore *ps_l=command_column_l_->pcol_l_->pscore_l_;
-    
-    if (!c->breakable_b()) {     
-       for  (int i =0; i < pre_p_arr.size(); i++)
-           delete pre_p_arr[i];
-       pre_p_arr.set_size(0);
-       for  (int i =0; i < post_p_arr.size(); i++)
-           delete post_p_arr[i];
-       post_p_arr.set_size(0);
-    }
-
-      
-    for  (int i =0; i < pre_p_arr.size(); i++) {
-       ps_l->typeset_item(pre_p_arr[i], c, staff_l_->pstaff_l_,0);
-    }
-    for  (int i =0; i < nobreak_p_arr.size(); i++) {
-       ps_l->typeset_item(nobreak_p_arr[i], c, staff_l_->pstaff_l_,1);
-    }
-    for  (int i =0; i < post_p_arr.size(); i++) {
-       ps_l->typeset_item(post_p_arr[i], c, staff_l_->pstaff_l_,2);
-    }
-
-    Interval pre_wid= align_items(pre_p_arr);
-    translate_items( -pre_wid.right, pre_p_arr);
-    align_items(nobreak_p_arr);
-    Interval post_wid =align_items(post_p_arr);
-    translate_items (-post_wid.left , post_p_arr);
-
-    pre_p_arr.set_size(0);
-    post_p_arr.set_size(0);
-    nobreak_p_arr.set_size(0);
-}
index 29d4b1eaf387af9a5308cc6a871cc1c15c51dff5..b3b8624ef06b1aa3b4d159e4c7ab4c56d17a9231 100644 (file)
@@ -1,9 +1,17 @@
+/*
+  template2.cc -- instantiate some list templates. 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "symbol.hh"
 #include "voice.hh"
 #include "musicalrequest.hh"
 #include "staff.hh"
-#include "sccol.hh"
-#include "stcol.hh"
+#include "scorecolumn.hh"
+#include "staffcolumn.hh"
 #include "spanner.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
index 69f7513390806572fe75962959ed710704998504..d26e748e6f490afe5ebc94024471d4675eeba0ce 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  template4.cc -- instantiate PointerList baseclass.
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "proto.hh"
 #include "list.tcc"
 #include "cursor.tcc"
index 1f94149abfe7de72bdb31f0010c201b70764427f..e85062003e9b38e7467755adcff5feeec883bff7 100644 (file)
@@ -1,8 +1,10 @@
 #include "proto.hh"
 #include "plist.tcc"
 #include "register.hh"
-#include "voicegroup.hh"
+#include "voicegroupregs.hh"
+#include "voiceregs.hh"
 
 
 IPL_instantiate(Voice_registers);
 IPL_instantiate(Voice_group_registers);
+IPL_instantiate(Request_register);
index 718e7cb6d1124b215d79b5f053bcf2bfcea6b765..ad07cf2040acbac7375f11cd385801abb910a01b 100644 (file)
@@ -48,7 +48,7 @@ Voice::Voice(Voice const&src)
 
 Voice::Voice()
 {
-    start = 0.0;
+    start = 0;
 }
 
 void
diff --git a/src/voicegroup.cc b/src/voicegroup.cc
deleted file mode 100644 (file)
index 0674ee0..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-  voicegroup.cc -- implement Voice_group_registers
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "plist.hh"
-#include "musicalrequest.hh"
-#include "voicegroup.hh"
-#include "register.hh"
-#include "textreg.hh"
-#include "stembeamreg.hh"
-#include "scriptreg.hh"
-#include "complexwalker.hh"
-#include "commandrequest.hh"
-
-static int temp_id_count;
-
-Voice_group_registers::Voice_group_registers(Complex_walker*w_l, String id)
-{
-    walk_l_ = w_l;
-    text_reg_=new Text_register(w_l);
-    stem_beam_reg_= new Stem_beam_register(w_l);
-    script_reg_ = new Script_register(w_l);
-    if (id=="")
-       id = __FUNCTION__ + String(temp_id_count++);
-    group_id_str_ = id;
-    dir_i_ = 0;
-}
-
-Voice_group_registers::~Voice_group_registers()
-{
-    delete text_reg_;
-    delete stem_beam_reg_;
-    delete script_reg_;
-}
-
-void
-Voice_group_registers::pre_move_processing()
-{
-    stem_beam_reg_->pre_move_processing();
-    script_reg_->pre_move_processing();
-    text_reg_->pre_move_processing();  
-}
-
-void
-Voice_group_registers::post_move_processing()
-{
-    stem_beam_reg_->post_move_processing();
-    text_reg_->post_move_processing();
-    script_reg_->post_move_processing();
-}
-
-bool
-Voice_group_registers::try_request(Request*r_l)
-{
-    if (r_l->groupfeature()) {
-       set_dir(r_l->groupfeature()->stemdir_i_);
-       return true;
-    } 
-    bool b = stem_beam_reg_->try_request(r_l);
-    if (!b)
-       b|= script_reg_->try_request(r_l);
-    if (!b)
-       b|=  text_reg_->try_request(r_l);
-
-    return b;
-}
-    
-void
-Voice_group_registers::acknowledge_element(Staff_elem_info i)
-{
-    if (i.group_regs_l_!= this)
-       return;
-       
-    stem_beam_reg_->acknowledge_element(i);
-    script_reg_->acknowledge_element(i);
-    text_reg_->acknowledge_element(i);
-}
-
-void
-Voice_group_registers::set_dir(int i)
-{
-    stem_beam_reg_->set_dir(i);
-    script_reg_->set_dir(i);
-    text_reg_->set_dir(i);
-    
-    Array<Voice_registers*> vr_arr (walk_l_->get_voice_regs(this));
-    for (int j=0; j<vr_arr.size(); j++) {
-       if (vr_arr[j])
-           vr_arr[j]->set_dir(i);
-}
-}
-void
-Voice_group_registers::process_requests()
-{
-    stem_beam_reg_->process_request();    
-    script_reg_->process_request();
-    text_reg_->process_request();
-}
-
-
-bool
-Voice_group_registers::acceptable_request(Request*r)
-{
-    return (r->stem() || r->beam() || r->text() || r->script() ||
-           r->groupfeature());
-}
diff --git a/src/voicegroupregs.cc b/src/voicegroupregs.cc
new file mode 100644 (file)
index 0000000..d23b58a
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+  voicegroup.cc -- implement Voice_group_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "plist.hh"
+#include "musicalrequest.hh"
+#include "voiceregs.hh"
+#include "voicegroupregs.hh"
+#include "register.hh"
+#include "textreg.hh"
+#include "stembeamreg.hh"
+#include "scriptreg.hh"
+#include "complexwalker.hh"
+#include "commandrequest.hh"
+
+static int temp_id_count;
+
+Voice_group_registers::Voice_group_registers(Complex_walker*w_l, String id)
+{
+    walk_l_ = w_l;
+    add(new Text_register(w_l));
+    add(new Stem_beam_register(w_l));
+    add(new Script_register(w_l));
+    
+    if (id=="")                        // UGH
+       id = __FUNCTION__ + String(temp_id_count++);
+    group_id_str_ = id;
+}
+
+bool
+Voice_group_registers::try_request(Request*r_l)
+{
+    if (r_l->groupfeature()) {
+       set_dir(r_l->groupfeature()->stemdir_i_);
+       return true;
+    }
+    return Register_group::try_request(r_l);
+}
+    
+void
+Voice_group_registers::acknowledge_element(Staff_elem_info i)
+{
+    if (i.group_regs_l_!= this)
+       return;
+    Register_group::acknowledge_element(i);
+}
+#if 1
+void
+Voice_group_registers::set_dir(int i)
+{
+    Register_group::set_dir(i);
+
+    // ughh
+    Array<Voice_registers*> vr_arr (walk_l_->get_voice_regs(this));
+    for (int j=0; j<vr_arr.size(); j++) {
+       if (vr_arr[j])
+           vr_arr[j]->set_dir(i);
+    }
+}
+#endif
+bool
+Voice_group_registers::acceptable_request_b(Request*r)
+{
+    return (r->stem() || r->beam() || r->text() || r->script() ||
+           r->groupfeature());
+}
index d6c24cd674e1e2bb2ca72ed9f118c0007e49a01c..ea56a5da4643b064da4fc54b94a26049e8097ad2 100644 (file)
@@ -1,5 +1,13 @@
+/*
+  voiceregs.cc -- implement Voice_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "musicalrequest.hh"
-#include "voicegroup.hh"
+#include "voiceregs.hh"
 #include "register.hh"
 #include "slurreg.hh"
 #include "headreg.hh"
@@ -7,21 +15,8 @@
 Voice_registers::Voice_registers(Complex_walker*c_l, Voice *v_p)
 {
     voice_l_ = v_p;
-    head_reg_ = new Notehead_register(c_l);
-    slur_reg_ = new Slur_register(c_l);
-}
-Voice_registers::~Voice_registers()
-{
-    delete head_reg_;
-    delete slur_reg_;
-}
-bool
-Voice_registers::try_request(Request * r_l)
-{
-    bool b = head_reg_->try_request(r_l);
-    if (!b)
-       b = slur_reg_->try_request(r_l);
-    return b;
+    add(new Notehead_register(c_l));
+    add(new Slur_register(c_l));
 }
 
 void
@@ -29,41 +24,11 @@ Voice_registers::acknowledge_element(Staff_elem_info i)
 {
     if (i.voice_l_ != voice_l_)
        return;
-    if (i.origin_reg_l_ != slur_reg_)
-       slur_reg_->acknowledge_element(i);
-}
-
-void
-Voice_registers::pre_move_processing()
-{
-    head_reg_->pre_move_processing();
-    slur_reg_->pre_move_processing();
-}
-void
-Voice_registers::post_move_processing()
-{
-    head_reg_->post_move_processing();
-    slur_reg_->post_move_processing();
-}
-
-void
-Voice_registers::process_requests()
-{
-    head_reg_->process_request();
-    slur_reg_->process_request();
+    Register_group::acknowledge_element(i);
 }
 
 bool
-Voice_registers::acceptable_request(Request*r)
+Voice_registers::acceptable_request_b(Request*r)
 {
     return (r->rest() || r->note() || r->slur());
-    
-}
-
-void
-Voice_registers::set_dir(int i)
-{
-    head_reg_->set_dir(i);
-    slur_reg_->set_dir(i);
 }
-
diff --git a/src/walkregs.cc b/src/walkregs.cc
new file mode 100644 (file)
index 0000000..4381688
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  walkregs.cc -- implement Walker_registers
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "clefreg.hh"
+#include "localkeyreg.hh"
+#include "keyreg.hh"
+#include "meterreg.hh"
+#include "barreg.hh"
+#include "walkregs.hh"
+
+Walker_registers::Walker_registers(Complex_walker *w)
+{
+    add( new Bar_register(w));
+    add( new Meter_register(w));
+    add( new Clef_register(w));
+    add( new Key_register(w));
+    add( new Local_key_register(w));
+}