source file of the GNU LilyPond music typesetter
- (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include <math.h>
+
#include <cstdio>
+using namespace std;
#include "spacing-spanner.hh"
#include "paper-column.hh"
#include "staff-spacing.hh"
#include "spacing-interface.hh"
-
-
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);
/*
can't use get_system() ? --hwn.
*/
- Link_array<Grob> all (me->pscore_->root_system ()->columns ());
+ Link_array<Grob> all (get_root_system (me)->columns ());
set_explicit_neighbor_columns (all);
Spacing_options options;
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;
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != left_col
- || (wish_rcol != right_col && wish_rcol != right_col->original_))
+ || (wish_rcol != right_col && wish_rcol != right_col->original ()))
continue;
/*
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 "
- "packed-spacing "
+ "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",