From: hanwen <hanwen>
Date: Thu, 18 Aug 2005 10:58:04 +0000 (+0000)
Subject: (instantiate): check for
X-Git-Tag: release/2.6.4~17^2~51
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f87a0a3ed4ded2f739ea9f5e6c272b565713423e;p=lilypond.git

(instantiate): check for
Engraver_group_engraver and Performer_group_performer not
Engraver/Performer. Fixes crashes when doing \with { \consist .. }
---

diff --git a/ChangeLog b/ChangeLog
index 64f0d50726..6195ed73e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-18  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+	* lily/context-def.cc (instantiate): check for
+	Engraver_group_engraver and Performer_group_performer not
+	Engraver/Performer. Fixes crashes when doing \with { \consist .. }
+ 
 2005-08-18  Jan Nieuwenhuizen  <janneke@gnu.org>
 
 	* input/les-nereides.ly: Remove three fingering tweaks, update
@@ -34,6 +40,11 @@
 
 2005-08-17  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+	* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): set timing
+	to #t.
+
+	* lily/timing-translator.cc (initialize): don't initialize timing.
+
 	* input/regression/stem-spacing.ly (Module): remove file.
 
 	* input/regression/spacing-stick-out.ly: specify Score context for
diff --git a/lily/context-def.cc b/lily/context-def.cc
index 101696f288..fa563bd80a 100644
--- a/lily/context-def.cc
+++ b/lily/context-def.cc
@@ -336,9 +336,9 @@ Context_def::instantiate (SCM ops, Object_key const *key)
   g->simple_trans_list_ = trans_list;
 
   context->implementation_ = g;
-  if (dynamic_cast<Engraver *> (g))
+  if (dynamic_cast<Engraver_group_engraver *> (g))
     g->simple_trans_list_ = filter_performers (g->simple_trans_list_);
-  else if (dynamic_cast<Performer *> (g))
+  else if (dynamic_cast<Performer_group_performer *> (g))
     g->simple_trans_list_ = filter_engravers (g->simple_trans_list_);
 
   g->context_ = context;
diff --git a/lily/default-bar-line-engraver.cc b/lily/default-bar-line-engraver.cc
index 086bc8374c..c66346a695 100644
--- a/lily/default-bar-line-engraver.cc
+++ b/lily/default-bar-line-engraver.cc
@@ -28,14 +28,23 @@ public:
 #include "translator.icc"
 
 ADD_TRANSLATOR (Default_bar_line_engraver,
-		"This engraver determines what kind of automatic bar lines should be produced, "
-		"and sets @code{whichBar} accordingly. It should be at the same "
+		"This engraver determines what kind of automatic bar "
+		"lines should be produced, "
+		"and sets @code{whichBar} "
+		"accordingly. It should be at the same "
 		"level as @ref{Timing_translator}. ",
+		
 		/* create */ "",
 		/* accept */ "",
+
 		/* read */
-		"measurePosition automaticBars whichBar barAlways defaultBarType "
-		"measureLength",
+		"automaticBars "
+		"barAlways "
+		"defaultBarType "
+		"measureLength "
+		"whichBar "
+		"measurePosition ",
+		
 		/* write */ "automaticBars");
 
 Default_bar_line_engraver::Default_bar_line_engraver ()
diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc
index bb40c0e45f..924098c4af 100644
--- a/lily/percent-repeat-engraver.cc
+++ b/lily/percent-repeat-engraver.cc
@@ -48,7 +48,8 @@ protected:
   Repeat_sign_type repeat_sign_type_;
 
   Item *double_percent_;
-  Item *double_percent_counter_; 
+  Item *double_percent_counter_;
+  
   Spanner *percent_;
   Spanner *percent_counter_;
   Spanner *finished_percent_;
@@ -95,9 +96,12 @@ Percent_repeat_engraver::try_music (Music *m)
       Moment now = now_mom ();
       start_mom_ = now;
       stop_mom_ = start_mom_ + Moment (total_count_) * body_length_;
-      next_moment_ = start_mom_ + body_length_;
+      next_moment_ = start_mom_;
+      next_moment_ += body_length_;
 
-      Moment meas_len (robust_scm2moment (get_property ("measureLength"), Moment (1)));
+      Moment meas_len (robust_scm2moment (get_property ("measureLength"),
+					  Moment (1)));
+      
       if (meas_len == body_length_)
 	repeat_sign_type_ = MEASURE;
       else if (Moment (2) * meas_len == body_length_)
diff --git a/lily/tie.cc b/lily/tie.cc
index 8668d994ca..36e97842f5 100644
--- a/lily/tie.cc
+++ b/lily/tie.cc
@@ -214,8 +214,8 @@ Tie::get_control_points (SCM smob)
   Bezier b = slur_shape (width, h_inf, r_0);
 
   /*
-    I think this better, particularly for small ties. It always allows the user to move ties if
-    they seem in the wrong place
+    I think this better, particularly for small ties. It always allows
+    the user to move ties if they seem in the wrong place
 
     TODO: what if 2 heads have different size.
 
diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc
index b73c1bdb73..447d08a5c2 100644
--- a/lily/timing-translator.cc
+++ b/lily/timing-translator.cc
@@ -19,14 +19,8 @@ Timing_translator::stop_translation_timestep ()
 {
   Global_context *global = get_global_context ();
 
-  /* allbars == ! skipbars */
-  SCM sb = get_property ("skipBars");
-  bool allbars = !to_boolean (sb);
-
-  // urg: multi bar rests: should always process whole of first bar?
-  SCM tim = get_property ("timing");
-  bool timb = to_boolean (tim);
-  if (timb && allbars)
+  if (to_boolean (get_property ("timing"))
+      && !to_boolean (get_property ("skipBars")))
     {
       Moment barleft = (measure_length () - measure_position (context ()));
       Moment now = now_mom ();
@@ -44,12 +38,7 @@ Timing_translator::stop_translation_timestep ()
 void
 Timing_translator::initialize ()
 {
-
-  /*
-    move this to engraver-init.ly?
-  */
   context ()->add_alias (ly_symbol2scm ("Timing"));
-  context ()->set_property ("timing", SCM_BOOL_T);
   context ()->set_property ("currentBarNumber", scm_from_int (1));
 
   context ()->set_property ("timeSignatureFraction",
@@ -58,8 +47,10 @@ Timing_translator::initialize ()
     Do not init measurePosition; this should be done from global
     context.
   */
-  context ()->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
-  context ()->set_property ("beatLength", Moment (Rational (1, 4)).smobbed_copy ());
+  context ()->set_property ("measureLength",
+			    Moment (Rational (1)).smobbed_copy ());
+  context ()->set_property ("beatLength",
+			    Moment (Rational (1, 4)).smobbed_copy ());
 }
 
 Rational
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 13f67e2b9f..ebda368827 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -584,6 +584,8 @@ AncientRemoveEmptyStaffContext = \context {
   instrumentTransposition = #(ly:make-pitch 0 0 0)
 
   verticallySpacedContexts = #'(Staff)
+
+  timing = ##t
 }