2 bar-reg.cc -- implement Bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "bar-engraver.hh"
11 #include "musical-request.hh"
12 #include "multi-measure-rest.hh"
13 #include "command-request.hh"
14 #include "time-description.hh"
15 #include "engraver-group.hh"
16 #include "repeated-music.hh"
18 Bar_engraver::Bar_engraver()
21 do_post_move_processing();
25 Bar_engraver::do_try_music (Music*r_l)
27 if (Bar_req * b= dynamic_cast <Bar_req *> (r_l))
29 if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh?
36 else if (Repeated_music * m = dynamic_cast<Repeated_music *> (r_l))
38 if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh?
40 bar_req_l_ = new Bar_req ("|:");
49 Bar_engraver::create_bar ()
54 bar_p_->break_priority_i_ = 0;
55 String default_type = get_property ("defaultBarType");
56 if (default_type.length_i ())
58 bar_p_->type_str_ = default_type;
60 announce_element (Score_element_info (bar_p_, bar_req_l_));
66 Bar_engraver::do_creation_processing ()
69 bar_p_->type_str_ = "";
73 Bar_engraver::do_removal_processing ()
77 typeset_element (bar_p_);
83 Bar_engraver::do_process_requests()
90 bar_p_->type_str_ = bar_req_l_->type_str_;
94 Time_description const *time = get_staff_info().time_C_;
95 String always = get_property ("barAlways");
96 if ((time && !time->whole_in_measure_) || always.length_i ())
105 r.penalty_i_ = Break_req::DISALLOW;
106 daddy_grav_l ()->try_music (&r);
112 Bar_engraver::do_pre_move_processing()
116 typeset_element (bar_p_);
122 Bar_engraver::do_post_move_processing()
129 ADD_THIS_TRANSLATOR(Bar_engraver);