]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.76
authorfred <fred>
Sun, 24 Mar 2002 19:48:10 +0000 (19:48 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:48:10 +0000 (19:48 +0000)
lily/include/span-score-bar.hh [new file with mode: 0644]
lily/lookup.cc
lily/span-score-bar.cc [new file with mode: 0644]

diff --git a/lily/include/span-score-bar.hh b/lily/include/span-score-bar.hh
new file mode 100644 (file)
index 0000000..c8991d6
--- /dev/null
@@ -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 <hanwen@stack.nl>
+*/
+
+
+#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
index e4a92693db53492c47d81ff48c5e70fe820e1564..9a0c8c709356c37c91c18d5b734508d2086128b5 100644 (file)
@@ -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<String> a;
-    a.push(idx);
-    s.tex = substitute_args(s.tex,a);
-    s.dim.y = Interval(0,y);
+    {
+       Array<String> a;
+       a.push(idx);
+       s.tex = substitute_args(s.tex,a);
+       s.dim.y = Interval(0,y);
+    }
+    {
+       Array<String> 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 (file)
index 0000000..9ee958a
--- /dev/null
@@ -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 <hanwen@stack.nl>
+*/
+
+#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);
+