/*
- bend-engraver.cc -- implement Bend_engraver
+ This file is part of LilyPond, the GNU music typesetter.
- (c) 2006--2008 Han-Wen Nienhuys
+ Copyright (C) 2006--2014 Han-Wen Nienhuys
-
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#include "engraver.hh"
void stop_translation_timestep ();
void start_translation_timestep ();
void stop_fall ();
-
+
private:
Moment stop_moment_;
Stream_event *fall_event_;
Bend_engraver::stop_fall ()
{
bool bar = scm_is_string (get_property ("whichBar"));
-
-
+
fall_->set_bound (RIGHT, unsmob_grob (bar
- ? get_property ("currentCommandColumn")
- : get_property ("currentMusicalColumn")));
+ ? get_property ("currentCommandColumn")
+ : get_property ("currentMusicalColumn")));
last_fall_ = fall_;
fall_ = 0;
note_head_ = 0;
void
Bend_engraver::stop_translation_timestep ()
{
- if (fall_ && !fall_->get_bound (LEFT))
+ if (fall_ && !fall_->get_bound (LEFT))
{
fall_->set_bound (LEFT, note_head_);
- fall_->set_parent (note_head_, Y_AXIS);
+ fall_->set_parent (note_head_, Y_AXIS);
}
}
{
if (!fall_event_)
return;
-
+
if (note_head_ && fall_)
{
stop_fall ();
note_head_ = info.grob ();
stop_moment_ = now_mom () + get_event_length (info.event_cause (),
- now_mom ());
+ now_mom ());
}
Bend_engraver::Bend_engraver ()
{
fall_ = make_spanner ("BendAfter", fall_event_->self_scm ());
fall_->set_property ("delta-position",
- scm_from_double (robust_scm2double (fall_event_->get_property ("delta-step"), 0)));
+ scm_from_double (robust_scm2double (fall_event_->get_property ("delta-step"), 0)));
}
}
ADD_ACKNOWLEDGER (Bend_engraver, note_head);
ADD_TRANSLATOR (Bend_engraver,
- /* doc */
- "Create fall spanners.",
+ /* doc */
+ "Create fall spanners.",
- /* create */
- "BendAfter ",
+ /* create */
+ "BendAfter ",
- /* read */
- "",
+ /* read */
+ "",
- /* write */
- ""
- );
+ /* write */
+ ""
+ );