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()))
44 spanning_l_arr_.substitute (bold , b);
49 Span_bar::set (Vertical_align_element *a)
56 Span_bar::do_width() const
58 return paper()->lookup_l ()->bar (type_str_, 40 PT).dim_.x (); // ugh
62 Span_bar::do_pre_processing()
64 if (spanning_l_arr_.size() < 1)
66 transparent_b_ = true;
72 type_str_ = spanning_l_arr_[0]->type_str_;
78 else if (type_str_ == "|:")
82 else if (type_str_ == ":|")
90 Span_bar::get_bar_sym (Real dy) const
92 return paper()->lookup_l ()->bar (type_str_, dy);
97 Span_bar::brew_molecule_p() const
100 for (int i=0; i < spanning_l_arr_.size(); i++)
102 Axis_group_element *common =
103 common_group (spanning_l_arr_[i], Y_AXIS);
105 Real y = spanning_l_arr_[i]->relative_coordinate (common, Y_AXIS)
106 -relative_coordinate (common,Y_AXIS);
108 y_int.unite (y + spanning_l_arr_[i]->height());
111 Atom s = get_bar_sym (y_int.length());
112 Molecule*output = new Molecule (Atom (s));
113 output->translate (y_int[-1], Y_AXIS);
118 IMPLEMENT_IS_TYPE_B1(Span_bar,Bar);