2 repeat-tie-engraver.cc -- implement Repeat_tie_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "engraver.hh"
13 #include "pointer-group-interface.hh"
14 #include "stream-event.hh"
16 #include "translator.icc"
18 class Repeat_tie_engraver : public Engraver
21 Grob *semi_tie_column_;
22 vector<Grob*> semi_ties_;
24 void stop_translation_timestep ();
25 DECLARE_ACKNOWLEDGER (note_head);
26 DECLARE_TRANSLATOR_LISTENER (repeat_tie);
29 TRANSLATOR_DECLARATIONS (Repeat_tie_engraver);
32 Repeat_tie_engraver::Repeat_tie_engraver ()
39 Repeat_tie_engraver::stop_translation_timestep ()
46 IMPLEMENT_TRANSLATOR_LISTENER (Repeat_tie_engraver, repeat_tie);
48 Repeat_tie_engraver::listen_repeat_tie (Stream_event *ev)
50 ASSIGN_EVENT_ONCE (event_, ev);
54 Repeat_tie_engraver::acknowledge_note_head (Grob_info inf)
59 if (!semi_tie_column_)
61 semi_tie_column_ = make_item ("RepeatTieColumn", event_->self_scm ());
64 SCM cause = event_->self_scm ();
65 Grob *semi_tie = make_item ("RepeatTie", cause);
66 semi_tie->set_object ("note-head", inf.grob ()->self_scm ());
68 Pointer_group_interface::add_grob (semi_tie_column_, ly_symbol2scm ("ties"),
70 semi_tie->set_parent (semi_tie_column_, Y_AXIS);
71 semi_ties_.push_back (semi_tie);
74 if (is_direction (unsmob_stream_event (cause)->get_property ("direction")))
76 Direction d = to_dir (unsmob_stream_event (cause)->get_property ("direction"));
77 semi_tie->set_property ("direction", scm_from_int (d));
82 ADD_ACKNOWLEDGER (Repeat_tie_engraver, note_head);
83 ADD_TRANSLATOR (Repeat_tie_engraver,
84 /* doc */ "Create repeat ties.",