Put Spacing_options in separate header.
--- /dev/null
+\header {
+
+ texidoc = "Horizontal spacing is bounded by of the current measure length.
+This means that the 3/8 setting does not affect the whole rest spacing."
+
+}
+
+
+\version "2.11.1"
+
+\layout {
+ ragged-right = ##t
+}
+
+\score {
+ \new Staff \with {
+ \remove Separating_line_group_engraver
+ } {
+ \relative c' {
+ \override Score.SpacingSpanner #'uniform-stretching = ##t
+ \set Score.proportionalNotationDuration = #(ly:make-moment 4 25)
+ r1
+ \time 3/8 r4.
+ }
+ }
+}
class Skyline_entry;
class Slur_configuration;
class Slur_score_state;
+class Spacing_options;
class Span_score_bar_engraver;
class Spanner;
class Staff_group_bar_engraver;
--- /dev/null
+/*
+ spacing-options.hh -- declare Spacing_options
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2006 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#ifndef SPACING_OPTIONS_HH
+#define SPACING_OPTIONS_HH
+
+#include "lily-proto.hh"
+#include "rational.hh"
+
+struct Spacing_options
+{
+ bool packed_;
+ bool stretch_uniformly_;
+ bool float_nonmusical_columns_;
+ bool float_grace_columns_;
+ Rational global_shortest_;
+ Real increment_;
+ Real shortest_duration_space_;
+
+ Spacing_options();
+ void init_from_grob (Grob *me);
+ Real get_duration_space (Rational d, bool *) const;
+};
+#endif /* SPACING_OPTIONS_HH */
#include "std-vector.hh"
#include "grob-interface.hh"
-struct Spacing_options
-{
- bool packed_;
- bool stretch_uniformly_;
- bool float_nonmusical_columns_;
- bool float_grace_columns_;
- Rational global_shortest_;
- Real increment_;
- Real shortest_duration_space_;
-
- Spacing_options();
- void init_from_grob (Grob *me);
- Real get_duration_space (Rational d, bool *) const;
-};
-
/*
TODO: prune to public interface.
*/
*/
#include "spacing-spanner.hh"
+
+#include "spacing-options.hh"
#include "moment.hh"
#include "paper-column.hh"
#include "warn.hh"
+#include "pointer-group-interface.hh"
+#include "system.hh"
/*
LilyPond spaces by taking a simple-minded spacing algorithm, and
}
}
+Moment *
+get_measure_length (Grob *column)
+{
+ Grob * sys = column->get_parent (X_AXIS);
+
+ extract_grob_set (sys, "columns", cols);
+
+ vsize col_idx = binary_search (cols, column,
+ Paper_column::less_than);
+
+ if (col_idx == VPOS)
+ {
+ programming_error ( __FUNCTION__ + string (": Unknown column"));
+ return 0;
+ }
+
+ do
+ {
+ if (Moment *len = unsmob_moment (cols[col_idx]->get_property ("measure-length")))
+ {
+ return len;
+ }
+ }
+ while (col_idx-- != 0);
+
+ return 0;
+}
+
Real
Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
Spacing_options const *options,
several measures.
*/
- Moment *dt = unsmob_moment (rc->get_property ("measure-length"));
+ Moment *dt = get_measure_length (lc);
if (dt)
{
delta_t = min (delta_t, *dt);
#include "staff-spacing.hh"
+#include "spacing-options.hh"
#include "system.hh"
#include "paper-column.hh"
#include "column-x-positions.hh"
#include "spacing-spanner.hh"
#include "warn.hh"
#include "moment.hh"
+#include "spacing-options.hh"
/* Find the loose columns in POSNS, and drape them around the columns
specified in BETWEEN-COLS. */
*/
-#include "spacing-spanner.hh"
+#include "spacing-options.hh"
#include "grob.hh"
#include "misc.hh"
#include "moment.hh"
#include <math.h>
#include <cstdio>
+
using namespace std;
+#include "spacing-options.hh"
#include "international.hh"
#include "main.hh"
#include "moment.hh"
return ret;
}
+
/** Return all columns, but filter out any unused columns , since they might
disrupt the spacing problem. */
vector<Grob*>