/*
script-engraver.cc -- implement Script_engraver
- (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "script.hh"
#include "engraver.hh"
#include "note-column.hh"
#include "translator-group.hh"
+#include "warn.hh"
struct Script_tuple
{
{
if (r->is_mus_type ("articulation-event"))
{
+ /*
+ Discard double articulations.
+ This is necessary for part-combining.
+ */
+ for (int j = 0; j < scripts_.size (); j++)
+ if (gh_equal_p (scripts_[j]. event_->get_mus_property ("articulation-type"),
+ r->get_mus_property ("articulation-type")
+ ))
+ return true;
+
Script_tuple t;
t.event_ =r;
scripts_.push (t);
+
return true;
}
return false;
ScriptStaccato , ScriptMarcato, etc. )
*/
void make_script_from_event (Grob *p,
- SCM * descr, Translator_group*tg, Music * event,
+ SCM * descr, Translator_group*tg,
+ SCM art_type,
int index)
{
SCM alist = tg->get_property ("scriptDefinitions");
- SCM art_type= event->get_mus_property ("articulation-type");
SCM art = scm_assoc (art_type, alist);
if (art == SCM_BOOL_F)
{
- event->origin ()->warning (_("Don't know how to interpret articulation:"));
- event->origin ()->warning (_("Scheme encoding: "));
+ warning (_("Don't know how to interpret articulation:"));
+ warning (_("Scheme encoding: "));
scm_write (art_type, scm_current_error_port ());
return ;
}
art = gh_cdr (art);
-
*descr = art;
- SCM force_dir = event->get_mus_property ("direction");
- if (is_direction (force_dir) && to_dir (force_dir))
- p->set_grob_property ("direction", force_dir);
- copy_property (p, ly_symbol2scm ("script-molecule"), art);
+ copy_property (p, ly_symbol2scm ("script-stencil"), art);
copy_property (p, ly_symbol2scm ("direction"), art);
copy_property (p, ly_symbol2scm ("side-relative-direction"), art);
Grob * p = make_item ("Script");
- make_script_from_event (p, &scripts_[i].description_, daddy_trans_, l, i);
+ make_script_from_event (p, &scripts_[i].description_, daddy_trans_,
+ l->get_mus_property ("articulation-type"),
+ i);
scripts_[i].script_ = p;
+
+
+ SCM force_dir = l->get_mus_property ("direction");
+ if (is_direction (force_dir) && to_dir (force_dir))
+ p->set_grob_property ("direction", force_dir);
+
if (p)
announce_grob (p, l->self_scm());
}
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), scripts_[i].description_);
if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
- sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
- else
- Side_position_interface::add_staff_support (sc);
+ {
+ sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
+ sc->set_grob_property ("staff-padding", SCM_EOL);
+ }
typeset_grob (sc);
}
scripts_.clear ();