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>
11 #include "engraver.hh"
13 #include "pointer-group-interface.hh"
14 #include "stream-event.hh"
16 #include "translator.icc"
18 class Laissez_vibrer_engraver
: public Engraver
22 vector
<Grob
*> lv_ties_
;
24 void stop_translation_timestep ();
25 DECLARE_ACKNOWLEDGER (note_head
);
27 DECLARE_TRANSLATOR_LISTENER (laissez_vibrer
);
29 TRANSLATOR_DECLARATIONS (Laissez_vibrer_engraver
);
32 Laissez_vibrer_engraver::Laissez_vibrer_engraver ()
39 Laissez_vibrer_engraver::stop_translation_timestep ()
46 IMPLEMENT_TRANSLATOR_LISTENER (Laissez_vibrer_engraver
, laissez_vibrer
);
48 Laissez_vibrer_engraver::listen_laissez_vibrer (Stream_event
*ev
)
50 ASSIGN_EVENT_ONCE (event_
, ev
);
54 Laissez_vibrer_engraver::acknowledge_note_head (Grob_info inf
)
61 lv_column_
= make_item ("LaissezVibrerTieColumn", event_
->self_scm ());
64 SCM cause
= event_
->self_scm ();
65 Grob
*lv_tie
= make_item ("LaissezVibrerTie", cause
);
66 lv_tie
->set_object ("note-head", inf
.grob ()->self_scm ());
68 Pointer_group_interface::add_grob (lv_column_
, ly_symbol2scm ("ties"),
71 if (is_direction (unsmob_stream_event (cause
)->get_property ("direction")))
73 Direction d
= to_dir (unsmob_stream_event (cause
)->get_property ("direction"));
74 lv_tie
->set_property ("direction", scm_from_int (d
));
77 lv_tie
->set_parent (lv_column_
, Y_AXIS
);
79 lv_ties_
.push_back (lv_tie
);
82 ADD_ACKNOWLEDGER (Laissez_vibrer_engraver
, note_head
);
83 ADD_TRANSLATOR (Laissez_vibrer_engraver
,
85 "Create laissez vibrer items.",
89 "LaissezVibrerTieColumn ",