]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest-engraver.cc
release: 1.3.67
[lilypond.git] / lily / rest-engraver.cc
index dde03daa1c844476d32ebdc6dcd2a5126874692c..ccc80a3f82de05f2f6fe3916280e4cb485cf3aae 100644 (file)
@@ -3,13 +3,31 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
-
-#include "rest-engraver.hh"
+#include "staff-symbol-referencer.hh"
 #include "musical-request.hh"
 #include "dots.hh"
-#include "rest.hh"
+#include "rhythmic-head.hh"
+#include "engraver.hh"
+
+class Rest_engraver : public Engraver
+{
+  Rest_req *rest_req_l_;
+  Item * dot_p_;
+  Rhythmic_head * rest_p_;
+protected:
+  virtual bool do_try_music (Music *);
+  virtual void do_pre_move_processing ();
+  virtual void do_post_move_processing ();
+  virtual void do_process_music ();
+public:
+  
+  VIRTUAL_COPY_CONS(Translator);
+  Rest_engraver ();
+};
+
+
 /*
   Should merge with Note_head_engraver
  */
@@ -42,18 +60,29 @@ Rest_engraver::do_pre_move_processing ()
 }
 
 void
-Rest_engraver::do_process_requests ()
+Rest_engraver::do_process_music ()
 {
   if (rest_req_l_ && !rest_p_) 
     {
-      rest_p_ = new Rest;
-      rest_p_->balltype_i_ = rest_req_l_->duration_.durlog_i_; 
-
+      rest_p_ = new Rhythmic_head (get_property ("basicRestProperties"));
+      Staff_symbol_referencer_interface si (rest_p_);
+      si.set_interface ();
+      
+      rest_p_->set_elt_property ("duration-log",
+                                gh_int2scm (rest_req_l_->duration_.durlog_i_)); 
+      
       if (rest_req_l_->duration_.dots_i_)
        {
-         dot_p_ = new Dots;
-         rest_p_->dots_l_  =dot_p_;
-         dot_p_->dots_i_ = rest_req_l_->duration_.dots_i_;       
+         dot_p_ = new Item (get_property ("basicDotsProperties"));
+
+         Staff_symbol_referencer_interface si (dot_p_);
+         si.set_interface ();
+         
+         rest_p_->set_dots (dot_p_);
+         dot_p_->set_parent (rest_p_, Y_AXIS);
+         dot_p_->add_offset_callback (Dots::quantised_position_callback, Y_AXIS);
+         dot_p_->set_elt_property ("dot-count",
+                                   gh_int2scm (rest_req_l_->duration_.dots_i_));
          announce_element (Score_element_info (dot_p_,0));
        }