]> git.donarmstrong.com Git - lilypond.git/blob - src/clefitem.cc
release: 0.0.10
[lilypond.git] / src / clefitem.cc
1 #include "clefitem.hh"
2 #include "string.hh"
3 #include "molecule.hh"
4 #include "paper.hh"
5 #include "lookup.hh"
6 #include "clef.hh"
7
8 Clef_item::Clef_item()
9 {
10     read("violin");
11 }
12 void
13 Clef_item::read(String t)
14 {
15     type = t;
16     if (type == "violin")
17         y_off = 2;
18     if (type == "bass")
19         y_off = 6;
20 }
21 void
22 Clef_item::read(Clef k)
23 {
24     read(k.clef_type);
25 }
26
27 void
28 Clef_item::preprocess()
29 {
30     Symbol s = paper()->lookup_->clef(type);
31     output = new Molecule(Atom(s));
32     output->translate(Offset(0, paper()->interline()/2 * y_off));
33 }
34