]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/plet-spanner.cc
release: 1.1.0
[lilypond.git] / lily / plet-spanner.cc
index feeacc4db77930bff3f0787b7504686a65e050ca..4a032ffc72354c5b418b4541b830d7467e456dad 100644 (file)
@@ -3,11 +3,11 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Jan Nieuwenhuizen <jan@digicash.com>
+  (c)  1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "atom.hh"
-#include "boxes.hh"
+#include "box.hh"
 #include "debug.hh"
 #include "lookup.hh"
 #include "molecule.hh"
@@ -31,7 +31,7 @@ Plet_spanner::Plet_spanner ()
   visibility_i_ = 3;
 
   tdef_p_ = new Text_def;
-  tdef_p_->align_i_ = CENTER;
+  tdef_p_->align_dir_ = CENTER;
   tdef_p_->style_str_ = "italic";
 }
 
@@ -59,12 +59,12 @@ Plet_spanner::brew_molecule_p () const
   
   w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
   
-  Atom a = paper ()->lookup_l ()->plet (dy_f, w, dir_);
+  Atom a = lookup_l ()->plet (dy_f, w, dir_);
 
   a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
 
   if (visibility_i_ >= 2)
-      mol_p->add (a);
+      mol_p->add_atom (a);
 
   Real interline_f = paper ()->interline_f ();
   Real numy_f = (dir_ > 0 ? 0 : -interline_f) + dir_ * interline_f / 2;
@@ -73,7 +73,7 @@ Plet_spanner::brew_molecule_p () const
     dy_f_drul_[LEFT] + dy_f / 2 + numy_f));
 
   if (visibility_i_ >= 1)
-    mol_p->add (num);
+    mol_p->add_atom (num);
 
   return mol_p;
 }
@@ -82,7 +82,7 @@ void
 Plet_spanner::do_add_processing ()
 {
   if (! (stem_l_drul_[LEFT] && stem_l_drul_[RIGHT]))
-    warning (_ ("Lonely plet.. "));
+    warning (_ ("lonely plet"));
 
   Direction d = LEFT;
   Drul_array<Stem *> new_stem_drul = stem_l_drul_;
@@ -119,19 +119,21 @@ Plet_spanner::do_post_processing ()
   do {
     if (stem_l_drul_[d]->empty_b ())
       {
-       dy_f_drul_[d] = dy_f_drul_[flip (&d)]; // ughugh \[/3 r8 c8 r8 \]/1
+        Direction u = d;
+       flip (&u);
+       dy_f_drul_[d] = dy_f_drul_[u]; // ughugh \[/3 r8 c8 r8 \]/1
       }
     }
   while (flip(&d) != LEFT);
 }
 
 void
-Plet_spanner::do_substitute_dependency (Score_elem* o, Score_elem* n)
+Plet_spanner::do_substitute_dependency (Score_element* o, Score_element* n)
 {
-  Stem* new_l = n ? (Stem*)n->item () : 0;
-  if (o->item () == stem_l_drul_[LEFT])
+  Stem* new_l = n ? (Stem*)dynamic_cast <Item *> (n) : 0;
+  if (dynamic_cast <Item *> (o) == stem_l_drul_[LEFT])
     stem_l_drul_[LEFT] = new_l;
-  else if (o->item () == stem_l_drul_[RIGHT])
+  else if (dynamic_cast <Item *> (o) == stem_l_drul_[RIGHT])
     stem_l_drul_[RIGHT] = new_l;
 }