#include "note-column.hh"
#include "group-interface.hh"
#include "note-collision.hh"
#include "accidental-interface.hh"
#include "note-column.hh"
#include "group-interface.hh"
#include "note-collision.hh"
#include "accidental-interface.hh"
if (!to_boolean (par->get_property ("positioning-done")))
{
par->set_property ("positioning-done", SCM_BOOL_T);
if (!to_boolean (par->get_property ("positioning-done")))
{
par->set_property ("positioning-done", SCM_BOOL_T);
{
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");
me->set_property ("accidental-grobs", accs);
}
/*
Split into break reminders.
me->set_property ("accidental-grobs", accs);
}
/*
Split into break reminders.
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
- for (SCM acs =accs->get_property ("accidental-grobs"); ly_c_pair_p (acs);
- acs =ly_cdr (acs))
- for (SCM s = ly_cdar (acs); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM acs = accs->get_property ("accidental-grobs"); scm_is_pair (acs);
+ acs = scm_cdr (acs))
+ for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
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.
- ape->notename_ = scm_to_int (ly_caar (s));
-
- for (SCM t = ly_cdar (s); ly_c_pair_p (t); t =ly_cdr (t))
- ape->grobs_.push (unsmob_grob (ly_car (t)));
+ 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)));
/*
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
{
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;
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")