]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/multi-measure-rest-engraver.cc
release: 1.2.13
[lilypond.git] / lily / multi-measure-rest-engraver.cc
index 0143543c6e94b9d8844b9fcafece92c431247879..51ff44654231651913b3ddc33fbe5a4ae4449007 100644 (file)
@@ -1,7 +1,7 @@
 /*
   multi_measure_rest-engraver.cc -- implement Multi_measure_rest_engraver
 
-  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
        Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "multi-measure-rest-engraver.hh"
 #include "score-column.hh"
 #include "time-description.hh"
-//#include "paper-score.hh"
-//#include "p-score.hh"
-//#include "paper-def.hh"
-//#include "main.hh"
-//#include "global-translator.hh"
 #include "bar.hh"
 
 
@@ -27,6 +22,8 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
   rest_moments_[START] =
     rest_moments_[STOP] =0;
   multi_measure_req_l_ = 0;
+
+  lastrest_p_ =0;
   mmrest_p_ = 0;
 }
 
@@ -45,20 +42,28 @@ Multi_measure_rest_engraver::acknowledge_element (Score_element_info i)
 bool
 Multi_measure_rest_engraver::do_try_music (Music* req_l)
 {
- if (Multi_measure_rest_req *mr = dynamic_cast<Multi_measure_rest_req *> (req_l))
-   {
-     if (multi_measure_req_l_)
-       if (!multi_measure_req_l_->equal_b (mr)
-          || rest_moments_[START] != now_mom ())
-        return false;
-  
-     multi_measure_req_l_ = mr;
-     rest_moments_[START] = now_mom ();
-     
-     rest_moments_[STOP] = rest_moments_[START] + multi_measure_req_l_->duration_.length_mom ();
-     return true;
-   }
- return false;
+  Rhythmic_req *r=0;
+  if (Multi_measure_rest_req *mr = 
+      dynamic_cast<Multi_measure_rest_req *> (req_l))
+    r=mr;
+  else if (Repetitions_req *rr = 
+          dynamic_cast<Repetitions_req *> (req_l))
+    r=rr;
+  if (r)
+    {
+      if (multi_measure_req_l_)
+       if (!multi_measure_req_l_->equal_b (r)
+           || rest_moments_[START] != now_mom ())
+         return false;
+      
+      multi_measure_req_l_ = r;
+      rest_moments_[START] = now_mom ();
+      
+      rest_moments_[STOP] = rest_moments_[START] +
+       multi_measure_req_l_->duration_.length_mom ();
+      return true;
+    }
+  return false;
 }
 
 void
@@ -68,6 +73,9 @@ Multi_measure_rest_engraver::do_process_requests ()
     {
       Time_description const *time = get_staff_info().time_C_;
       mmrest_p_ = new Multi_measure_rest;
+      if(dynamic_cast<Repetitions_req *> (multi_measure_req_l_))
+       mmrest_p_->set_elt_property (alt_symbol_scm_sym, 
+                                    ly_ch_C_to_scm ("scripts-repeatsign"));
       announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_));
       start_measure_i_ = time->bars_i_;
     }