2 script.cc -- implement Script
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 TODO: Quantisation support (staccato dots between stafflines)
18 #include "staff-side.hh"
19 #include "paper-def.hh"
20 #include "dimension-cache.hh"
28 Script::do_substitute_element_pointer (Score_element*o, Score_element*n)
30 if (o == staff_side_l_)
31 staff_side_l_ = dynamic_cast<Staff_side_item*>(n);
37 Script::get_molecule(Direction d) const
39 SCM s = get_elt_property ("molecule");
40 assert (s != SCM_UNDEFINED);
42 SCM key = SCM_CAR (s);
43 if (key == ly_symbol ("feta"))
45 return lookup_l ()->afm_find ("scripts-" +
46 ly_scm2string (index_cell (gh_cdr (s), d)));
48 else if (key == ly_symbol ("accordion"))
50 return lookup_l ()->accordion (s, paper_l()->get_var("interline"));
60 Script::do_pre_processing ()
63 center my self on the note head.
65 Graphical_element * e = staff_side_l_->parent_l(X_AXIS);
66 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
70 Script::do_post_processing ()
72 Direction d = staff_side_l_->get_direction ();
73 Molecule m (get_molecule(d));
78 if (staff_side_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED)
79 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
83 Script::set_staff_side (Staff_side_item*g)
87 set_parent (g, Y_AXIS);
91 Script::do_brew_molecule_p () const
93 return new Molecule (get_molecule (staff_side_l_->get_direction ()));
97 Script::do_print () const