]> git.donarmstrong.com Git - lilypond.git/blob - lily/score-align-grav.cc
release: 0.1.11
[lilypond.git] / lily / score-align-grav.cc
1 /*
2   score-align-reg.cc -- implement Score_align_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #include "horizontal-group-item.hh"
11 #include "score-align-grav.hh"
12 #include "item.hh"
13
14 Score_align_engraver::Score_align_engraver()
15 {
16   type_ch_C_ = 0;
17   priority_i_ =0;
18   align_p_=0;
19 }
20
21 void
22 Score_align_engraver::do_pre_move_processing()
23 {
24   if (align_p_) 
25     {
26         typeset_element (align_p_);
27         align_p_ =0;
28     }
29 }
30
31 void
32 Score_align_engraver::acknowledge_element (Score_elem_info inf)
33 {
34   if (inf.elem_l_->is_type_b (type_ch_C_)) 
35     {
36   
37         if (!align_p_) 
38           {
39             align_p_ = new Horizontal_group_item;
40             align_p_->breakable_b_ = true;
41             announce_element (Score_elem_info (align_p_,0));
42           }
43         Score_elem * unbound_elem = inf.elem_l_;
44         while (unbound_elem->axis_group_l_a_[X_AXIS])
45             unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
46         align_p_->add_element (unbound_elem);
47     }
48   
49 }
50
51 IMPLEMENT_IS_TYPE_B1(Score_align_engraver,Engraver);