]> git.donarmstrong.com Git - lilypond.git/blobdiff - src/clefitem.cc
release: 0.0.32
[lilypond.git] / src / clefitem.cc
index c6b8f09d0bb98c61664407549205079c2fffcc65..037aab69b80aab6504bf11301521b470a598d928 100644 (file)
@@ -1,39 +1,54 @@
+/*
+  clefitem.cc -- implement Clef_item
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "clefitem.hh"
 #include "string.hh"
 #include "molecule.hh"
-#include "paper.hh"
+#include "paperdef.hh"
 #include "lookup.hh"
-#include "clef.hh"
+#include "clefreg.hh"
+
+NAME_METHOD(Clef_item);
 
 Clef_item::Clef_item()
 {
     change = true;
     read("violin");
 }
+
 void
 Clef_item::read(String t)
 {
     type = t;
     if (type == "violin")
        y_off = 2;
+    if (type == "alto")
+       y_off = 4;
+    if (type == "tenor")
+       y_off = 6;
     if (type == "bass")
        y_off = 6;
 }
 void
-Clef_item::read(Clef k)
+Clef_item::read(Clef_register const &k)
 {
-    read(k.clef_type);
+    read(k.clef_type_str_);
 }
 
 Molecule*
-Clef_item::brew_molecule()const
+Clef_item::brew_molecule_p()const
 {
     String t = type;
     if  (change)
        t += "_change";
     Symbol s = paper()->lookup_p_->clef(t);
     Molecule*output = new Molecule(Atom(s));
-    output->translate(Offset(0, paper()->interline()/2 * y_off));
+    output->translate(Offset(0, paper()->internote() * y_off));
     return output;
 }