]> git.donarmstrong.com Git - lilypond.git/blob - lily/thread-devnull-engraver.cc
patch::: 1.3.127.jcn4
[lilypond.git] / lily / thread-devnull-engraver.cc
1 /*
2   thread-devnull-engraver.cc -- implement Thread_devnull_engraver
3
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "engraver.hh"
10 #include "item.hh"
11 #include "musical-request.hh"
12 #include "translator-group.hh"
13
14 class Thread_devnull_engraver : public Engraver
15 {
16 public:
17   VIRTUAL_COPY_CONS (Translator);
18   
19 protected:
20   virtual void acknowledge_grob (Grob_info);
21 };
22
23 ADD_THIS_TRANSLATOR (Thread_devnull_engraver);
24
25 void
26 Thread_devnull_engraver::acknowledge_grob (Grob_info i)
27 {
28   /*
29     FIXME: coriolan-fix hack -- ff  geen inspiratie
30     
31     We should have at least three modes:
32     
33       1. Never -- do nothing
34       2. Allways -- junk everythingallways
35       3. Regular: junk according to two/unison/unisilence/soloADue
36
37     but how shall we do that?
38
39     Hmm, maybe just: threadDevNull = 'never|'allways|...
40    */
41   if (!to_boolean (get_property ("disableDevNullThread"))
42       && daddy_trans_l_->id_str_.left_str (3) == "two"
43       && (to_boolean (get_property ("unison"))
44           || to_boolean (get_property ("unisilence")))
45       && to_boolean (get_property ("soloADue")))
46     i.elem_l_->suicide ();
47 }