From 992016f8c44ad4d53f8dfeb165039c95f9360a09 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:48:10 +0000 Subject: [PATCH] lilypond-0.0.76 --- lily/include/span-score-bar.hh | 38 ++++++++++++++++++++++++++++ lily/lookup.cc | 23 +++++++++++++---- lily/span-score-bar.cc | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 lily/include/span-score-bar.hh create mode 100644 lily/span-score-bar.cc diff --git a/lily/include/span-score-bar.hh b/lily/include/span-score-bar.hh new file mode 100644 index 0000000000..c8991d624b --- /dev/null +++ b/lily/include/span-score-bar.hh @@ -0,0 +1,38 @@ +/* + span-score-bar.hh -- declare Span_score_bar + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SPAN_SCORE_BAR_HH +#define SPAN_SCORE_BAR_HH + +#include "span-bar.hh" + +class Span_score_bar : public Span_bar +{ +public: + NAME_MEMBERS(); + SCORE_ELEM_CLONE(Span_score_bar); + Span_score_bar(); +protected: + + + virtual void do_pre_processing(); +}; + + +class Piano_brace : public Span_score_bar +{ +public: + NAME_MEMBERS(); + SCORE_ELEM_CLONE(Piano_brace); +protected: + virtual Interval do_width()const; + virtual Symbol get_bar_sym(Real) const; +}; + +#endif // SPAN_SCORE_BAR_HH diff --git a/lily/lookup.cc b/lily/lookup.cc index e4a92693db..9a0c8c7093 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -239,6 +239,9 @@ Lookup::stem(Real y1,Real y2) const return s; } +/* + should be handled via TeX code and Lookup::bar() + */ Symbol Lookup::vbrace(Real &y) const { @@ -254,10 +257,20 @@ Lookup::vbrace(Real &y) const int idx = int(rint((y/2.0 - 20 ) + 148)); Symbol s = (*symtables_)("param")->lookup("brace"); - - Array a; - a.push(idx); - s.tex = substitute_args(s.tex,a); - s.dim.y = Interval(0,y); + { + Array a; + a.push(idx); + s.tex = substitute_args(s.tex,a); + s.dim.y = Interval(0,y); + } + { + Array a; + a.push(print_dimen( y/2 )); + a.push(print_dimen(0)); + a.push(s.tex); + s.tex = substitute_args("\\placebox{%}{%}{%}", a); + } + + return s; } diff --git a/lily/span-score-bar.cc b/lily/span-score-bar.cc new file mode 100644 index 0000000000..9ee958ae46 --- /dev/null +++ b/lily/span-score-bar.cc @@ -0,0 +1,45 @@ +/* + span-score-bar.cc -- implement Span_score_bar + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "span-score-bar.hh" +#include "symbol.hh" +#include "paper-def.hh" +#include "lookup.hh" + +Span_score_bar::Span_score_bar() +{ + type_str_ = "|"; +} + +void +Span_score_bar::do_pre_processing() +{ + Span_bar::do_pre_processing(); + + if ( break_status_i() != 1) { + empty_b_ = transparent_b_ = true; + } +} + + +Symbol +Piano_brace::get_bar_sym(Real dy)const +{ + return paper()->lookup_l()->vbrace(dy); +} +Interval +Piano_brace::do_width()const +{ + return Interval(0,0); +} + +IMPLEMENT_STATIC_NAME(Span_score_bar); +IMPLEMENT_IS_TYPE_B1(Span_score_bar, Span_bar); +IMPLEMENT_IS_TYPE_B1(Piano_brace, Span_score_bar); +IMPLEMENT_STATIC_NAME(Piano_brace); + -- 2.39.5