]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.22
authorfred <fred>
Sun, 24 Mar 2002 19:27:45 +0000 (19:27 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:27:45 +0000 (19:27 +0000)
NEWS
Variables.make
hdr/simplewalker.hh
kortjakje.ly
src/getcommands.cc
src/simplewalker.cc

diff --git a/NEWS b/NEWS
index def00e3b86bbab1f052242ba134a4c285b8478a1..a2033eb3665e15ea6a448a9e7fc0a34fc1587eed 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,19 +1,34 @@
+pl 22:
+       - doco from mpp
+       - repeat signs
+       - | checks for bar in a voice (Barcheck_req)
+Internal changes:
+       - naming (Hungarian notation, svec vs. Array)
+       - huge memleak fixed; unearthed lots of bugs
+       - bug noteheadswap
+       - cleanup PScore, Score
+       - removed Staff_commands, plugging commands into Staff_column directly
+
 pl 21:
-       - Move breaking stuff into a separate class Break_algorithm
-       - dependencies for Staff_elem's
        - scripts
        - texts
        - nplets (triplets!)
+Internal changes:
+       - Move breaking stuff into a separate class Break_algorithm
+       - dependencies for Staff_elem's
 
 pl 20:
-       - Rational for time measurement
        - updated doco to .pod
+       - include files from .ly
+Internal changes:
+       - Rational for time measurement
        - directionalspanner/textspanner
-       - include files
 
 pl 19:
-       - struct Moment
        - grouping code: LilyPond can set advanced multibeams.
+Internal changes:
+       - struct Moment
+
 
 pl 18:
        - robust Staff_commands
index cd4a663b6ecf025b97a1c85d668a31a1c56ff04e..eea032df7fbcb6c78adce67fe626d661646daa05 100644 (file)
@@ -37,7 +37,7 @@ endif
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=21
+PATCHLEVEL=22
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 CXXVER=`$(CXX) --version`
 
@@ -77,7 +77,8 @@ DNAME=$(PACKAGENAME)-$(VERSION)
 othersrc=lexer.l parser.y
 SCRIPTS=make_version make_patch genheader
 IFILES=dimen.tex symbol.ini kortjakje.ly pavane.ly  maartje.ly\
-       lilyponddefs.tex test.tex .dstreamrc cadenza.ly
+       lilyponddefs.tex test.tex .dstreamrc cadenza.ly scales.ly\
+       titledefs.tex pavane.tex
 OFILES=Makefile Variables.make Sources.make COPYING README NEWS
 DFILES=$(OFILES) $(IFILES) $(SCRIPTS)
 
index 635b9fbbcc66b737d2a32f3ac4d1d73875383219..34403e465ca425be6265ac4744398e3dbab28963 100644 (file)
 
 struct Simple_walker: Staff_walker {
     Stem *stem_;
-    svec<Notehead *>noteheads;
+    Array<Notehead *>noteheads;
     Local_key local_key_;
     Key key_;
-    svec<int> *oldkey_undo;
-    svec<int> typesetkey;
+    Array<int> *oldkey_undo;
+    Array<int> typesetkey;
     Beam *beam_;
     Local_key_item *local_key_item_;
     bool wantkey;              // urgh
+    int processed_bar_priority;
     bool processed_key;
     bool processed_clef;
     Clef clef_;
     Rhythmic_grouping default_grouping;
     Rhythmic_grouping *current_grouping;
-    svec<Slur_req*> pending_slur_reqs;
-    svec<Slur*>  pending_slurs;
-    
+    Array<Slur_req*> pending_slur_reqs;
+    Array<Slur*>  pending_slurs;
+
     /****************/
 
     virtual void do_TYPESET_command(Command*);
index f5e6d081397af8ff4e5edcd2b437fb41c6a19970..ac78340c4fade31a8d7ae2e51e723a882486646a 100644 (file)
@@ -11,17 +11,20 @@ melodie = music {
        \octave {}              % set the default octave
        % the default note duratino is 4
        %%% theme
-         c c g g       a a
-         g2            % g2 means a "g-1" pitched half-note 
-       f f     e e     d d  c2
-         g g   f f     e e     d d     g g     f f     e e     d d
+       c c |                   % the '|' checks if there is a new measure here.
+       g g|
+       a a|
+
+       g2|     % g2 means a "g-1" pitched half-note 
+       f f|    e e|    d d|  c2
+       g g|    f f|    e e|    d d|    g g|    f f|    e e|    d d|
        %%% var 1
          c r8 c8               % r8 means an 8th rest.
-                 (             % start a slur
+                 (|            % start a slur
                                % NOTE: the slurstart should be directly after the note
                        )       % end a slur.
-                         g r8 g8 (     ) a r8 a8 (     ) g r4 
-         f r8 f8 (     ) e4 r8 e8 (    ) d4 r8 d8 (    ) c4 r4
+                         g r8 g8 (|    ) a r8 a8 (|    ) g r4 
+         f r8 f8 (|    ) e4 r8 e8 (    |) d4 r8 d8 (|  ) c4 r4 
 $}
 
                                % more of this.
@@ -49,7 +52,6 @@ bstaf = staff {
        music { begeleiding }   % use the declared music
                commands {      % commands with Staff-wide impact.
                        clef bass       % bass-clef
-
                }
        }
 
@@ -57,6 +59,7 @@ bstaf = staff {
 vstaf = staff {
        melodic
                music { melodie }
+               commands { clef violin }
                                % default clef is violin clef
        }
 
@@ -69,8 +72,8 @@ score {
        }
        commands {
                meter 2 4       % a 2/4 meter.
-               skip 32:0       % skip 32 measures, and generate the bars
-               meter 6 8       % another meter
+               skip 33:0       % skip 32 measures, and generate the bars
+%              meter 6 8       % another meter
        }
 }
 
index b415e0b1cfb5d0a1cef5376a4bdeca5bb6acbb9b..6545c0ec1c083f5cb445aa0c74d73cb3552dbb61 100644 (file)
@@ -4,7 +4,7 @@
 #include "command.hh"
 
 Command*
-get_key_typeset_command(svec<Scalar>which)
+get_key_typeset_command(Array<Scalar>which)
 {
     Command*c = new Command;
     c->code = TYPESET;    
@@ -20,7 +20,6 @@ get_meter_command(int n, int m)
 {
     Command*c = new Command;
     
-//    c->when = w;
     c->code = TYPESET;
     c->args.add( "METER");
     c->args.add( n );
@@ -29,3 +28,38 @@ get_meter_command(int n, int m)
     return c;
 }
 
+Command
+get_defaultbar_command()
+{
+    Command c;
+    c.code = TYPESET;
+    c.args.add("BAR");
+    c.args.add("default");
+    return c;
+}
+
+void
+split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,
+                 String s)
+{
+    Command c;
+    c.code = TYPESET;
+    c.priority = (s=="default") ? 100: 110;
+    c.args.add("BAR");
+    if(s=="default")
+       s = "|";
+    
+    if (s == "|" || s == ":|" || s == "||") {
+       c.args.add(s);
+       pre_com= no_break_com= c;       
+    } else if (s == ":|:") {
+       no_break_com=post_com=pre_com = c;
+       
+       pre_com.args.add( ":|");
+       no_break_com.args.add( s);
+       post_com.args.add( "|:");
+    }else if (s=="|:") {
+       c.args.add(s);
+       no_break_com=post_com=c;
+    } 
+}
index 945f5151decff85f9e46c5f78db10c5f1f2ed5d8..21ed11573af506ead3bdbd1089fffad83bccf698 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  UGR
+  UGR!! CHAOS RULEZ
   */
 #include "textspanner.hh"
 #include "script.hh"
 #include "textitem.hh"
 
 Rhythmic_grouping
-parse_grouping(svec<Scalar> a, Moment one_beat)
+parse_grouping(Array<Scalar> a, Moment one_beat)
 {
-    svec<int> r;
-    for (int i= 0 ; i < a.sz(); i++)
+    Array<int> r;
+    for (int i= 0 ; i < a.size(); i++)
        r.add(a[i]);
     Moment here =0.0;
 
-    svec<Rhythmic_grouping*> children;
-    for (int i=0; i < r.sz(); i++) {
+    Array<Rhythmic_grouping*> children;
+    for (int i=0; i < r.size(); i++) {
        
        Moment last = here;
        here += one_beat * r[i];
@@ -45,19 +45,19 @@ parse_grouping(svec<Scalar> a, Moment one_beat)
 void
 Simple_walker::do_INTERPRET_command(Command*com)
 {
-    svec<Scalar> args(com->args);
+    Array<Scalar> args(com->args);
     args.del(0);
     if (com->args[0] == "GROUPING") {  
        default_grouping = parse_grouping(args,
                                          col()->tdescription_->one_beat);
-    }else if (com->args[0] == "BAR") {
+    }else if (com->args[0] == "NEWMEASURE") {
        local_key_.reset(key_);
 
     } else if (com->args[0] == "KEY") {
        
        if (col()->when() > Moment(0)) {
            assert(!oldkey_undo);
-           oldkey_undo = new svec<int>( key_.oldkey_undo(args));
+           oldkey_undo = new Array<int>( key_.oldkey_undo(args));
        }
        
        typesetkey = key_.read(args);
@@ -84,7 +84,13 @@ Simple_walker::do_TYPESET_command(Command*com)
        if (processed_clef) 
            return;
     }
-    
+    if (com->args[0] == "BAR") {
+       
+       if (processed_bar_priority > com->priority)
+           return;
+       else
+           processed_bar_priority = com->priority;
+    }
 
     Item* i = staff()->get_TYPESET_item(com);
     if (!i)
@@ -132,11 +138,13 @@ Simple_walker::do_note(Note_info n)
        Item*rhythmic=0;
     if (n.rq->note()) {
        Note_req * req = n.rq->note() ;
-       const Voice *v = req->elt->voice_;
+       const Voice *v = req->elt_l_->voice_;
 
        Notehead*n = s->get_notehead(req, clef_.c0_pos);
        rhythmic=n;
-       stem_->add(n);
+       if (stem_)
+           stem_->add(n);
+       
        if (current_grouping) {
            current_grouping->add_child(
                c->tdescription_->whole_in_measure, req->duration());
@@ -168,14 +176,15 @@ Simple_walker::process_requests()
            error("Too many beams (t = "
                          +String(c->when())+")");
        beam_ = new Beam;
+       assert(!current_grouping);
        current_grouping = new Rhythmic_grouping;
     }
     
-    for (int i=0; i < c->slurs.sz(); i++) {
+    for (int i=0; i < c->slurs.size(); i++) {
        Slur_req*sl = c->slurs[i];
 
        if (sl->spantype == Span_req::START) {
-           if  (find_slur(sl->elt->voice_ )>=0)
+           if  (find_slur(sl->elt_l_->voice_ )>=0)
                error_t("Too many slurs in voice", col()->when());
            pending_slur_reqs.add(sl);
            pending_slurs.add(new Slur);
@@ -190,7 +199,7 @@ Simple_walker::process_requests()
        stem_ = s->get_stem(c->stem_->stem(), c->stem_requester_len);
     }
     
-    for (int i = 0; i <  c->notes.sz(); i ++)  {
+    for (int i = 0; i <  c->notes.size(); i ++)  {
        do_note(c->notes[i]);
     }
     
@@ -208,6 +217,7 @@ Simple_walker::process_requests()
        /* needed, otherwise placement of
           local_key fucks up */
     }
+
     if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
        beam_->set_grouping(default_grouping, *current_grouping);
        pscore_->typeset_spanner(beam_, s->theline);
@@ -223,7 +233,7 @@ Simple_walker::process_requests()
        delete current_grouping;
        current_grouping =0;
     }
-    for (int i = 0; i < noteheads.sz(); i++) {
+    for (int i = 0; i < noteheads.size(); i++) {
        c->typeset_item(noteheads[i]);
     }
     noteheads.set_size(0);
@@ -235,13 +245,13 @@ Simple_walker::process_requests()
     if (stem_) {
        stem_ = 0;
     }
-    for (int i=0; i < c->slurs.sz(); i++) {
+    for (int i=0; i < c->slurs.size(); i++) {
        Slur_req *sl = c->slurs[i];
 
        if (sl->spantype == Span_req::STOP) {
-           int idx = find_slur(sl->elt->voice_);
+           int idx = find_slur(sl->elt_l_->voice_);
            if (idx < 0)
-               error("can't find slur to end");
+               error_t("can't find slur to end; ", c->when());
            
            pscore_->typeset_spanner(pending_slurs[idx],
                                     s->theline);
@@ -253,7 +263,7 @@ Simple_walker::process_requests()
 }
 
 Simple_walker::Simple_walker(Simple_staff*s)
-    : Staff_walker(s, s->theline->pscore_)
+    : Staff_walker(s, s->theline->pscore_l_)
 {
     stem_ = 0;
     beam_ =0;
@@ -285,13 +295,14 @@ Simple_walker::reset()
 {
     processed_clef =false;    
     processed_key = false;
+    processed_bar_priority = 0;
 }
 
 int
 Simple_walker::find_slur(const Voice *v)
 {
-    for (int i=0; i < pending_slur_reqs.sz(); i++) {
-       if (pending_slur_reqs[i]->elt->voice_ == v)
+    for (int i=0; i < pending_slur_reqs.size(); i++) {
+       if (pending_slur_reqs[i]->elt_l_->voice_ == v)
            return i;
     }
     return -1;