]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.0.1
authorfred <fred>
Sun, 24 Mar 2002 20:13:05 +0000 (20:13 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:13:05 +0000 (20:13 +0000)
lily/include/piano-brace.hh [new file with mode: 0644]
lily/include/span-score-bar.hh
lily/lyric-engraver.cc [new file with mode: 0644]
lily/piano-brace.cc [new file with mode: 0644]
lily/span-score-bar.cc
lily/staff-bracket.cc [new file with mode: 0644]
tex/mudela-book.tex [new file with mode: 0644]

diff --git a/lily/include/piano-brace.hh b/lily/include/piano-brace.hh
new file mode 100644 (file)
index 0000000..2d094ca
--- /dev/null
@@ -0,0 +1,33 @@
+/*   
+  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 */
+
index f42205b38e9377c98f81051222eab4caa2ac6afc..411c56da5e4d9aa365109756a654daed889eb227 100644 (file)
@@ -3,7 +3,7 @@
 
   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>
 */
 
 
@@ -17,31 +17,13 @@ class Span_score_bar : public Span_bar, public Score_bar
 {
 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
diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc
new file mode 100644 (file)
index 0000000..8ed3989
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+  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);
diff --git a/lily/piano-brace.cc b/lily/piano-brace.cc
new file mode 100644 (file)
index 0000000..0d0d6a1
--- /dev/null
@@ -0,0 +1,54 @@
+
+/*
+  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);
+
+  
index 0849f15c609b1c3dfb09db00c45659661f3022b6..6952062a67291eb7cbcbf99fb24db21e18d26b2e 100644 (file)
@@ -3,13 +3,14 @@
 
   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()
 {
@@ -19,7 +20,7 @@ void
 Score_bar::do_pre_processing ()
 {
   type_str_ = "|";
-  if (break_status_i() != 1
+  if (break_status_dir() != RIGHT
     {
       set_empty (true);
       transparent_b_ = true;
@@ -36,35 +37,6 @@ Span_score_bar::do_pre_processing()
   //  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);
 
   
diff --git a/lily/staff-bracket.cc b/lily/staff-bracket.cc
new file mode 100644 (file)
index 0000000..b431eed
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+  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);
+
+  
diff --git a/tex/mudela-book.tex b/tex/mudela-book.tex
new file mode 100644 (file)
index 0000000..5df5c77
--- /dev/null
@@ -0,0 +1,34 @@
+
+\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{}