]> git.donarmstrong.com Git - lilypond.git/blob - src/clefitem.cc
d5237513a29a04f85f4977f8d57f22f2d231a628
[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     change = true;
11     read("violin");
12 }
13 void
14 Clef_item::read(String t)
15 {
16     type = t;
17     if (type == "violin")
18         y_off = 2;
19     if (type == "bass")
20         y_off = 6;
21 }
22 void
23 Clef_item::read(Clef k)
24 {
25     read(k.clef_type);
26 }
27
28 Molecule*
29 Clef_item::brew_molecule_p()const
30 {
31     String t = type;
32     if  (change)
33         t += "_change";
34     Symbol s = paper()->lookup_p_->clef(t);
35     Molecule*output = new Molecule(Atom(s));
36     output->translate(Offset(0, paper()->interline()/2 * y_off));
37     return output;
38 }
39