]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spanner.cc
patch::: 1.3.130.jcn1
[lilypond.git] / lily / spanner.cc
index 56bce58a58454e2739529e7d7f6b0ed04ea7720a..d6a356572903dde62a2c892b555712b188fff30c 100644 (file)
@@ -110,18 +110,6 @@ Spanner::do_break_processing ()
              || bounds[LEFT]->line_l () != bounds[RIGHT]->line_l ())
            {
              programming_error ("bounds of spanner are invalid");
-#if 0
-             /*
-               lily crashes upon displaying this ...
-               
-              */
-             
-             gh_display (ly_str02scm ("\nspanner:mutable_property_alist_\n"));
-             gh_display (mutable_property_alist_);
-             gh_display (ly_str02scm ("\nspanner:immutable_property_alist_\n"));
-             gh_display (immutable_property_alist_);
-             gh_newline ();
-#endif
              span_p->suicide ();
            }
          else
@@ -168,6 +156,10 @@ Spanner::get_bound (Direction d) const
   return spanned_drul_ [d];
 }
 
+/*
+  Set the items that this spanner spans. If D == LEFT, we also set the
+  X-axis parent of THIS to S.
+*/
 void
 Spanner::set_bound(Direction d, Grob*s)
 {
@@ -202,7 +194,6 @@ Spanner::set_bound(Direction d, Grob*s)
     }
 }
 
-
 Spanner::Spanner (SCM s)
   : Grob (s)
 {
@@ -216,7 +207,6 @@ Spanner::Spanner (Spanner const &s)
   spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
 }
 
-
 Real
 Spanner::spanner_length() const
 {  
@@ -321,14 +311,17 @@ add_bound_item (Spanner* sp, Item*it)
     sp->set_bound (RIGHT, it);
 }
 
+/*
+  Extends EXTREMAL_PAIR to include IT
+ */
 static void
 extend_spanner_over_item (Item *it, SCM extremal_pair)
 {
   if (!it)
     return;
   Item * col = it->column_l ();
-  Item * i1 = dynamic_cast<Item*> (unsmob_element (gh_car (extremal_pair)));
-  Item * i2 = dynamic_cast<Item*> (unsmob_element (gh_cdr (extremal_pair)));
+  Item * i1 = dynamic_cast<Item*> (unsmob_grob (gh_car (extremal_pair)));
+  Item * i2 = dynamic_cast<Item*> (unsmob_grob (gh_cdr (extremal_pair)));
   int r = Paper_column::rank_i (col);
   if (!i1 || r < Paper_column::rank_i (i1->column_l ()))
     {
@@ -340,6 +333,9 @@ extend_spanner_over_item (Item *it, SCM extremal_pair)
     }
 }
 
+/*
+  Extends EXTREMAL_PAIR to include every grob in VALUE
+ */
 static void
 extend_spanner_over_elements (SCM value, SCM extremal_pair)
 {
@@ -348,14 +344,14 @@ extend_spanner_over_elements (SCM value, SCM extremal_pair)
       extend_spanner_over_elements (gh_car (value), extremal_pair);
       extend_spanner_over_elements (gh_cdr (value), extremal_pair);
     }
-  else if (unsmob_element (value))
+  else if (unsmob_grob (value))
     {
-      if (Spanner * sp = dynamic_cast<Spanner*> (unsmob_element(value)))
+      if (Spanner * sp = dynamic_cast<Spanner*> (unsmob_grob(value)))
        {
          extend_spanner_over_item (sp->get_bound (LEFT), extremal_pair);
          extend_spanner_over_item (sp->get_bound (RIGHT), extremal_pair);
        }
-      else if (Item * it= dynamic_cast<Item*> (unsmob_element(value)))
+      else if (Item * it= dynamic_cast<Item*> (unsmob_grob(value)))
        extend_spanner_over_item (it, extremal_pair);
     }
 }
@@ -379,11 +375,9 @@ extend_spanner_over_elements (Grob*s)
   SCM pair = gh_cons (s1,s2);
   extend_spanner_over_elements (sp->mutable_property_alist_, pair);
 
-  Grob *p1 =  unsmob_element (gh_car (pair));
-  Grob* p2 = unsmob_element (gh_cdr (pair));
+  Grob *p1 =  unsmob_grob (gh_car (pair));
+  Grob* p2 = unsmob_grob (gh_cdr (pair));
   sp->set_bound (LEFT,p1);
   sp->set_bound (RIGHT, p2);
-
-  //extra precaution.
 }