-void
-set_manual_tie_configuration (Array<Tie_configuration> *tie_configs,
- bool *manual_override,
- SCM manual_configs
- )
-{
- *manual_override = false;
- int k = 0;
- for (SCM s = manual_configs;
- scm_is_pair (s) && k < tie_configs->size(); s = scm_cdr (s))
- {
- SCM entry = scm_car (s);
- if (!scm_is_pair (entry))
- continue;
-
- *manual_override = true;
- Tie_configuration &conf = tie_configs->elem_ref (k);
-
- Real complete_pos = robust_scm2double (scm_car (entry),
- conf.position_);
-
- conf.position_ = int (rint (complete_pos));
- conf.delta_y_ = complete_pos - conf.position_;
- conf.dir_ = Direction (robust_scm2int (scm_cdr (entry),
- conf.dir_));
- k ++;
- }
-}
-
-void
-set_chord_outline (Array<Skyline_entry> *skyline,
- Link_array<Item> bounds,
- Grob *common,
- Direction d)
-{
- Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]);
-
- Array<Box> boxes;
-
- Grob *stem = 0;
- for (int i = 0; i < bounds.size (); i++)
- {
- Grob *head = bounds[i];
- if (!Note_head::has_interface (head))
- continue;
-
- if (!stem)
- stem = unsmob_grob (head->get_object ("stem"));
-
- Real p = Staff_symbol_referencer::get_position (head);
- Interval y ((p-1) * 0.5 * staff_space,
- (p+1) * 0.5 * staff_space);
-
- Interval x = head->extent (common, X_AXIS);
- boxes.push (Box (x, y));
-
- Grob *dots = Rhythmic_head::get_dots (head);
- if (d == LEFT && dots)
- {
- Interval x = dots->extent (common, X_AXIS);
- Interval y (-0.5, 0.5);
- y.translate (Staff_symbol_referencer::get_position (dots));
- y *= staff_space * 0.5;
-
- boxes.push (Box (x, y));
- }
- }
-
- (*skyline) = empty_skyline (-d);
-
- if (bounds[0]->break_status_dir ())
- {
- Real x = robust_relative_extent (bounds[0], common, X_AXIS)[-d];
- skyline->elem_ref (0).height_ = x;
- }
-
- for (int i = 0; i < boxes.size (); i++)
- insert_extent_into_skyline (skyline,
- boxes[i], Y_AXIS, -d);
- if (stem
- && !Stem::is_invisible (stem))
- {
- Interval x;
- x.add_point (stem->relative_coordinate (common, X_AXIS));
- x.widen (staff_space / 20); // ugh.
- Interval y;
- y.add_point (Stem::stem_end_position (stem) * staff_space * .5);
-
- Direction stemdir = get_grob_direction (stem);
- y.add_point (Stem::head_positions (stem)[-stemdir]
- * staff_space * .5);
-
- insert_extent_into_skyline (skyline, Box (x,y), Y_AXIS, -d);
-
-
-
- if (d == LEFT)
- {
- Box flag_box = Stem::get_translated_flag (stem).extent_box ();
- flag_box.translate( Offset (x[RIGHT], X_AXIS));
- insert_extent_into_skyline (skyline, flag_box,
- Y_AXIS, -d);
- }
- }
-
- Direction updowndir = DOWN;
- do
- {
- Interval x ;
- Interval y;
- if (boxes.size())
- {
- Box b = boxes.boundary (updowndir, 0);
- x = b[X_AXIS];
- x[-d] = b[X_AXIS].linear_combination (-d / 2);
- y[-updowndir] = b[Y_AXIS][updowndir];
- y[updowndir] = updowndir * infinity_f;
- }
-
- if (!x.is_empty ())
- insert_extent_into_skyline (skyline,
- Box (x,y),
- Y_AXIS, -d);
- }
- while (flip (&updowndir) != DOWN);
-
- for (int i = 0; i < bounds.size (); i++)
- {
- if (!Note_head::has_interface (bounds[i]))
- continue;
-
-
- Grob *dots = unsmob_grob (bounds[i]->get_object ("dot"));
- if (dots && d == LEFT)
- {
- Interval x = dots->extent (common, X_AXIS);
- Real p = Staff_symbol_referencer::get_position (dots);
-
- Interval y (-1,1);
- y *= (staff_space /4);
- y.translate (p * staff_space * .5);
-
- insert_extent_into_skyline (skyline,
- Box (x,y), Y_AXIS, -d);
- }
- }
-}
-
-void
-set_chord_outlines (Drul_array< Array<Skyline_entry> > *skyline_drul,
- Link_array<Grob> ties,
- Grob *common)
-{
- Direction d = LEFT;
-
- do
- {
- Link_array<Item> bounds;
-
- for (int i = 0; i < ties.size (); i++)
- {
- Item *it = dynamic_cast<Spanner*> (ties[i])->get_bound (d);
-
- bounds.push (it);
- }
-
- set_chord_outline (&skyline_drul->elem_ref (d),
- bounds, common, d);
- }
- while (flip (&d) != LEFT);
-}