2 clef.cc -- implement Clef_register
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>,
7 Mats Bengtsson <matsb@s3.kth.se>
11 #include "clef-reg.hh"
12 #include "clef-item.hh"
14 #include "command-request.hh"
15 #include "time-description.hh"
17 Clef_register::Clef_register()
26 Clef_register::set_type(String s
)
29 if (clef_type_str_
== "violin") {
31 } else if (clef_type_str_
== "alto") {
33 } else if (clef_type_str_
== "tenor") {
35 } else if (clef_type_str_
== "bass") {
44 Clef_register::fill_staff_info(Staff_info
&i
)
46 i
.c0_position_i_l_
= &c0_position_i_
;
50 Clef_register::read_req(Clef_change_req
*c_l
)
52 if (!set_type(c_l
->clef_str_
))
53 c_l
->error("unknown clef type ");
56 Clef_register::acknowledge_element(Score_elem_info info
)
58 if (info
.elem_l_
->name() == Bar::static_name() ) {
61 clef_p_
->default_b_
= true;
66 Clef_register::do_creation_processing()
69 clef_p_
->default_b_
= false;
73 Clef_register::do_try_request(Request
* r_l
)
75 Command_req
* creq_l
= r_l
->command();
76 if (!creq_l
|| !creq_l
->clefchange())
79 clef_req_l_
= creq_l
->clefchange();
81 read_req(clef_req_l_
);
86 Clef_register::create_clef()
89 clef_p_
= new Clef_item
;
90 announce_element(Score_elem_info(clef_p_
,clef_req_l_
));
96 Clef_register::do_process_requests()
100 clef_p_
->default_b_
= false;
105 Clef_register::do_pre_move_processing()
109 typeset_breakable_item(clef_p_
);
114 Clef_register::do_post_move_processing()
120 Clef_register::do_removal_processing()
126 IMPLEMENT_STATIC_NAME(Clef_register
);
127 IMPLEMENT_IS_TYPE_B1(Clef_register
,Request_register
);
128 ADD_THIS_REGISTER(Clef_register
);