]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/chord-tremolo-engraver.cc (acknowledge_grob): trigger
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 Mar 2004 09:44:33 +0000 (09:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 31 Mar 2004 09:44:33 +0000 (09:44 +0000)
stem-tremolo by stem object. This fixes no stem for tremolo bug.

* lily/stem-tremolo.cc (print): don't crash for no-stem.

ChangeLog
lily/chord-tremolo-engraver.cc
lily/include/stem-tremolo.hh
lily/stem-engraver.cc
lily/stem-tremolo.cc

index 92d228098cc1c96aa3fc2b1562a534d921a514dd..9ea8cf00526642bff9f4e2457177248612ef60f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-03-31  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/chord-tremolo-engraver.cc (acknowledge_grob): trigger
+       stem-tremolo by stem object. This fixes no stem for tremolo bug.
+
        * lily/stem-tremolo.cc (print): don't crash for no-stem.
 
        * Documentation/user/changing-defaults.itely (Which properties to
index 8ab127d5eb99546be5f05f9927fcf01f9961af16..1d06bd4ea419e4db837b9740ad5aab2d29e7cc46 100644 (file)
@@ -119,9 +119,7 @@ Chord_tremolo_engraver::try_music (Music * m)
 void
 Chord_tremolo_engraver::process_music ()
 {
-  if (repeat_)
-    {
-      if (sequential_body_b_ && !beam_)
+  if (repeat_ && sequential_body_b_ && !beam_)
        {
          beam_ = make_spanner ("Beam");
          beam_->set_property ("chord-tremolo", SCM_BOOL_T);
@@ -132,18 +130,8 @@ Chord_tremolo_engraver::process_music ()
          beam_start_location_ = mp;
          announce_grob (beam_, repeat_->self_scm ());
        }
-      else if (!sequential_body_b_ && !stem_tremolo_)
-       {
-         if (flags_)
-           {
-             stem_tremolo_ = make_item ("StemTremolo");
-             announce_grob (stem_tremolo_, repeat_->self_scm ());
-             stem_tremolo_->set_property ("flag-count",
-                                               scm_int2num (flags_));
-           }
-       }
-    }
 }
+
 void
 Chord_tremolo_engraver::finalize ()
 {
@@ -195,10 +183,16 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
            ::warning (s);
        }
     }
-  else if (stem_tremolo_ && Stem::has_interface (info.grob_))
+  else if (repeat_ &&
+          flags_ && !sequential_body_b_ && Stem::has_interface (info.grob_))
     {
-       Stem_tremolo::set_stem (stem_tremolo_, info.grob_);
-       stem_tremolo_->set_parent (info.grob_,X_AXIS);
+      stem_tremolo_ = make_item ("StemTremolo");
+      announce_grob (stem_tremolo_, repeat_->self_scm ());
+      stem_tremolo_->set_property ("flag-count",
+                                  scm_int2num (flags_));
+      stem_tremolo_->set_property ("stem",
+                                  info.grob_->self_scm ());
+      stem_tremolo_->set_parent (info.grob_, X_AXIS);
     }
 }
 
index 8cddd8f18a742c45973f875006c9b79c8dd3a810..47255b3f9dd468fc41ca1256a776d670002e0815 100644 (file)
@@ -21,7 +21,6 @@ public:
   DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis));
   DECLARE_SCHEME_CALLBACK (print, (SCM ));
   DECLARE_SCHEME_CALLBACK (height, (SCM,SCM));
-  static void set_stem (Grob*me, Grob *st);
   static Stencil raw_stencil (Grob*);
 };
 
index 69d47c70acb659f4ae58a05369334f9df50a8783..0216c85106a0ac45b000eba48dc17ca97d7b45d6 100644 (file)
@@ -112,6 +112,8 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                                               gh_int2scm (tremolo_flags));
                  tremolo_->set_parent (stem_, X_AXIS);
                  stem_->set_property ("tremolo-flag", tremolo_->self_scm ());
+                 tremolo_->set_property ("stem",
+                                         stem_->self_scm ());
                }
            }
 
@@ -137,7 +139,6 @@ Stem_engraver::stop_translation_timestep ()
 {
   if (tremolo_)
     {
-      Stem_tremolo::set_stem (tremolo_, stem_);
       typeset_grob (tremolo_);
       tremolo_ = 0;
     }
index 20bff9d6866c2f6b2d317cdc668c41fc3510d004..d8c08c7bd950beca43498d0f2077cbe22c338d7a 100644 (file)
@@ -193,12 +193,6 @@ Stem_tremolo::print (SCM grob)
 }
 
 
-void
-Stem_tremolo::set_stem (Grob*me,Grob *s)
-{
-  me->set_property ("stem", s->self_scm ());
-}
-
 
 ADD_INTERFACE (Stem_tremolo,"stem-tremolo-interface",
   "A beam slashing a stem to indicate a tremolo.",