2 voicegroup.cc -- implement Voice_group_registers
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "musicalrequest.hh"
11 #include "voicegroup.hh"
12 #include "register.hh"
14 #include "stembeamreg.hh"
15 #include "scriptreg.hh"
16 #include "complexwalker.hh"
17 #include "commandrequest.hh"
19 static int temp_id_count
;
21 Voice_group_registers::Voice_group_registers(Complex_walker
*w_l
, String id
)
24 text_reg_
=new Text_register(w_l
);
25 stem_beam_reg_
= new Stem_beam_register(w_l
);
26 script_reg_
= new Script_register(w_l
);
28 id
= __FUNCTION__
+ String(temp_id_count
++);
33 Voice_group_registers::~Voice_group_registers()
36 delete stem_beam_reg_
;
41 Voice_group_registers::pre_move_processing()
43 stem_beam_reg_
->pre_move_processing();
44 script_reg_
->pre_move_processing();
45 text_reg_
->pre_move_processing();
49 Voice_group_registers::post_move_processing()
51 stem_beam_reg_
->post_move_processing();
52 text_reg_
->post_move_processing();
53 script_reg_
->post_move_processing();
57 Voice_group_registers::try_request(Request
*r_l
)
59 if (r_l
->groupfeature()) {
60 set_dir(r_l
->groupfeature()->stemdir_i_
);
63 bool b
= stem_beam_reg_
->try_request(r_l
);
65 b
|= script_reg_
->try_request(r_l
);
67 b
|= text_reg_
->try_request(r_l
);
73 Voice_group_registers::acknowledge_element(Staff_elem_info i
)
75 if (i
.group_regs_l_
!= this)
78 stem_beam_reg_
->acknowledge_element(i
);
79 script_reg_
->acknowledge_element(i
);
80 text_reg_
->acknowledge_element(i
);
84 Voice_group_registers::set_dir(int i
)
86 stem_beam_reg_
->set_dir(i
);
87 script_reg_
->set_dir(i
);
88 text_reg_
->set_dir(i
);
90 Array
<Voice_registers
*> vr_arr (walk_l_
->get_voice_regs(this));
91 for (int j
=0; j
<vr_arr
.size(); j
++) {
93 vr_arr
[j
]->set_dir(i
);
97 Voice_group_registers::process_requests()
99 stem_beam_reg_
->process_request();
100 script_reg_
->process_request();
101 text_reg_
->process_request();
106 Voice_group_registers::acceptable_request(Request
*r
)
108 return (r
->stem() || r
->beam() || r
->text() || r
->script() ||