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.
67 = staff_side_l_->dim_cache_[X_AXIS]->parent_l_->element_l();
68 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
72 Script::do_post_processing ()
74 Direction d = staff_side_l_->dir_;
75 Molecule m (get_molecule(d));
80 if (staff_side_l_->get_elt_property (no_staff_support_scm_sym) == SCM_BOOL_F)
81 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
85 Script::set_staff_side (Staff_side_item*g)
89 dim_cache_[Y_AXIS]->parent_l_ = g->dim_cache_[Y_AXIS];
93 Script::do_brew_molecule_p () const
95 return new Molecule (get_molecule (staff_side_l_->dir_));
99 Script::do_print () const