]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie.cc
patch::: 1.1.52.gp2
[lilypond.git] / lily / tie.cc
index 7b0cbc870b9cd7fa13c514c8738d0d657600e587..dc7ac39b9ce60072f60674c0693000b76f4b0260 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "paper-def.hh"
@@ -28,19 +28,18 @@ Tie::Tie()
 {
   head_l_drul_[RIGHT] =0;
   head_l_drul_[LEFT] =0;
-  same_pitch_b_ =false;
 }
 
 
 /*
   ugh: direction of the Tie is more complicated.  See [Ross] p136 and further
  */
-void
-Tie::set_default_dir()
+Direction
+Tie::get_default_dir() const
 {
   int m= (head_l_drul_[LEFT]->position_i_ 
          + head_l_drul_[RIGHT]->position_i_) /2;
-  dir_ =  (m < 0)? DOWN : UP;
+  return(m < 0)? DOWN : UP;
 }
 
 void
@@ -65,8 +64,8 @@ Tie::do_post_processing()
   assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
 
   // URG
-  Real notewidth = paper ()->note_width () * 0.8;
-  Real interline_f = paper ()->interline_f ();
+  Real notewidth = paper_l ()->note_width () * 0.8;
+  Real interline_f = paper_l ()->get_realvar (interline_scm_sym);
 
   /* 
    [OSU]: slur and tie placement
@@ -79,7 +78,7 @@ Tie::do_post_processing()
      --> height <= 5 length ?? we use <= 3 length, now...
    */
 
-  Real gap_f = paper ()->get_var ("slur_x_gap");
+  Real gap_f = paper_l ()->get_var ("slur_x_gap");
 
   Direction d = LEFT;
   do
@@ -93,7 +92,8 @@ Tie::do_post_processing()
   do
     {
       // tie attached to outer notehead
-      if (head_l_drul_[d] && head_l_drul_[d]->extremal_i_)
+      if (head_l_drul_[d]
+         && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F)
        {
          if (d == LEFT)
            dx_f_drul_[d] += notewidth;
@@ -130,7 +130,7 @@ Tie::do_post_processing()
     Avoid too steep ties
       * slur from notehead to stemend: c''()b''
    */
-  Real damp_f = paper ()->get_var ("tie_slope_damping");
+  Real damp_f = paper_l ()->get_var ("tie_slope_damping");
   Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
     dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
   d_off.x () += extent (X_AXIS).length ();
@@ -142,7 +142,7 @@ Tie::do_post_processing()
 }
 
 void
-Tie::do_substitute_dependency (Score_element*o, Score_element*n)
+Tie::do_substitute_element_pointer (Score_element*o, Score_element*n)
 {
   Note_head *new_l =n?dynamic_cast<Note_head *> (n):0;
   if (dynamic_cast <Item *> (o) == head_l_drul_[LEFT])
@@ -151,13 +151,6 @@ Tie::do_substitute_dependency (Score_element*o, Score_element*n)
     head_l_drul_[RIGHT] = new_l;
 }
 
-Interval
-Tie::do_width () const
-{
-  Real min_f = paper ()->get_var ("tie_x_minimum");
-  Interval width_int = Bow::do_width ();
-  return width_int.length () < min_f ? Interval (0, min_f) : width_int;
-}
 
 Array<Rod>
 Tie::get_rods () const
@@ -165,7 +158,7 @@ Tie::get_rods () const
   Array<Rod> a;
   Rod r;
   r.item_l_drul_ = spanned_drul_;
-  r.distance_f_ = do_width ().length ();
+  r.distance_f_ = paper_l ()->get_var ("tie_x_minimum");
   a.push (r);
   return a;
 }