]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.91.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 30 Sep 2000 23:58:00 +0000 (01:58 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 30 Sep 2000 23:58:00 +0000 (01:58 +0200)
1.3.91.jcn1
===========

* Abort all running spanners when part-combiner combines voices.

CHANGES
Documentation/regression-test.tely
VERSION
lily/beam-engraver.cc
lily/dynamic-engraver.cc
lily/part-combine-music-iterator.cc
lily/slur-engraver.cc

diff --git a/CHANGES b/CHANGES
index 79bdc9e7cd20f58a77aa41090b95e567b53bbc4e..9b04a9f385c6df507782e4e6115dab32b2dab41a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+1.3.91.jcn1
+===========
+
+* Abort all running spanners when part-combiner combines voices.
+
 1.3.90.jcn1
 ===========
 
index 127f991038074b4488aeb30f5a65949deeb91f64..f0db906fb6985497ad7365068ae4bb159ed47168 100644 (file)
@@ -8,7 +8,7 @@
 @title LilyPond Regression test
 @end ignore
 
-@node Top, , ,
+@node Top, , , (dir)
 
 @section Introduction
 
diff --git a/VERSION b/VERSION
index f34eb289b7972b541becdbc28859158f411959cc..e8eabc10d0394bf5d7ae58c0bcb2994734e7bd96 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=91
-MY_PATCH_LEVEL=tca2
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index a4ffe9a51930cd6d3934516bdf019f5beff39ed6..25ab6a735eeaf90fc259bf688f5ea9e48393bb00 100644 (file)
@@ -66,29 +66,38 @@ Beam_engraver::do_try_music (Music *m)
 {
   if (Span_req * c = dynamic_cast<Span_req*>(m))
     {
-      if (c->span_type_str_ != "beam")
-       return false;
-      
-      Direction d =c->span_dir_;
-
-      if (d == STOP && !beam_p_)
+      if (c->span_type_str_ == "abort")
        {
-         m->origin ()->warning  (_ ("can't find start of beam"));
-         return false;
+         reqs_drul_[START] = 0;
+         reqs_drul_[STOP] = 0;
+         if (beam_p_)
+           beam_p_->suicide ();
+         beam_p_ = 0;
        }
-
-      if(d == STOP)
+      else if (c->span_type_str_ == "beam")
        {
-         SCM m = get_property ("automaticMelismata");
-         SCM b = get_property("noAutoBeaming");
-         if (to_boolean (m) && to_boolean(b))
+      
+         Direction d =c->span_dir_;
+
+         if (d == STOP && !beam_p_)
            {
-             set_melisma (false);
+             m->origin ()->warning  (_ ("can't find start of beam"));
+             return false;
            }
-       }
 
-      reqs_drul_[d ] = c;
-      return true;
+         if(d == STOP)
+           {
+             SCM m = get_property ("automaticMelismata");
+             SCM b = get_property("noAutoBeaming");
+             if (to_boolean (m) && to_boolean(b))
+               {
+                 set_melisma (false);
+               }
+           }
+
+         reqs_drul_[d ] = c;
+         return true;
+       }
     }
   return false;
 }
index bdd8f8e656fa13efe48344885901d4b4ba43466d..e0788f08e5e68644806394f9ce69a1bc8a13263d 100644 (file)
@@ -100,7 +100,15 @@ Dynamic_engraver::do_try_music (Music * m)
     }
   else if (Span_req* s =  dynamic_cast <Span_req*> (m))
     {
-      if ((s->span_type_str_ == "crescendo"
+      if (s->span_type_str_ == "abort")
+       {
+         accepted_spanreqs_drul_[LEFT] = 0;
+         accepted_spanreqs_drul_[RIGHT] = 0;
+         if (line_spanner_)
+           line_spanner_->suicide ();
+         line_spanner_ = 0;
+       }
+      else if ((s->span_type_str_ == "crescendo"
           || s->span_type_str_ == "decrescendo"))
        {
          accepted_spanreqs_drul_[s->span_dir_] = s;
index 754b1023bbf74d8e7affd0ec0a61bf64284f55af..498f0fc831fe7f3309031437046c6d6a91ac07c9 100644 (file)
@@ -325,6 +325,26 @@ Part_combine_music_iterator::process (Moment m)
   else if (state & (UNIRHYTHM | UNISILENCE))
     combine_b = true;
 
+  /*
+    When combining, abort all running spanners
+   */
+  if (combine_b && combine_b != previously_combined_b)
+    {
+#if 0
+      // Urg: Error in unknown function during GC: rogue pointer in heap
+      // Who deletes this 'pointer'?
+      Span_req abort;
+      abort.span_type_str_ = "abort";
+      if (second_iter_p_ && second_iter_p_->ok ())
+       second_translator->try_music (&abort);
+#else
+      Span_req* abort = new Span_req;
+      abort->span_type_str_ = "abort";
+      if (second_iter_p_ && second_iter_p_->ok ())
+       second_iter_p_->try_music (abort);
+#endif
+     }
+
   if (combine_b != previously_combined_b)
     change_to (second_iter_p_, p->what_str_, (combine_b ? "one" : "two")
               + suffix_);
index 763d77a3e585cb075cb7287d996f129b86961d22..8fe4f5de8510cb43b9ebaa6b88954c0f47aedfbf 100644 (file)
 #include "engraver.hh"
 #include "spanner.hh"
 
-class Slur_engraver :public Engraver {
+class Slur_engraver : public Engraver
+{
   Link_array<Span_req> requests_arr_;
   Link_array<Span_req> new_slur_req_l_arr_;
   Link_array<Score_element> slur_l_stack_;
   Link_array<Score_element> end_slur_l_arr_;
 
   void set_melisma (bool);
+
 protected:
   virtual bool do_try_music (Music*);
   virtual void do_process_music ();
@@ -30,7 +32,6 @@ protected:
 
 public:
   VIRTUAL_COPY_CONS (Translator);
-  
 };
 
 bool
@@ -38,11 +39,26 @@ Slur_engraver::do_try_music (Music *req_l)
 {
   if (Span_req *sl = dynamic_cast <Span_req *> (req_l))
     {
-      if (sl->span_type_str_ != "slur")
-       return false;
-      new_slur_req_l_arr_.push (sl);
-
-      return true;
+      if (sl->span_type_str_ == "abort")
+       {
+         for (int i = 0; i < slur_l_stack_.size (); i++)
+           {
+             slur_l_stack_[i]->suicide ();
+           }
+         slur_l_stack_.clear ();
+         for (int i = 0; i < end_slur_l_arr_.size (); i++)
+           {
+             end_slur_l_arr_[i]->suicide ();
+           }
+         end_slur_l_arr_.clear ();
+         requests_arr_.clear ();
+         new_slur_req_l_arr_.clear ();
+       }
+      else if (sl->span_type_str_ == "slur")
+       {
+         new_slur_req_l_arr_.push (sl);
+         return true;
+       }
     }
   return false;
 }
@@ -93,7 +109,7 @@ Slur_engraver::do_removal_processing ()
 void
 Slur_engraver::do_process_music ()
 {
-  Link_array<Score_element> start_slur_l_arr_;
+  Link_array<Score_element> start_slur_l_arr;
   for (int i=0; i< new_slur_req_l_arr_.size (); i++)
     {
       Span_req* slur_req_l = new_slur_req_l_arr_[i];
@@ -125,13 +141,13 @@ Slur_engraver::do_process_music ()
            {
              index_set_cell (slur->get_elt_property ("attachment"), START, s);
            }
-         start_slur_l_arr_.push (slur);
+         start_slur_l_arr.push (slur);
          requests_arr_.push (slur_req_l);
          announce_element (slur, slur_req_l);
        }
     }
-  for (int i=0; i < start_slur_l_arr_.size (); i++)
-    slur_l_stack_.push (start_slur_l_arr_[i]);
+  for (int i=0; i < start_slur_l_arr.size (); i++)
+    slur_l_stack_.push (start_slur_l_arr[i]);
 }
 
 void