2 thread-devnull-engraver.cc -- implement Thread_devnull_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "musical-request.hh"
12 #include "translator-group.hh"
14 class Thread_devnull_engraver
: public Engraver
17 TRANSLATOR_DECLARATIONS(Thread_devnull_engraver
);
20 virtual void acknowledge_grob (Grob_info
);
26 Thread_devnull_engraver::acknowledge_grob (Grob_info i
)
28 SCM s
= get_property ("devNullThread");
31 /* No need, next if will never be true */
32 if (s
== ly_symbol2scm ("never"))
36 if (s
== ly_symbol2scm ("always")
38 && to_boolean (get_property ("soloADue"))
39 && ((daddy_trans_
->id_string_
.left_string (3) == "two"
40 && (to_boolean (get_property ("unison"))
41 || to_boolean (get_property ("unisilence"))))
43 /* Maybe this should be optional? */
44 || to_boolean (get_property ("othersolo")))))
49 Thread_devnull_engraver::Thread_devnull_engraver(){}
51 ENTER_DESCRIPTION(Thread_devnull_engraver
,
52 /* descr */ "Kill elements whenever we are Voice called `two' and either
53 unison, unisilence or soloADue is set.@footnote{On unix systems, the
54 file @file{/dev/null} is special device: anything written to it is
55 discarded.}. This engraver works closely together with the part
56 combiner. When the part combiner notices that two threads are
57 identical, it tells the @code{Thread_devnull_engraver} to discard
58 everything in the second thread.
61 /* acks */ "grob-interface",