2 fall-engraver.cc -- implement Fall_engraver
4 (c) 2006 Han-Wen Nienhuys
13 class Fall_engraver : public Engraver
16 TRANSLATOR_DECLARATIONS (Fall_engraver);
17 DECLARE_ACKNOWLEDGER (note_head);
20 virtual bool try_music (Music *event);
21 void process_music ();
22 void stop_translation_timestep ();
23 void start_translation_timestep ();
34 Fall_engraver::stop_fall ()
36 bool bar = scm_is_string (get_property ("whichBar"));
39 fall_->set_bound (RIGHT, unsmob_grob (
41 ? get_property ("currentCommandColumn")
42 : get_property ("currentMusicalColumn")));
49 Fall_engraver::stop_translation_timestep ()
51 if (fall_ && !fall_->get_bound (LEFT))
53 fall_->set_bound (LEFT, note_head_);
54 fall_->set_parent (note_head_, Y_AXIS);
59 Fall_engraver::start_translation_timestep ()
61 if (fall_ && now_mom ().main_part_ >= stop_moment_.main_part_)
68 Fall_engraver::acknowledge_note_head (Grob_info info)
73 if (note_head_ && fall_)
78 note_head_ = info.grob ();
79 stop_moment_ = now_mom () + info.music_cause ()->get_length ();
82 Fall_engraver::Fall_engraver ()
90 Fall_engraver::try_music (Music *r)
97 Fall_engraver::process_music ()
99 if (fall_event_ && !fall_)
101 fall_ = make_spanner ("BendAfter", fall_event_->self_scm ());
102 fall_->set_property ("delta-position",
103 scm_from_double (robust_scm2double (fall_event_->get_property ("delta-pitch"), 0) * 0.5));
107 #include "translator.icc"
110 ADD_ACKNOWLEDGER (Fall_engraver, note_head);
113 ADD_TRANSLATOR (Fall_engraver,
114 /* doc */ "Create fall spanners.",
115 /* create */ "BendAfter",
116 /* accept */ "bend-after-event",