]> git.donarmstrong.com Git - lilypond.git/blob - lily/script.cc
release: 1.3.18
[lilypond.git] / lily / script.cc
1 /*   
2   script.cc --  implement Script
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "debug.hh"
11 #include "script.hh"
12 #include "lookup.hh"
13 #include "side-position-interface.hh"
14 #include "paper-def.hh"
15 #include "dimension-cache.hh"
16
17
18 Molecule
19 Script::get_molecule(Direction d) const
20 {
21   SCM s = get_elt_property ("molecule");
22   assert (gh_pair_p (s));
23
24   SCM key = gh_car  (s);
25   if (key == ly_symbol2scm ("feta"))
26     {
27       return lookup_l ()->afm_find ("scripts-" +
28                                     ly_scm2string (index_cell (gh_cdr (s), d)));
29     }
30   else if (key == ly_symbol2scm ("accordion"))
31     {
32       return lookup_l ()->accordion (s, paper_l()->get_var("interline"));
33     }
34
35   else assert (false);
36
37   return Molecule ();
38 }
39
40
41 void
42 Script::do_pre_processing ()
43 {
44   /*
45     center my self on the note head.
46    */
47   Score_element * e = parent_l(X_AXIS);
48   translate_axis (e->extent (X_AXIS).center (), X_AXIS);
49 }
50
51 void
52 Script::do_post_processing ()
53 {
54   Direction d =  Side_position_interface (this).get_direction ();
55   Molecule m (get_molecule(d));
56 }
57
58 Molecule*
59 Script::do_brew_molecule_p () const
60 {
61   Direction dir = DOWN;
62   SCM d = get_elt_property ("direction");
63   if (isdir_b (d))
64     dir = to_dir (d);
65   
66   return new Molecule (get_molecule (dir));
67 }
68
69
70