2 part-combine-engraver.cc -- implement PC-engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2006 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"
19 #include "translator.icc"
21 class Part_combine_engraver : public Engraver
23 TRANSLATOR_DECLARATIONS (Part_combine_engraver);
26 DECLARE_ACKNOWLEDGER (note_head);
27 DECLARE_ACKNOWLEDGER (stem);
29 DECLARE_TRANSLATOR_LISTENER (part_combine);
30 void process_music ();
31 void stop_translation_timestep ();
37 IMPLEMENT_TRANSLATOR_LISTENER (Part_combine_engraver, part_combine);
39 Part_combine_engraver::listen_part_combine (Stream_event *ev)
41 ASSIGN_EVENT_ONCE (event_, ev);
44 Part_combine_engraver::Part_combine_engraver ()
51 Part_combine_engraver::process_music ()
54 && to_boolean (get_property ("printPartCombineTexts")))
56 SCM what = event_->get_property ("class");
58 if (what == ly_symbol2scm ("solo-one-event"))
59 text = get_property ("soloText");
60 else if (what == ly_symbol2scm ("solo-two-event"))
61 text = get_property ("soloIIText");
62 else if (what == ly_symbol2scm ("unisono-event"))
63 text = get_property ("aDueText");
65 if (Text_interface::is_markup (text))
67 text_ = make_item ("CombineTextScript", event_->self_scm ());
68 text_->set_property ("text", text);
74 Part_combine_engraver::acknowledge_note_head (Grob_info i)
79 Side_position_interface::add_support (t, i.grob ());
80 if (Side_position_interface::get_axis (t) == X_AXIS
81 && !t->get_parent (Y_AXIS))
82 t->set_parent (i.grob (), Y_AXIS);
87 Part_combine_engraver::acknowledge_stem (Grob_info i)
90 Side_position_interface::add_support (text_, i.grob ());
94 Part_combine_engraver::stop_translation_timestep ()
100 ADD_ACKNOWLEDGER (Part_combine_engraver, note_head);
101 ADD_ACKNOWLEDGER (Part_combine_engraver, stem);
102 ADD_TRANSLATOR (Part_combine_engraver,
103 /* doc */ "Part combine engraver for orchestral scores: "
104 "Print markings a2, Solo, Solo II, and unisono ",
105 /* create */ "CombineTextScript",
106 /* read */ "printPartCombineTexts soloText soloIIText "