-
- Real right_dist = 0.0;
- if (next_hint != SCM_BOOL_F)
- {
- next_hint = SCM_CADR(next_hint);
- right_dist += - gh_scm2double (next_hint);
- }
- else
- {
- Interval ext (rc->extent (X_AXIS));
- right_dist = ext.empty_b() ? 0.0 : - ext [LEFT];
- }
+ /*
+ sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
+ */
+ SCM ln = cols[i] ->get_grob_property ("left-neighbors");
+ if (!gh_pair_p (ln) && i )
+ {
+ cols[i]->set_grob_property ("left-neighbors", gh_cons (cols[i-1]->self_scm(), SCM_EOL));
+ }
+
+ SCM rn = cols[i] ->get_grob_property ("right-neighbors");
+ if (!gh_pair_p (rn) && i < cols.size () - 1)
+ {
+ cols[i]->set_grob_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm(), SCM_EOL));
+ }
+ }
+}
+
+
+MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs,1);
+SCM
+Spacing_spanner::set_springs (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+
+ Link_array<Grob> all (me->pscore_l_->line_l_->column_l_arr ()) ;
+
+ set_explicit_neighbor_columns (all);
+ prune_loose_colunms (&all);
+ set_implicit_neighbor_columns (all);
+
+ int j = 0;
+ for (int i = 1; i < all.size (); i++)
+ {
+ Grob *sc = all[i];
+ if (Item::breakable_b (sc))
+ {
+ Link_array<Grob> measure (all.slice (j, i+1));
+ do_measure (me, &measure);
+ j = i;
+ }
+ }
+
+ return SCM_UNSPECIFIED;
+}
+
+
+void
+Spacing_spanner::do_measure (Grob*me, Link_array<Grob> *cols)
+{
+ Moment shortest_in_measure;
+
+ /*
+ space as if this duration is present.
+ */
+ Moment base_shortest_duration = *unsmob_moment (me->get_grob_property ("maximum-duration-for-spacing"));
+ shortest_in_measure.set_infinite (1);
+
+ for (int i =0 ; i < cols->size (); i++)
+ {
+ if (Paper_column::musical_b (cols->elem (i)))
+ {
+ Moment *when = unsmob_moment (cols->elem (i)->get_grob_property ("when"));