]> git.donarmstrong.com Git - lilypond.git/blobdiff - src/notehead.cc
release: 0.0.30
[lilypond.git] / src / notehead.cc
index a103e69b3daaeedcb3a0975d5741f27af8fb94a1..d96b4d0599b076dcdea3d27f8ea130e2170ad73f 100644 (file)
@@ -1,65 +1,80 @@
+#include "misc.hh"
 #include "notehead.hh"
 #include "dimen.hh" 
 #include "debug.hh"
 #include "paper.hh"
 #include "lookup.hh"
 #include "molecule.hh"
+#include "request.hh"
 
+NAME_METHOD(Notehead);
 
 Notehead::Notehead(int ss)
 {
+    x_dir = 0;
     staff_size=ss;
     position = 0;
     balltype = 0;
     dots = 0;
+    extremal = 0;
+    defined_ch_c_l_m = 0;
 }
 
 void
-Notehead::print()const
+Notehead::set_rhythmic(Rhythmic_req*r_req_l)
 {
-    mtor << "Head "<<balltype<<", position = "<< position << "dots " << dots;
-    Item::print();
+    balltype = r_req_l->balltype;
+    dots = r_req_l->dots;
+    if ( r_req_l->defined_ch_c_l_m )
+       defined_ch_c_l_m = r_req_l->defined_ch_c_l_m;
 }
-
+    
 void
-Notehead::preprocess()
+Notehead::do_print()const
 {
-    brew_molecole();
+#ifndef NPRINT
+    mtor << "balltype "<< balltype << ", position = "<< position
+        << "dots " << dots;
+#endif
 }
 
-void
-Notehead::brew_molecole()
+
+int
+Notehead::compare(Notehead*&a, Notehead*&b)
 {
-    assert(pstaff_);
-    assert(!output);
+    return a->position - b->position;
+}
 
+Molecule*
+Notehead::brew_molecule_p() const return out;
+{
     Paperdef *p = paper();
 
-    Real dy = p->interline()/2;
-    Symbol s = p->lookup_->ball(balltype);
+    Real dy = p->internote();
+    Symbol s = p->lookup_p_->ball(balltype);
     
-    output = new Molecule(Atom(s));
+    out = new Molecule(Atom(s));
     if (dots) {
-       Symbol d = p->lookup_->dots(dots);
+       Symbol d = p->lookup_p_->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        if (!(position %2))
            dm.translate(Offset(0,dy));
-       output->add_right(dm);
+       out->add_right(dm);
     }
+    out->translate(Offset(x_dir * p->note_width(),0));
     bool streepjes = (position<-1)||(position > staff_size+1);
     if (streepjes) {
-       int dir = sgn(position);
+       int dir = sign(position);
        int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
-       Symbol str = p->lookup_->streepjes(s);
+       Symbol str = p->lookup_p_->streepjes(s);
        Molecule sm;
        sm.add(Atom(str));
        if (position % 2)
            sm.translate(Offset(0,-dy* dir));
-       output->add(sm);            
+       out->add(sm);       
     }
     
-
-    output->translate(Offset(0,dy*position));
+    out->translate(Offset(0,dy*position));
 }