]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spanner.cc
release: 1.1.29
[lilypond.git] / lily / spanner.cc
index 83ad5f2091d9548584496f5488e239225fe553ce..cf4932b47f2acc7a3da40fe81ce854dab75cc398 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "debug.hh"
 #include "molecule.hh"
 #include "paper-outputter.hh"
 
-IMPLEMENT_IS_TYPE_B1(Spanner,Score_element);
+
 
 void
 Spanner::do_print() const
 {
 #ifndef NPRINT
-  DOUT << "Between " << spanned_drul_[LEFT]->name ()
-       << " and " << spanned_drul_[RIGHT]->name() << '\n';
+  DOUT << "Between " << classname (spanned_drul_[LEFT])
+       << " and " << classname (spanned_drul_[RIGHT]) << '\n';
   if (broken_into_l_arr_.size())
     {
       DOUT << "with broken pieces:\n";
@@ -98,7 +98,7 @@ Spanner::set_bounds(Direction d, Item*i)
 
   if  (spanned_drul_[Direction(-d)] == spanned_drul_[d]
        && i)
-    warning (_f ("Spanner `%s\' with equal left and right spanpoints", name ()));
+    warning (_f ("Spanner `%s\' with equal left and right spanpoints", classname (this)));
 }
 
 void
@@ -118,12 +118,6 @@ Spanner::do_break_processing()
     }
 }
 
-Spanner* 
-Spanner::access_Spanner ()
-{
-  return this;
-}
-
 Spanner::Spanner ()
 {
   unbroken_original_l_ =0;
@@ -139,15 +133,14 @@ Spanner::Spanner (Spanner const &s)
 }
 
 void
-Spanner::do_brew_molecule () 
+Spanner::output_processing () 
 {
   if (transparent_b_)
     return ;
-  Molecule *output= brew_molecule_p ();
+  output_p_ = do_brew_molecule_p ();
   Offset left_off (spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), 0);
   Offset o = absolute_offset() + left_off;
-  pscore_l_->outputter_l_->output_molecule (output, o, name ());
-  delete output;
+  pscore_l_->outputter_l_->output_molecule (output_p_, o, classname (this));
 }
 
 Interval
@@ -155,7 +148,9 @@ Spanner::do_width() const
 {
   Real l = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS);
   Real r = spanned_drul_[RIGHT]->absolute_coordinate (X_AXIS);
-  assert (r>=l);
+
+  if (r< l)
+    warning ("Spanner with negative length");
        
   return Interval (0, r-l);
 }