if (!to_boolean (par->get_property ("positioning-done")))
{
par->set_property ("positioning-done", SCM_BOOL_T);
position_accidentals (par);
}
if (!to_boolean (par->get_property ("positioning-done")))
{
par->set_property ("positioning-done", SCM_BOOL_T);
position_accidentals (par);
}
{
a->set_parent (me, X_AXIS);
a->add_offset_callback (alignment_callback_proc, X_AXIS);
SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
{
a->set_parent (me, X_AXIS);
a->add_offset_callback (alignment_callback_proc, X_AXIS);
SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
int ape_compare (Accidental_placement_entry *const &a,
Accidental_placement_entry *const &b)
{
int ape_compare (Accidental_placement_entry *const &a,
Accidental_placement_entry *const &b)
{
*/
void
stagger_apes (Link_array<Accidental_placement_entry> *apes)
{
Link_array<Accidental_placement_entry> asc = *apes;
*/
void
stagger_apes (Link_array<Accidental_placement_entry> *apes)
{
Link_array<Accidental_placement_entry> asc = *apes;
This routine computes placements of accidentals. During
add_accidental (), accidentals are already grouped by note, so that
octaves are placed above each other; they form columns. Then the
columns are sorted: the biggest columns go closest to the note.
Then the columns are spaced as closely as possible (using skyline
spacing).
This routine computes placements of accidentals. During
add_accidental (), accidentals are already grouped by note, so that
octaves are placed above each other; they form columns. Then the
columns are sorted: the biggest columns go closest to the note.
Then the columns are spaced as closely as possible (using skyline
spacing).
TODO: more advanced placement. Typically, the accs should be placed
to form a C shape, like this
TODO: more advanced placement. Typically, the accs should be placed
to form a C shape, like this
/*
TODO: there is a bug in this code. If two accs are on the same
Y-position, they share an Ape, and will be printed in overstrike.
/*
TODO: there is a bug in this code. If two accs are on the same
Y-position, they share an Ape, and will be printed in overstrike.
Link_array<Accidental_placement_entry> apes;
for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
ape->notename_ = scm_to_int (scm_caar (s));
Link_array<Accidental_placement_entry> apes;
for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
ape->notename_ = scm_to_int (scm_caar (s));
for (SCM t = scm_cdar (s); scm_is_pair (t); t = scm_cdr (t))
ape->grobs_.push (unsmob_grob (scm_car (t)));
for (SCM t = scm_cdar (s); scm_is_pair (t); t = scm_cdr (t))
ape->grobs_.push (unsmob_grob (scm_car (t)));
/*
First we must extract *all* pointers. We can only determine
extents if we're sure that we've found the right common refpoint
/*
First we must extract *all* pointers. We can only determine
extents if we're sure that we've found the right common refpoint
Link_array<Grob> note_cols, heads;
for (int i = apes.size (); i--;)
Link_array<Grob> note_cols, heads;
for (int i = apes.size (); i--;)
-
- for (int i = note_cols.size () ; i--;)
- {
- heads.concat (Pointer_group_interface__extract_grobs (note_cols[i],
- (Grob*)0,
- "note-heads"));
-
- }
+
+ for (int i = note_cols.size (); i--;)
+ heads.concat (extract_grob_array (note_cols[i], "note-heads"));
+
{
insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT);
{
insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT);
- insert_extent_into_skyline (&ape->right_skyline_ , boxes[j], Y_AXIS, RIGHT);
+ insert_extent_into_skyline (&ape->right_skyline_, boxes[j], Y_AXIS, RIGHT);
- Accidental_placement_entry * head_ape = new Accidental_placement_entry;
- common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);
+ Accidental_placement_entry *head_ape = new Accidental_placement_entry;
+ common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);
- Box b (heads[i]->extent (common[X_AXIS] , X_AXIS),
- heads[i]->extent (common[Y_AXIS], Y_AXIS));
+ Box b (heads[i]->extent (common[X_AXIS], X_AXIS),
+ heads[i]->extent (common[Y_AXIS], Y_AXIS));
- insert_extent_into_skyline (&head_skyline, b , Y_AXIS, LEFT);
+ insert_extent_into_skyline (&head_skyline, b, Y_AXIS, LEFT);
Array<Skyline_entry> left_skyline = head_ape->left_skyline_;
heighten_skyline (&left_skyline,
-robust_scm2double (me->get_property ("right-padding"), 0));
/*
Add accs entries right-to-left.
Array<Skyline_entry> left_skyline = head_ape->left_skyline_;
heighten_skyline (&left_skyline,
-robust_scm2double (me->get_property ("right-padding"), 0));
/*
Add accs entries right-to-left.
heighten_skyline (&new_left_skyline, apes[i]->offset_);
merge_skyline (&new_left_skyline, left_skyline, LEFT);
left_skyline = new_left_skyline;
heighten_skyline (&new_left_skyline, apes[i]->offset_);
merge_skyline (&new_left_skyline, left_skyline, LEFT);
left_skyline = new_left_skyline;
- Accidental_placement_entry* ape = apes[i];
- for (int j = ape->grobs_.size (); j--;)
- {
- ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
- }
+ Accidental_placement_entry *ape = apes[i];
+ for (int j = ape->grobs_.size (); j--;)
+ ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
Interval left_extent, right_extent;
Accidental_placement_entry *ape = apes[0];
for (int i = ape->extents_.size (); i--;)
Interval left_extent, right_extent;
Accidental_placement_entry *ape = apes[0];
for (int i = ape->extents_.size (); i--;)
left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
Interval width (left_extent[LEFT], right_extent[RIGHT]);
SCM scm_width = ly_interval2scm (width);
me->set_extent (scm_width, X_AXIS);
left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
Interval width (left_extent[LEFT], right_extent[RIGHT]);
SCM scm_width = ly_interval2scm (width);
me->set_extent (scm_width, X_AXIS);
- "accidental-placement-interface",
- "Resolve accidental collisions.",
- "left-padding padding right-padding accidental-grobs positioning-done")
+ "accidental-placement-interface",
+ "Resolve accidental collisions.",
+ "left-padding padding right-padding accidental-grobs positioning-done")