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);
48 Span_bar::set (Vertical_align_element *a)
55 Span_bar::do_width() const
57 return paper()->lookup_l ()->bar (type_str_, 40 PT).dim.x (); // ugh
60 Span_bar::do_pre_processing()
62 if ( spanning_l_arr_.size() < 1) {
63 transparent_b_ = true;
67 type_str_ = spanning_l_arr_[0]->type_str_;
71 } else if ( type_str_ == "|:") {
73 } else if ( type_str_ == ":|"){
80 Span_bar::get_bar_sym (Real dy) const
82 return paper()->lookup_l ()->bar (type_str_, dy);
87 Span_bar::brew_molecule_p()const
90 for (int i=0; i < spanning_l_arr_.size(); i++) {
91 Axis_group_element *common =
92 common_group (spanning_l_arr_[i], Y_AXIS);
94 Real y = spanning_l_arr_[i]->relative_coordinate (common, Y_AXIS)
95 -relative_coordinate (common,Y_AXIS);
97 y_int.unite (y + spanning_l_arr_[i]->height());
100 Symbol s = get_bar_sym (y_int.length());
101 Molecule*output = new Molecule (Atom (s));
102 output->translate ( y_int[-1], Y_AXIS);
107 IMPLEMENT_IS_TYPE_B1(Span_bar,Bar);