source file of the GNU LilyPond music typesetter
- (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
Chris Jackson <chris@fluffhouse.org.uk> - extended to support
bracketed pedals.
#include "staff-symbol-referencer.hh"
#include "item.hh"
#include "axis-group-interface.hh"
-#include "translator-group.hh"
+#include "context.hh"
+
#include "directional-element-interface.hh"
#include "note-column.hh"
#include "warn.hh"
bool
Piano_pedal_engraver::try_music (Music *m)
{
- if (m->is_mus_type ("abort-event"))
- {
- for (Pedal_info*p = info_list_; p->name_; p ++)
- {
- p->event_drul_[START] = 0;
- p->event_drul_[STOP] = 0;
-
- if (p->bracket_)
- p->bracket_->suicide ();
- p->bracket_ = 0;
- }
- }
- else if (m->is_mus_type ("pedal-event"))
+ if (m->is_mus_type ("pedal-event"))
{
for (Pedal_info*p = info_list_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (gh_equal_p (m->get_mus_property ("name") ,
+ if (gh_equal_p (m->get_property ("name") ,
gh_symbol2scm (nm.to_str0())))
{
- Direction d = to_dir (m->get_mus_property ("span-direction"));
+ Direction d = to_dir (m->get_property ("span-direction"));
p->event_drul_[d] = m;
return true;
}
String msg = _ ("Need 3 strings for piano pedals. No pedal made. ");
if (m)
- m->origin()->warning (msg);
+ m->origin ()->warning (msg);
else
warning (msg);
{
s = ly_caddr (strings);
if (previous_.size ())
- previous_.pop();
+ previous_.pop ();
}
p->start_ev_ = 0;
}
String propname = String (p->name_) + "Pedal";
p->item_ = make_item (propname.to_str0 ());
- p->item_->set_grob_property ("text", s);
+ p->item_->set_property ("text", s);
Axis_group_interface::add_element (p->line_spanner_, p->item_);
announce_grob (p->item_,
{
if (!p->event_drul_[START])
{
- if (previous_.size())
- previous_.pop();
+ if (previous_.size ())
+ previous_.pop ();
}
assert (!p->finished_bracket_);
p->bracket_->set_bound (RIGHT, cmc);
/*
- Set properties so that the molecule-creating function will
+ Set properties so that the stencil-creating function will
know whether the right edge should be flared ___/
*/
if (!p->event_drul_[START])
{
- SCM flare = p->bracket_->get_grob_property ("bracket-flare");
- p->bracket_->set_grob_property ("bracket-flare", scm_cons (gh_car (flare),
+ SCM flare = p->bracket_->get_property ("bracket-flare");
+ p->bracket_->set_property ("bracket-flare", scm_cons (gh_car (flare),
gh_double2scm (0)));
}
p->bracket_ = make_spanner ("PianoPedalBracket");
/*
- Set properties so that the molecule-creating function will
+ Set properties so that the stencil-creating function will
know whether the left edge should be flared \___
*/
if (!p->finished_bracket_)
{
- SCM flare = p->bracket_->get_grob_property ("bracket-flare");
- p->bracket_->set_grob_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
+ SCM flare = p->bracket_->get_property ("bracket-flare");
+ p->bracket_->set_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
}
/* Set this property for 'mixed style' pedals, Ped._______/\ ,
- so the molecule function will shorten the ____ line by the length of the Ped. text.
+ so the stencil function will shorten the ____ line by the length of the Ped. text.
*/
if (mixed)
WTF is pedal-text not the bound of the object? --hwn
*/
if (p->item_)
- p->bracket_->set_grob_property ("pedal-text", p->item_->self_scm ());
+ p->bracket_->set_property ("pedal-text", p->item_->self_scm ());
}
// position new pedal spanner below the current one
*/
- if (previous_.size())
- Side_position_interface::add_support (p->line_spanner_, previous_.top());
+ if (previous_.size ())
+ Side_position_interface::add_support (p->line_spanner_, previous_.top ());
previous_.push (p->line_spanner_);
}
suicide?
*/
if (p->line_spanner_
- && !p->line_spanner_->live())
+ && !p->line_spanner_->live ())
p->line_spanner_ = 0;
if (p->line_spanner_)
typeset_all ();
}
if (p->bracket_
- && !p->bracket_->live())
+ && !p->bracket_->live ())
p->bracket_ = 0;
if (p->bracket_)
&& !p->finished_line_spanner_->live ())
p->finished_line_spanner_ = 0;
if (p->finished_bracket_
- && !p->finished_bracket_->live())
+ && !p->finished_bracket_->live ())
p->finished_bracket_ = 0;
ENTER_DESCRIPTION (Piano_pedal_engraver,
/* descr */ "Engrave piano pedal symbols and brackets.",
/* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
-/* accepts */ "pedal-event abort-event",
+/* accepts */ "pedal-event",
/* acks */ "note-column-interface",
/* reads */ "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings pedalSostenutoStyle pedalSustainStyle pedalUnaCordaStyle",
/* write */ "");