/*
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 "rhythmic-head.hh"
#include "engraver.hh"
#include "note-column.hh"
-#include "translator-group.hh"
+#include "context.hh"
+
+#include "warn.hh"
struct Script_tuple
{
{
Array<Script_tuple> scripts_;
public:
- TRANSLATOR_DECLARATIONS(Script_engraver);
+ TRANSLATOR_DECLARATIONS (Script_engraver);
protected:
virtual bool try_music (Music*);
virtual void stop_translation_timestep ();
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")
+ if (ly_c_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
+ r->get_property ("articulation-type")
))
return true;
void
copy_property (Grob * g , SCM sym, SCM alist)
{
- if (g->internal_get_grob_property (sym) == SCM_EOL)
+ if (g->internal_get_property (sym) == SCM_EOL)
{
SCM entry = scm_assoc (sym,alist);
- if (gh_pair_p (entry))
+ if (ly_c_pair_p (entry))
{
- g->internal_set_grob_property (sym, gh_cdr (entry));
+ g->internal_set_property (sym, ly_cdr (entry));
}
}
}
ScriptStaccato , ScriptMarcato, etc. )
*/
void make_script_from_event (Grob *p,
- SCM * descr, Translator_group*tg, Music * event,
+ SCM * descr, Context *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);
-
+ art = ly_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);
int prio =0;
SCM sprio = scm_assoc (ly_symbol2scm ("script-priority"), art);
- if (gh_pair_p (sprio))
- prio = gh_scm2int (gh_cdr (sprio));
+ if (ly_c_pair_p (sprio))
+ prio = ly_scm2int (ly_cdr (sprio));
/*
prio += index;
Side_position_interface::set_axis (p, Y_AXIS);
- p->set_grob_property ("script-priority", gh_int2scm (prio));
+ p->set_property ("script-priority", scm_int2num (prio));
}
void
{
Music* l=scripts_[i].event_;
- Grob * p = make_item ("Script");
+ Grob * p = make_item ("Script", l->self_scm ());
- make_script_from_event (p, &scripts_[i].description_, daddy_trans_, l, i);
+ make_script_from_event (p, &scripts_[i].description_, context (),
+ l->get_property ("articulation-type"),
+ i);
scripts_[i].script_ = p;
- if (p)
- announce_grob (p, l->self_scm());
+
+
+ SCM force_dir = l->get_property ("direction");
+ if (is_direction (force_dir) && to_dir (force_dir))
+ p->set_property ("direction", force_dir);
}
}
{
Grob*e = scripts_[i].script_;
- if (to_dir (e->get_grob_property ("side-relative-direction")))
- e->set_grob_property ("direction-source", inf.grob_->self_scm ());
+ if (to_dir (e->get_property ("side-relative-direction")))
+ e->set_property ("direction-source", inf.grob_->self_scm ());
/*
add dep ?
Grob * sc = scripts_[i].script_;
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), scripts_[i].description_);
- if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
+ if (ly_c_pair_p (follow) && to_boolean (ly_cdr (follow)))
{
sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
- sc->set_grob_property ("staff-padding", SCM_EOL);
+ sc->set_property ("staff-padding", SCM_EOL);
}
- typeset_grob (sc);
}
scripts_.clear ();
}
-Script_engraver::Script_engraver(){}
+Script_engraver::Script_engraver (){}
-ENTER_DESCRIPTION(Script_engraver,
+ENTER_DESCRIPTION (Script_engraver,
/* descr */ "Handles note scripted articulations.",
/* creats*/ "Script",
/* accepts */ "script-event articulation-event",