2 bar-engraver.cc -- implement Bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "score-engraver.hh"
12 #include "bar-engraver.hh"
13 #include "musical-request.hh"
14 #include "multi-measure-rest.hh"
15 #include "command-request.hh"
17 #include "engraver-group-engraver.hh"
21 Bar_engraver::Bar_engraver()
24 do_post_move_processing();
28 Bar_engraver::create_bar ()
32 bar_p_ = new Item (get_property ("basicBarProperties"));
33 announce_element (bar_p_, 0);
38 Bar_engraver::do_creation_processing ()
43 Bar_engraver::do_removal_processing ()
49 Bar_engraver should come *after* any engravers that expect bars to
50 modify whichBar in do_process_music () be typeset
53 Bar_engraver::do_process_music()
55 SCM b =get_property ("whichBar");
63 Bar_engraver::typeset_bar ()
67 SCM gl = get_property ("whichBar");
68 if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T)
69 bar_p_->set_elt_property ("glyph", gl);
70 typeset_element (bar_p_);
76 lines may only be broken if there is a barline in all staffs
79 Bar_engraver::do_pre_move_processing()
83 Score_engraver * e = 0;
84 Translator * t = daddy_grav_l ();
85 for (; !e && t; t = t->daddy_trans_l_)
87 e = dynamic_cast<Score_engraver*> (t);
91 programming_error ("No score engraver!");
93 e->forbid_breaks (); // guh. Use properties!
99 ADD_THIS_TRANSLATOR(Bar_engraver);