- if (art == SCM_BOOL_F)
- {
- String a = ly_scm2string (l->get_mus_property ("articulation-type"));
- l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.to_str0 ()));
-
- continue;
- }
- // todo -> use result of articulation-to-scriptdef directly as basic prop list.
- Grob *p =new Item (get_property ("Script"));
- art = ly_cdr (art);
- p->set_grob_property ("script-molecule", ly_car (art));
-
- art = ly_cdr (art);
- bool follow_staff = gh_scm2bool (ly_car (art));
- art = ly_cdr (art);
- SCM relative_stem_dir = ly_car (art);
- art = ly_cdr (art);
-
- SCM force_dir = l->get_mus_property ("direction");
- if (ly_dir_p (force_dir) && !to_dir (force_dir))
- force_dir = ly_car (art);
-
- art = ly_cdr (art);
- int priority = gh_scm2int (ly_car (art));
-
- SCM s = p->get_grob_property ("script-priority");
- if (gh_number_p (s))
- priority = gh_scm2int (s);
-
- /* Make sure they're in order of user input by adding index i. */
- priority += i * (to_dir (force_dir) ? to_dir (force_dir) : 1);
-
- if (ly_dir_p (force_dir) && to_dir (force_dir))
- p->set_grob_property ("direction", force_dir);
- else if (to_dir (relative_stem_dir))
- p->set_grob_property ("side-relative-direction", relative_stem_dir);
-
-
- /*
- FIXME: should figure this out in relation with basic props!
- */
- SCM axisprop = get_property ("scriptHorizontal");
- bool xaxis = to_boolean (axisprop);
- Side_position_interface::set_axis (p, xaxis ? X_AXIS : Y_AXIS);
-
- if (!follow_staff && ! xaxis)
- p->set_grob_property ("staff-support", SCM_BOOL_T);
-
- if (!xaxis && follow_staff)
- p->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
-
-
- p->set_grob_property ("script-priority", gh_int2scm (priority));
-
- scripts_.push (p);
-
- announce_grob (p, l->self_scm());
+ make_script_from_event (p, context (),
+ ev->get_property ("articulation-type"),
+ i);
+
+ scripts_[i].script_ = p;
+
+ SCM force_dir = ev->get_property ("direction");
+ if (is_direction (force_dir) && to_dir (force_dir))
+ p->set_property ("direction", force_dir);