2 g-script.cc -- implement G_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)
16 #include "g-script.hh"
18 #include "g-staff-side.hh"
26 G_script::do_substitute_element_pointer (Score_element*o, Score_element*n)
28 if (o == staff_side_l_)
29 staff_side_l_ = dynamic_cast<G_staff_side_item*>(n);
35 G_script::get_molecule(Direction d) const
37 SCM s = get_elt_property (molecule_scm_sym);
38 assert (s != SCM_BOOL_F);
41 SCM key = SCM_CAR (s);
42 if (key == ly_symbol ("feta"))
44 return lookup_l ()->afm_find ("scripts-" +
45 ly_scm2string (index_cell (SCM_CDR (s), d)));
47 else if (key == ly_symbol ("accordion"))
49 return lookup_l ()->accordion (SCM_CDR(s));
59 G_script::do_pre_processing ()
62 = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
63 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
67 G_script::do_post_processing ()
69 Direction d = staff_side_l_->dir_;
70 Molecule m (get_molecule(d));
71 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
75 G_script::set_staff_side (G_staff_side_item*g)
79 dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
83 G_script::do_brew_molecule_p () const
85 return new Molecule (get_molecule (staff_side_l_->dir_));
89 G_script::do_print () const