2 thread-devnull-engraver.cc -- implement Thread_devnull_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
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");
30 if (s == ly_symbol2scm ("always")
32 && to_boolean (get_property ("soloADue"))
33 && ((daddy_trans_->id_string_.left_string (3) == "two"
34 && (to_boolean (get_property ("unison"))
35 || to_boolean (get_property ("unisilence"))))
37 /* Maybe this should be optional? */
38 || to_boolean (get_property ("othersolo")))))
43 Thread_devnull_engraver::Thread_devnull_engraver(){}
45 ENTER_DESCRIPTION(Thread_devnull_engraver,
46 /* descr */ "Kill elements whenever we are Voice called `two' and either "
47 "unison, unisilence or soloADue is set.@footnote{On unix systems, the "
48 "file @file{/dev/null} is special device: anything written to it is "
49 "discarded.}. This engraver works closely together with the part "
50 "combiner. When the part combiner notices that two threads are "
51 "identical, it tells the @code{Thread_devnull_engraver} to discard "
52 "everything in the second thread. "
56 /* acks */ "grob-interface",