]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/tie-arpeggio-collision.ly: new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 1 May 2006 16:29:40 +0000 (16:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 1 May 2006 16:29:40 +0000 (16:29 +0000)
* lily/tie-formatting-problem.cc (set_column_chord_outline): new
function: store outlines per column rank.

ChangeLog
Documentation/topdocs/NEWS.tely
input/regression/tie-arpeggio-collision.ly [new file with mode: 0644]
input/regression/tie-arpeggio.ly
lily/include/tie-formatting-problem.hh
lily/tie-formatting-problem.cc

index d9f6a7db3ebda930aa2e9be93b41d59e366bb79f..e5191329099f7328b70bd647f16acfe07a51554d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2006-05-01  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * input/regression/tie-arpeggio-collision.ly: new file.
+
        * lily/tie-formatting-problem.cc (set_column_chord_outline): new
        function: store outlines per column rank.
 
index 403b70bdaaf3d7a337c7519ff7902dfd80f89bb0..02cd922aafe729c1a23ebde5e85d5e072087d441 100644 (file)
@@ -66,8 +66,13 @@ which scares away people.
 
 @end ignore
 
+
+@item 
+
 @end itemize
 
+
+
 @ifhtml
 For older news, go to
 @uref{http://lilypond.org/doc/v2.8/Documentation/topdocs/NEWS.html},
diff --git a/input/regression/tie-arpeggio-collision.ly b/input/regression/tie-arpeggio-collision.ly
new file mode 100644 (file)
index 0000000..c8c78d4
--- /dev/null
@@ -0,0 +1,21 @@
+
+\header {
+
+  texidoc = "Advanced tie chord formatting also works with arpegiated
+ties.  Due to arpeggios, tie directions may be changed relative to the
+unarpegiated case."
+
+  
+}
+
+\version "2.9.3"
+
+\version "2.8.1"
+\layout { ragged-right = ##t }
+\new Staff \relative c'' {
+  <e c a f>2~ <e c a f> |
+  \set tieWaitForNote = ##t
+  e8~ c~ a~ f~ <e' c a f>2 |
+  f,8~ a~ c~ e~ <f, a c e>2 |
+}
+
index 74b3e742fe50f18b947c1f0aaa74a14748893dc4..aa94e4736ac4035aa72d79a5de3c3d92771d9be9 100644 (file)
@@ -1,10 +1,11 @@
 \header
 {
 
-  texidoc = "when @code{tieWaitForNote} is set, the right-tied note
- does not have to follow the lef-tied note directly. When
- @code{tieWaitForNote} is set to false, any tie will erase all pending
- ties."
+  texidoc =
+
+  "when @code{tieWaitForNote} is set, the right-tied note does not
+ have to follow the lef-tied note directly. When @code{tieWaitForNote}
+ is set to false, any tie will erase all pending ties."
   
 }
 
@@ -21,4 +22,6 @@
   \set tieWaitForNote = ##f
   <c e> ~
   <c e c'>
+  |
+
 }
index 1b8f203608541dc69e9591565c00730093090518..94e2f4b3732f1717da759cc7e698528a93b0c058 100644 (file)
@@ -73,12 +73,14 @@ struct Tie_configuration_variation
   Tie_configuration_variation ();
 };
 
-typedef   map <int, vector<Skyline_entry> > Chord_outline_map ;
+typedef map <int, vector<Skyline_entry> > Chord_outline_map;
+typedef map <int, Box> Column_extent_map;
 class Tie_formatting_problem
 {
   Chord_outline_map chord_outlines_;
-  Drul_array< Box > stem_extents_;
-  Drul_array< Box > head_extents_;
+  Column_extent_map stem_extents_;
+  Column_extent_map head_extents_;
+  
   set<int> dot_positions_;
   Interval dot_x_;
   vector<Tie_specification> specifications_;
@@ -109,6 +111,9 @@ public:
   Tie_details details_;
   void print_ties_configuration (Ties_configuration const *);
 
+  Interval get_stem_extent (int, Axis) const; 
+  Interval get_head_extent (int, Axis) const; 
+  
 public:
   Tie_formatting_problem ();
   ~Tie_formatting_problem ();
index 882dd7ae8baa86cded287ba532e4a4dc2b00afc1..d8b88950709874e18a43bff10c43b84bbd0fb2ac 100644 (file)
@@ -147,7 +147,7 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
          
       insert_extent_into_skyline (&chord_outlines_[column_rank], Box (x,y), Y_AXIS, -dir);
 
-      stem_extents_[dir].unite (Box (x,y));
+      stem_extents_[column_rank].unite (Box (x,y));
 
       if (dir == LEFT)
        {
@@ -179,10 +179,10 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
     }
   while (flip (&updowndir) != DOWN);
   
-  head_extents_[dir].set_empty ();
+  head_extents_[column_rank].set_empty ();
   for (vsize i = 0; i < head_boxes.size (); i++)
     {
-      head_extents_[dir].unite (head_boxes[i]);
+      head_extents_[column_rank].unite (head_boxes[i]);
     }
 }
 
@@ -391,12 +391,12 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir,
     }
   
   if (y_tune
-      && max (fabs (head_extents_[LEFT][Y_AXIS][dir] - y),
-             fabs (head_extents_[RIGHT][Y_AXIS][dir] - y)) < 0.25
+      && max (fabs (get_head_extent (columns[LEFT], Y_AXIS)[dir] - y),
+             fabs (get_head_extent (columns[RIGHT],Y_AXIS)[dir] - y)) < 0.25
       && !Staff_symbol_referencer::on_line (details_.staff_symbol_referencer_, pos))
     {
       conf->delta_y_ =
-       (head_extents_[LEFT][Y_AXIS][dir] - y)
+       (get_head_extent (columns[LEFT], Y_AXIS)[dir] - y)
        + dir * details_.outer_tie_vertical_gap_;
     }
 
@@ -467,19 +467,31 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir,
   do
     {
       Real y = conf->position_ * details_.staff_space_ * 0.5 + conf->delta_y_;
-      if (stem_extents_[d][X_AXIS].is_empty ()
-         || !stem_extents_[d][Y_AXIS].contains (y))
+      if (get_stem_extent (conf->column_ranks_[d], X_AXIS).is_empty ()
+         || !get_stem_extent (conf->column_ranks_[d], Y_AXIS).contains (y))
        continue;
 
       conf->attachment_x_[d] =
        d * min (d * conf->attachment_x_[d],
-                d * (stem_extents_[d][X_AXIS][-d] - d * details_.stem_gap_));
+                d * (get_stem_extent (conf->column_ranks_[d], X_AXIS)[-d] - d * details_.stem_gap_));
     }
   while (flip (&d) != LEFT);
   
   return conf;
 }
 
+Interval
+Tie_formatting_problem::get_head_extent (int col, Axis a) const
+{
+  return (*head_extents_.find (col)).second[a];
+}
+
+Interval
+Tie_formatting_problem::get_stem_extent (int col, Axis a) const
+{
+  return (*stem_extents_.find (col)).second[a];
+}
+
 /**
    TIE_IDX and TIES_CONF are optional.
  */