2 laissez-vibrer-engraver.cc -- implement Laissez_vibrer_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "engraver.hh"
12 #include "pointer-group-interface.hh"
13 #include "stream-event.hh"
15 #include "translator.icc"
17 class Laissez_vibrer_engraver
: public Engraver
21 vector
<Grob
*> lv_ties_
;
23 void stop_translation_timestep ();
24 DECLARE_ACKNOWLEDGER (note_head
);
26 DECLARE_TRANSLATOR_LISTENER (laissez_vibrer
);
28 TRANSLATOR_DECLARATIONS (Laissez_vibrer_engraver
);
31 Laissez_vibrer_engraver::Laissez_vibrer_engraver ()
38 Laissez_vibrer_engraver::stop_translation_timestep ()
45 IMPLEMENT_TRANSLATOR_LISTENER (Laissez_vibrer_engraver
, laissez_vibrer
);
47 Laissez_vibrer_engraver::listen_laissez_vibrer (Stream_event
*ev
)
49 ASSIGN_EVENT_ONCE (event_
, ev
);
53 Laissez_vibrer_engraver::acknowledge_note_head (Grob_info inf
)
58 SCM cause
= event_
->self_scm ();
61 lv_column_
= make_item ("LaissezVibrerTieColumn", cause
);
63 Grob
*lv_tie
= make_item ("LaissezVibrerTie", cause
);
64 lv_tie
->set_object ("note-head", inf
.grob ()->self_scm ());
66 Pointer_group_interface::add_grob (lv_column_
, ly_symbol2scm ("ties"),
69 if (is_direction (unsmob_stream_event (cause
)->get_property ("direction")))
71 Direction d
= to_dir (unsmob_stream_event (cause
)->get_property ("direction"));
72 lv_tie
->set_property ("direction", scm_from_int (d
));
75 lv_tie
->set_parent (lv_column_
, Y_AXIS
);
77 lv_ties_
.push_back (lv_tie
);
80 ADD_ACKNOWLEDGER (Laissez_vibrer_engraver
, note_head
);
81 ADD_TRANSLATOR (Laissez_vibrer_engraver
,
83 "Create laissez vibrer items.",
87 "LaissezVibrerTieColumn ",