X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbar.cc;h=31ff0b9c2583125e6ce9542aaf5a53facbbb39d5;hb=da7dbf5f2f54bc66984ab2524c490335d567b5e7;hp=7ba3f2d77b953fea9b87b3709005d290857c3a56;hpb=cec6dfa6bf0fb931eb7f42b1ee44ca2ec19a9f34;p=lilypond.git diff --git a/lily/bar.cc b/lily/bar.cc index 7ba3f2d77b..31ff0b9c25 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--1999 Han-Wen Nienhuys */ #include "bar.hh" @@ -13,60 +13,74 @@ #include "lookup.hh" #include "debug.hh" -Bar::Bar() + +Bar::Bar () { - breakable_b_ = true; + set_elt_property (breakable_scm_sym, SCM_BOOL_T); type_str_ = "|"; - spanned_i_ = 0; } - - -IMPLEMENT_IS_TYPE_B1(Bar,Item); - void -Bar::do_print() const +Bar::do_print () const +{ +#ifndef NPRINT + String s = type_str_; + DOUT << "type = " << s; +#endif +} + +Real +Bar::get_bar_size () const { - DOUT << type_str_; + return paper_l ()->get_var ("barsize"); } + Molecule* -Bar::brew_molecule_p() const +Bar::do_brew_molecule_p () const { - Paper_def *p = paper(); - Symbol s = p->lookup_l()->bar (type_str_, - p->get_var ("bar_size")); - Molecule*output = new Molecule (Atom (s)); + Molecule *output = new Molecule (lookup_l ()->bar (type_str_, get_bar_size (), paper_l ())); + return output; } /** Prescriptions for splitting bars. - TODO: parametrise this (input-settable) + TODO: put this in SCM. */ static char const *bar_breaks[][3] ={ {":|", ":|:", "|:"}, {"|", "|", ""}, - {"", "|:", "|:"}, - {"||.", "||.", ""}, + {"", "|s", "|"}, + {"|", "|:", "|:"}, + {"|.", "|.", ""}, {":|", ":|", ""}, + {"||", "||", ""}, + {".|.", ".|.", ""}, + {"", "scorebar", "scorepostbreak"}, + {"", "brace", "brace"}, + {"", "bracket", "bracket"}, {0,0,0} }; void -Bar::do_pre_processing() +Bar::do_pre_processing () { for (int i=0; bar_breaks[i][0]; i++) { - if (bar_breaks[i][1] == type_str_) - type_str_ = bar_breaks[i][break_status_i()+1]; + if (bar_breaks[i][1] == type_str_) + { + type_str_ = bar_breaks[i][break_status_dir ()+1]; + break; + } } - - /* - span_score_bar needs dims, so don't do - - transparent_b_ = empty_b_ = (!type_str_); - - */ + if (remove_elt_property (at_line_start_scm_sym)!= SCM_BOOL_F + && (break_status_dir () == RIGHT) && (type_str_ == "")) + { + type_str_ = "|"; + } + + if (type_str_ =="") + dim_cache_[X_AXIS]->set_empty (true); }