2 laissez-vibrer-tie-column.cc -- implement Laissez_vibrer_tie_column
4 source file of the GNU LilyPond music typesetter
6 (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "laissez-vibrer-tie-column.hh"
11 #include "laissez-vibrer-tie.hh"
13 #include "tie-column.hh"
15 #include "directional-element-interface.hh"
16 #include "pointer-group-interface.hh"
17 #include "staff-symbol-referencer.hh"
19 #include "tie-column-format.hh"
20 #include "tie-formatting-problem.hh"
23 ADD_INTERFACE(Laissez_vibrer_tie_column,
24 "laissez-vibrer-tie-column-interface",
25 "The interface for a column of l.v. ties.",
35 Cut & paste from tie-column.cc
37 MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie_column, calc_positioning_done, 1);
39 Laissez_vibrer_tie_column::calc_positioning_done (SCM smob)
41 Grob *me = unsmob_grob (smob);
43 extract_grob_set (me, "ties", lv_ro_ties);
44 Link_array<Grob> lv_ties (lv_ro_ties);
46 lv_ties.sort (&Laissez_vibrer_tie::compare);
48 Ties_configuration ties_config;
49 for (int i = 0; i < lv_ties.size (); i++)
51 Tie_configuration conf;
53 Item *head = unsmob_item (lv_ties[i]->get_object ("note-head"));
56 conf.position_ = (int) Staff_symbol_referencer::get_position (head);
58 ties_config.ties_.push (conf);
61 bool manual_override = false;
62 SCM manual_configs = me->get_property ("tie-configuration");
63 set_manual_tie_configuration (&ties_config,
68 set_tie_config_directions (&ties_config);
70 Tie_formatting_problem problem;
71 problem.from_lv_ties (lv_ties);
74 Calculate final width and shape of the ties.
76 for (int i = 0; i < lv_ties.size(); i++)
78 final_shape_adjustment (ties_config.ties_[i],
83 Try to shift small ties into available spaces.
87 shift_small_ties (&ties_config, lv_ties[0], problem.details_);
90 for (int i = 0; i < lv_ties.size(); i++)
92 Tie::set_control_points (lv_ties[i], problem.common_x_refpoint (), ties_config.ties_[i],
94 set_grob_direction (lv_ties[i], ties_config.ties_[i].dir_);