2 staff-symbol-engraver.cc -- implement Staff_symbol_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "staff-symbol-engraver.hh"
12 Staff_symbol_engraver::~Staff_symbol_engraver ()
17 Staff_symbol_engraver::Staff_symbol_engraver ()
22 span_events_[LEFT] = 0;
23 span_events_[RIGHT] = 0;
27 Staff_symbol_engraver::try_music (Music *music)
29 Direction d = to_dir (music->get_property ("span-direction"));
32 span_events_[d] = music;
40 Staff_symbol_engraver::process_music ()
42 if (span_events_[STOP])
44 finished_span_ = span_;
50 if (span_events_[START]
51 || (first_start_ && !span_events_[STOP]))
56 Staff_symbol_engraver::start_spanner ()
59 span_ = make_spanner ("StaffSymbol", SCM_EOL);
63 Staff_symbol_engraver::stop_spanner ()
65 if (finished_span_ && !finished_span_->get_bound (RIGHT))
66 finished_span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
71 Staff_symbol_engraver::stop_translation_timestep ()
73 if ((span_events_[START] || first_start_)
75 && !span_->get_bound (LEFT))
77 span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
81 span_events_[START] = 0;
82 span_events_[STOP] = 0;
87 Staff_symbol_engraver::finalize ()
89 finished_span_ = span_;
95 Todo: staff-symbol-referencer iface.
98 Staff_symbol_engraver::acknowledge_grob (Grob_info s)
101 Perhaps should try to take SeparationItem as bound of the staff
104 if (span_ || finished_span_)
106 Spanner *my = span_ ? span_ : finished_span_;
107 s.grob ()->set_object ("staff-symbol", my->self_scm ());
111 #include "translator.icc"
112 ADD_ACKNOWLEDGER (Staff_symbol_engraver, grob);
113 ADD_TRANSLATOR (Staff_symbol_engraver,
114 /* doc */ "Create the constellation of five (default) "
116 /* create */ "StaffSymbol",
117 /* accept */ "staff-span-event",