From 3ddc8bb1d7ec8d361cae96889ad804384c2f2698 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 31 Mar 2004 09:44:33 +0000 Subject: [PATCH] * 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. --- ChangeLog | 3 +++ lily/chord-tremolo-engraver.cc | 28 +++++++++++----------------- lily/include/stem-tremolo.hh | 1 - lily/stem-engraver.cc | 3 ++- lily/stem-tremolo.cc | 6 ------ 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92d228098c..9ea8cf0052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-03-31 Han-Wen Nienhuys + * 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 diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 8ab127d5eb..1d06bd4ea4 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -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); } } diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index 8cddd8f18a..47255b3f9d 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -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*); }; diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 69d47c70ac..0216c85106 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -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; } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 20bff9d686..d8c08c7bd9 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -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.", -- 2.39.2