]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie-column.cc
* stepmake/aclocal.m4: do NDEBUG for optimizing builds.
[lilypond.git] / lily / tie-column.cc
index 0b76bbb362e4e6cb54b39f689fece523a8e22486..4f47e190b44d5608859954cb1957274010dc05cb 100644 (file)
@@ -3,26 +3,24 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
-#include "spanner.hh"
 #include "tie-column.hh"
+
+#include "spanner.hh"
 #include "group-interface.hh"
 #include "tie.hh"
 #include "directional-element-interface.hh"
 #include "rhythmic-head.hh"
 
-
-
-
-
-
 /*
   tie dir depends on what Tie_column does.
 */
-
+/*
+  TODO: this doesn't follow standard pattern. Regularize.
+ */
 void
 Tie_column::add_tie (Grob*me,Grob *s)
 {
@@ -30,7 +28,7 @@ Tie_column::add_tie (Grob*me,Grob *s)
       && Tie_column::has_interface (s->get_parent (Y_AXIS)))
     return ;
   
-  if (!  Pointer_group_interface::count (me, "ties"))
+  if (!Pointer_group_interface::count (me, ly_symbol2scm ("ties")))
     {
       dynamic_cast<Spanner*> (me)->set_bound (LEFT, Tie::head (s,LEFT));
       dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (s,RIGHT));
@@ -46,8 +44,6 @@ Tie_column::set_directions (Grob*me)
 {
   werner_directions (me);
 }
-  
-
 
 int
 tie_compare (Grob* const & s1,
@@ -74,11 +70,9 @@ Tie_column::old_directions (Grob*me)
   for (int i = ties.size (); i--;)
     if (get_grob_direction (ties[i]))
       ties.del (i);
-  
 
   if (!ties.size ())
     return ;
-  
 
   Direction d = get_grob_direction (me);
   if (d)
@@ -103,7 +97,7 @@ Tie_column::old_directions (Grob*me)
   ties.del (0);
   
   set_grob_direction (ties.pop (), UP);
-  for (int i=ties.size (); i--;)
+  for (int i = ties.size (); i--;)
     {
       Grob *  t = ties[i];
       Real p = Tie::get_position (t);
@@ -155,8 +149,10 @@ Tie_column::werner_directions (Grob *me)
   
   if (ties.size () == 1)
     {
-      Grob *  t = ties[0];      
-      set_grob_direction (t,Tie::get_default_dir (t));
+      Grob *  t = ties[0];
+      if (t->is_live ()
+         && !get_grob_direction (t))
+       set_grob_direction (t,Tie::get_default_dir (t));
       return ;
     }
 
@@ -203,6 +199,6 @@ Tie_column::after_line_breaking (SCM smob)
 
 
 ADD_INTERFACE (Tie_column,"tie-column-interface",
-  "that sets tie directions in a tied chord",
+  "Object that sets directions of multiple ties in a tied chord",
   "direction");