]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separating-group-spanner.cc
release: 1.3.69
[lilypond.git] / lily / separating-group-spanner.cc
index 9ce1156d171bccdf9b29d9287e68eed29592a568..6b5c2302a82d96992e443e587bb8022ab18e2345 100644 (file)
@@ -8,19 +8,19 @@
  */
 
 #include "separating-group-spanner.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
 #include "dimensions.hh"
 #include "group-interface.hh"
 
 static Rod
-make_rod (Single_malt_grouping_item *l, Single_malt_grouping_item *r)
+make_rod (Item *l, Item *r)
 {
   Rod rod;
 
-  Interval li (l->my_width ());
-  Interval ri (r->my_width ());
+  Interval li (Separation_item::my_width (l));
+  Interval ri (Separation_item::my_width (r));
 
   rod.item_l_drul_[LEFT] =l;
   rod.item_l_drul_[RIGHT]=r;
@@ -40,7 +40,7 @@ Separating_group_spanner::get_rods () const
 {
   Array<Rod> a;
   
-  for (SCM s = get_elt_pointer ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
+  for (SCM s = get_elt_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
     {
       /*
        Order of elements is reversed!
@@ -48,17 +48,17 @@ Separating_group_spanner::get_rods () const
       SCM elt = gh_cadr (s);
       SCM next_elt = gh_car (s);
 
-      Single_malt_grouping_item *l = dynamic_cast<Single_malt_grouping_item*> (unsmob_element (elt));
-      Single_malt_grouping_item *r = dynamic_cast<Single_malt_grouping_item*> (unsmob_element ( next_elt));
+      Item *l = dynamic_cast<Item*> (unsmob_element (elt));
+      Item *r = dynamic_cast<Item*> (unsmob_element ( next_elt));
 
       if (!r || !l)
        continue;
       
-      Single_malt_grouping_item *lb
-       = dynamic_cast<Single_malt_grouping_item*>(l->find_prebroken_piece (RIGHT));
+      Item *lb
+       = dynamic_cast<Item*>(l->find_prebroken_piece (RIGHT));
 
-      Single_malt_grouping_item *rb
-       = dynamic_cast<Single_malt_grouping_item*>(r->find_prebroken_piece (LEFT));
+      Item *rb
+       = dynamic_cast<Item*>(r->find_prebroken_piece (LEFT));
       
       a.push (make_rod(l,  r));
       if (lb)
@@ -82,7 +82,7 @@ Separating_group_spanner::get_rods () const
   /*
     We've done our job, so we get lost. 
    */
-  for (SCM s = get_elt_pointer ("elements"); gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
     {
       Item * it =dynamic_cast<Item*>(unsmob_element (gh_car (s)));
       if (it && it->broken_b ())
@@ -99,15 +99,15 @@ Separating_group_spanner::get_rods () const
 }
 
 void
-Separating_group_spanner::add_spacing_unit (Single_malt_grouping_item*i)
+Separating_group_spanner::add_spacing_unit (Score_element* me ,Item*i)
 {
-  Pointer_group_interface (this, "elements").add_element (i);
-  add_dependency (i);
+  Pointer_group_interface (me, "elements").add_element (i);
+  me->add_dependency (i);
 }
 
 
 Separating_group_spanner::Separating_group_spanner (SCM s)
   : Spanner (s)  
 {
-  set_elt_pointer ("elements", SCM_EOL);
+  set_elt_property ("elements", SCM_EOL);
 }