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"
17 Bar_engraver::Bar_engraver()
20 do_post_move_processing();
24 Bar_engraver::do_try_music (Music*r_l)
26 if (Bar_req * b= dynamic_cast <Bar_req *> (r_l))
28 if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh?
41 Bar_engraver::create_bar ()
46 bar_p_->break_priority_i_ = 0;
47 String default_type = get_property ("defaultBarType");
48 if (default_type.length_i ())
50 bar_p_->type_str_ = default_type;
52 announce_element (Score_element_info (bar_p_, bar_req_l_));
58 Bar_engraver::do_creation_processing ()
61 bar_p_->type_str_ = "";
65 Bar_engraver::do_removal_processing ()
69 typeset_element (bar_p_);
75 Bar_engraver::do_process_requests()
82 bar_p_->type_str_ = bar_req_l_->type_str_;
86 Time_description const *time = get_staff_info().time_C_;
87 String always = get_property ("barAlways");
88 if ((time && !time->whole_in_measure_) || always.length_i ())
97 r.penalty_i_ = Break_req::DISALLOW;
98 daddy_grav_l ()->try_music (&r);
104 Bar_engraver::do_pre_move_processing()
108 typeset_element (bar_p_);
114 Bar_engraver::do_post_move_processing()
121 ADD_THIS_TRANSLATOR(Bar_engraver);