]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.32.hwn2
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 14 Mar 2000 14:16:52 +0000 (15:16 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 14 Mar 2000 14:16:52 +0000 (15:16 +0100)
1.3.32.hwn2
===========

* Cleanups for Dynamic_engraver and Dynamic_line_spanner.

* Warn if last column in score is musical. Helps catch programming errors.

* Spanner::spanned_drul_ now is private.

---

Zorg dat de dynamic-line-spanner als typeset_element () wordt
aangeroepen verschillende linker en rechter spanpunten heeft. Je mag
hiervoor *nooit* de laatste musical_column uit de score gebruiken
(want de laatste moet altijd breakable, dus non-musical, zijn.)  Het
gaat fout met crescendo die over space-noten heen zijn gezet. Zie ook
bug-voorbeeld in input/bugs/b.ly. Ik heb nog geprobeerd robuustheids
fix te maken in spanner.cc als spanpunten wel gelijk zijn, maar kreeg
niet werkend, en gdb snapt multiple inheritance ook niet.

Verder heb ik wat ? vervangen door /* uitleg */. Misschien kan jij er
weer iets bij typen.

Generated by hanwen@cs.uu.nl,
From = lilypond-1.3.32.hwn1, To = lilypond-1.3.32.hwn2

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.32.hwn2.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure

38 files changed:
CHANGES
VERSION
input/bugs/b.fly [new file with mode: 0644]
lily/audio-item.cc
lily/axis-group-engraver.cc
lily/beam.cc
lily/crescendo.cc
lily/dynamic-engraver.cc
lily/extender-engraver.cc
lily/extender-spanner.cc
lily/hyphen-engraver.cc
lily/hyphen-spanner.cc
lily/include/atom.hh
lily/include/axis-align-item.hh
lily/include/axis-align-spanner.hh
lily/include/axis-group-element.hh
lily/include/axis-group-item.hh
lily/include/axis-group-spanner.hh
lily/include/line-of-score.hh
lily/include/spanner.hh
lily/include/super-element.hh
lily/line-group-group-engraver.cc
lily/line-of-score.cc
lily/multi-measure-rest.cc
lily/paper-score.cc
lily/score-engraver.cc
lily/separating-line-group-engraver.cc
lily/slur.cc
lily/spacing-engraver.cc
lily/spanner.cc
lily/staff-symbol-engraver.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/tie-column.cc
lily/tie.cc
lily/tuplet-spanner.cc
lily/vertical-align-engraver.cc
lily/volta-spanner.cc

diff --git a/CHANGES b/CHANGES
index 82ae10ab04232149d6a189a32ea8a69b8e13056b..f659443b62ee6d3fe7ec68fce3a43a1bee9f872d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,18 @@
-1.3.32.jcn3
+--- ../lilypond-1.3.32.hwn1/CHANGES    Tue Mar 14 12:47:50 2000
+++ b/CHANGES   Tue Mar 14 15:16:52 2000
+@@ -1,3 +1,12 @@
+1.3.32.hwn2
+===========
+
+* Cleanups for Dynamic_engraver and Dynamic_line_spanner.
+
+* Warn if last column in score is musical. Helps catch programming errors.
+
+* Spanner::spanned_drul_ now is private. 
+
+ 1.3.32.jcn2
+ ===========
+ 1.3.32.jcn3
 ===========
 
 * Embedded newlines in text items are now allowed.  This helps avoiding
diff --git a/VERSION b/VERSION
index 340fa5797e7b4cd699800a138ea50107b78fd6de..4f01f008b7b021c6576dd546503aedce3f8d61ac 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=32
-MY_PATCH_LEVEL=jcn3
+MY_PATCH_LEVEL=hwn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/bugs/b.fly b/input/bugs/b.fly
new file mode 100644 (file)
index 0000000..0b3c3a3
--- /dev/null
@@ -0,0 +1,4 @@
+
+\time 3/2; < a1.
+       { s1 \> s4 \! s4\ppp} >
+                       
index 410222f0e5520552cfca1f9f152118697b69fd7e..60b15abb5c6a4b29865a4e35b734685df12d07c6 100644 (file)
@@ -78,7 +78,7 @@ Audio_tie::set_note (Direction d, Audio_note* note_l)
 {
   assert (!note_l_drul_[d]);
   note_l_drul_[d] = note_l;
-  //set_bounds (d, head_l);
+  //set_bound (d, head_l);
 
   //  add_dependency (head_l);
 }
index 9ae9db643886ebd331494387bfef89d138756714..e4182d8f5a071e8a8fa5da28a445165782790b33 100644 (file)
@@ -20,7 +20,7 @@ Axis_group_engraver::do_creation_processing ()
 {
   staffline_p_ = get_spanner_p ();
   staffline_p_->set_axes (Y_AXIS, Y_AXIS);
-  staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+  staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_element_info (staffline_p_, 0));
 }
 
@@ -32,7 +32,7 @@ Axis_group_engraver::get_spanner_p () const
 void
 Axis_group_engraver::do_removal_processing ()
 {
-  staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+  staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (staffline_p_);
   staffline_p_ = 0;
 }
index e104c10ec89618ba0d4fedb62917b7cedf3c1344..4b875343479d028c7637aa37da3074e53c409254 100644 (file)
@@ -50,10 +50,10 @@ Beam::add_stem (Stem*s)
   assert (!s->beam_l ());
   s->set_elt_property ("beam", self_scm_);
 
-  if (!spanned_drul_[LEFT])
-    set_bounds (LEFT,s);
+  if (!get_bound (LEFT))
+    set_bound (LEFT,s);
   else
-    set_bounds (RIGHT,s);
+    set_bound (RIGHT,s);
 }
 
 int
@@ -742,7 +742,7 @@ Beam::do_brew_molecule () const
       mol.add_molecule (sb);
     }
   mol.translate_axis (x0 
-    - spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS), X_AXIS);
+    - get_bound (LEFT)->relative_coordinate (0, X_AXIS), X_AXIS);
 
   return mol;
 }
index 36bdcbdbec6a308431b2dd4cb560907aee1f99d1..ffe11eaefb9becbee5967236e7dbab864e46d4dc 100644 (file)
@@ -72,7 +72,7 @@ Crescendo::do_brew_molecule () const
   Direction d = LEFT;
   do
     {
-      Paper_column* s = dynamic_cast<Paper_column*>(spanned_drul_[d]); // UGH
+      Paper_column* s = dynamic_cast<Paper_column*>(get_bound (d)); // UGH
       broken[d] = (!s->musical_b ());
     }
   while (flip (&d) != LEFT);
index 38362df35118cc27fc447ea2428888174257187d..b729de9c6574031d1598ec38e67d7ad8bbe798ea 100644 (file)
@@ -28,11 +28,9 @@ class Dynamic_line_spanner : public Spanner
 {
 public:
   Dynamic_line_spanner ();
-  
-  void add_column (Note_column*);
+  VIRTUAL_COPY_CONS(Score_element);
+  void add_column (Item*);
   Direction get_default_dir () const;
-protected:
-  virtual void do_post_processing ();
 };
 
 Dynamic_line_spanner::Dynamic_line_spanner ()
@@ -42,11 +40,12 @@ Dynamic_line_spanner::Dynamic_line_spanner ()
 }
 
 void
-Dynamic_line_spanner::add_column (Note_column* n)
+Dynamic_line_spanner::add_column (Item* n)
 {
-  if (!spanned_drul_[LEFT])
-    set_bounds (LEFT, n);
-  set_bounds (RIGHT, n);
+  if (!get_bound (LEFT))
+    set_bound (LEFT, n);
+  else
+    set_bound (RIGHT, n);
 
   add_dependency (n);
 }
@@ -57,48 +56,6 @@ Dynamic_line_spanner::get_default_dir () const
   return DOWN;
 }
 
-void
-Dynamic_line_spanner::do_post_processing ()
-{
-  Spanner::do_post_processing ();
-  Direction dir = directional_element (this).get ();
-  if (!dir)
-    dir = get_default_dir ();
-
-  /*
-    Hier is ook vast iets voor?
-   */
-  Staff_symbol_referencer_interface si (this);
-  Real above_staff = si.line_count () + 2;
-
-#if 0
-  // Aargh, nu snap ik waarom ik het niet snap
-  // zie Staff_symbol_referencer_interface::set_position 
-
-  if (si.position_f () * dir < above_staff)
-    si.set_position (above_staff * (int)dir);
-
-  SCM s = get_elt_property ("padding");
-  if (gh_number_p (s))
-    {
-      si.set_position (si.position_f () + gh_scm2double (s) * (int) dir);
-    }
-#else
-  Real dy = 0;
-  Real pos = si.position_f () * dir;
-  if (pos * dir < above_staff)
-    dy = above_staff;
-
-  SCM s = get_elt_property ("padding");
-  if (gh_number_p (s))
-    dy += gh_scm2double (s);
-  
-  Real half_space = si.staff_space () / 2;
-  translate_axis (dy*half_space*dir, Y_AXIS);
-#endif
-  
-}
-
 /**
    print text & hairpin dynamics.
  */
@@ -162,6 +119,12 @@ Dynamic_engraver::do_post_move_processing ()
   text_req_l_ = 0;
   span_req_l_drul_[START] = 0;
   span_req_l_drul_[STOP] = 0;
+
+  /* ugr; we must attach the Dynamic_line_spanner to something
+     to be sure that the linebreaker will not be confused
+  */
+  // if (line_spanner_)
+  // line_spanner_->add_column (LEFT, get_staff_info ().command_pcol_l ());
 }
 
 bool
@@ -229,8 +192,8 @@ Dynamic_engraver::do_process_requests ()
       else
        {
          assert (!finished_cresc_p_);
-         cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
-         cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+         cresc_p_->set_bound(RIGHT, get_staff_info ().musical_pcol_l ());
+         //      cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
          finished_cresc_p_ = cresc_p_;
          cresc_p_ = 0;
          span_start_req_l_ = 0;
@@ -272,11 +235,21 @@ Dynamic_engraver::do_process_requests ()
                                            + "Spanner", SCM_UNDEFINED);
            }
 
-         cresc_p_->set_bounds(LEFT, get_staff_info ().musical_pcol_l ());
-         cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
-         cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+         cresc_p_->set_bound(LEFT, get_staff_info ().musical_pcol_l ());
+
 
-         // arrragh, brr, urg: we know how wide text is, no?
+         // cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+
+         /* 
+             We know how wide the text is, if we can be sure that the
+             text already has relevant pointers into the paperdef,
+             and it has its font-size property set.
+
+             Since font-size may be set by a context higher up, we
+             can not be sure of the size.
+         */
+
+            
          if (text_p_)
            {
              index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
@@ -288,7 +261,7 @@ Dynamic_engraver::do_process_requests ()
 
          assert (line_spanner_);
          cresc_p_->set_parent (line_spanner_, Y_AXIS);
-         cresc_p_->add_dependency (line_spanner_);
+         // cresc_p_->add_dependency (line_spanner_);
          announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
        }
     }
@@ -300,6 +273,7 @@ Dynamic_engraver::do_pre_move_processing ()
   typeset_all ();
 }
 
+
 void
 Dynamic_engraver::do_removal_processing ()
 {
@@ -323,7 +297,6 @@ Dynamic_engraver::typeset_all ()
 {  
   if (finished_cresc_p_)
     {
-      //finished_cresc_p_->set_bounds (RIGHT, get_staff_info ().musical_pcol_l ());
       typeset_element (finished_cresc_p_);
       finished_cresc_p_ =0;
     }
@@ -338,10 +311,12 @@ Dynamic_engraver::typeset_all ()
     TODO: This should be optionised:
       * break when group of dynamic requests ends
       * break now 
-      * continue through piece
-   */
+      * continue through piece */
   if (line_spanner_ && last_request_mom_ < now_mom ())
     {
+
+      side_position (line_spanner_).add_staff_support ();
+      
       typeset_element (line_spanner_);
       line_spanner_ = 0;
     }
index 32e6f01f389b56234eda968dc53273ccdbbf42f1..9cab9a6db5c6c7484ea82b233d28758e1aa8ef06 100644 (file)
@@ -31,7 +31,7 @@ Extender_engraver::acknowledge_element (Score_element_info i)
     {
       current_lyric_l_ = t;
       if (extender_spanner_p_
-         && !extender_spanner_p_->spanned_drul_[RIGHT]
+         && !extender_spanner_p_->get_bound (RIGHT)
            )
          {
            extender_spanner_p_->set_textitem (RIGHT, t);
@@ -60,7 +60,7 @@ Extender_engraver::do_removal_processing ()
   if (extender_spanner_p_)
     {
       req_l_->warning (_ ("unterminated extender"));
-      extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+      extender_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
     }
 }
 
index ff02c16d92efbb71aa4be8d5eeec2cc2722f31f7..a590aa1a242e4286ebebbe9c610e3ff3f49e576c 100644 (file)
@@ -58,8 +58,8 @@ Extender_spanner::do_post_processing ()
   Direction d = LEFT;
   do
     {
-      Item* t = spanned_drul_[d]
-       ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+      Item* t = get_bound (d)
+       ? get_bound (d) : get_bound ((Direction)-d);
       if (d == LEFT)
         dx_f_drul_[d] += t->extent (X_AXIS).length ();
       else
@@ -72,7 +72,7 @@ Extender_spanner::do_post_processing ()
 void
 Extender_spanner::set_textitem (Direction d, Item* textitem_l)
 {
-  set_bounds (d, textitem_l);
+  set_bound (d, textitem_l);
   add_dependency (textitem_l);
 }
 
index 1b73e0149932cbb34ab59f5219ed5c4f565064b7..b259f296702c3e901cac601535eeddd52359938e 100644 (file)
@@ -29,7 +29,7 @@ Hyphen_engraver::acknowledge_element (Score_element_info i)
     {
       current_lyric_l_ = t;
       if (hyphen_spanner_p_
-         && !hyphen_spanner_p_->spanned_drul_[RIGHT]
+         && !hyphen_spanner_p_->get_bound (RIGHT)
            )
          {
            hyphen_spanner_p_->set_textitem (RIGHT, t);
@@ -58,7 +58,7 @@ Hyphen_engraver::do_removal_processing ()
   if (hyphen_spanner_p_)
     {
       req_l_->warning (_ ("unterminated hyphen"));
-      hyphen_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+      hyphen_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
     }
 }
 
index 65470ea81c4204e414228bf39055ff20d45e2425..3fd4f63bc992c59cd6fa08a3c25fd4125b3a2fcd 100644 (file)
@@ -65,8 +65,8 @@ Hyphen_spanner::do_post_processing ()
   Direction d = LEFT;
   do
     {
-      Item* t = spanned_drul_[d]
-       ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+      Item* t = get_bound (d)
+       ? get_bound (d) : get_bound ((Direction)-d);
       if (d == LEFT)
         dx_f_drul_[d] += t->extent (X_AXIS).length ();
       else
@@ -79,7 +79,7 @@ Hyphen_spanner::do_post_processing ()
 void
 Hyphen_spanner::set_textitem (Direction d, Item* textitem_l)
 {
-  set_bounds (d, textitem_l);
+  set_bound (d, textitem_l);
   add_dependency (textitem_l);
 }
 
index 576dc45e1a626f286538836e36fcd3887cd9a45f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,17 +0,0 @@
-/*
-  atom.hh -- declare Atom
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef ATOM_HH
-#define ATOM_HH
-
-#include "lily-proto.hh"
-
-#include "lily-guile.hh"
-
-
-#endif
index b6a0ab5231572f4d8c6211b06be70628c45c3e5c..bcea4e18d9b1f7201759c0403ac784cf3e6a2cc8 100644 (file)
 #include "align-element.hh"
 #include "axis-group-item.hh"
 
-class Axis_align_item : public virtual Align_element,
-                       public virtual Axis_group_item
+/*
+  UGH. FIXME: multiple inheritance.
+ */
+class Axis_align_item : public virtual Align_element, public virtual Axis_group_item
 {
 public:
   Axis_align_item ();
index 9fdb72194d27fb408c19a8175bbf3367009788aa..0352968aeea63a2760a979d05b4757c29e1eb64e 100644 (file)
 #include "align-element.hh"
 #include "axis-group-spanner.hh"
 
-class Axis_align_spanner : public virtual Align_element,
-                          public virtual Axis_group_spanner
+/*
+  FIXME: multiple inheritance
+ */
+class Axis_align_spanner : public virtual Align_element, public virtual Axis_group_spanner
 {
 public:
   VIRTUAL_COPY_CONS(Score_element);
index 969fd7b73688e42930f534f9df8ed3ffc19a661f..83acd188b107da2bbdac94971965b176eff504b2 100644 (file)
@@ -16,7 +16,9 @@
 /** 
   Treat a group of elements a unity in either or both axis sense .
   This is a wrapper around Axis_group_administration
-  */
+
+  FIXME: remove this class, and make interface of it, so we can remove multiple inheritance.
+*/
 class Axis_group_element : public virtual Score_element
 {
   /// modify fields of E for removal.
index 06561d0301bd9ed4570f61fabf4842e0dbe7d409..0f88cc78bb23d94e64aee7147191ff5b0b27abb5 100644 (file)
@@ -16,9 +16,7 @@
 /**
   A grouping item. Its special support is in do_breakable_col_processing().
  */
-
-class Axis_group_item : public virtual Axis_group_element,
-                       public virtual Item
+class Axis_group_item : public virtual Axis_group_element, public virtual Item
 {
 public:
   VIRTUAL_COPY_CONS(Score_element);
index a88d9c3dad5d04bee7d36c833923046024757eb0..d421973f5058d361958dc8c487184e068144fad5 100644 (file)
 #include "spanner.hh"
 #include "axis-group-element.hh"
 
-/** An element which groups a line in a certain direction. The most
-  useful example of this is the Vertical_group_spanner */
+/**
+   An element which groups a line in a certain direction. The most
+   useful example of this is the Vertical_group_spanner
+*/
 class Axis_group_spanner : public virtual Axis_group_element,
                           public virtual Spanner
 
index 1c65a78ebce9bbb257034789a114bf15b7f15a91..994a50b20d7fb42550602f1b944bd454312699cc 100644 (file)
@@ -11,7 +11,7 @@
 #include "axis-group-spanner.hh"
 #include "super-element.hh"
 
-/// the columns of a score that form one line.
+/// the columns of a score that form one line. FIXME: multiple inheritance
 class Line_of_score : public Axis_group_spanner, public Super_element
 {
 public:
index 7736ed8610c3539b1d6d153991aa7b9992eeaf1f..130604b86303cdfc1b4dedcbf960471b29580d7b 100644 (file)
@@ -35,11 +35,12 @@ class Axis_group_spanner;
 
   */
 class Spanner : public virtual Score_element {
-public:
   Drul_array<Item*> spanned_drul_;
-  Link_array<Spanner> broken_into_l_arr_;
-  void set_bounds (Direction d, Item*);
 
+public:
+  Link_array<Spanner> broken_into_l_arr_;
+  void set_bound (Direction d, Item*);
+  Item *get_bound (Direction d) const;
   
   Spanner ();
   Spanner (Spanner const &);
index c27d1bd963375d8fd98fbabef3403ebb36712365..cdc121c06eaa5a693a147f19b7479ba959801bfb 100644 (file)
@@ -19,8 +19,9 @@
   dependency graph, and calls the appropriate
   Score_element::do_XXX_processing function on each Score_element it encounters.
   
-  
-  */
+
+  FIXME: remove this class, to eliminate multiple inheritance. Merge
+  with Line_of_score ?  */
 class Super_element : public virtual Score_element {
 public:
   void space_processing ();
index f30e40959fff4ecf89413ba334f7fe73c133f260..a0f8d10dbce7b8afc283e3df34a4e6a1dc624d03 100644 (file)
@@ -34,7 +34,7 @@ Line_group_engraver_group::do_removal_processing()
 {
   Engraver_group_engraver::do_removal_processing ();
 
-  staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+  staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   Engraver_group_engraver::typeset_element (staffline_p_);
   staffline_p_ = 0;
 }
@@ -43,7 +43,7 @@ void
 Line_group_engraver_group::do_creation_processing()
 {
   create_line_spanner ();
-  staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+  staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
   
   Engraver::announce_element (Score_element_info (staffline_p_,0));
 }
index 69d7f363397482f90ab9db253b6abdd214fec784..cde8965e03456c9c9a4a84d46d3937c066d1306e 100644 (file)
@@ -48,8 +48,8 @@ Line_of_score::break_into_pieces (Array<Column_x_positions> const &breaking)
       line_l->rank_i_ = i;
       Link_array<Paper_column> c (breaking[i].cols_);
       pscore_l_->typeset_element (line_l);
-      line_l->set_bounds(LEFT,c[0]);
-      line_l->set_bounds(RIGHT,c.top ());
+      line_l->set_bound(LEFT,c[0]);
+      line_l->set_bound(RIGHT,c.top ());
       for (int j=0; j < c.size(); j++)
        {
          c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
index cba889d3f71924ee7f05401f26b33cca8c8abf56..81ba1f26da6becbda775143fd672ef0afe0d49b9 100644 (file)
@@ -40,7 +40,7 @@ Multi_measure_rest::do_brew_molecule () const
   Direction d = LEFT;
   do
     {
-      Item * col = spanned_drul_[d]->column_l ();
+      Item * col = get_bound (d)->column_l ();
 
       Interval coldim = col->extent (X_AXIS)
        + col->relative_coordinate (0, X_AXIS);
@@ -51,7 +51,7 @@ Multi_measure_rest::do_brew_molecule () const
   Molecule mol;
   Real x_off = 0.0;
 
-  Real rx  = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
+  Real rx  = get_bound (LEFT)->relative_coordinate (0, X_AXIS);
   /*
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
@@ -143,8 +143,8 @@ Multi_measure_rest::do_add_processing ()
     {
       Link_array<Item> column_arr (Group_interface__extract_elements (this, (Item*)0, "columns"));
                                    
-      set_bounds (LEFT, column_arr[0 >? column_arr.size () - 2]);
-      set_bounds (RIGHT, column_arr.top ());
+      set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]);
+      set_bound (RIGHT, column_arr.top ());
     }
 
   // set columns to SCM_EOL?
@@ -175,14 +175,14 @@ Multi_measure_rest::get_rods () const
 {
   Array<Rod> a;
 
-  if (!(spanned_drul_[LEFT] && spanned_drul_[RIGHT]))
+  if (!(get_bound (LEFT) && get_bound (RIGHT)))
     {
       programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
       return a;
     }
 
-  Item * l = spanned_drul_[LEFT]->column_l ();
-  Item * r = spanned_drul_[RIGHT]->column_l ();
+  Item * l = get_bound (LEFT)->column_l ();
+  Item * r = get_bound (RIGHT)->column_l ();
   Item * lb = l->find_broken_piece (RIGHT);
   Item * rb = r->find_broken_piece (LEFT);      
   
index 6bd6e33e0507530b68c9ffeed23e343ef72bb4ec..b062978633db4145e2fd065be927685bceafaee2 100644 (file)
@@ -225,6 +225,11 @@ Paper_score::fixup_refpoints ()
        {
          Score_element * se = unsmob_element (e);
          se->fixup_refpoint ();
+
+         if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
+           {
+             programming_error ("No parent!");
+           }
        }
     }
 }
index ed74043951ade9dc3910b25d933193ee158543e3..09c7ffd47fb9073c28844e412a8eef4b0071e0ee 100644 (file)
@@ -53,7 +53,7 @@ Score_engraver::do_creation_processing ()
 {
   scoreline_l_ = pscore_p_->line_l_;
 
-  scoreline_l_->set_bounds(LEFT, command_column_l_);
+  scoreline_l_->set_bound(LEFT, command_column_l_);
   
   command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
 
@@ -65,10 +65,15 @@ void
 Score_engraver::do_removal_processing()
 {
   Engraver_group_engraver::do_removal_processing();
-  scoreline_l_->set_bounds(RIGHT,command_column_l_);
+  scoreline_l_->set_bound(RIGHT,command_column_l_);
   command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
 
+  
   typeset_all ();
+
+
+  if (musical_column_l_->linked_b ())
+    programming_error ("Last column in score should be non-musical");
   set_columns (0,0);
 }
 
@@ -128,9 +133,9 @@ Score_engraver::typeset_all()
           */
          Direction d = LEFT;
          do {
-           if (!s->spanned_drul_[d])
+           if (!s->get_bound (d))
              {
-               s->set_bounds(d, command_column_l_);
+               s->set_bound(d, command_column_l_);
                ::warning (_f ("unbound spanner `%s'", classname(s)));
              }
          } while (flip(&d) != LEFT);
@@ -189,7 +194,11 @@ Score_engraver::set_columns (Paper_column *new_command_l,
                We're forgetting about this column. Dump it, and make SCM
                forget it.
 
-               (UGH.)  */
+               FIXME: we should have another way of not putting this
+               column into the spacing problem. Maybe we shouldn't
+               even prevent this.
+
+             */
              scm_unprotect_object ((*current[i])->self_scm_);
              *current[i]  =0;
            }
index 9cd56f58b618399e31c8250d1cc33cd0df49f641..7d99122fd5c4f1ceb2f61f43c678b33bf5a6fca6 100644 (file)
@@ -25,13 +25,13 @@ Separating_line_group_engraver::do_creation_processing ()
 {
   sep_span_p_ = new Separating_group_spanner;
   announce_element (Score_element_info (sep_span_p_, 0));
-  sep_span_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ());
+  sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
 }
 
 void
 Separating_line_group_engraver::do_removal_processing ()
 {
-  sep_span_p_->set_bounds (RIGHT, get_staff_info ().command_pcol_l ());
+  sep_span_p_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
   typeset_element (sep_span_p_);
   sep_span_p_ =0;
 }
index 916cc54e25cd7fb043639677c18427ed54fffedf..774a5dc13232b233c6ed8c206b533f8783e2debb 100644 (file)
@@ -302,9 +302,9 @@ Slur::do_add_processing ()
 
   if (encompass_arr.size ())
     {
-      set_bounds (LEFT, encompass_arr[0]);    
+      set_bound (LEFT, encompass_arr[0]);    
       if (encompass_arr.size () > 1)
-       set_bounds (RIGHT, encompass_arr.top ());
+       set_bound (RIGHT, encompass_arr.top ());
     }
 }
 
@@ -411,7 +411,7 @@ Slur::set_extremities ()
       dx_f_drul_[d] = 0;
       dy_f_drul_[d] = 0;
       
-      if ((note_column_drul[d] == spanned_drul_[d])
+      if ((note_column_drul[d] == get_bound (d))
          && note_column_drul[d]->first_head ()
          && (note_column_drul[d]->stem_l ()))
        {
@@ -425,7 +425,7 @@ Slur::set_extremities ()
              && !((my_dir == stem_l->get_direction ())
                   && stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
            {
-             dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
+             dx_f_drul_[d] = get_bound (d)->extent (X_AXIS).length () / 2;
              dx_f_drul_[d] -= d * x_gap_f;
 
              if (stem_l->get_direction () != my_dir)
@@ -445,7 +445,7 @@ Slur::set_extremities ()
          else
            {
              dx_f_drul_[d] = stem_l->hpos_f ()
-               - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
+               - get_bound (d)->relative_coordinate (0, X_AXIS);
              /*
                side attached to beamed stem
               */
@@ -503,7 +503,7 @@ Slur::set_extremities ()
 
   if (fix_broken_b)
     {
-      Direction d = (encompass_arr.top () != spanned_drul_[RIGHT]) ?
+      Direction d = (encompass_arr.top () != get_bound (RIGHT)) ?
        RIGHT : LEFT;
       dy_f_drul_[d] = info_drul[d][Y_AXIS];
       if (!interstaff_b)
@@ -569,7 +569,7 @@ Slur::get_encompass_offset_arr () const
 
   int cross_count  = cross_staff_count ();
   bool cross_b = cross_count && cross_count < encompass_arr.size ();
-  if (encompass_arr[0] != spanned_drul_[LEFT])
+  if (encompass_arr[0] != get_bound (LEFT))
     {
       first--;
       Real is   = calc_interstaff_dist (encompass_arr[0], this);
@@ -580,7 +580,7 @@ Slur::get_encompass_offset_arr () const
   /*
     right is broken edge
   */
-  if (encompass_arr.top () != spanned_drul_[RIGHT])
+  if (encompass_arr.top () != get_bound (RIGHT))
     {
       last++;
     }
@@ -603,7 +603,9 @@ Slur::get_rods () const
 {
   Array<Rod> a;
   Rod r;
-  r.item_l_drul_ = spanned_drul_;
+  r.item_l_drul_[LEFT] = get_bound (LEFT);
+  r.item_l_drul_[RIGHT] = get_bound (RIGHT);
+  
   r.distance_f_ = paper_l ()->get_var ("slur_x_minimum");
 
   a.push (r);
@@ -612,31 +614,6 @@ Slur::get_rods () const
 
 
 
-#if 0
-SCM
-ugly_scm (Bezier  b) 
-{
-  b.translate (-b.control_[0]);
-  Real alpha = b.control_[3].arg ();
-
-  b.rotate ( -alpha);
-  if (b.control_[1][Y_AXIS] < 0)
-    {
-      b.control_[1][Y_AXIS] *= -1;
-      b.control_[2][Y_AXIS] *= -1;      
-    }
-
-  Real len = b.control_[3][X_AXIS];
-  Real indent = 10 *b.control_[1][X_AXIS] / len ;
-  Real ht = 10 *b.control_[1][Y_AXIS] / len ;
-  
-  SCM res = scm_eval (scm_listify (ly_symbol2scm ("slur-ugly"), gh_double2scm (indent), gh_double2scm (ht), SCM_UNDEFINED ));
-
-  return res;
-}
-#endif
-
-
 /*
   Ugh should have dash-length + dash-period
  */
@@ -653,19 +630,6 @@ Slur::do_brew_molecule () const
   else
     a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
 
-#if 0 
-  SCM u = ugly_scm (one);
-  if (gh_pair_p (u))
-    {
-      Molecule mark = lookup_l ()-> text ( "roman",
-                          to_str (gh_scm2double (gh_car (u)), "%0.2f") + "," +
-                          to_str(gh_scm2double (gh_cdr (u)), "%0.2f"),
-                          paper_l ());
-
-      mark.translate_axis (20 , Y_AXIS);
-      a.add_molecule (mark);
-    }
-#endif
   return a;
 }
 
index 7f3ac132fce5c00f41ab4c8cda00e155f739f34a..5caefdf72ed4adaf9749f66d74a5ad9aaf556700 100644 (file)
@@ -35,7 +35,7 @@ void
 Spacing_engraver::do_creation_processing ()
 {
   spacing_p_  =new Spacing_spanner;
-  spacing_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ());  
+  spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());  
   announce_element (Score_element_info (spacing_p_, 0));
 }
 
@@ -44,7 +44,7 @@ Spacing_engraver::do_removal_processing ()
 {
   Paper_column * p = get_staff_info ().command_pcol_l ();
 
-  spacing_p_->set_bounds (RIGHT, p);
+  spacing_p_->set_bound (RIGHT, p);
   typeset_element (spacing_p_);
   spacing_p_ =0;
 }
index 7d0ca15fdd2635b27c47641b2c2231f1c5c6ddf6..2bc8b98ab4f2339455216a157c00898796411884 100644 (file)
@@ -32,38 +32,58 @@ Spanner::do_break_processing()
   if  (left == right)
     {
       warning (_ ("Left spanpoint is right spanpoint"));
-      return;
-    }
-  
-  Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
-
-  break_points.insert (left,0);
-  break_points.push (right);
 
-  for (int i=1; i < break_points.size(); i++) 
-    {
-      Drul_array<Item*> bounds;
-      bounds[LEFT] = break_points[i-1];
-      bounds[RIGHT] = break_points[i];
+      /*
+       FIXME: this is broken.
+       */
+      /*
+       If we have a spanner spanning one column, we must break it
+       anyway because it might provide a parent for another item.  */
       Direction d = LEFT;
       do
        {
-         Item *&pc_l = bounds[d] ;
-         if (!pc_l->line_l())
-           pc_l =  pc_l->find_broken_piece(- d);
-         
-         assert (pc_l);
+         Item* bound = left->find_broken_piece (d);
+         Spanner * span_p = dynamic_cast<Spanner*>( clone ());
+         span_p->set_bound (LEFT, bound);
+         span_p->set_bound (RIGHT, bound);
+
+         assert (span_p->line_l ()); 
+         pscore_l_->typeset_element (span_p);
+         broken_into_l_arr_.push (span_p);
        }
       while ((flip(&d))!= LEFT);
+    }
+  else
+    {
+      Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
 
-      Spanner *span_p = dynamic_cast<Spanner*>(clone ());
-      span_p->set_bounds(LEFT,bounds[LEFT]);
-      span_p->set_bounds(RIGHT,bounds[RIGHT]);
+      break_points.insert (left,0);
+      break_points.push (right);
+
+      for (int i=1; i < break_points.size(); i++) 
+       {
+         Drul_array<Item*> bounds;
+         bounds[LEFT] = break_points[i-1];
+         bounds[RIGHT] = break_points[i];
+         Direction d = LEFT;
+         do
+           {
+             Item *&pc_l = bounds[d] ;
+             if (!pc_l->line_l())
+               pc_l =  pc_l->find_broken_piece(- d);
+         
+             assert (pc_l);
+           }
+         while ((flip(&d))!= LEFT);
+
+         Spanner *span_p = dynamic_cast<Spanner*>(clone ());
+         span_p->set_bound(LEFT,bounds[LEFT]);
+         span_p->set_bound(RIGHT,bounds[RIGHT]);
       
-      pscore_l_->typeset_element (span_p);
-      broken_into_l_arr_.push (span_p);
+         pscore_l_->typeset_element (span_p);
+         broken_into_l_arr_.push (span_p);
+       }
     }
-
   broken_into_l_arr_.sort (Spanner::compare);
 }
 
@@ -74,13 +94,20 @@ Spanner::set_my_columns()
   do 
     {
       if (!spanned_drul_[i]->line_l())
-       set_bounds(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
+       set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
     } 
   while (flip(&i) != LEFT);
 }       
 
+
+Item*
+Spanner::get_bound (Direction d) const
+{
+  return spanned_drul_ [d];
+}
+
 void
-Spanner::set_bounds(Direction d, Item*i)
+Spanner::set_bound(Direction d, Item*i)
 {
   spanned_drul_[d] =i;
   if (i)
index a84f393a52d125d8fa36eb197415a489cb24baaa..4bed0bf75264e00da63edfe0fbd094aa1f2112c9 100644 (file)
@@ -47,7 +47,7 @@ void
 Staff_symbol_engraver::do_creation_processing()
 {
   span_p_ = new Staff_symbol;
-  span_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+  span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_element_info (span_p_, 0));
 }
 
@@ -62,7 +62,7 @@ Staff_symbol_engraver::do_removal_processing()
   if (gh_number_p (n))
     span_p_->set_elt_property ("line-count", n);
 
-  span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+  span_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (span_p_);
   span_p_ =0;
 }
index 0557fce059f8c2931e6ea9c032509d85d180c829..00172d198547f3665f7dca7ce29c3cd3f956323c 100644 (file)
@@ -108,7 +108,19 @@ Staff_symbol_referencer_interface::callback (Dimension_cache const * c)
 }
 
 /*
-  Huh? -- jcn
+  
+  This sets the position relative to the center of the staff symbol.
+
+  The function is hairy, because it can be callled in two situations:
+
+  1.  There is no staff yet; we must set staff-position
+
+  2.  There is a staff, and perhaps someone even applied a
+  translate_axis (). Then we must compensate for the translation
+  
+  In either case, we set a callback to be sure that our new position
+  will be extracted from staff-position
+  
  */
 void
 Staff_symbol_referencer_interface::set_position (Real p)
@@ -117,7 +129,6 @@ Staff_symbol_referencer_interface::set_position (Real p)
   if (st && elt_l_->common_refpoint(st, Y_AXIS))
     {
       Real oldpos = position_f ();
-      // Aargh!
       elt_l_->set_elt_property ("staff-position", gh_double2scm (p - oldpos));
     }
   else
index 21123e75d96de75f9bfe88e3bd1e97fc08f37a2a..4419d8dc126ea043d2a587eb71e1fd070f75c6bc 100644 (file)
@@ -19,12 +19,12 @@ Molecule
 Staff_symbol::do_brew_molecule() const
 {
   Score_element * common
-    = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
+    = get_bound (LEFT)->common_refpoint (get_bound (RIGHT), X_AXIS);
   
   Real width =
     // right_shift     - left_shift
-    + spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS)
-    - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS)
+    + get_bound (RIGHT)->relative_coordinate (common , X_AXIS)
+    - get_bound (LEFT)->relative_coordinate (common, X_AXIS)
     ;
 
   Real t = paper_l ()->get_var ("stafflinethickness");
index f23d218d9316ca1dc82d970700fa3e789caf76d4..eba1c4d8f02bd0793457d1e3ac987c69b647bbf3 100644 (file)
@@ -27,8 +27,8 @@ Tie_column::add_tie (Tie *s)
   Group_interface g (this, "ties");
   if (!g.count ())
     {
-      set_bounds (LEFT, s->head (LEFT));
-      set_bounds (RIGHT, s->head (RIGHT));
+      set_bound (LEFT, s->head (LEFT));
+      set_bound (RIGHT, s->head (RIGHT));
     }
   
   group (this, "ties").add_element (s);
index 87de462d7391656f316118bf2c377c9faebb76b6..e98bb1eea906ad02d39f25a6e5a7aa61fe447e8f 100644 (file)
@@ -26,7 +26,7 @@ Tie::set_head (Direction d, Item * head_l)
   assert (!head (d));
   index_set_cell (get_elt_property ("heads"), d, head_l->self_scm_);
   
-  set_bounds (d, head_l);
+  set_bound (d, head_l);
   add_dependency (head_l);
 }
 
@@ -179,7 +179,10 @@ Tie::get_rods () const
 {
   Array<Rod> a;
   Rod r;
-  r.item_l_drul_ = spanned_drul_;
+
+  r.item_l_drul_ [LEFT]=get_bound (LEFT);
+  r.item_l_drul_ [RIGHT]=get_bound (RIGHT);  
+  
   r.distance_f_ = paper_l ()->get_var ("tie_x_minimum");
   a.push (r);
   return a;
index 544759570939e5601815e3ec9d9bab6b078b2e83..dd55332caa1821961f3df5a9713eee2aeb38f0ac 100644 (file)
@@ -116,8 +116,8 @@ Tuplet_spanner::do_add_processing ()
       Link_array<Note_column> column_arr=
        Group_interface__extract_elements (this, (Note_column*)0, "columns");
       
-      set_bounds (LEFT, column_arr[0]);
-      set_bounds (RIGHT, column_arr.top ());  
+      set_bound (LEFT, column_arr[0]);
+      set_bound (RIGHT, column_arr.top ());  
     }
 }
 
@@ -223,8 +223,8 @@ calc_position_and_height  (&offset,&dy);
       Score_element *b = unsmob_element (gh_car (bs));
       Beam * beam_l = dynamic_cast<Beam*> (b);
       if (!broken_b () 
-         && spanned_drul_[LEFT]->column_l () == beam_l->spanned_drul_[LEFT]->column_l ()
-         && spanned_drul_[RIGHT]->column_l () == beam_l->spanned_drul_[RIGHT]->column_l ())
+         && get_bound (LEFT)->column_l () == beam_l->get_bound (LEFT)->column_l ()
+         && get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
        set_elt_property ("parallel-beam", SCM_BOOL_T);
     }
 }
index 464e7e3df21defc27b8fb59409625949b857ad00..001d79f494e15be082a74fec17e7cae1688a54a2 100644 (file)
@@ -25,7 +25,7 @@ Vertical_align_engraver::do_creation_processing()
   valign_p_->set_axis (Y_AXIS);
   valign_p_->set_elt_property ("stacking-dir",  gh_int2scm (DOWN));
   
-  valign_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+  valign_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
   announce_element (Score_element_info (valign_p_ , 0));
 }
 
@@ -44,7 +44,7 @@ Vertical_align_engraver::do_removal_processing()
       valign_p_->threshold_interval_[SMALLER]  = gh_scm2double (dist);
     }
 
-  valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+  valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (valign_p_);
   valign_p_ =0;
 }
index 9f5427a2443feb73407f40b5ef081df958ca34a4..a446d7cd12bd2c55fe67ebe3b677cd36f4fd8b69 100644 (file)
@@ -114,8 +114,8 @@ Volta_spanner::do_add_processing ()
 
   if (bar_arr.size ())
     {
-      set_bounds (LEFT, bar_arr[0]);
-      set_bounds (RIGHT, bar_arr.top ());  
+      set_bound (LEFT, bar_arr[0]);
+      set_bound (RIGHT, bar_arr.top ());  
     }
 }