#include "staff-spacing.hh"
#include "spacing-interface.hh"
-
-
-void
-Spacing_options::init (Grob *me)
-{
- increment_ = robust_scm2double (me->get_property ("spacing-increment"), 1);
- packed_ = to_boolean (me->get_layout ()->c_variable ("packed"));
- stretch_uniformly_ = to_boolean (me->get_property ("uniform-stretching"));
- float_nonmusical_columns_
- = to_boolean (me->get_property ("strict-note-spacing"));
-}
-
-
Rational
-Spacing_spanner::effective_shortest_duration (Grob *me, Link_array<Grob> const &all)
+Spacing_spanner::effective_shortest_duration (Grob *me,
+ Link_array<Grob> const &all)
{
SCM preset_shortest = me->get_property ("common-shortest-duration");
Rational global_shortest;
if (unsmob_moment (preset_shortest))
- {
- global_shortest = unsmob_moment (preset_shortest)->main_part_;
- }
+ global_shortest = unsmob_moment (preset_shortest)->main_part_;
else
{
global_shortest = Spacing_spanner::find_shortest (me, all);
return global_shortest;
}
-
MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs, 1);
SCM
Spacing_spanner::set_springs (SCM smob)
set_explicit_neighbor_columns (all);
Spacing_options options;
- options.init (me);
+ options.init_from_grob (me);
options.global_shortest_ = effective_shortest_duration (me, all);
-
+
prune_loose_columns (me, &all, &options);
set_implicit_neighbor_columns (all);
generate_springs (me, all, &options);
if (Paper_column::is_musical (left_col))
{
bool skip_unbroken_right = false;
-
+
if (!Paper_column::is_musical (right_col)
&& options->float_nonmusical_columns_
&& after_right_col
&& Paper_column::is_musical (after_right_col))
- {
- skip_unbroken_right = true;
- }
+ skip_unbroken_right = true;
if (skip_unbroken_right)
{
}
else
musical_column_spacing (me, left_col, right_col, options);
-
if (Item *rb = right_col->find_prebroken_piece (LEFT))
musical_column_spacing (me, left_col, rb, options);
if (left_col && right_col)
breakable_column_spacing (me, left_col, right_col, options);
-
+
if (lb && right_col)
breakable_column_spacing (me, lb, right_col, options);
{
bool expand_only = false;
Real base_note_space = note_spacing (me, left_col, right_col, options, &expand_only);
-
+
Real compound_note_space = 0.0;
Real compound_fixed_note_space = 0.0;
if (options->stretch_uniformly_)
- {
- compound_note_space = base_note_space;
- }
+ compound_note_space = base_note_space;
else
{
int wish_count = 0;
compound_fixed_note_space = min (compound_fixed_note_space,
compound_note_space);
}
-
+
Real inverse_strength = 1.0;
Real distance = 1.0;
}
if (options->stretch_uniformly_ && l->break_status_dir () != RIGHT)
- {
- compound_fixed = 0.0;
- }
-
+ compound_fixed = 0.0;
+
assert (!isinf (compound_space));
compound_space = max (compound_space, compound_fixed);
"gets 2 note heads width (i.e. the space following a note is 1 note\n"
"head width) A 16th note is followed by 0.5 note head width. The\n"
"quarter note is followed by 3 NHW, the half by 4 NHW, etc.\n",
-
- "grace-space-factor spacing-increment base-shortest-duration strict-note-spacing "
- "shortest-duration-space common-shortest-duration uniform-stretching"
- );
+ "grace-space-factor spacing-increment base-shortest-duration strict-note-spacing "
+ "shortest-duration-space common-shortest-duration uniform-stretching "
+ "packed-spacing ");
ADD_INTERFACE (Spacing_interface, "spacing-interface",
"Something to do with line breaking and spacing. "