]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/notehead.cc
release: 0.0.68pre
[lilypond.git] / lily / notehead.cc
index ccfffcc2b5d014e40e8a05cc0d8cc34a10cdd24a..fa21149a6fdbfb0381142f89ba209413b898aae6 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  notehead.cc -- implement Note_head
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "misc.hh"
 #include "note-head.hh"
 #include "dimen.hh" 
@@ -20,16 +28,23 @@ Note_head::Note_head(int ss)
     rest_b_ = false;
 }
 
+void
+Note_head::do_pre_processing()
+{
+   // 8 ball looks the same as 4 ball:
+    if (balltype_i_ > 4 && !rest_b_)
+       balltype_i_ = 4;
+}
+
 void
 Note_head::set_rhythmic(Rhythmic_req*r_req_l)
 {
     balltype_i_ = r_req_l->duration_.type_i_;
-    if (balltype_i_ > 4)
-       balltype_i_ = 4;
     dots_i_ = r_req_l->duration_.dots_i_;
 }
     
 IMPLEMENT_STATIC_NAME(Note_head);
+IMPLEMENT_IS_TYPE_B1(Note_head,Item);
 
 void
 Note_head::do_print()const
@@ -68,10 +83,10 @@ Note_head::brew_molecule_p() const
        Molecule dm;
        dm.add(Atom(d));
        if (!(position_i_ %2))
-           dm.translate(Offset(0,dy));
+           dm.translate_y(dy);
        out->add_right(dm);
     }
-    out->translate(Offset(x_dir_i_ * p->note_width(),0));
+    out->translate_x(x_dir_i_ * p->note_width());
     bool streepjes = (position_i_<-1)||(position_i_ > staff_size_i_+1);
     
     if (rest_b_ && balltype_i_ > 2)
@@ -84,11 +99,11 @@ Note_head::brew_molecule_p() const
        Molecule sm;
        sm.add(Atom(str));
        if (position_i_ % 2)
-           sm.translate(Offset(0,-dy* dir));
+           sm.translate_y(-dy* dir);
        out->add(sm);       
     }
     
-    out->translate(Offset(0,dy*position_i_));
+    out->translate_y(dy*position_i_);
     return out;
 }