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_scm_sym);
40 assert (s != SCM_BOOL_F);
43 SCM key = SCM_CAR (s);
44 if (key == ly_symbol ("feta"))
46 return lookup_l ()->afm_find ("scripts-" +
47 ly_scm2string (index_cell (SCM_CDR (s), d)));
49 else if (key == ly_symbol ("accordion"))
51 return lookup_l ()->accordion (SCM_CDR(s), paper_l()->get_realvar(interline_scm_sym));
61 Script::do_pre_processing ()
64 center my self on the note head.
66 Graphical_element * e = staff_side_l_->parent_l(X_AXIS);
67 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
71 Script::do_post_processing ()
73 Direction d = staff_side_l_->dir_;
74 Molecule m (get_molecule(d));
79 if (staff_side_l_->get_elt_property (no_staff_support_scm_sym) == SCM_BOOL_F)
80 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
84 Script::set_staff_side (Staff_side_item*g)
88 set_parent (g, Y_AXIS);
92 Script::do_brew_molecule_p () const
94 return new Molecule (get_molecule (staff_side_l_->dir_));
98 Script::do_print () const