lilypond-1.3.71
authorfred <fred>
Tue, 26 Mar 2002 23:24:40 +0000 (23:24 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:24:40 +0000 (23:24 +0000)
VERSION
lily/spaceable-element.cc

diff --git a/VERSION b/VERSION
index 7da804129723ea48c53a6f66c346f762e7610ae5..be67f6cfe8c354a2a7d011ba729e26c045c11f07 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=70
+PATCH_LEVEL=71
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index 7f746ee4d6b5d1b35be0c2057bc6926540b534df..6bc4c1893fd31866d6af70203de01832a43b8428 100644 (file)
@@ -17,14 +17,16 @@ Spaceable_element::get_minimum_distances ( Score_element*me)
   return me->get_elt_property ("minimum-distances");
 }
 
+/*todo: merge code of spring & rod?
+ */
 void
 Spaceable_element::add_rod (Score_element *me , Score_element * p, Real d)
 {
   SCM mins = get_minimum_distances (me);
-  SCM newdist=                        gh_double2scm (d);
-  for (; gh_pair_p (mins); mins = gh_cdr (mins))
+  SCM newdist = gh_double2scm (d);
+  for (SCM s = mins; gh_pair_p (s); s = gh_cdr (s))
     {
-      SCM dist = gh_car (mins);
+      SCM dist = gh_car (s);
       if (gh_car (dist) == p->self_scm_)
        {
          gh_set_cdr_x (dist, scm_max (gh_cdr (dist),
@@ -37,34 +39,32 @@ Spaceable_element::add_rod (Score_element *me , Score_element * p, Real d)
   me->set_elt_property ("minimum-distances", mins);
 }
 
-SCM
-Spaceable_element::get_ideal_distances (Score_element*me)
-{
-  return me->get_elt_property ("ideal-distances");
-}
-
 void
-Spaceable_element::add_spring (Score_element*me, Score_element * p, Real d, Real s)
+Spaceable_element::add_spring (Score_element*me, Score_element * p, Real d, Real strength)
 {
   SCM mins = get_ideal_distances (me);
   SCM newdist= gh_double2scm (d);
-  for (; gh_pair_p (mins); mins = gh_cdr (mins))
+  for (SCM s = mins; gh_pair_p (s); s = gh_cdr (s))
     {
-      SCM dist = gh_car (mins);
+      SCM dist = gh_car (s);
       if (gh_car (dist) == p->self_scm_)
        {
          programming_error("already have that spring");
-         /*      gh_set_car_x (gh_cdr (dist), scm_max (gh_cadr (dist),
-                 newdist));*/
          return ;
        }
     }
-  SCM newstrength= gh_double2scm (s);  
+  SCM newstrength= gh_double2scm (strength);  
   
   mins = gh_cons (gh_cons (p->self_scm_, gh_cons (newdist, newstrength)), mins);
   me->set_elt_property ("ideal-distances", mins);
 }
 
+SCM
+Spaceable_element::get_ideal_distances (Score_element*me)
+{
+  return me->get_elt_property ("ideal-distances");
+}
+
 
 void
 Spaceable_element::remove_interface (Score_element*me)