]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest.cc
release: 0.0.49
[lilypond.git] / lily / rest.cc
index 0e4394a3c6f5694fb7c5d3218e1cd2dd33e7c45c..3e582511e937d99b002faa49ca207c811288a6c6 100644 (file)
@@ -1,18 +1,29 @@
+/*
+  rest.cc -- implement Rest
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "duration.hh"
 #include "rest.hh"
 #include "dimen.hh" 
 #include "debug.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "molecule.hh"
+#include "rest.hh"
 
-
-Rest::Rest(int t, int d)
+Rest::Rest(Duration d)
 {
-    balltype = t;
-    dots = d;
+    balltype = d.type_i_;
+    dots = d.dots_i_;
+    pos_i_ = 0;
 }
 
 
+IMPLEMENT_STATIC_NAME(Rest);
+
 void
 Rest::do_print()const
 {
@@ -28,15 +39,16 @@ Rest::brew_molecule_p()const
     Paper_def *p =paper();
 
     Symbol s;
-    s = p->lookup_p_->rest(balltype);
+    s = p->lookup_l()->rest(balltype);
     
     Molecule *m = new Molecule(Atom(s));
     if (dots) {
-       Symbol d =p->lookup_p_->dots(dots);
+       Symbol d =p->lookup_l()->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        m->add_right(dm);
     }
+    m->translate(Offset(0,pos_i_ * paper()->internote()));
     return m;
 }