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 "musical-request.hh"
13 #include "engraver-group-engraver.hh"
16 #include "engraver.hh"
19 generate bars. Either user ("|:"), or default (new measure)
22 class Bar_engraver : public Engraver
26 VIRTUAL_COPY_CONS(Translator);
27 void request_bar (String type_str);
30 virtual void do_creation_processing ();
31 virtual void do_removal_processing ();
32 virtual void do_process_music();
33 virtual void do_pre_move_processing();
42 Bar_engraver::Bar_engraver()
45 do_post_move_processing();
49 Bar_engraver::create_bar ()
53 bar_p_ = new Item (get_property ("BarLine"));
55 SCM gl = get_property ("whichBar");
56 if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T)
57 bar_p_->set_elt_property ("glyph", gl);
59 announce_element (bar_p_, 0);
64 Bar_engraver::do_creation_processing ()
69 Bar_engraver::do_removal_processing ()
75 Bar_engraver should come *after* any engravers that expect bars to
76 modify whichBar in do_process_music () be typeset
79 Bar_engraver::do_process_music()
81 SCM b =get_property ("whichBar");
89 Bar_engraver::typeset_bar ()
93 typeset_element (bar_p_);
99 lines may only be broken if there is a barline in all staffs
102 Bar_engraver::do_pre_move_processing()
106 Score_engraver * e = 0;
107 Translator * t = daddy_grav_l ();
108 for (; !e && t; t = t->daddy_trans_l_)
110 e = dynamic_cast<Score_engraver*> (t);
114 programming_error ("No score engraver!");
116 e->forbid_breaks (); // guh. Use properties!
122 ADD_THIS_TRANSLATOR(Bar_engraver);