]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.34 release/1.3.34
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 15 Mar 2000 13:08:34 +0000 (14:08 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 15 Mar 2000 13:08:34 +0000 (14:08 +0100)
======
1.3.33.h

44 files changed:
CHANGES
VERSION
flower/include/timer.hh [deleted file]
input/bugs/hara-clef.ly [new file with mode: 0644]
input/bugs/k.fly [new file with mode: 0644]
lily/align-element.cc
lily/align-note-column-engraver.cc
lily/atom.cc [deleted file]
lily/axis-group-element.cc
lily/break-align-item.cc
lily/clef-engraver.cc
lily/clef-item.cc
lily/command-request.cc
lily/cross-staff.cc
lily/dimension-cache.cc
lily/dynamic-engraver.cc
lily/engraver.cc
lily/grace-align-item.cc
lily/include/align-element.hh
lily/include/axis-group-element.hh
lily/include/command-request.hh
lily/include/dimension-cache-callback.hh [new file with mode: 0644]
lily/include/dimension-cache.hh
lily/include/directional-spanner.hh [deleted file]
lily/include/key-def.hh
lily/include/key-item.hh
lily/include/leastsquares.hh [deleted file]
lily/include/note-head-side.hh [deleted file]
lily/include/score-element.hh
lily/include/staff-margin-engraver.hh [deleted file]
lily/key-engraver.cc
lily/key-item.cc
lily/key-performer.cc
lily/lookup.cc
lily/parser.yy
lily/score-element.cc
lily/side-position-interface.cc
lily/staff-margin-engraver.cc
lily/staff-symbol-referencer.cc
lily/stem.cc
lily/vertical-align-engraver.cc
make/out/lilypond.lsm
make/out/lilypond.spec
scripts/mudela-book.py

diff --git a/CHANGES b/CHANGES
index 143b66cbd57acfd291545461e963a24d7284e92a..7f45cd778b06f671371eac0e5c437da27620f188 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,19 @@
+1.3.34
+======
+1.3.33.hwn2
+===========
+
+* Print key without setting key, syntax "\key ;". General cleanups of
+key-item.
+
+* Add paragraph tags in HTML output of mudela-book.  Music fragment
+don't run into the text anymore.
+
+* Bugfix: don't align the first line of text. (Lookup::text ()).
+
+* Abstract away data members of Axis_group_element, Align_element
+
+
 1.3.33.jcn3
 ===========
 
@@ -10,9 +26,6 @@
   moving in case of a collision) more than maximumRestCount similar rests.
   WIP!
 
-1.3.33.jcn1
-===========
-
 * Rewrote Staff_margin_engraver.  Staff margin texts now hang on a new
   breakable item: Left_edge_item.
 
   (not supported by a Dynamic_line_spanner) still collide with Staff,
   although they now have staff support, which was supposed to fix this.
 
-1.3.32.jcn4
-===========
-
 * Fixed Staff_margin_engraver for "instrument", "instr" is still broken.
 
 * Dynamic elements are only put in a Dynamic_line_spanner if there
   actually is more than one adjacent note-column with a dynamic.
   This breaks the fine looks of all dynamics, again :-)
 
+
 1.3.33
 ======
 
diff --git a/VERSION b/VERSION
index bf5765c717076ff56739d5e72fc6dbbbd30e6364..42ffa362e59ff01d900f4a0c0dca0618a7d03fa1 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=33
-MY_PATCH_LEVEL=jcn3
+PATCH_LEVEL=34
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/flower/include/timer.hh b/flower/include/timer.hh
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/input/bugs/hara-clef.ly b/input/bugs/hara-clef.ly
new file mode 100644 (file)
index 0000000..639ebaa
--- /dev/null
@@ -0,0 +1,10 @@
+
+\score {
+\notes <  \context Staff { \clef "G^8"; s1 s1 s1 }
+         \context Staff = CC { c1 c c  } >
+
+\paper {
+\translator {
+  \HaraKiriStaffContext
+}}
+}
diff --git a/input/bugs/k.fly b/input/bugs/k.fly
new file mode 100644 (file)
index 0000000..b7d1761
--- /dev/null
@@ -0,0 +1,2 @@
+
+\key e; c2 \clef "treble";\key es;  c \break c1
index c75902783b546eabf421fc36630cb62d60ba288f..d892e733162ed09aadb16cea0fbcefe6860257f9 100644 (file)
 #include "hash-table-iter.hh"
 #include "dimension-cache.hh"
 
-void
-Align_element::after_line_breaking()
+/*
+  This callback is set in the children of the align element. It does
+  not compute anything, but a side effect of a->do_side_processing ()
+  is that the elements are placed correctly.  */
+Real
+Align_element::alignment_callback (Dimension_cache const *c)
 {
-  if (axis () == Y_AXIS)
-    do_side_processing ();
+  Axis ax = c->axis ();
+  Score_element * sc = c->element_l ()->parent_l (ax);
+  Align_element * a = dynamic_cast<Align_element*> (sc);
+  if (a && a->get_elt_property ("alignment-done") == SCM_UNDEFINED) 
+    {
+      a->do_side_processing (ax);
+    }
+  return 0.0;
 }
 
 void
-Align_element::before_line_breaking ()
+Align_element::add_element (Score_element* s)
 {
-  if (axis () == X_AXIS)
-    do_side_processing ();
+  s->add_offset_callback (alignment_callback, axis ());
+  Axis_group_element::add_element (s);
 }
 
+/*
+  Hairy function to put elements where they should be. Can be tweaked
+  from the outside by setting minimum-space and extra-space in its
+  children */
 void
-Align_element::do_side_processing ()
+Align_element::do_side_processing (Axis a)
 {
+  set_elt_property ("alignment-done", SCM_BOOL_T);
+  
   SCM d = get_elt_property ("stacking-dir");
   Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
@@ -42,7 +58,7 @@ Align_element::do_side_processing ()
   Link_array<Score_element> all_elts (elem_l_arr ());
   for (int i=0; i < all_elts.size(); i++) 
     {
-      Interval y = all_elts[i]->extent(axis ()) + all_elts[i]->relative_coordinate (this, axis ());
+      Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (this, a);
       if (!y.empty_b())
        {
          Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
@@ -71,6 +87,15 @@ Align_element::do_side_processing ()
        }
     }
 
+  
+  Interval threshold = Interval (0, Interval::infinity ());
+  SCM thr = get_elt_property ("threshold");
+  if (gh_pair_p (thr))
+    {
+      threshold[SMALLER] = gh_scm2double (gh_car (thr));
+      threshold[BIGGER] = gh_scm2double (gh_cdr (thr));      
+    }
+
   Real where_f=0;
   for (int i=0 ;  i < elems.size(); i++) 
     {
@@ -80,20 +105,15 @@ Align_element::do_side_processing ()
 
       if (i)
        {
-         dy = (dy >? threshold_interval_[SMALLER] )
-           <? threshold_interval_[BIGGER];
+         dy = (dy >? threshold[SMALLER] )
+           <? threshold[BIGGER];
        }
 
-
       where_f += stacking_dir * dy;
-      elems[i]->translate_axis (where_f, axis ());
+      elems[i]->translate_axis (where_f, a);
     }
 }
 
-Align_element::Align_element()
-{
-  threshold_interval_ = Interval (0, Interval::infinity ());
-}
 
 int
 Align_element::get_count (Score_element*s)const
@@ -113,13 +133,13 @@ Align_element::get_count (Score_element*s)const
 Axis
 Align_element::axis () const
 {
-  return axes_[0];
+  return Axis (gh_scm2int (gh_car (get_elt_property ("axes"))));
 }
 
 void
 Align_element::set_axis (Axis a)
 {
-  set_axes (a,a);
+  set_axes (a, a);
 }
 
 
index 42e973765e66751eaa882caf292a45723c47a450..5bde41d6bf2f5ae4f6d94cb0afa1a86a81bb67a7 100644 (file)
@@ -59,7 +59,6 @@ Align_note_column_engraver::do_removal_processing ()
     {
       Direction d = to_dir (al);
       directional_element (align_item_p_).set (d);
-      align_item_p_->set_elt_property ("align-dir", to_dir (-d));
     }
   
   typeset_element (align_item_p_);
diff --git a/lily/atom.cc b/lily/atom.cc
deleted file mode 100644 (file)
index e69de29..0000000
index 7e2cdacf13725082fc30ad0a2778448e1bdb1d83..d3235510d484fc27b4b6afae7b614c1006c89a9a 100644 (file)
 #include "dimension-cache.hh"
 #include "group-interface.hh"
 
-Link_array<Score_element>
-Axis_group_element::get_extra_dependencies() const
-{
-  Link_array<Score_element> e(elem_l_arr ());
-  return e;
-}
-
 Link_array<Score_element>
 Axis_group_element::elem_l_arr () const
 {  
@@ -44,9 +37,6 @@ Axis_group_element::get_children ()
 
 Axis_group_element::Axis_group_element()
 {
-  axes_[0] = (Axis)-1 ; 
-  axes_[1] = (Axis)-1 ;
-
   set_elt_property ("elements", SCM_EOL);
   set_elt_property ("transparent", SCM_BOOL_T);
 }
@@ -54,8 +44,13 @@ Axis_group_element::Axis_group_element()
 void
 Axis_group_element::set_axes (Axis a1, Axis a2)
 {
-  axes_[0] = a1 ; 
-  axes_[1] = a2 ;
+  SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
+  if (a1 != a2)
+    ax= gh_cons (gh_int2scm (a2), ax);
+
+  
+  set_elt_property ("axes", ax);
+
   if (a1 != X_AXIS && a2 != X_AXIS)
     set_empty (X_AXIS);
   if (a1 != Y_AXIS && a2 != Y_AXIS)
@@ -87,19 +82,29 @@ Axis_group_element::extent_callback (Dimension_cache const *c)
 }
 
 
+bool
+Axis_group_element::axis_b (Axis a )const
+{
+  return dim_cache_[a]->extent_callback_l_ == extent_callback;
+}
+
 
 void
 Axis_group_element::add_element (Score_element *e)
 {
   used_b_ =true;
   e->used_b_ = true;
-  
-  for (int i = 0; i < 2; i++)
+
+  for (SCM ax = get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
     {
-      if (!e->parent_l (axes_[i]))
-       e->set_parent (this, axes_[i]);
+      Axis a = (Axis) gh_scm2int (gh_car (ax));
+      
+      if (!e->parent_l (a))
+       e->set_parent (this, a);
     }
   Group_interface gi (this);
   gi.add_element (e);
+
+  add_dependency (e);
 }
 
index dfb91c3845ba2fb870f30a828f1b7107d34799a9..0d67818da9448c8cbbde633ed2f58a4093e9fc0b 100644 (file)
@@ -155,5 +155,5 @@ Break_align_item::Break_align_item ()
   set_elt_property ("stacking-dir" , gh_int2scm (RIGHT));
   set_axis (X_AXIS);
 
-  dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
+  add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
 }
index 835b2c57604ae4bea51cf02678024d63d41bc810..cffdd3f34059e624483b5fa71dc419e22d8c591c 100644 (file)
@@ -124,7 +124,7 @@ Clef_engraver::acknowledge_element (Score_element_info info)
        }
       else if (Key_item *k = dynamic_cast<Key_item*>(it_l))
        {
-         k-> set_c_position (c0_position_i_);
+         k->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
        }
     } 
 }
index d49534d727bcca9a0aecc4d92d40e4786b31c08a..a7c9661293e0217f613360c72ec8096ac3343d8b 100644 (file)
@@ -74,9 +74,9 @@ Clef_item::do_add_processing ()
          g->set_parent (this, X_AXIS);
          
          g->set_elt_property ("self-alignment-X", gh_int2scm (0));
-         g->dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
-         g->dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::centered_on_parent);
-         
+         g->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
+         g->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
+
          g->set_elt_property ("direction", octave_dir);
          
          add_dependency (g);   // just to be sure.
index 58f4d434d03c28bfffe80a78f364c063a8c1a1a4..68016b6683e80d7b9d9df7628f78390168014aa6 100644 (file)
@@ -106,17 +106,25 @@ Tempo_req::do_equal_b (Request const *r) const
 void
 Key_change_req::do_print () const
 {
-#ifndef NPRINT
-  for (int i=0; i < key_.pitch_arr_.size (); i++)
-    {
-      key_.pitch_arr_[i].print ();
-    }
+#if 0
+  key_->print();
 #endif
 }
 
 Key_change_req::Key_change_req ()
 {
+  key_ = 0;
+}
+Key_change_req::Key_change_req (Key_change_req const&s)
+  : Request (s)
+{
+  key_ = new Key_def (*s.key_);
 }
+Key_change_req::~Key_change_req ()
+{
+  delete key_;
+}
+
 
 Break_req::Break_req ()
 {
@@ -134,8 +142,6 @@ Mark_req::do_equal_b (Request const * r) const
 void
 Key_change_req::transpose (Musical_pitch p)
 {
-  key_.transpose (p);
+  key_->transpose (p);
 }
 
-
-                          
index ca44c30e9d19c35a9c6f765b477a2a840b2debd7..c7855b583669f9b90718de85211f4e2dac307215 100644 (file)
@@ -12,11 +12,14 @@ calc_interstaff_dist (Item const *item, Spanner const *span)
   Align_element * align = dynamic_cast<Align_element*> (common);
   if (align && align->axis() == Y_AXIS)
     {
-      if (align->threshold_interval_[MIN] != 
-         align->threshold_interval_[MAX])
+      SCM threshold = align->get_elt_property ("threshold");
+      if (!gh_pair_p (threshold)
+         || !scm_equal_p (gh_car (threshold), gh_cdr (threshold)))
        warning (_ ("minVerticalAlign != maxVerticalAlign: cross staff spanners may be broken"));
 
-      interstaff = align->threshold_interval_[MIN];
+      interstaff = 0.0;
+      if (gh_pair_p (threshold))
+       interstaff =  gh_scm2double (gh_car (threshold));
 
       Score_element const * span_refpoint = span;
       while (span_refpoint->parent_l  (Y_AXIS) != common)
index 69ff282b0a929ec1f3bb13a89795bc16e600e8c8..f314dbc24eb9d8e27bf413b5bdce77314c90586f 100644 (file)
@@ -14,7 +14,7 @@
 Dimension_cache::Dimension_cache (Dimension_cache const &d)
 {
   init();
-  callback_l_ = d.callback_l_;
+  extent_callback_l_ = d.extent_callback_l_;
   basic_offset_ = d.basic_offset_;
   extra_offset_ = d.extra_offset_;
   off_valid_b_ = d.off_valid_b_;
@@ -30,7 +30,7 @@ Dimension_cache::Dimension_cache ()
 void
 Dimension_cache::init()
 {
-  callback_l_ =0;
+  extent_callback_l_ =0;
   basic_offset_ =0.0;
   extra_offset_ =0.0;
   
@@ -113,13 +113,13 @@ Dimension_cache::get_dim () const
 {
   Interval r;
   Dimension_cache *nc = ((Dimension_cache*)this);
-  if (!callback_l_)
+  if (!extent_callback_l_)
     {
       nc->dim_.set_empty ();
     }
   else if (!valid_b_)
     {
-      nc->dim_= (*callback_l_ ) (nc);
+      nc->dim_= (*extent_callback_l_ ) (nc);
       nc->valid_b_ = true;
     }
 
@@ -130,7 +130,7 @@ Dimension_cache::get_dim () const
 void
 Dimension_cache::set_callback (Dim_cache_callback c)
 {
-  callback_l_ =c;
+  extent_callback_l_ =c;
 }
 
 
index b68a2b2788d912fd222ce45d339c83388044628d..9bd790f0016d15f5d7c6574ea3c88ed6e2c8aefb 100644 (file)
@@ -206,19 +206,8 @@ Dynamic_engraver::do_process_music ()
                                          gh_int2scm (100));
       pending_element_arr_.push (text_p_);
       text_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
-      text_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
-       (Side_position_interface::aligned_on_self);
-      /*
-       Don't crash into staff
-      */
-#if 0
-      // nogo
-      text_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
-        (Side_position_interface::aligned_side);
-#else
-      // doet't ook niet, maar breekt wel alignment op line-spanner
-      //side_position (text_p_).set_axis (Y_AXIS);
-#endif
+      text_p_->add_offset_callback (Side_position_interface::aligned_on_self,
+               Y_AXIS);
       announce_element (Score_element_info (text_p_, text_req_l_));
     }
 
@@ -303,19 +292,8 @@ Dynamic_engraver::do_process_music ()
            }
          pending_element_arr_.push (cresc_p_);
          cresc_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
-         cresc_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
-           (Side_position_interface::aligned_on_self);
-         /*
-           Don't crash into staff
-         */
-#if 0
-         // nogo
-         cresc_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
-          (Side_position_interface::aligned_side);
-#else
-         // doet't ook niet, maar breekt wel alignment op line-spanner
-         //side_position (cresc_p_).set_axis (Y_AXIS);
-#endif
+         cresc_p_->add_offset_callback
+           (Side_position_interface::aligned_on_self, Y_AXIS);
          announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
        }
     }
index 40bc87f9c1b649e976aba629e106f3cd4db9bc65..2211e8ac324a1c260f0f69c88c82c08307605b30 100644 (file)
@@ -25,7 +25,9 @@ void
 Engraver::announce_element (Score_element_info i)
 {
   Score_element *  e = i.elem_l_;
-  group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
+
+  if (e->get_elt_property ("interfaces") == SCM_EOL)
+    group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
   
   if (!i.origin_trans_l_)
     i.origin_trans_l_ = this;
index e397ba9c56535af32e1370093e5381db5077ef68..0ddf8481b7476d78f75d3879d4bb4932b1768e49 100644 (file)
@@ -24,7 +24,9 @@ Grace_align_item::before_line_breaking ()
   Real nhw = // lookup_l ()->notehead (2, "").dim_[X_AXIS].length();
     paper_l ()->get_var ("quartwidth");
   
-  threshold_interval_[MIN] = nhw* 1.5;
+  set_elt_property ("threshold",
+                   gh_cons (gh_double2scm (nhw* 1.5),
+                            gh_double2scm (infinity_f)));
   column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
 
   
index 49d4e4bab1039c069efe7bbd5209a0edae45a415..b4fae226423f29d196f32294b44ced9804e23929 100644 (file)
   Which side to align?  -1: left side, 0: centered (around
      center_l_ if not nil, or around center of width), 1: right side
 
-  *****
-
-  align-dir: deprecate! Use Side_pos_interface::self_align
-  
 
 */
 class Align_element : public virtual Axis_group_element {
 public:
-  Interval threshold_interval_ ;
-
   Axis axis () const;
-  
-  Align_element ();
+
   void set_axis (Axis);
   int get_count (Score_element*)const;
+  void add_element (Score_element *);
+  static Real alignment_callback (Dimension_cache const *);
 protected:
-  virtual void after_line_breaking () ;
-  virtual void before_line_breaking ();
-  virtual void do_side_processing ();
+  virtual void do_side_processing (Axis);
+  
 };
 #endif // VERTICAL_ALIGN_ITEM_HH
index 83acd188b107da2bbdac94971965b176eff504b2..75cf8d13d966fc34574fc1ea43221fe2c998983c 100644 (file)
 */
 class Axis_group_element : public virtual Score_element
 {
-  /// modify fields of E for removal.
-  void do_remove (Score_element*e);
-
 protected:
-  virtual Link_array<Score_element> get_extra_dependencies() const;
   virtual Link_array<Score_element> elem_l_arr() const;
   static Interval extent_callback (Dimension_cache const*);
 
 public:
-  Axis axes_[2];
-    
   void add_element (Score_element*);
-
+  bool axis_b (Axis) const;
   Axis_group_element ();
   void set_axes (Axis,Axis);
 
index c21b1d0b3c07b912be8cc2d0224e2114ad1fd9d5..5f138b28b0123e725cae52805fb67d597f66160d 100644 (file)
@@ -106,7 +106,9 @@ class Key_change_req  : public Request
 {
 public:
   Key_change_req ();
-  Key_def key_;
+  ~Key_change_req();
+  Key_change_req(Key_change_req const &);
+  Key_def *key_;
 
 protected:
   VIRTUAL_COPY_CONS(Music);
diff --git a/lily/include/dimension-cache-callback.hh b/lily/include/dimension-cache-callback.hh
new file mode 100644 (file)
index 0000000..b12dc10
--- /dev/null
@@ -0,0 +1,18 @@
+/*   
+  dimension-cache-callback.hh -- declare 
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef DIMENSION_CACHE_CALLBACK_HH
+#define DIMENSION_CACHE_CALLBACK_HH
+
+class Dimension_cache;
+typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
+typedef Real (*Offset_cache_callback)(Dimension_cache const *);
+
+#endif /* DIMENSION_CACHE_CALLBACK_HH */
+
index 52985161a3e03d7fb252a182d4050b90505e8332..e110041d0bb55b168b4f693d218d460cd614ba7a 100644 (file)
 #include "real.hh"
 #include "lily-proto.hh"
 #include "parray.hh"
+#include "dimension-cache-callback.hh"
 
-class Dimension_cache;
-typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
-typedef Real (*Offset_cache_callback)(Dimension_cache const *);
 
 /**
   Adminstration of offset dimension info. 
@@ -38,12 +36,12 @@ class Dimension_cache
   friend class Score_element;
 
   void init ();
-public:
   Array<Offset_cache_callback> off_callbacks_;
   /**
      What to call to find extent.  Nil means empty. 
    */
-  Dim_cache_callback callback_l_;
+public:
+  Dim_cache_callback extent_callback_l_;
   static Interval point_dimension_callback (Dimension_cache const* );
   Axis axis () const;
   Real get_offset () const;
diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 6ed11378957b0e17edf784c94cb443a3b76ad62b..2b9fdccff205d216baff6f2e39a082cc0016f710 100644 (file)
@@ -15,6 +15,8 @@
 
 /**
   Universal key definition (Should rename class Key to 'Accidentals'?)
+
+  FIXME: merge key.hh and key-def.hh classes.
  */
 class Key_def
 {
index 55f320c9c9bed87d35eeae45b52700c0e7603822..d8a7f295a05f5f5948b0ce5d42ec51af045d46ae 100644 (file)
 #include "array.hh"
 
 
-/// An item which places accidentals at the start of the line
+/** An item which places accidentals at the start of the line
+
+    TODO: Schemify me.
+ */
 class Key_item :public  Item
 {
   Array<int> pitch_arr_;
   Array<int> acc_arr_;
   Array<int> old_pitch_arr_;
   Array<int> old_acc_arr_;
-  int c0_position_;
-
 
 public:
-  bool multi_octave_b_;  
-
-  int get_c_position () const;
-    
-  
   VIRTUAL_COPY_CONS(Score_element);
-
   Key_item ();
   void add (int pitch, int acc);
   void add_old (int pitch, int acc);
-  void set_c_position (int);
+
   int calculate_position(int p, int a) const;
 
 protected:
diff --git a/lily/include/leastsquares.hh b/lily/include/leastsquares.hh
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lily/include/note-head-side.hh b/lily/include/note-head-side.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 886659fe35e601a04e5bf59e8c096099ad381541..9bcbd2e33ca779dd7d6f072357873377379e2e14 100644 (file)
@@ -12,6 +12,8 @@
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 #include "smobs.hh"
+#include "dimension-cache-callback.hh"
+
 
 typedef void (Score_element::*Score_element_method_pointer) (void);
 
@@ -150,8 +152,6 @@ protected:
   /// do calculations after determining horizontal spacing
   virtual void after_line_breaking ();
     
-  virtual Link_array<Score_element> get_extra_dependencies () const;
-
   static Interval dim_cache_callback (Dimension_cache const*);
 public:
   static SCM ly_set_elt_property (SCM, SCM,SCM);
@@ -194,6 +194,9 @@ public:
   Score_element*common_refpoint (Score_element const* s, Axis a) const;
   Score_element*common_refpoint (Link_array<Score_element> elems, Axis a) const;
 
+
+  bool has_offset_callback_b (Offset_cache_callback, Axis)const;
+  void add_offset_callback (Offset_cache_callback, Axis);
   /**
      Set the  parent refpoint of THIS to E
    */
diff --git a/lily/include/staff-margin-engraver.hh b/lily/include/staff-margin-engraver.hh
deleted file mode 100644 (file)
index e69de29..0000000
index b9f0ec4e29f0f4c528c86548e1977b0015557ac0..88ca9e102cf3b2b12ba04caf7221bf913616c0a3 100644 (file)
@@ -131,6 +131,9 @@ Key_engraver::do_pre_move_processing ()
 void
 Key_engraver::read_req (Key_change_req const * r)
 {
+  if (!r->key_)
+    return;
+  
   old_accidental_idx_arr_ = accidental_idx_arr_;
   key_.clear ();
   SCM prop = get_property ("keyOctaviation");
@@ -139,9 +142,9 @@ Key_engraver::read_req (Key_change_req const * r)
   
   accidental_idx_arr_.clear ();
 
-  if (r->key_.ordinary_key_b_) 
+  if (r->key_->ordinary_key_b_) 
     {
-      int no_of_acc = r->key_.ordinary_accidentals_i ();
+      int no_of_acc = r->key_->ordinary_accidentals_i ();
 
       // Hmm, can't these be handled/constructed by Key_change_req?
       if (no_of_acc < 0) 
@@ -181,9 +184,9 @@ Key_engraver::read_req (Key_change_req const * r)
     }
   else // Special key
     {
-      for (int i = 0; i < r->key_.pitch_arr_.size (); i ++) 
+      for (int i = 0; i < r->key_->pitch_arr_.size (); i ++) 
        {
-         Musical_pitch m_l =r->key_.pitch_arr_[i];
+         Musical_pitch m_l =r->key_->pitch_arr_[i];
          if (key_.multi_octave_b_)
            key_.set (m_l);
          else
index bd12e97bee401c59444e44a9f9d69c89ce5c4b85..e6b8df7b4493e1f14fea0f5f2df3e7c5d41775f3 100644 (file)
@@ -23,27 +23,9 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
 Key_item::Key_item ()
 {
   set_elt_property ("breakable", SCM_BOOL_T);
-  set_c_position (0);
+  set_elt_property ("c0-position", gh_int2scm (0));
 }
 
-int
-Key_item::get_c_position () const
-{
-  // Find the c in the range -4 through 2
-  int from_bottom_pos = c0_position_ + 4;      
-  from_bottom_pos = from_bottom_pos%7;
-  from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
-  return from_bottom_pos - 4;
-}
-
-
-void 
-Key_item::set_c_position (int c0)
-{
-  c0_position_ = c0;
-}
-
-
 void
 Key_item::add (int p, int a)
 {
@@ -64,27 +46,35 @@ Key_item::calculate_position(int p, int a) const
 {
   if (to_boolean (get_elt_property ("multi-octave")))
     {
-      return p + c0_position_;
+      return p + gh_scm2int (get_elt_property ("c0-position"));
     }
   else {
-    if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+get_c_position ()>4)) && (p+get_c_position ()>1)) 
+    // Find the c in the range -4 through 2
+    int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
+    from_bottom_pos = from_bottom_pos%7;
+    from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
+    int c0 = from_bottom_pos - 4;
+
+    
+    if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) 
        ||
-       (a>0 && ((p>SHARP_TOP_PITCH) || (p+get_c_position ()>5)) && (p+get_c_position ()>2))) 
+       (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) 
       {
        p -= 7; /* Typeset below c_position */
       }
     /* Provide for the four cases in which there's a glitch */
     /* it's a hack, but probably not worth */
     /* the effort of finding a nicer solution. dl. */
-    if (get_c_position ()==2 && a>0 && p==3)
+    if (c0==2 && a>0 && p==3)
       p -= 7;
-    if (get_c_position ()==-3 && a>0 && p==-1)
+    if (c0==-3 && a>0 && p==-1)
       p += 7;
-    if (get_c_position ()==-4 && a<0 && p==-1)
+    if (c0==-4 && a<0 && p==-1)
       p += 7;
-    if (get_c_position ()==-2 && a<0 && p==-3)
+    if (c0==-2 && a<0 && p==-3)
       p += 7;
-    return p + get_c_position ();
+    
+    return p + c0;
   }
 }
 
index 6c4132a451e8e9105bc1c7019c2a85f19a8d507f..ea2668b926c91bd2419836b5f32e0a4d71fbdf8d 100644 (file)
@@ -37,9 +37,9 @@ Key_performer::do_print () const
 void
 Key_performer::do_process_music ()
 {
-  if (key_req_l_)
+  if (key_req_l_ && key_req_l_->key_)
     {
-      audio_p_ = new Audio_key (key_req_l_->key_);
+      audio_p_ = new Audio_key (*key_req_l_->key_);
       Audio_element_info info (audio_p_, key_req_l_);
       announce_element (info);
       key_req_l_ = 0;
index 0f422458eea29ee76480df753352c08e08e63fa6..fc4d696d93656fa456f7bb1e132ba0671e51b9cd 100644 (file)
@@ -273,27 +273,36 @@ Lookup::text (String style, String text, Paper_def *paper_l)
   
   Array<String> lines = String_convert::split_arr (text, '\n');
   
-  Molecule mol;
-  
   Real kern = paper_l->get_var ("line_kern");
   
-  for (i = 0; i< lines.size (); i++)
+  for (int i=0; i < lines.size (); i++)
     {
-      /*
-       Huh?  This way we'll still see \foo sequences in ps output.
-       */
-      String str = lines[i];
+      String str (lines[i]);
       if (output_global_ch == "tex")
        str = sanitise_TeX_string  (str);
       else if (output_global_ch == "ps")
        str = sanitise_PS_string (str);
+      lines[i] = str;
+    }
+
+
+  SCM first = gh_list (ly_symbol2scm ("text"),
+                        ly_str02scm (lines[0].ch_C()),
+                        SCM_UNDEFINED);
+  first = fontify_atom (metric_l, first);
 
+  
+
+  Molecule mol (metric_l->text_dimension (lines[0]), first);
+
+  for (i = 1; i < lines.size (); i++)
+    {
       SCM line = (gh_list (ly_symbol2scm ("text"),
-                          ly_str02scm (str.ch_C ()),
+                          ly_str02scm (lines[i].ch_C ()),
                           SCM_UNDEFINED));
       line = fontify_atom (metric_l, line);
       mol.add_at_edge (Y_AXIS, DOWN,
-                      Molecule (metric_l->text_dimension (str), line),
+                      Molecule (metric_l->text_dimension (lines[i]), line),
                       kern);
     }
 
index 580d7dcee51c14e1d55b997a6982b3efa399d709..3b9df13d0425c7cc095d65f6e7f6cb4ce6b0dff5 100644 (file)
@@ -1039,19 +1039,31 @@ verbose_command_req:
                $$ = new Clef_change_req (ly_scm2string ($2));
 
        }
+       | KEY {
+               Key_change_req *key_p= new Key_change_req;
+               key_p->key_ = 0;
+               $$ = key_p;
+       }
 /* UGH. optional.  */
+
        | KEY NOTENAME_PITCH optional_modality  {
                Key_change_req *key_p= new Key_change_req;
-               key_p->key_.pitch_arr_.push (*$2);
-               key_p->key_.ordinary_key_b_ = true;
-               key_p->key_.modality_i_ = $3;
+               Key_def d;
+               d.pitch_arr_.push (*$2);
+               d.ordinary_key_b_ = true;
+               d.modality_i_ = $3;
+
+               key_p->key_ = new Key_def (d);
                $$ = key_p;
                delete $2;
        }
        | KEYSIGNATURE pitch_list {
                Key_change_req *key_p= new Key_change_req;
-               key_p->key_.pitch_arr_ = *$2;
-               key_p->key_.ordinary_key_b_ = false;
+               Key_def d;
+               d.pitch_arr_ = *$2;
+               d.ordinary_key_b_ = false;
+
+               key_p->key_ = new Key_def(d);
                $$ = key_p;
                delete $2;
        }
index 141d95a22d9f819541d56d3982c8330b3d5e487c..a2d31ab4a5b8f549681517cd482ca5e2c15f1501 100644 (file)
@@ -202,14 +202,14 @@ Score_element::add_processing()
   if (get_elt_property ("self-alignment-X") != SCM_UNDEFINED
       && !dim_cache_[X_AXIS]->off_callback_l_)
     {
-      dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
+      add_offset_callback (Side_position_interface::aligned_on_self,X_AXIS);
     }
   
   if (get_elt_property ("self-alignment-Y") != SCM_UNDEFINED
       && !dim_cache_[X_AXIS]->off_callback_l_)
       
     {
-      dim_cache_[Y_AXIS]->set_offset_callback (Side_position_interface::aligned_on_self);
+      add_offset_callback (Side_position_interface::aligned_on_self, Y_AXIS);
     }
 #endif
   
@@ -228,16 +228,12 @@ Score_element::calculate_dependencies (int final, int busy,
   assert (status_i_!= busy);
   status_i_= busy;
 
-  Link_array<Score_element> dependency_arr =
-    Group_interface__extract_elements (this, (Score_element*)0, "dependencies");
-  
-  for (int i=0; i < dependency_arr.size(); i++)
-    dependency_arr[i]->calculate_dependencies (final, busy, funcptr);
+  for (SCM d=  get_elt_property ("dependencies"); d != SCM_EOL; d = gh_cdr (d))
+    {
+      unsmob_element (gh_car (d))
+       ->calculate_dependencies (final, busy, funcptr);
+    }
 
-  Link_array<Score_element> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->calculate_dependencies (final, busy, funcptr);
-  
   (this->*funcptr)();
   status_i_= final;
 }
@@ -453,13 +449,6 @@ Score_element::handle_prebroken_dependencies()
     }
 }
 
-Link_array<Score_element>
-Score_element::get_extra_dependencies() const
-{
-  Link_array<Score_element> empty;
-  return empty;
-}
-
 bool
 Score_element::linked_b() const
 {
@@ -499,13 +488,13 @@ Score_element::common_refpoint (Score_element const* s, Axis a) const
 void
 Score_element::set_empty (Axis a)
 {
-  dim_cache_[a]->callback_l_ =0;
+  dim_cache_[a]->extent_callback_l_ =0;
 }
 
 bool
 Score_element::empty_b (Axis a)const
 {
-  return !dim_cache_[a]->callback_l_;
+  return !dim_cache_[a]->extent_callback_l_;
 }
 
 Interval
@@ -542,6 +531,22 @@ Score_element::name () const
   return classname (this);
 }
 
+void
+Score_element::add_offset_callback (Offset_cache_callback cb, Axis a)
+{
+  dim_cache_[a]->off_callbacks_.push (cb);
+}
+
+bool
+Score_element::has_offset_callback_b (Offset_cache_callback cb, Axis a)const
+{
+  for (int i= dim_cache_[a]->off_callbacks_.size (); i--;)
+    {
+      if (dim_cache_[a]->off_callbacks_[i] == cb)
+       return true;
+    }
+  return false;
+}
 
 void
 Score_element::set_parent (Score_element *g, Axis a)
index ba8861c5024c0c08401cd8d1b0173c75f76af0e7..787a22ac948cd17afd25130a4d09996afcbf24f0 100644 (file)
@@ -230,26 +230,22 @@ Side_position_interface::set_axis (Axis a)
   if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
     elt_l_->set_elt_property ("side-support" ,SCM_EOL);
 
-  elt_l_->dim_cache_[a]->off_callbacks_.push (aligned_side);
+  elt_l_->add_offset_callback (aligned_side, a);
 }
 
 
 void
 Side_position_interface::set_quantised (Axis a)
 {
-  Dimension_cache * c = elt_l_->dim_cache_[a];
-  
-  c->off_callbacks_.push (quantised_position);
+  elt_l_->add_offset_callback (quantised_position, a);
 }
 
 Axis
 Side_position_interface::get_axis () const
 {
-  Dimension_cache * c =  elt_l_->dim_cache_[X_AXIS];
-  for (int i=0 ; i < c->off_callbacks_.size();i ++)
-    if (c->off_callbacks_[i] == side_position
-       ||c->off_callbacks_[i] == aligned_side)
-      return X_AXIS;
+  if (elt_l_->has_offset_callback_b (&side_position, X_AXIS)
+      || elt_l_->has_offset_callback_b (&aligned_side , X_AXIS))
+    return X_AXIS;
 
   
   return Y_AXIS;
index fd68c6fb4bbfff5311a6c4536de46db012065620..3472bcf54f101f278138f918046c26df79e5eb9f 100644 (file)
@@ -97,8 +97,7 @@ Staff_margin_engraver::create_text (SCM text)
       Text_item* t = new Text_item;
 
       t->set_elt_property ("self-alignment-Y", gh_int2scm (0));
-      t->dim_cache_[Y_AXIS]->off_callbacks_.push
-       (Side_position_interface::aligned_on_self);
+      t->add_offset_callback (Side_position_interface::aligned_on_self, Y_AXIS);
 
       t->set_parent (l, X_AXIS);
       t->set_parent (l, Y_AXIS);
index 53adce0e0766f4e44fce75203a70161984fa98e9..8126bbbcf172cb47855cb1f623cce71a513b35e9 100644 (file)
@@ -22,7 +22,8 @@ void
 Staff_symbol_referencer_interface::set_interface ()
 {
   elt_l_->set_elt_property ("staff-position", gh_double2scm (0.0));
-  elt_l_->dim_cache_[Y_AXIS]->off_callbacks_.push (callback);
+  elt_l_->add_offset_callback (callback, Y_AXIS);
+  
 }
 
 
@@ -138,12 +139,10 @@ Staff_symbol_referencer_interface::set_position (Real p)
 
     }
 
-  Array<Offset_cache_callback> &callbacks (elt_l_->dim_cache_[Y_AXIS]->off_callbacks_);
-  for (int i=0; i < callbacks.size ();i++)
-    if (callbacks[i] == callback)
-      return ;
+  if (elt_l_->has_offset_callback_b (callback, Y_AXIS))
+    return ; 
 
-  callbacks.push (callback);
+  elt_l_->add_offset_callback (callback, Y_AXIS);
 }
 
 Staff_symbol_referencer_interface
index 8258775abf4b9edd65e6831311428ee9b5f4dc58..470d324552a90dc9dedf3f54c647ff61a920fe60 100644 (file)
@@ -219,7 +219,7 @@ Stem::Stem ()
   set_elt_property ("heads", SCM_EOL);
   set_elt_property ("rests", SCM_EOL);
 
-  dim_cache_[X_AXIS]->off_callbacks_.push ( &Stem::off_callback);
+  add_offset_callback ( &Stem::off_callback, X_AXIS);
 }
 
 bool
index 001d79f494e15be082a74fec17e7cae1688a54a2..46da33759686b50cd59595f040fa8890397a0036 100644 (file)
@@ -32,18 +32,17 @@ Vertical_align_engraver::do_creation_processing()
 void
 Vertical_align_engraver::do_removal_processing()
 {
-  SCM dist (get_property ("maxVerticalAlign"));
-  if (gh_number_p(dist))
-    {
-      valign_p_->threshold_interval_[BIGGER]  = gh_scm2double (dist);
-    }
-
-  dist = get_property ("minVerticalAlign");
-  if (gh_number_p(dist))
-    {
-      valign_p_->threshold_interval_[SMALLER]  = gh_scm2double (dist);
-    }
+  SCM min = get_property ("maxVerticalAlign");
+  SCM max = get_property ("minVerticalAlign");
 
+  if (gh_number_p (min) || gh_number_p (max))
+  {
+    min = gh_number_p (min) ? min : gh_double2scm (0.0);
+    max = gh_number_p (max) ? max : gh_double2scm (infinity_f);    
+    
+    valign_p_->set_elt_property ("threshold",
+                                gh_cons (min,max));
+  }
   valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (valign_p_);
   valign_p_ =0;
@@ -57,7 +56,7 @@ Vertical_align_engraver::qualifies_b (Score_element_info i) const
 
   Axis_group_element * elt = dynamic_cast<Axis_group_element *> (i.elem_l_);
 
-  return sz > 1 && elt && elt->axes_[0] == Y_AXIS && !elt->parent_l (Y_AXIS);
+  return sz > 1 && elt && !elt->parent_l (Y_AXIS) && elt->axis_b (Y_AXIS);
 }
 
 void
index 00de2551e99014c387246f1efe649706f196557a..8aa23b5e34d64c779845d73d80115862ce920d94 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.33
-Entered-date: 14MAR00
+Version: 1.3.34
+Entered-date: 15MAR00
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.33.tar.gz 
+       1000k lilypond-1.3.34.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.33.tar.gz 
+       1000k lilypond-1.3.34.tar.gz 
 Copying-policy: GPL
 End
index 94972a476e3383d7e62c835114d61bc0e08af868..6556e08990a7080302145b643265ea8e23ec3152 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.33
+Version: 1.3.34
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.33.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.34.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # get Packager from (undocumented?) ~/.rpmmacros!
index f84a660505a2b555461f3e1d4be0b6f57b0ff6c8..a78822588d18363d6fc2d86059fe87c2a109f197 100644 (file)
@@ -96,6 +96,9 @@ output_dict= {
 # override EndLilyPondOutput, since @tex is done
 # in a sandbox, you can't do \input lilyponddefs at the
 # top of the document.
+
+# should also support fragment in
+                 
                  'output-all': r"""@tex
 \catcode`\@=12
 \input lilyponddefs
@@ -104,6 +107,7 @@ output_dict= {
 \catcode`\@=0
 @end tex
 @html
+<p>
 <img src=%s.png>
 @end html
 """,