2 part-combine-engraver.cc -- implement PC-engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
8 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "engraver.hh"
12 #include "multi-measure-rest.hh"
13 #include "note-head.hh"
14 #include "side-position-interface.hh"
16 #include "stream-event.hh"
17 #include "text-interface.hh"
20 #include "translator.icc"
22 class Part_combine_engraver
: public Engraver
24 TRANSLATOR_DECLARATIONS (Part_combine_engraver
);
27 DECLARE_ACKNOWLEDGER (note_head
);
28 DECLARE_ACKNOWLEDGER (stem
);
30 DECLARE_TRANSLATOR_LISTENER (part_combine
);
31 void process_music ();
32 void stop_translation_timestep ();
38 IMPLEMENT_TRANSLATOR_LISTENER (Part_combine_engraver
, part_combine
);
40 Part_combine_engraver::listen_part_combine (Stream_event
*ev
)
42 ASSIGN_EVENT_ONCE (event_
, ev
);
45 Part_combine_engraver::Part_combine_engraver ()
52 Part_combine_engraver::process_music ()
55 && to_boolean (get_property ("printPartCombineTexts")))
57 SCM what
= event_
->get_property ("class");
59 if (what
== ly_symbol2scm ("solo-one-event"))
60 text
= get_property ("soloText");
61 else if (what
== ly_symbol2scm ("solo-two-event"))
62 text
= get_property ("soloIIText");
63 else if (what
== ly_symbol2scm ("unisono-event"))
64 text
= get_property ("aDueText");
66 if (Text_interface::is_markup (text
))
68 text_
= make_item ("CombineTextScript", event_
->self_scm ());
69 text_
->set_property ("text", text
);
75 Part_combine_engraver::acknowledge_note_head (Grob_info i
)
80 Side_position_interface::add_support (t
, i
.grob ());
81 if (Side_position_interface::get_axis (t
) == X_AXIS
82 && !t
->get_parent (Y_AXIS
))
83 t
->set_parent (i
.grob (), Y_AXIS
);
88 Part_combine_engraver::acknowledge_stem (Grob_info i
)
91 Side_position_interface::add_support (text_
, i
.grob ());
95 Part_combine_engraver::stop_translation_timestep ()
101 ADD_ACKNOWLEDGER (Part_combine_engraver
, note_head
);
102 ADD_ACKNOWLEDGER (Part_combine_engraver
, stem
);
103 ADD_TRANSLATOR (Part_combine_engraver
,
105 "Part combine engraver for orchestral scores: Print markings"
106 " @q{a2}, @q{Solo}, @q{Solo II}, and @q{unisono}.",
109 "CombineTextScript ",
112 "printPartCombineTexts "