lilypond-1.3.145
[lilypond.git] / lily / priority-halign-grav.cc
blob76fc2b8046edff97df3f1a2e9696015a3a596c0c
1 /*
2 score-halign-reg.cc -- implement Priority_horizontal_align_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "bar.hh"
10 #include "break-align-item.hh"
11 #include "priority-halign-grav.hh"
12 #include "score-priority-grav.hh"
14 Priority_horizontal_align_engraver::Priority_horizontal_align_engraver()
16 halign_p_ =0;
19 void
20 Priority_horizontal_align_engraver::do_pre_move_processing()
22 if (halign_p_)
24 typeset_element (halign_p_);
25 halign_p_ =0;
29 void
30 Priority_horizontal_align_engraver::acknowledge_element (Score_elem_info i)
32 Engraver* reg = i.origin_grav_l_arr_[0];
33 if (reg->is_type_b (Score_priority_engraver::static_name()))
35 if (!halign_p_)
37 halign_p_ = new Break_align_item;
38 halign_p_->breakable_b_ = true;
39 announce_element (Score_elem_info (halign_p_,0));
41 Item * it = i.elem_l_->item();
42 if (it->break_priority_i_ == 0)
43 halign_p_->center_l_ = it;
45 halign_p_->add (it, it->break_priority_i_);
49 IMPLEMENT_IS_TYPE_B1(Priority_horizontal_align_engraver,Engraver);
50 ADD_THIS_TRANSLATOR(Priority_horizontal_align_engraver);