2 span-bar.cc -- implement Span_bar
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "span-bar.hh"
13 #include "paper-def.hh"
14 #include "molecule.hh"
15 #include "vertical-align-elem.hh"
21 spanning_l_arr_.push(b);
28 Span_bar::do_substitute_dependency(Score_elem*o, Score_elem*n)
31 if (o->is_type_b(Bar::static_name() ))
32 bold = (Bar*)o->item();
38 if (n && n->is_type_b(Bar::static_name() )) {
43 spanning_l_arr_.substitute( bold , b);
47 A no-op if not yet output: the span_bar slavish follows what it spans
50 Span_bar::translate_y(Real y)
52 if (status() == OUTPUT)
53 Score_elem::translate_y(y);
57 Span_bar::set(Vertical_align_element *a)
64 Span_bar::do_width() const
66 return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x; // ugh
69 Span_bar::do_pre_processing()
71 if ( spanning_l_arr_.size () < 1) {
72 transparent_b_ = true;
76 type_str_ = spanning_l_arr_[0]->type_str_;
80 } else if ( type_str_ == "|:") {
82 } else if ( type_str_ == ":|"){
89 Span_bar::get_bar_sym(Real dy) const
91 return paper()->lookup_l()->bar(type_str_, dy);
95 Span_bar::brew_molecule_p()const
98 for (int i=0; i < spanning_l_arr_.size(); i++)
99 y.unite( spanning_l_arr_[i]->height() );
100 Symbol s = get_bar_sym(y.length());
101 Molecule*output = new Molecule(Atom(s));
102 output->translate_y ( y[-1] );
108 IMPLEMENT_IS_TYPE_B1(Span_bar,Bar);