2 voice-devnull-engraver.cc -- implement Voice_devnull_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "musical-request.hh"
12 #include "translator-group.hh"
14 class Voice_devnull_engraver
: public Engraver
17 VIRTUAL_COPY_CONS (Translator
);
20 virtual bool try_music (Music
*m
);
21 virtual void acknowledge_grob (Grob_info
);
24 ADD_THIS_TRANSLATOR (Voice_devnull_engraver
);
26 static char const *eat_spanners
[] = {
30 "crescendo-interface",
35 Voice_devnull_engraver::try_music (Music
*m
)
37 if (daddy_trans_l_
->id_str_
== "two"
38 && (to_boolean (get_property ("unison"))
39 || to_boolean (get_property ("unisilence"))))
41 for (char const **p
= eat_spanners
; *p
; p
++)
43 if (Span_req
*s
= dynamic_cast <Span_req
*> (m
))
45 if (scm_equal_p (s
->get_mus_property ("span-type"),
46 ly_str02scm ( *p
)) == SCM_BOOL_T
)
56 static char const *junk_interfaces
[] = {
62 "text-item-interface",
63 "text-script-interface",
65 "crescendo-interface",
70 Voice_devnull_engraver::acknowledge_grob (Grob_info i
)
72 if (daddy_trans_l_
->id_str_
== "two"
73 && (to_boolean (get_property ("unison"))
74 || to_boolean (get_property ("unisilence"))))
75 for (char const **p
= junk_interfaces
; *p
; p
++)
76 if (i
.elem_l_
->has_interface (ly_symbol2scm (*p
)))
78 i
.elem_l_
->suicide ();