--- /dev/null
+/*
+ piano-brace.hh -- declare Piano_brace
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef PIANO_BRACE_HH
+#define PIANO_BRACE_HH
+
+#include "span-score-bar.hh"
+
+class Piano_brace : public Span_score_bar
+{
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ SCORE_ELEMENT_CLONE(Piano_brace);
+
+ /** make room for Staff_bracket. Ugh. Should use some kind of
+ relation thingy. */
+ Real extra_move_left_f_;
+ Piano_brace ();
+protected:
+ virtual Interval do_width() const;
+ virtual void do_post_processing();
+ virtual Atom get_bar_sym (Real) const;
+};
+
+
+#endif /* PIANO_BRACE_HH */
+
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
{
public:
DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Span_score_bar);
+ SCORE_ELEMENT_CLONE(Span_score_bar);
Span_score_bar();
+
protected:
virtual void do_pre_processing();
};
-class Piano_brace : public Span_score_bar
-{
-public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Piano_brace);
-protected:
- virtual Interval do_width() const;
- virtual Atom get_bar_sym (Real) const;
-};
-
-class Staff_bracket : public Span_score_bar
-{
-public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Staff_bracket);
-protected:
- virtual Interval do_width() const;
- virtual Atom get_bar_sym (Real) const;
-};
#endif // SPAN_SCORE_BAR_HH
--- /dev/null
+/*
+ lyric-engraver.cc -- implement Lyric_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "lyric-engraver.hh"
+#include "musical-request.hh"
+#include "text-item.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "paper-def.hh"
+#include "main.hh"
+
+Lyric_engraver::Lyric_engraver()
+{
+ lreq_l_ =0;
+ lyric_item_p_ =0;
+}
+
+bool
+Lyric_engraver::do_try_request (Request*r)
+{
+ Musical_req * m =r->access_Musical_req ();
+ if (!m || ! m->access_Lyric_req ())
+ return false;
+ lreq_l_ = m->access_Lyric_req ();
+
+ return true;
+}
+
+void
+Lyric_engraver::do_process_requests()
+{
+ if (lreq_l_)
+ {
+ Text_def *td_p = new Text_def;
+ td_p->text_str_ = lreq_l_->text_str_;
+ td_p->align_dir_ = LEFT;
+ Scalar style = get_property ("textstyle");
+ if (style.length_i ())
+ {
+ td_p->style_str_ = style;
+ }
+
+ lyric_item_p_ = new Text_item (td_p);
+
+ lyric_item_p_->dir_ = DOWN;
+ lyric_item_p_->fat_b_ = true;
+ announce_element (Score_element_info (lyric_item_p_, lreq_l_));
+ }
+}
+
+void
+Lyric_engraver::do_post_move_processing()
+{
+ lreq_l_ =0;
+}
+
+void
+Lyric_engraver::do_pre_move_processing()
+{
+ if (lyric_item_p_)
+ {
+ typeset_element (lyric_item_p_);
+ lyric_item_p_ =0;
+ }
+}
+
+
+IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver);
+ADD_THIS_TRANSLATOR(Lyric_engraver);
--- /dev/null
+
+/*
+ span-score-bar.cc -- implement Span_score_bar
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "piano-brace.hh"
+#include "atom.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "main.hh"
+
+Piano_brace::Piano_brace ()
+{
+ extra_move_left_f_ = 0.0;
+}
+
+Atom
+Piano_brace::get_bar_sym (Real dy) const
+{
+ Atom a = lookup_l ()->vbrace (dy);
+ a.translate_axis (-extra_move_left_f_, X_AXIS);
+
+
+ return a;
+}
+
+Interval
+Piano_brace::do_width() const
+{
+ return Interval (0,0);
+}
+
+void
+Piano_brace::do_post_processing ()
+{
+ Span_score_bar::do_post_processing();
+ Interval i = Span_score_bar::do_height ();
+ Real staffheight_f = paper ()->staffheight_f ();
+
+ // don't set braces that span only one staff
+ if (i.length () <= 2.0 * staffheight_f)
+ {
+ set_empty (true);
+ transparent_b_ = true;
+ }
+}
+
+IMPLEMENT_IS_TYPE_B1(Piano_brace, Span_score_bar);
+
+
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "span-score-bar.hh"
#include "atom.hh"
#include "paper-def.hh"
#include "lookup.hh"
+#include "main.hh"
Span_score_bar::Span_score_bar()
{
Score_bar::do_pre_processing ()
{
type_str_ = "|";
- if (break_status_i() != 1)
+ if (break_status_dir() != RIGHT)
{
set_empty (true);
transparent_b_ = true;
// Span_bar::do_pre_processing();
}
-Atom
-Piano_brace::get_bar_sym (Real dy) const
-{
- return paper()->lookup_l ()->vbrace (dy);
-}
-
-Interval
-Piano_brace::do_width() const
-{
- return Interval (0,0);
-}
-
-Atom
-Staff_bracket::get_bar_sym (Real dy) const
-{
- Atom a = paper()->lookup_l ()->vbracket (dy);
- a.translate_axis (- 1.5 * a.extent ().x ().length (), X_AXIS);
- return a;
-}
-
-Interval
-Staff_bracket::do_width() const
-{
- return Interval (0,0);
-}
-
-
IMPLEMENT_IS_TYPE_B2(Span_score_bar, Span_bar, Score_bar);
-IMPLEMENT_IS_TYPE_B1(Piano_brace, Span_score_bar);
-IMPLEMENT_IS_TYPE_B1(Staff_bracket, Span_score_bar);
--- /dev/null
+/*
+ span-score-bar.cc -- implement Span_score_bar
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "staff-bracket.hh"
+#include "atom.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "main.hh"
+
+Atom
+Staff_bracket::get_bar_sym (Real dy) const
+{
+ Atom a = lookup_l ()->vbracket (dy);
+
+ a.translate_axis (- 1.33 * a.extent ().x ().length (), X_AXIS);
+ return a;
+}
+
+Interval
+Staff_bracket::do_width() const
+{
+ return Interval (0,0);
+}
+
+
+void
+Staff_bracket::do_post_processing ()
+{
+ Span_score_bar::do_post_processing();
+ Interval i = Span_score_bar::do_height ();
+ // don't set bracket that spans less than one staff
+ Real staffheight_f = paper ()->staffheight_f ();
+ if (i.length () < 0.5 * staffheight_f)
+ {
+ transparent_b_ = true;
+ set_empty (true);
+ }
+}
+
+IMPLEMENT_IS_TYPE_B1(Staff_bracket, Span_score_bar);
+
+
--- /dev/null
+
+\def\file#1{\verb+#1+}
+
+% ugh: trick to get examples not generate par
+% these are for 16pt
+\def\mudelapaperlinewidth{-28.452756}%
+\def\mudelapaperindent{28.452756}%
+\def\mudelapaperrulethickness{0.400000}%
+\def\mudelapaperbarsize{16.000000}%
+\def\mudelapaperinterline{4.000000}%
+\def\mudelapapernotewidth{5.930000}%
+\def\mudelapaperwholewidth{8.640000}%
+\def\mudelapaperunitspace{22.000000}%
+\def\mudelapaperbasicspace{4.000000}%
+\def\mudelapapergeometric{0.000000}%
+\def\mudelapaperarithmetic_basicspace{2.000000}%
+\def\mudelapaperarithmetic_multiplier{4.800000}%
+\def\mudelapaperinterbeam{3.140000}%
+\def\mudelapapergourlay_energybound{100000.000000}%
+\def\mudelapapergourlay_maxmeasures{14.000000}%
+% huh?
+% \def\exampleheight{2\mudelapaperbarsize pt}
+\def\exampleheight{2cm}
+
+% ful of pars, needs the above
+\input lilyponddefs
+% generates par
+\musixsixteendefs
+\def\musixsixteendefs{}
+% generates par
+\turnOnPostScript%
+\def\turnOnPostScript{}
+% generates par
+\def\interscoreline{}