]> git.donarmstrong.com Git - lilypond.git/commitdiff
(instantiate): check for
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Aug 2005 10:58:04 +0000 (10:58 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Aug 2005 10:58:04 +0000 (10:58 +0000)
Engraver_group_engraver and Performer_group_performer not
Engraver/Performer. Fixes crashes when doing \with { \consist .. }

ChangeLog
lily/context-def.cc
lily/default-bar-line-engraver.cc
lily/percent-repeat-engraver.cc
lily/tie.cc
lily/timing-translator.cc
ly/engraver-init.ly

index 64f0d50726051e971ab77f566efce6ce5ee0a13e..6195ed73e15903cad49484d63cc036d3895fbf35 100644 (file)
--- 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
 
 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
index 101696f288a284f043960dcad32e97ffbd1a99b5..fa563bd80a578016ecf18d2e3cd7142f8f6b4473 100644 (file)
@@ -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;
index 086bc8374c0d4b94102b7f9b39745a448062d7dc..c66346a6959099e33a41cbf6081134d72b97169b 100644 (file)
@@ -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 ()
index bb40c0e45fe197a8702d90429d8e005109ebb051..924098c4af1c29a0216f3a6615ebddb4f5c67e22 100644 (file)
@@ -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_)
index 8668d994cad5b992c583d801b5fa4a01c5d94f23..36e97842f5745236527b49229e04b9aa13c1881d 100644 (file)
@@ -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.
 
index b73c1bdb73f31101ecc855b2bdf4a1dd2ea47211..447d08a5c29bbb7e3d1ef7b0a9a1073e57f0ebb3 100644 (file)
@@ -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
index 13f67e2b9fb1861b909686fb0a359bce29ad284c..ebda3688274619ddb5b4d870270c1d6e40b238c2 100644 (file)
@@ -584,6 +584,8 @@ AncientRemoveEmptyStaffContext = \context {
   instrumentTransposition = #(ly:make-pitch 0 0 0)
 
   verticallySpacedContexts = #'(Staff)
+
+  timing = ##t
 }