]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.38
authorfred <fred>
Sun, 24 Mar 2002 19:34:07 +0000 (19:34 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:34:07 +0000 (19:34 +0000)
src/headreg.cc

index c41037c5134b2a5364706d450cc57acce7eec1ee..dc5d72d572aa1ab02782c6c2965ab0348794c2fa 100644 (file)
@@ -6,65 +6,71 @@
 #include "rest.hh"
 #include "notehead.hh"
 #include "headreg.hh"
-#include "paperdef.hh"
-#include "complexwalker.hh"
+#include "paper-def.hh"
+#include "complex-walker.hh"
 #include "musicalrequest.hh"
 
-Notehead_register::Notehead_register(Complex_walker*w_l)
-    :Request_register(w_l)
+Notehead_register::Notehead_register()
 {
     note_p_ = 0;
-    set_dir(0);
+    set_feature(Features::dir(0));
+    post_move_processing();
 }
 
 bool
 Notehead_register::try_request(Request *req_l) 
 {
     if (req_l->note() || req_l->rest())
-       accepted_req_arr_.push(req_l);
+       note_req_l_=req_l->rhythmic();
     else
        return false;
 
     return true;
 }
 void
-Notehead_register::set_dir(int d)
+Notehead_register::set_feature(Features d)
 {
-    dir_i_ = d;
+    if(d.direction_i_ || d.initialiser_b_)
+       dir_i_ = d.direction_i_;
 }
 
 void
-Notehead_register::process_request()
+Notehead_register::process_requests()
 {
-    if (!accepted_req_arr_.size())
+    if (!note_req_l_)
        return;
     
-    Request* req_l = accepted_req_arr_.top();
-    if (req_l->note()) {
+
+    if (note_req_l_->note()) {
        Notehead*n_p = new Notehead(8); // ugh
        note_p_ = n_p;
-       n_p->set_rhythmic(req_l->rhythmic());
-       n_p->position = req_l->note()->height() +
-           walk_l_->c0_position_i();
+       n_p->set_rhythmic(note_req_l_->rhythmic());
+       n_p->position = note_req_l_->note()->height() +
+           *get_staff_info().c0_position_i_;
     } else {
-       note_p_ = new Rest ( req_l->rhythmic()->balltype,
-                            req_l->rhythmic()->dots);
-       if (req_l->rhythmic()->balltype <= 2)
+       note_p_ = new Rest ( note_req_l_->rhythmic()->balltype,
+                            note_req_l_->rhythmic()->dots);
+       if (note_req_l_->rhythmic()->balltype <= 2)
            note_p_->translate(
                Offset(0,
                       6 * paper()->internote()));
     }
-    Staff_elem_info itinf(note_p_,req_l,this);
+    Staff_elem_info itinf(note_p_,note_req_l_);
     announce_element(itinf);
 }
 
 void
-Notehead_register::do_pre_move_process()
+Notehead_register::pre_move_processing()
 {
     if (note_p_) {
-       if (dir_i_ && note_p_->name() == String("Rest"))
+       if (dir_i_ && note_p_->name() == Rest::static_name())
            note_p_->translate(Offset(0, 4*dir_i_ * paper()->internote()));
        typeset_element(note_p_);
        note_p_ = 0;
     }
 }
+void
+Notehead_register::post_move_processing()
+{
+    note_req_l_ = 0;
+}