2 part-combine-engraver.cc -- implement PC-engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
8 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "engraver.hh"
12 #include "text-item.hh"
13 #include "note-head.hh"
15 #include "side-position-interface.hh"
16 #include "multi-measure-rest.hh"
18 class Part_combine_engraver : public Engraver
20 TRANSLATOR_DECLARATIONS (Part_combine_engraver);
23 virtual void acknowledge_grob (Grob_info);
24 virtual void process_music ();
25 virtual void stop_translation_timestep ();
26 virtual bool try_music (Music *);
33 Part_combine_engraver::try_music (Music *m)
39 Part_combine_engraver::Part_combine_engraver ()
46 Part_combine_engraver::process_music ()
49 && to_boolean (get_property ("printPartCombineTexts")))
51 SCM what = event_->get_property ("part-combine-status");
53 if (what == ly_symbol2scm ("solo1"))
54 text = get_property ("soloText");
55 else if (what == ly_symbol2scm ("solo2"))
56 text = get_property ("soloIIText");
57 else if (what == ly_symbol2scm ("unisono"))
58 text = get_property ("aDueText");
60 if (Text_interface::markup_p (text))
62 text_ = make_item ("CombineTextScript", event_->self_scm ());
63 text_->set_property ("text", text);
69 Part_combine_engraver::acknowledge_grob (Grob_info i)
73 if (Note_head::has_interface (i.grob ()))
76 Side_position_interface::add_support (t, i.grob ());
77 if (Side_position_interface::get_axis (t) == X_AXIS
78 && !t->get_parent (Y_AXIS))
79 t->set_parent (i.grob (), Y_AXIS);
81 if (Stem::has_interface (i.grob ()))
83 Side_position_interface::add_support (text_, i.grob ());
89 Part_combine_engraver::stop_translation_timestep ()
95 ADD_TRANSLATOR (Part_combine_engraver,
96 /* descr */ "Part combine engraver for orchestral scores: "
97 "Print markings a2, Solo, Solo II, and unisono ",
98 /* creats*/ "CombineTextScript",
99 /* accepts */ "part-combine-event",
100 /* acks */ "multi-measure-rest-interface "
101 "slur-interface stem-interface note-head-interface",
102 /* reads */ "printPartCombineTexts soloText soloIIText "