]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/slur-configuration.cc (score_extra_encompass): don't use
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 23 Dec 2005 12:06:56 +0000 (12:06 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 23 Dec 2005 12:06:56 +0000 (12:06 +0000)
bound->column() == avoid->column() for checking extents, as this
doesn't work for accidentals.

* lily/slur-engraver.cc (acknowledge_extra_object): remove
DynamicText hardcoding.

* lily/slur-scoring.cc (enumerate_attachments): robustness: don't
crash if bound stem is NULL

* lily/piano-pedal-performer.cc: patch by MWD for enabling piano
pedals.

ChangeLog
THANKS
lily/include/main.hh
lily/include/slur-scoring.hh
lily/piano-pedal-performer.cc
lily/slur-configuration.cc
lily/slur-engraver.cc
lily/slur-scoring.cc
scm/define-grobs.scm

index 927f44b64c0f805407919c872059da0259e43f9f..ae9f2b229e128d3440007fc5e6bfaa5e45daa534 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-12-23  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/slur-configuration.cc (score_extra_encompass): don't use
+       bound->column() == avoid->column() for checking extents, as this
+       doesn't work for accidentals. 
+
+       * lily/slur-engraver.cc (acknowledge_extra_object): remove
+       DynamicText hardcoding.
+
+       * lily/slur-scoring.cc (enumerate_attachments): robustness: don't
+       crash if bound stem is NULL
+
+       * lily/piano-pedal-performer.cc: patch by MWD for enabling piano
+       pedals.
+
 2005-12-22  Graham Percival  <gpermus@gmail.com>
 
        * scm/define-markup-commands.scm: typo.  @code{\raise}
 
 2005-12-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * stepmake/bin/install.py (dest): don't create existing.
+       * lily/slur-configuration.cc (score_extra_encompass): don't use
+       "avoid" choice for avoid-slur.
+
+       * stepmake/bin/install.py (dest): don't create existing dir.
 
 2005-12-21  Jan Nieuwenhuizen  <janneke@gnu.org>
 
diff --git a/THANKS b/THANKS
index ec17d8d488e5552919488b56fb195a6426ce0cd8..ecb68c039725ec657440a492f093e85ef460f994 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -78,6 +78,7 @@ Vicente Solsona Dellá
 Vincenzo Colonnella
 Werner Lemberg
 Will Oram
+Wolfgang Hoffmann
 
 Release 2.6
 ***********
index 4dcda0f86af400cbc9bb33af95d5a028d39c991b..ca059cbc7fcfb52d2ef3d3a6572579ef01c13e84 100644 (file)
@@ -54,10 +54,11 @@ extern const char *LILYPOND_DATADIR;
 
 /*
   Debugging options: switch on
+
+  Cannot switch on -DNDEBUG, because it causes weird errors if you mix
+  DNDEBUG and normal builds.
 */
 
-#ifndef NDEBUG
 #define DEBUG_SLUR_SCORING 1
-#endif
 
 #endif /* MAIN_HH */
index deeab485893225d8cdae5aaf699c1337dfe01be9..4d3e742da32ea8cd869ef5632b9cfbc8481f219a 100644 (file)
@@ -81,7 +81,7 @@ struct Bound_info
   Grob *slur_head_;
   Grob *staff_;
   Grob *stem_;
-  Interval slur_head_extent_;
+  Interval slur_head_x_extent_;
   Real staff_space_;
 
   Bound_info ()
index ea4889f11bbeb1ec3ed6c506d3e407d3a54eaa2e..74643891894e3b25b486e202ae5f54f80a7bb4b6 100644 (file)
@@ -84,6 +84,8 @@ Piano_pedal_performer::process_music ()
              a->type_string_ = String (p->name_);
              a->dir_ = STOP;
              audios_.push (a);
+              Audio_element_info info(a, p->event_drul_[STOP]);
+              announce_element (info);
            }
          p->start_event_ = 0;
        }
@@ -95,6 +97,8 @@ Piano_pedal_performer::process_music ()
          a->type_string_ = String (p->name_);
          a->dir_ = START;
          audios_.push (a);
+          Audio_element_info info(a, p->event_drul_[START]);
+          announce_element (info);
        }
       p->event_drul_[START] = 0;
       p->event_drul_[STOP] = 0;
index 2b5a090822d5026cf5344d23f8a8a8eae9f1ef56..4d32a9a545b2d213a3bbceca77127c6045516506 100644 (file)
@@ -322,14 +322,17 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state)
            distance.
          */
          Item *as_item = dynamic_cast<Item *> (state.extra_encompass_infos_[j].grob_);
-         if ((as_item
-              && as_item->get_column ()
-              == state.extremes_[d].bound_->get_column ())
-             || state.extra_encompass_infos_[j].extents_[X_AXIS].contains (attachment[d][X_AXIS]))
+         if (!as_item)
+           continue;
+         
+         Interval item_x = as_item->extent (state.common_[X_AXIS], X_AXIS);
+         item_x.intersect (state.extremes_[d].slur_head_x_extent_);
+         if (!item_x.is_empty ())
            {
              y = attachment[d][Y_AXIS];
              found = true;
            }
+             
        }
       while (flip (&d) != LEFT);
 
@@ -344,7 +347,7 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state)
        }
 
       Real dist = 0.0;
-      if (info.type_ == ly_symbol2scm ("avoid"))
+      if (info.type_ == ly_symbol2scm ("around"))
        dist = info.extents_[Y_AXIS].distance (y);
 
       /*
index 2dfe2fec10df5942cd72ae554cc0ddea499bd3e2..2dd0d01ec3d4a6c7e52981ab22e79703ff09da9c 100644 (file)
@@ -93,6 +93,10 @@ Slur_engraver::acknowledge_note_column (Grob_info info)
 void
 Slur_engraver::acknowledge_extra_object (Grob_info info)
 {
+  if (slurs_.is_empty ()
+      && end_slurs_.is_empty ())
+    return ;
+  
   Grob *e = info.grob ();
   SCM avoid = e->get_property ("avoid-slur");
   if (Tie::has_interface (e)
@@ -103,9 +107,8 @@ Slur_engraver::acknowledge_extra_object (Grob_info info)
       for (int i = end_slurs_.size (); i--;)
        Slur::add_extra_encompass (end_slurs_[i], e);
     }
-  else if ((avoid == ly_symbol2scm ("outside")
-           || avoid == ly_symbol2scm ("around"))
-          && e->name () != "DynamicText")
+  else if (avoid == ly_symbol2scm ("outside")
+          || avoid == ly_symbol2scm ("around"))
     {
       Grob *slur = slurs_.size () ? slurs_[0] : 0;
       slur = (end_slurs_.size () && !slur)
@@ -155,6 +158,7 @@ Slur_engraver::acknowledge_script (Grob_info info)
 void
 Slur_engraver::acknowledge_text_script (Grob_info info)
 {
+  //  if (!info.grob ()->internal_has_interface (ly_symbol2scm ("DynamicText")))
   acknowledge_extra_object (info);
 }
 
index b808375fb750a609bf24b5fa3b3232417b07cd0f..64246d9a9f62c56d65191fe56ed32101ea6dc401 100644 (file)
@@ -236,38 +236,41 @@ Slur_score_state::get_bound_info () const
        {
          extremes[d].note_column_ = extremes[d].bound_;
          extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_);
-         extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
-
-         for (int a = X_AXIS; a < NO_AXES; a++)
+         if (extremes[d].stem_)
            {
-             Axis ax = Axis (a);
-             Interval s = extremes[d].stem_->extent (common_[ax], ax);
-             if (s.is_empty ())
+             extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
+
+             for (int a = X_AXIS; a < NO_AXES; a++)
                {
-                 /*
-                   do not issue warning. This happens for rests and
-                   whole notes.
-                 */
-                 s = Interval (0, 0)
-                   + extremes[d].stem_->relative_coordinate (common_[ax], ax);
+                 Axis ax = Axis (a);
+                 Interval s = extremes[d].stem_->extent (common_[ax], ax);
+                 if (s.is_empty ())
+                   {
+                     /*
+                       do not issue warning. This happens for rests and
+                       whole notes.
+                     */
+                     s = Interval (0, 0)
+                       + extremes[d].stem_->relative_coordinate (common_[ax], ax);
+                   }
+                 extremes[d].stem_extent_[ax] = s;
                }
-             extremes[d].stem_extent_[ax] = s;
-           }
 
-         extremes[d].slur_head_
-           = Stem::extremal_heads (extremes[d].stem_)[dir];
-         if (!extremes[d].slur_head_
-             && Note_column::has_rests (extremes[d].bound_))
-           extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_);
+             extremes[d].slur_head_
+               = Stem::extremal_heads (extremes[d].stem_)[dir];
+             if (!extremes[d].slur_head_
+                 && Note_column::has_rests (extremes[d].bound_))
+               extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_);
+             extremes[d].staff_ = Staff_symbol_referencer
+               ::get_staff_symbol (extremes[d].stem_);
+             extremes[d].staff_space_ = Staff_symbol_referencer
+               ::staff_space (extremes[d].stem_);
+           }
 
          if (extremes[d].slur_head_)
-           extremes[d].slur_head_extent_
+           extremes[d].slur_head_x_extent_
              = extremes[d].slur_head_->extent (common_[X_AXIS], X_AXIS);
 
-         extremes[d].staff_ = Staff_symbol_referencer
-           ::get_staff_symbol (extremes[d].stem_);
-         extremes[d].staff_space_ = Staff_symbol_referencer
-           ::staff_space (extremes[d].stem_);
        }
     }
   while (flip (&d) != LEFT);
@@ -343,7 +346,8 @@ Slur_score_state::fill (Grob *me)
   Direction d = LEFT;
   do
     {
-      if (!is_broken_)
+      if (!is_broken_
+         && extremes_[d].slur_head_)
        musical_dy_ += d
          * extremes_[d].slur_head_->relative_coordinate (common_[Y_AXIS], Y_AXIS);
     }
@@ -598,6 +602,9 @@ Real
 Slur_score_state::move_away_from_staffline (Real y,
                                            Grob *on_staff) const
 {
+  if (!on_staff)
+    return y;
+  
   Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff);
   if (!staff_symbol)
     return y;
@@ -723,9 +730,9 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
              do
                {
                  if (extremes_[d].slur_head_
-                     && !extremes_[d].slur_head_extent_.is_empty ())
+                     && !extremes_[d].slur_head_x_extent_.is_empty ())
                    {
-                     os[d][X_AXIS] = extremes_[d].slur_head_extent_.center ();
+                     os[d][X_AXIS] = extremes_[d].slur_head_x_extent_.center ();
                      attach_to_stem[d] = false;
                    }
                }
@@ -743,7 +750,7 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
 
                     TODO: parameter */
                  os[d][X_AXIS]
-                   -= dir_ * extremes_[d].slur_head_extent_.length ()
+                   -= dir_ * extremes_[d].slur_head_x_extent_.length ()
                    * sin (dz.arg ()) / 3;
                }
            }
index 0c5ea1c7324b6ff2ac9a3a651d252c6eff20bcd3..44ba247e457110b68cafa8eaebef93ac5d15266e 100644 (file)
        (font-series . bold)
        (font-encoding . fetaDynamic)
        (font-shape . italic)
-       (avoid-slur . avoid)
+       (avoid-slur . around)
        (no-spacing-rods . #t)
        (script-priority . 100)
        (meta . ((class . Item)