2 bar-engraver.cc -- implement Bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "bar-line.hh"
11 #include "score-engraver.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
25 TRANSLATOR_DECLARATIONS (Bar_engraver);
26 void request_bar (String type_string);
29 virtual void finalize ();
30 virtual void stop_translation_timestep ();
31 virtual void process_acknowledged_grobs ();
40 Bar_engraver::Bar_engraver ()
46 Bar_engraver::create_bar ()
50 bar_ = make_item ("BarLine", SCM_EOL);
51 SCM gl = get_property ("whichBar");
52 if (scm_equal_p (gl, bar_->get_property ("glyph")) != SCM_BOOL_T)
53 bar_->set_property ("glyph", gl);
58 Bar_engraver::finalize ()
64 Bar_engraver should come *after* any engravers that
67 This is a little hairy : whichBar may be set by
68 Repeat_acknowledge_engraver::process_music, which is at score
69 context. This means that grobs could should be created after
70 process_music. We do stuff process_acknowledged_grobs (), just to be
76 Bar_engraver::process_acknowledged_grobs ()
78 if (!bar_ && ly_c_string_p (get_property ("whichBar")))
83 Bar_engraver::typeset_bar ()
89 lines may only be broken if there is a barline in all staves
92 Bar_engraver::stop_translation_timestep ()
95 /* guh. Use properties! */
96 get_score_engraver ()->forbid_breaks ();
102 ENTER_DESCRIPTION (Bar_engraver,
103 /* descr */ "Create barlines. This engraver is controlled through the "
104 "@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
105 /* creats*/ "BarLine",
108 /* reads */ "whichBar",