lilypond-1.3.31
[lilypond.git] / lily / span-score-bar-engraver.cc
blob98782a58da259b81111eb6243e6b2a769c8d3963
1 /*
2 span-score-bar-engraver.cc -- implement Span_score_bar_engraver,
3 Piano_bar_engraver and Staff_group_bar_engraver
5 source file of the GNU LilyPond music typesetter
7 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "span-bar.hh"
11 #include "span-score-bar-engraver.hh"
12 #include "paper-def.hh"
13 #include "dimension-cache.hh"
15 Span_bar*
16 Span_score_bar_engraver::get_span_bar_p () const
18 Span_bar*s = new Span_bar;
19 s->set_elt_property ("glyph", gh_str02scm ("scorebar"));
20 s->set_elt_property ("break-aligned",SCM_BOOL_T);
22 return s;
26 Span_score_bar_engraver::Span_score_bar_engraver ()
28 use_priority_b_ = true;
31 Span_bar*
32 Piano_bar_engraver::get_span_bar_p () const
34 Span_bar *s= new Span_bar;
35 s->set_empty (X_AXIS);
36 s->set_elt_property ("glyph", gh_str02scm ("brace"));
37 return s;
40 Span_bar*
41 Staff_group_bar_engraver::get_span_bar_p () const
43 Span_bar *s= new Span_bar;
44 s->set_empty (X_AXIS);
45 s->set_elt_property ("glyph", gh_str02scm ("bracket"));
46 return s;
49 void
50 Staff_group_bar_engraver::acknowledge_element (Score_element_info i)
52 Base_span_bar_engraver::acknowledge_element (i);
53 if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
55 SCM gl = b->get_elt_property ("glyph");
56 if (gh_string_p (gl) && ly_scm2string (gl) == "brace")
57 b->translate_axis ( -paper_l ()->get_var ("interline"),
58 X_AXIS); // ugh
62 ADD_THIS_TRANSLATOR (Piano_bar_engraver);
63 ADD_THIS_TRANSLATOR (Staff_group_bar_engraver);
64 ADD_THIS_TRANSLATOR (Span_score_bar_engraver);