]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.8
authorfred <fred>
Tue, 5 Nov 1996 20:09:27 +0000 (20:09 +0000)
committerfred <fred>
Tue, 5 Nov 1996 20:09:27 +0000 (20:09 +0000)
melodicstaff.cc
stem.cc

index 83e038652fff0918936d4356eaf6e392f16ba058..2937f45dfe265ad83c288e82160d5356e4d054a1 100644 (file)
@@ -1,6 +1,6 @@
 #include "melodicstaff.hh"
 #include "stem.hh"
-
+#include "notehead.hh"
 #include "paper.hh"
 #include "molecule.hh"
 #include "linestaff.hh"
@@ -29,15 +29,18 @@ Melodic_column::typeset_command(Command *com, int breakst)
 void
 Melodic_column::typeset_req(Request *rq)
 {
-    Item *i =new Item;
-    Molecule*m=create_req_mol(rq);
-
+    Item *i ;
     if (rq->note()) {
-       int h = rq->note()->height();
-       Real dy = staff_->paper()->interline()/2;
-       m->translate(Offset(0,(h-BOTTOM_POSITION)*dy));
+       Notehead *n =new Notehead((NO_LINES-1)*2);
+       n->balltype = rq->rhythmic()->balltype;
+       n->dots = rq->rhythmic()->dots;
+       n->position = rq->note()->height() - BOTTOM_POSITION;
+       i = n;
+    } else if (rq->rest()) {
+       i =new Item;
+       Molecule*m=create_req_mol(rq);
+       i->output=m;
     }
-    i->output = m;
     typeset_item(i);
 }
 
@@ -49,10 +52,7 @@ Melodic_column::typeset_stem(Stem_req*rq)
     int n = the_note->note()->height()-BOTTOM_POSITION;
     s->minnote =s->maxnote=n;
     s->flag = rq->stem_number;
-    s->calculate();
-    typeset_item(s);
-    
-    s->brew_molecole();
+    typeset_item(s);   
 }
 
 /*
diff --git a/stem.cc b/stem.cc
index 33198adddecb9df02e65bb9d6bfe532f6b6b2bd0..fd6634c6bfe63f7bd08b859962360ed95a856384 100644 (file)
--- a/stem.cc
+++ b/stem.cc
@@ -47,6 +47,13 @@ Stem::calculate()
     }
 }
 
+void
+Stem::postprocess()
+{
+    calculate();
+    brew_molecole();
+}
+
 Interval
 Stem::width()const
 {
@@ -60,16 +67,18 @@ void
 Stem::brew_molecole()
 {
     assert(pstaff_);
-    Paperdef *p = pstaff_->pscore_->paper_;
-    Parametric_symbol *stem = p->lookup_->stem();
-
     assert(bot!=top);
     assert(!output);
     
+    Paperdef *p = pstaff_->pscore_->paper_;
+    Parametric_symbol *stem = p->lookup_->stem();
+    
     Real dy = p->interline()/2;
     String y1 =print_dimen( dy * bot);
     String y2 = print_dimen(dy * top);
     Symbol ss =stem->eval(y1,y2);
+    delete stem;
+    
     output = new Molecule(Atom(ss));
 
     if (ABS(flag) > 4){