lilypond-1.4.4
[lilypond.git] / lily / thread-devnull-engraver.cc
blob9e995b2f741183c2c7a23dfc16c7a0e218d7763b
1 /*
2 thread-devnull-engraver.cc -- implement Thread_devnull_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2001 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "engraver.hh"
10 #include "item.hh"
11 #include "musical-request.hh"
12 #include "translator-group.hh"
14 class Thread_devnull_engraver : public Engraver
16 public:
17 VIRTUAL_COPY_CONS (Translator);
19 protected:
20 virtual void acknowledge_grob (Grob_info);
23 ADD_THIS_TRANSLATOR (Thread_devnull_engraver);
25 void
26 Thread_devnull_engraver::acknowledge_grob (Grob_info i)
28 SCM s = get_property ("devNullThread");
29 #if 0
30 /* No need, next if will never be true */
31 if (s == ly_symbol2scm ("never"))
32 return;
33 #endif
35 if (s == ly_symbol2scm ("allways")
36 || (s == SCM_EOL
37 && daddy_trans_l_->id_str_.left_str (3) == "two"
38 && (to_boolean (get_property ("unison"))
39 || to_boolean (get_property ("unisilence")))
40 && to_boolean (get_property ("soloADue"))))
42 /* Ugh, we can suicide them, but they remain living */
43 i.elem_l_->suicide ();