]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.70
authorfred <fred>
Tue, 26 Mar 2002 23:24:26 +0000 (23:24 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:24:26 +0000 (23:24 +0000)
49 files changed:
buildscripts/ps-to-pfa.py
lily/align-note-column-engraver.cc
lily/axis-group-interface.cc
lily/beam-engraver.cc
lily/chord-tremolo-engraver.cc
lily/collision-engraver.cc
lily/collision.cc
lily/dynamic-engraver.cc
lily/include/beam.hh
lily/include/collision.hh
lily/include/multi-measure-rest.hh
lily/include/note-column.hh
lily/include/rest-collision.hh
lily/include/rod.hh
lily/include/score-element.hh
lily/include/script.hh
lily/include/separating-group-spanner.hh
lily/include/slur.hh
lily/include/stem.hh
lily/include/system-start-delimiter.hh
lily/include/tie-column.hh
lily/include/tie.hh
lily/instrument-name-engraver.cc
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/note-column.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rhythmic-column-engraver.cc
lily/rhythmic-head.cc
lily/score-element.cc
lily/script-engraver.cc
lily/script.cc
lily/separating-group-spanner.cc
lily/slur-engraver.cc
lily/slur.cc
lily/spacing-engraver.cc
lily/spanner.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
ly/engraver.ly

index 796c5d8b3770426b7dec2792e60d636da579fedf..ef3c94a291ba67ac1c42191d6ad56102911ca5c4 100644 (file)
@@ -21,6 +21,8 @@ from string import *
 import re
 import time
 
+logfile = sys.stdout
+
 def program_id ():
     return name + ' version ' + version;
 
@@ -58,19 +60,19 @@ for opt in options:
 
 
 def gulp_file (f):
-       sys.stderr.write ('[%s' % f)
+       logfile.write ('[%s' % f)
        try:
                i = open (f)
                i.seek (0, 2)
                n = i.tell ()
                i.seek (0,0)
        except:
-               sys.stderr.write ('can\'t open file %s\n ' % f)
+               logfile.write ('can\'t open file %s\n ' % f)
                return ''
        s = i.read (n)
-       sys.stderr.write (']')
+       logfile.write (']')
        if len (s) <= 0:
-               sys.stderr.write ('gulped empty file: %s\n'% f)
+               logfile.write ('gulped empty file: %s\n'% f)
        return s
 
 mf = files[0]
@@ -81,7 +83,7 @@ if not output_name:
     output_name  = font_name + '.pfa'
 
 
-sys.stderr.write ('Font: %s\n'% font_name)
+logfile.write ('Font: %s\n'% font_name)
 
 def header (f):
        f.write ('%!PS-AdobeFont-3.0: ' + font_name + '\n')
@@ -125,7 +127,7 @@ end                                         % of font dictionary
 suspect_re = re.compile ('closepath ((gsave )*fill( grestore stroke)*) 1 setgray newpath (.*?) closepath fill')
 
 def characters (f):
-       sys.stderr.write ('[')
+       logfile.write ('[')
        
        files = []
        import find                     # q
@@ -179,14 +181,14 @@ def characters (f):
        f.write ('end                                         % of CharProcs\n')
        f.write (encoding)
        f.write ('\n')
-       sys.stderr.write (']')
+       logfile.write (']')
 
 
 ps_file = open (output_name, 'w')
 header (ps_file)
 characters (ps_file)
 footer (ps_file)
-sys.stderr.write ('\n')
+logfile.write ('\n')
 ps_file.close ()
-sys.stderr.write ('Wrote PostScript font: %s\n' % output_name)
+logfile.write ('Wrote PostScript font: %s\n' % output_name)
 
index cbe7a931f01da1b2312ba61aaf243cc71659176b..05a51c710b0fb1b2bdca95d123838b4d7ae9d0a8 100644 (file)
@@ -22,7 +22,7 @@
 class Align_note_column_engraver: public Engraver
 {
   Item * align_item_p_;
-  Note_column * now_column_l_;
+  Score_element * now_column_l_;
   Score_element * accidental_l_;
 
   virtual void process_acknowledged ();
@@ -71,9 +71,9 @@ Align_note_column_engraver::do_removal_processing ()
 void
 Align_note_column_engraver::acknowledge_element (Score_element_info inf)
 {
-  if (Note_column * n = dynamic_cast<Note_column*> (inf.elem_l_))
+  if (Note_column::has_interface(inf.elem_l_))
     {
-      now_column_l_ =n;
+      now_column_l_ =inf.elem_l_;
     }
   else if (Local_key_item::has_interface (inf.elem_l_))
     {
index 12eac1632955ff20618b64087ab28cb7301af37e..3b144f624f1665d47b4d2ba18d7723b102c5df84 100644 (file)
@@ -125,6 +125,6 @@ Axis_group_interface::set_interface (Score_element*me)
   if (!has_interface (me))
     {
       me->set_interface (ly_symbol2scm ("axis-group-interface"));      
-      me->set_elt_property ("elements", SCM_EOL);
     }
+  me->set_elt_property ("elements", SCM_EOL);
 }
index dedbad0dd00c029c89254529ffed89b9b77fd6d7..1678dff784e836a482386ef3e6b60b5bbe13f4d9 100644 (file)
 #include "score-engraver.hh"
 #include "rest.hh"
 #include "drul-array.hh"
+#include "item.hh"
+#include "spanner.hh"
 
 class Beam_engraver : public Engraver
 {
   Drul_array<Span_req*> reqs_drul_;
 
-  Beam *finished_beam_p_;
-  Beam *beam_p_;
+  Spanner *finished_beam_p_;
+  Spanner *beam_p_;
   Span_req * prev_start_req_;
 
   Beaming_info_list * beam_info_p_;
@@ -120,8 +122,9 @@ Beam_engraver::do_process_music ()
        }
 
       prev_start_req_ = reqs_drul_[START];
-      beam_p_ = new Beam (get_property ("basicBeamProperties"));
-
+      beam_p_ = new Spanner (get_property ("basicBeamProperties"));
+      Beam::set_interface (beam_p_);
+      
       SCM smp = get_property ("measurePosition");
       Moment mp =  (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
 
@@ -143,7 +146,7 @@ Beam_engraver::typeset_beam ()
     {
       finished_beam_info_p_->beamify ();
       
-      finished_beam_p_->set_beaming (finished_beam_info_p_);
+      Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
       typeset_element (finished_beam_p_);
       delete finished_beam_info_p_;
       finished_beam_info_p_ =0;
@@ -229,7 +232,7 @@ Beam_engraver::acknowledge_element (Score_element_info info)
          Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
          beam_info_p_->add_stem (stem_location,
                                  (rhythmic_req->duration_.durlog_i_ - 2) >? 1);
-         beam_p_->add_stem (stem_l);
+         Beam::add_stem (beam_p_, stem_l);
        }
     }
 }
index d670feb130172f09bd157469b7ad8f505c36105e..87fdecbce89e1540b40204bd0454b5e6dc5af58c 100644 (file)
@@ -17,6 +17,8 @@
 #include "warn.hh"
 #include "misc.hh"
 #include "note-head.hh"
+#include "spanner.hh"
+#include "item.hh"
 
 /**
   This acknowledges repeated music with "tremolo" style.  It typesets
@@ -49,8 +51,8 @@ protected:
 
   int note_head_i_;
   
-  Beam * beam_p_;
-  Beam * finished_beam_p_;
+  Spanner * beam_p_;
+  Spanner * finished_beam_p_;
   
 protected:
   virtual void do_removal_processing();
@@ -91,7 +93,8 @@ Chord_tremolo_engraver::do_process_music ()
 {
   if (repeat_ && !beam_p_)
     {
-      beam_p_ = new Beam (get_property ("basicBeamProperties"));
+      beam_p_ = new Spanner (get_property ("basicBeamProperties"));
+      Beam::set_interface (beam_p_);
       beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
 
 
@@ -160,7 +163,7 @@ Chord_tremolo_engraver::acknowledge_element (Score_element_info info)
 
          if (Rhythmic_req* r = dynamic_cast <Rhythmic_req *> (info.req_l_))
            {
-             beam_p_->add_stem (s);
+             Beam::add_stem (beam_p_, s);
              Moment stem_location = now_mom () -
                start_mom_ + beam_start_location_;
            }
index 8816100638c886697c2e7bbe8a02debee40301a4..9b3218de78922fd0eadd0c253a7270bba2d842d3 100644 (file)
@@ -17,7 +17,7 @@
   a collision object.  */
 class Collision_engraver : public Engraver {
   Item * col_p_;
-  Link_array<Note_column> note_column_l_arr_;
+  Link_array<Score_element> note_column_l_arr_;
 
 protected:
   virtual void acknowledge_element (Score_element_info);
@@ -50,13 +50,13 @@ Collision_engraver::process_acknowledged ()
 void
 Collision_engraver::acknowledge_element (Score_element_info i)
 {
-  if (Note_column * c = dynamic_cast<Note_column *> (i.elem_l_))
+  if (Note_column::has_interface (i.elem_l_))
     {
       /*should check Y axis? */
-      if (c->rest_b () || c->parent_l(X_AXIS))
+      if (Note_column::rest_b (i.elem_l_) || i.elem_l_->parent_l(X_AXIS))
        return ;
 
-      note_column_l_arr_.push (c);
+      note_column_l_arr_.push (i.elem_l_);
     }
 }
 
index a52c13004850036456932058960b3e1a55a9c0b0..8d1f6d1232ca0fa1d63cce82821b665af6be83db 100644 (file)
@@ -14,7 +14,7 @@
 #include "item.hh"
 
 void
-Collision::add_column (Score_element*me,Note_column* ncol_l)
+Collision::add_column (Score_element*me,Score_element* ncol_l)
 {
   ncol_l->add_offset_callback (force_shift_callback, X_AXIS);
   Axis_group_interface::add_element (me, ncol_l);
@@ -77,7 +77,7 @@ Collision::do_shifts(Score_element* me)
 SCM
 Collision::automatic_shift (Score_element *me)
 {
-  Drul_array<Link_array<Note_column> > clash_groups;
+  Drul_array<Link_array<Score_element> > clash_groups;
   Drul_array<Array<int> > shifts;
   SCM  tups = SCM_EOL;
 
@@ -87,8 +87,8 @@ Collision::automatic_shift (Score_element *me)
       SCM car = gh_car (s);
 
       Score_element * se = unsmob_element (car);
-      if (Note_column * col = dynamic_cast<Note_column*> (se))
-       clash_groups[col->dir ()].push (col);
+      if (Note_column::has_interface (se))
+       clash_groups[Note_column::dir (se)].push (se);
     }
 
   
@@ -96,7 +96,7 @@ Collision::automatic_shift (Score_element *me)
   do
     {
       Array<int> & shift (shifts[d]);
-      Link_array<Note_column> & clashes (clash_groups[d]);
+      Link_array<Score_element> & clashes (clash_groups[d]);
 
       clashes.sort (Note_column::shift_compare);
 
@@ -157,15 +157,15 @@ Collision::automatic_shift (Score_element *me)
     all of them again. */
   if (extents[UP].size () && extents[DOWN].size ())
     {
-      Note_column *cu_l =clash_groups[UP][0];
-      Note_column *cd_l =clash_groups[DOWN][0];
+      Score_element *cu_l =clash_groups[UP][0];
+      Score_element *cd_l =clash_groups[DOWN][0];
 
 
       /*
        TODO.
        */
-      Score_element * nu_l= cu_l->first_head();
-      Score_element * nd_l = cd_l->first_head();
+      Score_element * nu_l= Note_column::first_head(cu_l);
+      Score_element * nd_l = Note_column::first_head(cd_l);
       
       int downpos = Note_column::head_positions_interval (cd_l)[BIGGER];
       int uppos = Note_column::head_positions_interval (cu_l)[SMALLER];      
index 967dcc188693e0561fddb4f04d501996ba4ec703..f0390d479853df753d537b69ad890d2f99005158 100644 (file)
@@ -333,12 +333,12 @@ Dynamic_engraver::typeset_all ()
 void
 Dynamic_engraver::acknowledge_element (Score_element_info i)
 {
-  if (Note_column* n = dynamic_cast<Note_column*> (i.elem_l_))
+  if (Note_column::has_interface (i.elem_l_))
     {
       if (line_spanner_)
        {
-         Side_position::add_support (line_spanner_,n);
-         add_bound_item (line_spanner_,n);
+         Side_position::add_support (line_spanner_,i.elem_l_);
+         add_bound_item (line_spanner_,dynamic_cast<Item*>(i.elem_l_));
        }
     }
 }
index dba75f20450bc798474b7311e6dbe9f35419c291..b83254e1c5346fe64056f73d812cfd91eddb9c61 100644 (file)
@@ -8,7 +8,7 @@
 #define BEAM_HH
 
 #include "lily-proto.hh"
-#include "spanner.hh"
+#include "lily-guile.hh"
 
 
 /** a beam connects multiple stems.
    damping -- amount of beam slope damping. (int)
    should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
 */
-class Beam : public Spanner
+class Beam
 {
 public:
-
-
-  int visible_stem_count () const;
-  Item* first_visible_stem () const;
-  Item* last_visible_stem () const;
+  static int visible_stem_count (Score_element*);
+  static  Item* first_visible_stem (Score_element*);
+  static  Item* last_visible_stem (Score_element*);
+  static bool has_interface (Score_element*);
+  static void set_interface (Score_element*);  
   static Real rest_collision_callback (Score_element *,Axis);
   Beam (SCM);
-  void add_stem (Score_element*);
-  void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
-  void set_beaming (Beaming_info_list *);
-  void set_stemlens ();
-  VIRTUAL_COPY_CONS(Score_element);
-
-  int get_multiplicity () const;
-
+  static void add_stem (Score_element*,Score_element*);
+  static void set_grouping (Score_element*,Rhythmic_grouping def, Rhythmic_grouping current);
+  static void set_beaming (Score_element*,Beaming_info_list *);
+  static void set_stemlens (Score_element*);
+  static int get_multiplicity (Score_element*me);
   static SCM brew_molecule (SCM);
   static SCM before_line_breaking (SCM);
   static SCM after_line_breaking (SCM);
+  static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
 
-  Molecule stem_beams (Item *here, Item *next, Item *prev) const;
 private:
-  Direction get_default_dir () const;
-  void set_stem_directions ();
-  void auto_knees ();
-  bool auto_knee (String gap_str, bool interstaff_b);
-  void set_stem_shorten ();
-  void calc_default_position_and_height (Real* y, Real* dy) const;
-  bool suspect_slope_b (Real y, Real dy) const;
-  Real calc_slope_damping_f (Real dy) const;
-  Real calc_stem_y_f (Item* s, Real y, Real dy) const;
-  Real check_stem_length_f (Real y, Real dy) const;
-  void set_stem_length (Real y, Real dy);
-  Real quantise_dy_f (Real dy) const;
-  Real quantise_y_f (Real y, Real dy, int quant_dir);
-  int forced_stem_count () const;
+  static Direction get_default_dir (Score_element*);
+  static  void set_stem_directions (Score_element*);
+  static  void auto_knees (Score_element*);
+  static  bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
+  static void set_stem_shorten (Score_element*);
+  static  void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
+  static  bool suspect_slope_b (Score_element*, Real y, Real dy);
+  static  Real calc_slope_damping_f (Score_element*, Real dy);
+  static  Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
+  static  Real check_stem_length_f (Score_element*, Real y, Real dy);
+  static  void set_stem_length (Score_element*, Real y, Real dy);
+  static   Real quantise_dy_f (Score_element*, Real dy);
+  static  Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
+  static int forced_stem_count (Score_element*);
 };
 
 #endif // BEAM_HH
index 469dfeacbd7873b8b99e16d3f558b1054a58bd15..10c5397a6eb57df8709a2b1131d966cc8643a7cf 100644 (file)
@@ -43,6 +43,6 @@ public:
   static SCM forced_shift (Score_element*);
   static Real force_shift_callback (Score_element *, Axis);
   static void do_shifts (Score_element*);
-  static void add_column (Score_element*me,Note_column*ncol_l);
+  static void add_column (Score_element*me,Score_element*ncol_l);
 };
 #endif // COLLISION_HH
index 71353da3b1b7c026e50f8360e88ab70972f905f5..4b57a9662c37ada2054729331612a3f97d2c156d 100644 (file)
 #ifndef MULTI_MEASURE_REST_HH
 #define MULTI_MEASURE_REST_HH
 
-#include "spanner.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "rod.hh"
 
-
-class Multi_measure_rest : public Spanner
+class Multi_measure_rest
 {
 public:
-  Multi_measure_rest (SCM);
-  
   static void set_interface (Score_element*);
   static bool has_interface (Score_element*);
   static SCM brew_molecule (SCM);
   static  void add_column (Score_element*,Item*);
-  VIRTUAL_COPY_CONS (Score_element);
-  virtual Array<Rod> get_rods () const;
+  static SCM set_spacing_rods (SCM);
 };
 
 #endif /* MULTI_MEASURE_REST_HH */
index 7bf51956d5144f9cd1e92810a563b3413f0eb755..855d655cd6596b2afe6de605a293781a41d8775d 100644 (file)
   UGR. Junkme.  refpoint should be the notehead, dir should come from stem.
 
 */
-class Note_column : public Item
+class Note_column
 {
 public:
-  static int shift_compare (Note_column *const &, Note_column*const&);
+  static int shift_compare (Score_element *const &, Score_element*const&);
   
   /** The relative position of the "voice" containing this
     chord. Normally this would be the same as the stem direction,
 
     JUNKME.
     */
-  Direction dir () const;
 
-
-  static Slice head_positions_interval(Score_element* me) ;
+  static Direction dir (Score_element*me);
+  static Slice head_positions_interval(Score_element* me);
   static Direction static_dir (Score_element*);
-  void translate_rests(int dy);
-  Score_element * first_head ()const;
-  Interval rest_dim ()const ;
-  Note_column (SCM);
-  void set_stem (Score_element*);
-  void set_dotcol (Score_element*);
-  void add_head (Score_element*);
-  bool rest_b () const;
-
+  static void translate_rests(Score_element*me,int dy);
+  static Score_element * first_head (Score_element*me);
+  static Interval rest_dim (Score_element*me);
+  static void set_stem (Score_element*me,Score_element*);
+  static void set_dotcol (Score_element*me,Score_element*);
+  static void add_head (Score_element*me,Score_element*);
+  static bool rest_b (Score_element*me);
   static bool has_interface (Score_element*);
-
-  Item *stem_l()const;
+  static void set_interface (Score_element*);
+  static Item *stem_l(Score_element*);
 };
 
 #endif // NOTE_COLUMN_HH
index 39a9fcd120669a3db0e45052396f858908c91cfd..79b7b8aa72876bcbbd85d77f5da2be0c1273a41b 100644 (file)
@@ -16,7 +16,7 @@
 class Rest_collision           // interface
 {
 public:
-  static void add_column (Score_element*me,Note_column*);
+  static void add_column (Score_element*me,Score_element*);
   static void set_interface (Score_element*me);
   static bool has_interface (Score_element*);
   static Real force_shift_callback (Score_element *, Axis);
index f76a4e5b0c8d50c3e18ee86e0d94bed23a3e002f..d795f539ad3b1163af9df1e1a86ea926f2846d22 100644 (file)
 #include "direction.hh"
 #include "drul-array.hh"
 
-struct Column_rod
-{
-  Paper_column *other_l_;
-  Real distance_f_;
-
-  Column_rod ();
-};
 
 
 struct Rod
index 0fd7fd077fa701e616c08266cc7b31123f7d64dd..ebd656070d6d9ee485c602eb78e87da8fcd20dba 100644 (file)
@@ -139,8 +139,6 @@ public:
 
   virtual void do_break_processing ();
   virtual Score_element *find_broken_piece (Line_of_score*) const;
-  /// generate rods & springs
-  virtual void do_space_processing ();
   virtual void discretionary_processing ();
   virtual void do_derived_mark ();
 
index b983b54716bc57f99b6a31866e76d8ddbb935971..0e4dfae387c731f9634c5e67467bbbbe40eedc58 100644 (file)
 #ifndef SCRIPT_HH
 #define SCRIPT_HH
 
-#include "item.hh"
-#include "drul-array.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /**
    Articulation marks (and the like) that are attached to notes/stems.
    Needs support from Staff_side for proper operation.  Staff_side
    handles the positioning.
 */
-class Script : public Item
+class Script
 {
 public:
-  static  Molecule get_molecule (Score_element*,Direction d);
-  Script (SCM);
+  static Molecule get_molecule (Score_element*,Direction d);
+  static void set_interface (Score_element*);
+  static bool  has_interface (Score_element*);
   static SCM brew_molecule (SCM);
   static SCM after_line_breaking (SCM);
 };
index 5c46dc3f8d4266da647d6a3b81e3565e2153bdd0..d01b6dbb5182685c930032c8f429921f006ed77a 100644 (file)
 
 #include "spanner.hh"
 
-class Separating_group_spanner : public Spanner
+class Separating_group_spanner
 {
 public:
   static void add_spacing_unit (Score_element*me, Item*);
-  Separating_group_spanner(SCM);
-protected:
-  VIRTUAL_COPY_CONS(Score_element);
-  virtual Array<Rod> get_rods () const;
+  static void set_interface (Score_element*);
+  static SCM set_spacing_rods (SCM);
 };
 
 #endif /* SEPARATING_GROUP_SPANNER_HH */
index c9f6052d5a6a4d13507fb83d3e91d8740267fd08..83d0900834b88ba1306d92a903a0d1646b6daa24 100644 (file)
@@ -7,34 +7,28 @@
 #ifndef SLUR_HH
 #define SLUR_HH
 
-#include "spanner.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 #include "rod.hh"
 
-/**
-  A #Bow# which tries to drape itself around the stems too.
- */
-class Slur : public Spanner
+class Slur
 {
 public:
-  Slur (SCM);
-  VIRTUAL_COPY_CONS(Score_element);
-
-  void add_column (Note_column*);
- static SCM brew_molecule (SCM);
-  
-  Array<Offset> get_encompass_offset_arr () const;
-  Bezier get_curve () const;
-
-  Direction get_default_dir () const;
+  static void add_column (Score_element*me,Score_element*col);
+  static SCM brew_molecule (SCM);
+  static void set_interface (Score_element*);
+  static bool  has_interface (Score_element*);
+  static Array<Offset> get_encompass_offset_arr (Score_element*me) ;
+  static Bezier get_curve (Score_element*me) ;
+  static Direction get_default_dir (Score_element*me) ;
   static SCM after_line_breaking (SCM);
-  Array<Rod> get_rods () const;
-  Offset get_attachment (Direction dir, Score_element**common) const;
-
+  static SCM set_spacing_rods (SCM);
 private:  
-  void de_uglyfy (Slur_bezier_bow* bb, Real default_height);
-  void set_extremities ();
-  void set_control_points ();
-  Offset encompass_offset (Score_element *col,Score_element**common)const;
+  static Offset get_attachment (Score_element*me,Direction dir, Score_element**common) ;
+  static void de_uglyfy (Score_element*me,Slur_bezier_bow* bb, Real default_height);
+  static void set_extremities (Score_element*me);
+  static void set_control_points (Score_element*me);
+  static Offset encompass_offset (Score_element*me,Score_element *col,Score_element**common);
 };
 
 #endif // SLUR_HH
index d3b9eb8a1e7d494ea37e832664d75749dcd74aec..8c3e6f769134ae948a2a75999012541879533032 100644 (file)
@@ -7,10 +7,8 @@
 #ifndef STEM_HH
 #define STEM_HH
 
-#include "item.hh"
-#include "array.hh"
-#include "moment.hh"
-#include "molecule.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
 #include "stem-info.hh"
 
 /**the rule attached to the ball.
 
   /// how many abbrev beam don't reach stem?
   int beam_gap_i_;
-
-
   
   */
-class Stem : public Item
+class Stem 
 {
 public:
   static SCM brew_molecule (SCM);
 
   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
   static  int flag_i (Score_element*) ;
-
   static int beam_count (Score_element*,Direction) ;
   static void set_beaming (Score_element*,int,  Direction d);
   /** 
       don't print flag when in beam.
       our beam, for aligning abbrev flags
   */
-  static Beam * beam_l (Score_element*);
+  static Score_element * beam_l (Score_element*);
   static Score_element * first_head (Score_element*) ;
   static Drul_array<Score_element*> extremal_heads (Score_element*);
-
   static Score_element * support_head (Score_element*) ;
-  Stem (SCM);
-
+  
   /// ensure that this Stem also encompasses the Notehead #n#
   static void add_head (Score_element*me, Score_element*n);
-
   static Stem_info calc_stem_info (Score_element *) ;
-
   static Real chord_start_f (Score_element *) ;
   static Direction get_direction (Score_element*) ;
   static int type_i (Score_element *) ;
@@ -73,13 +64,10 @@ public:
   static Direction get_default_dir(Score_element *) ;
   static int get_center_distance(Score_element *,Direction) ;
   static int heads_i (Score_element *) ;
-
   static bool invisible_b(Score_element *) ;
  
   /// heads that the stem encompasses (positions)
   static Interval head_positions(Score_element *) ;
-
-
   static Real get_default_stem_end_position (Score_element*me) ;
   static void position_noteheads(Score_element*);
   static Real stem_end_position (Score_element*) ;
index b5c500c6f70ef809cea94fdda28cd0e883a4a0e2..121713d9e6328d5820b3c5e45b1d01cdc270f815 100644 (file)
 #ifndef SYSTEM_START_DELIMITER_HH
 #define SYSTEM_START_DELIMITER_HH
 
-#include "spanner.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /*
   Braces/brackets across staffs.
  */
-class System_start_delimiter : public Spanner
+class System_start_delimiter
 {
 public:
-  System_start_delimiter (SCM);
   static SCM brew_molecule (SCM);
   
-  VIRTUAL_COPY_CONS (Score_element);
-
+  static void set_interface (Score_element*me);
+  static bool has_interface (Score_element*);
   static SCM after_line_breaking (SCM);
   static void try_collapse (Score_element*);
-  
-  Molecule staff_bracket (Real) const;
-  Molecule staff_brace (Real) const;
-  Molecule simple_bar (Real) const;
+  static Molecule staff_bracket (Score_element*,Real) ;
+  static Molecule staff_brace (Score_element*,Real) ;
+  static Molecule simple_bar (Score_element*,Real) ;
 };
 
 #endif /* SYSTEM_START_DELIMITER_HH */
index bbee8fede5287c4027df346da56255b9b096a753..8dfab669bda63ac0921237636b1a5542eb86111e 100644 (file)
 #ifndef TIE_COLUMN_HH
 #define TIE_COLUMN_HH
 
-#include "spanner.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
 
-class Tie_column : public Spanner
+class Tie_column
 {
 public:
-  Tie_column (SCM s);
-  VIRTUAL_COPY_CONS (Score_element);
   static void set_interface (Score_element*me);
   static bool has_interface (Score_element*);
   static void add_tie (Score_element*me,Tie*);
-
   static SCM after_line_breaking (SCM);
   static void set_directions (Score_element*me);
 };
index ea1f5f97f3237929198aa6d6cbaef3ba735b2b7e..422a9fa375b33162a944323a4da3e4ed812f135d 100644 (file)
@@ -38,7 +38,7 @@ public:
   Bezier get_curve () const;
   Drul_array<Real> dy_f_drul_;
   Drul_array<Real> dx_f_drul_;
-  virtual Array<Rod> get_rods () const;
+  static SCM set_spacing_rods (SCM);
   Array<Offset> get_controls () const;
 };
 
index 910a8f8ef5531286bbf1d8f6eef95d0a5cecb87f..8b65565b943c539794d8f881ad93be02c68814c4 100644 (file)
@@ -17,7 +17,7 @@
 class Instrument_name_engraver : public Engraver
 {
   Item *text_;
-  System_start_delimiter * delim_ ;
+  Spanner * delim_ ;
 
   void create_text (SCM s);
 public:
@@ -84,10 +84,10 @@ Instrument_name_engraver::acknowledge_element (Score_element_info i)
        }
     }
 
-  if (dynamic_cast <System_start_delimiter*> (i.elem_l_)
+  if (System_start_delimiter::has_interface (i.elem_l_)
       && i.origin_trans_l_->daddy_trans_l_ == daddy_trans_l_)
     {
-      delim_ = dynamic_cast<System_start_delimiter*> (i.elem_l_);
+      delim_ = dynamic_cast<Spanner*> (i.elem_l_);
     }
 }
 
index 84d5061e7f32646692abfb949562bbc9dc91642c..6a5d06ed7d975d7cc47188bf62f9b07f7ac5b7c2 100644 (file)
@@ -111,7 +111,8 @@ Multi_measure_rest_engraver::do_process_music ()
 
   if (busy_span_req_l_ && !mmrest_p_)
     {
-      mmrest_p_ = new Multi_measure_rest (get_property ("basicMultiMeasureRestProperties"));
+      mmrest_p_ = new Spanner (get_property ("basicMultiMeasureRestProperties"));
+
       Multi_measure_rest::set_interface (mmrest_p_);
       Staff_symbol_referencer::set_interface (mmrest_p_);
 
index 6d95336d3ac1f81fb812f4b1a368e0841992acee..ba2e2cbc243e25d97b6d4eb4443c6fef3aafca2a 100644 (file)
 #include "debug.hh"
 #include "paper-def.hh"
 #include "paper-column.hh" // urg
-#include "bar.hh"
 #include "lookup.hh"
 #include "rest.hh"
 #include "molecule.hh"
 #include "misc.hh"
 #include "group-interface.hh"
-#include "stem.hh"
+#include "spanner.hh"
 #include "staff-symbol-referencer.hh"
+
 void
 Multi_measure_rest::set_interface (Score_element*me)
 {
   me->set_elt_property ("columns", SCM_EOL);
 }
 
-Multi_measure_rest::Multi_measure_rest (SCM s)
-  : Spanner(s)
-{}
-
 /*
    [TODO]                                      17
  * variable-sized multi-measure rest symbol: |====| ??
@@ -151,19 +147,22 @@ Multi_measure_rest::add_column (Score_element*me,Item* c)
 }
 
 
-Array<Rod>
-Multi_measure_rest::get_rods () const
+MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods);
+
+SCM
+Multi_measure_rest::set_spacing_rods (SCM smob)
 {
-  Array<Rod> a;
+  Score_element*me = unsmob_element (smob);
 
-  if (!(get_bound (LEFT) && get_bound (RIGHT)))
+  Spanner*sp = dynamic_cast<Spanner*> (me);
+  if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
     {
       programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
-      return a;
+      return SCM_UNDEFINED;
     }
 
-  Item * l = get_bound (LEFT)->column_l ();
-  Item * r = get_bound (RIGHT)->column_l ();
+  Item * l = sp->get_bound (LEFT)->column_l ();
+  Item * r = sp->get_bound (RIGHT)->column_l ();
   Item * lb = l->find_prebroken_piece (RIGHT);
   Item * rb = r->find_prebroken_piece (LEFT);      
   
@@ -184,11 +183,10 @@ Multi_measure_rest::get_rods () const
          should do something more advanced.
         */
       rod.distance_f_ = l->extent (X_AXIS)[BIGGER] - r->extent (X_AXIS)[SMALLER]
-       + paper_l ()->get_var ("multi_measure_rest_x_minimum");
+       + me->paper_l ()->get_var ("multi_measure_rest_x_minimum");
   
-      a.push (rod);
+      rod.add_to_cols ();
     }
-  
-  return a;
+  return SCM_UNDEFINED;
 }
 
index 7616a119b559a2687129fe698b6f1887a630f1bd..473c0146636dbcff21dd5d5e5c27df7ffa40b342 100644 (file)
 #include "note-head.hh"
 
 bool
-Note_column::rest_b () const
+Note_column::rest_b (Score_element*me) 
 {
-  return unsmob_element (get_elt_property ("rest"));
+  return unsmob_element (me->get_elt_property ("rest"));
 }
 
 int
-Note_column::shift_compare (Note_column *const &p1, Note_column*const&p2)
+Note_column::shift_compare (Score_element *const &p1, Score_element *const&p2)
 {
   SCM s1 = p1->get_elt_property ("horizontal-shift");
   SCM s2 = p2->get_elt_property ("horizontal-shift");
@@ -34,10 +34,9 @@ Note_column::shift_compare (Note_column *const &p1, Note_column*const&p2)
   return h1 - h2;
 }
 
-Note_column::Note_column( SCM s)
-  : Item (s)
+void
+Note_column::set_interface (Score_element* me)
 {
-  Score_element* me = this;
   me->set_elt_property ("note-heads", SCM_EOL);  
   me->set_interface (ly_symbol2scm ("note-column-interface"));
   
@@ -46,12 +45,11 @@ Note_column::Note_column( SCM s)
 }
 
 Item *
-Note_column::stem_l () const
+Note_column::stem_l (Score_element*me) 
 {
-  SCM s = get_elt_property ("stem");
+  SCM s = me->get_elt_property ("stem");
   return  dynamic_cast<Item*>(unsmob_element (s));
 }
-
   
 Slice
 Note_column::head_positions_interval(Score_element *me)
@@ -72,7 +70,7 @@ Note_column::head_positions_interval(Score_element *me)
 }
 
 Direction
-Note_column::static_dir (Score_element*  me)
+Note_column::dir (Score_element*  me)
 {
   Score_element *stem = unsmob_element (me->get_elt_property ("stem"));
   if (stem && Stem::has_interface (stem))
@@ -85,43 +83,36 @@ Note_column::static_dir (Score_element*  me)
 }
 
 
-Direction
-Note_column::dir () const
-{
-  return static_dir ((Score_element*) this);
-}
-
 void
-Note_column::set_stem (Score_element * stem_l)
+Note_column::set_stem (Score_element*me,Score_element * stem_l)
 {
-  set_elt_property ("stem", stem_l->self_scm_);
-
-  add_dependency (stem_l);
-  Axis_group_interface::add_element (this, stem_l);
+  me->set_elt_property ("stem", stem_l->self_scm_);
+  me->add_dependency (stem_l);
+  Axis_group_interface::add_element (me, stem_l);
 }
 
 void
-Note_column::add_head (Score_element *h)
+Note_column::add_head (Score_element*me,Score_element *h)
 {
   if (Rest::has_interface (h))
     {
-      this->set_elt_property ("rest", h->self_scm_);
+      me->set_elt_property ("rest", h->self_scm_);
     }
   else if (Note_head::has_interface (h))
     {
-      Pointer_group_interface gi (this, "note-heads");
+      Pointer_group_interface gi (me, "note-heads");
       gi.add_element (h);
     }
-  Axis_group_interface::add_element (this, h);
+  Axis_group_interface::add_element (me, h);
 }
 
 /**
   translate the rest symbols vertically by amount DY_I.
  */
 void
-Note_column::translate_rests (int dy_i)
+Note_column::translate_rests (Score_element*me,int dy_i)
 {
-  Score_element * r = unsmob_element (get_elt_property ("rest"));
+  Score_element * r = unsmob_element (me->get_elt_property ("rest"));
   if (r)
     {
       r->translate_axis (dy_i * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
@@ -130,24 +121,24 @@ Note_column::translate_rests (int dy_i)
 
 
 void
-Note_column::set_dotcol (Score_element *d)
+Note_column::set_dotcol (Score_element*me,Score_element *d)
 {
-  Axis_group_interface::add_element (this, d);
+  Axis_group_interface::add_element (me, d);
 }
 
 
 
 Interval
-Note_column::rest_dim () const
+Note_column::rest_dim (Score_element*me) 
 {
-  Score_element * r = unsmob_element (get_elt_property ("rest"));
+  Score_element * r = unsmob_element (me->get_elt_property ("rest"));
   return r->extent (Y_AXIS);
 }
 
 Score_element*
-Note_column::first_head () const
+Note_column::first_head (Score_element*me) 
 {
-  Score_element * st = stem_l ();
+  Score_element * st = stem_l (me);
   return st?  Stem::first_head (st): 0; 
 }
 
index fc310aef059fcb8b2e016bc245a3415485c62945..e748b88c012a6421a7c939d0b8ed1038fa0feecc 100644 (file)
@@ -16,7 +16,7 @@ class Rest_collision_engraver : public Engraver
 {
   Item* rest_collision_p_;
 
-  Link_array<Note_column> note_column_l_arr_;
+  Link_array<Score_element> note_column_l_arr_;
 protected:
   virtual void acknowledge_element (Score_element_info);
   virtual void process_acknowledged ();
@@ -50,8 +50,8 @@ Rest_collision_engraver::process_acknowledged ()
 void
 Rest_collision_engraver::acknowledge_element (Score_element_info i)
 {
-  if (dynamic_cast<Note_column *> (i.elem_l_))
-    note_column_l_arr_.push (dynamic_cast<Note_column *> (i.elem_l_));
+  if (Note_column::has_interface (i.elem_l_))
+    note_column_l_arr_.push (i.elem_l_);
 }
 
 void
index 7a26dee1a984cfa2bd0bf97cea38a0d184bfd58a..9d86cbb81bbb5ceb96a92ecd298b2bbb2cba35f7 100644 (file)
@@ -41,7 +41,7 @@ Rest_collision::force_shift_callback (Score_element *them, Axis a)
 }
 
 void
-Rest_collision::add_column (Score_element*me,Note_column *p)
+Rest_collision::add_column (Score_element*me,Score_element *p)
 {
   me->add_dependency (p);
   Pointer_group_interface gi (me);  
@@ -72,16 +72,16 @@ Rest_collision::do_shift (Score_element *me, SCM elts)
   /*
     ugh. -> score  elt type
    */
-  Link_array<Note_column> rests;
-  Link_array<Note_column> notes;
+  Link_array<Score_element> rests;
+  Link_array<Score_element> notes;
 
   for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
     {
       Score_element * e = unsmob_element (gh_car (s));
       if (e && unsmob_element (e->get_elt_property ("rest")))
-       rests.push (dynamic_cast<Note_column*> (e));
+       rests.push (e);
       else
-       notes.push (dynamic_cast<Note_column*> (e));
+       notes.push (e);
     }
 
   
@@ -147,8 +147,8 @@ Rest_collision::do_shift (Score_element *me, SCM elts)
       int dy = display_count > 2 ? 6 : 4;
       if (display_count > 1)
        {
-         rests[0]->translate_rests (dy);       
-         rests[1]->translate_rests (-dy);
+         Note_column::translate_rests (rests[0],dy);   
+         Note_column::translate_rests (rests[1], -dy);
        }
     }
   // meisjes met jongetjes
@@ -162,12 +162,12 @@ Rest_collision::do_shift (Score_element *me, SCM elts)
        {
          warning (_("too many notes for rest collision"));
        }
-      Note_column * rcol = rests[0];
+      Score_element * rcol = rests[0];
 
       // try to be opposite of noteheads. 
-      Direction dir = - notes[0]->dir();
+      Direction dir = - Note_column::dir (notes[0]);
 
-      Interval restdim = rcol->rest_dim ();
+      Interval restdim = Note_column::rest_dim (rcol);
       if (restdim.empty_b ())
        return SCM_UNDEFINED;
       
@@ -208,7 +208,7 @@ Rest_collision::do_shift (Score_element *me, SCM elts)
       if (discrete_dist < stafflines+1)
        discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0);
       
-      rcol->translate_rests (dir * discrete_dist);
+      Note_column::translate_rests (rcol,dir * discrete_dist);
     }
   return SCM_UNDEFINED;
 }
index b83520535c0df17892c9450a1201c8232c63a739..82c02d9a4a7bced7fbf3f9f6be01cff20a1dad53 100644 (file)
@@ -19,9 +19,9 @@
 class Rhythmic_column_engraver :public Engraver
 {
   Link_array<Score_element> rhead_l_arr_;
-  Link_array<Slur> grace_slur_endings_;
+  Link_array<Score_element> grace_slur_endings_;
   Score_element * stem_l_;
-  Note_column *ncol_p_;
+  Score_element *ncol_p_;
   Score_element *dotcol_l_;
 
 protected:
@@ -52,14 +52,15 @@ Rhythmic_column_engraver::process_acknowledged ()
     {
       if (!ncol_p_)
        {
-         ncol_p_ = new Note_column (get_property("basicNoteColumnProperties"));
+         ncol_p_ = new Item (get_property("basicNoteColumnProperties"));
+         Note_column::set_interface (ncol_p_);
          announce_element (Score_element_info (ncol_p_, 0));
        }
 
       for (int i=0; i < rhead_l_arr_.size (); i++)
        {
          if (!rhead_l_arr_[i]->parent_l(X_AXIS))
-           ncol_p_->add_head (rhead_l_arr_[i]);
+           Note_column::add_head (ncol_p_, rhead_l_arr_[i]);
        }
       rhead_l_arr_.set_size (0);
     }
@@ -70,13 +71,13 @@ Rhythmic_column_engraver::process_acknowledged ()
       if (dotcol_l_
          && !dotcol_l_->parent_l (X_AXIS))
        {
-         ncol_p_->set_dotcol (dotcol_l_);
+         Note_column::set_dotcol (ncol_p_, dotcol_l_);
        }
 
       if (stem_l_
          && !stem_l_->parent_l(X_AXIS))
        {
-         ncol_p_->set_stem (stem_l_);
+         Note_column::set_stem (ncol_p_, stem_l_);
          stem_l_ = 0;
        }
 
@@ -85,7 +86,7 @@ Rhythmic_column_engraver::process_acknowledged ()
 
       if (!wegrace)
        for (int i=0; i < grace_slur_endings_.size(); i++)
-         grace_slur_endings_[i]->add_column (ncol_p_);
+         Slur::add_column (grace_slur_endings_[i], ncol_p_);
       grace_slur_endings_.clear ();
     }
 }
@@ -96,7 +97,7 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
   SCM wg = get_property ("weAreGraceContext");
   bool wegrace = to_boolean (wg);
   if (wegrace != to_boolean (i.elem_l_->get_elt_property ("grace"))
-    && !dynamic_cast<Slur*> (i.elem_l_))
+    && !Slur::has_interface (i.elem_l_))
     return ;
   
   Item * item =  dynamic_cast <Item *> (i.elem_l_);
@@ -112,14 +113,14 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
     {
       dotcol_l_ = item;
     }
-  else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
+  else if (Slur::has_interface (i.elem_l_))
     {
       /*
        end slurs starting on grace notes
        */
       
-      if (to_boolean (s->get_elt_property ("grace")))
-       grace_slur_endings_.push (s);
+      if (to_boolean (i.elem_l_->get_elt_property ("grace")))
+       grace_slur_endings_.push (i.elem_l_);
    }
 }
 
index 9c8cb00b501f354aa2bff6b427c8cb9380d331fd..63006674fce24236e9fbea65d6eca5ddb9d51984 100644 (file)
@@ -16,6 +16,7 @@
 #include "paper-score.hh"
 #include "stem.hh"
 #include "staff-symbol-referencer.hh"
+#include "item.hh"
 
 
 Item*
index 5b17ffbbd394104dc31ea29d6fada6f68f35b5c2..47ca5c9eea8f0659b090a9a8bbb520ad539630af 100644 (file)
@@ -265,10 +265,6 @@ Score_element::do_break_processing()
 {
 }
 
-void
-Score_element::do_space_processing ()
-{
-}
 
 void
 Score_element::do_add_processing()
index 2f433d9d3776169796b765f3ee00298d1caa27d0..effd5b7123394ddb841d0f43245ba9102d21a44c 100644 (file)
 #include "musical-request.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
-
-
 #include "engraver.hh"
 
 class Script_engraver : public Engraver {
-  Link_array<Script> script_p_arr_;
+  Link_array<Score_element> script_p_arr_;
   Link_array<Articulation_req> script_req_l_arr_;
 
 public:
@@ -69,7 +67,8 @@ Script_engraver::do_process_music()
          continue;
        }
       // todo -> use result of articulation-to-scriptdef directly as basic prop list.
-      Script *p =new Script (get_property ("basicScriptProperties"));
+      Score_element *p =new Item (get_property ("basicScriptProperties"));
+      Script::set_interface (p);
 
       p->add_offset_callback (Side_position::centered_on_parent, X_AXIS);
       
@@ -157,8 +156,8 @@ Script_engraver::do_pre_move_processing()
 {
   for (int i=0; i < script_p_arr_.size(); i++) 
     {
-      Script * sc = script_p_arr_[i];
-      if (to_boolean (sc->remove_elt_property ("staff-support")))
+      Score_element * sc = script_p_arr_[i];
+      if (to_boolean (sc->get_elt_property ("staff-support")))
        {
          Side_position::add_staff_support (sc);
        }
index c4dcc30cd401cfe2c03a4122d1bc03dfb17dd15e..c4b3e004dee3489bf0da50f3b7a37320598e612e 100644 (file)
 #include "lookup.hh"
 #include "side-position-interface.hh"
 #include "paper-def.hh"
-
-
-Script ::Script (SCM s)
-  : Item (s)
-{
-}
+#include "item.hh"
 
 Molecule
 Script::get_molecule(Score_element * me, Direction d)
@@ -41,8 +36,6 @@ Script::get_molecule(Score_element * me, Direction d)
   return Molecule ();
 }
 
-
-
 MAKE_SCHEME_CALLBACK(Script,after_line_breaking);
 SCM
 Script::after_line_breaking (SCM smob)
@@ -55,7 +48,6 @@ Script::after_line_breaking (SCM smob)
   return SCM_UNDEFINED;
 }
 
-
 MAKE_SCHEME_CALLBACK(Script,brew_molecule);
 
 SCM
@@ -70,5 +62,14 @@ Script::brew_molecule (SCM smob)
   return get_molecule (me, dir).create_scheme();
 }
 
+bool
+Script::has_interface (Score_element*me)
+{
+  return me->has_interface ("script-interface");
+}
 
-
+void
+Script::set_interface (Score_element*me)
+{
+  return me->set_interface ("script-interface");
+}
index 6b5c2302a82d96992e443e587bb8022ab18e2345..cc6f70c219ac5450617da42981eb1e009d08677b 100644 (file)
@@ -14,8 +14,8 @@
 #include "dimensions.hh"
 #include "group-interface.hh"
 
-static Rod
-make_rod (Item *l, Item *r)
+static void
+do_rod (Item *l, Item *r)
 {
   Rod rod;
 
@@ -31,16 +31,16 @@ make_rod (Item *l, Item *r)
     rod.distance_f_ = li[RIGHT] - ri[LEFT];
 
   rod.columnize ();
-  return rod;
+  rod.add_to_cols ();
 }
   
-
-Array<Rod>
-Separating_group_spanner::get_rods () const
+MAKE_SCHEME_CALLBACK(Separating_group_spanner,set_spacing_rods);
+SCM
+Separating_group_spanner::set_spacing_rods (SCM smob)
 {
-  Array<Rod> a;
+  Score_element*me = unsmob_element (smob);
   
-  for (SCM s = get_elt_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
+  for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
     {
       /*
        Order of elements is reversed!
@@ -60,29 +60,28 @@ Separating_group_spanner::get_rods () const
       Item *rb
        = dynamic_cast<Item*>(r->find_prebroken_piece (LEFT));
       
-      a.push (make_rod(l,  r));
+      do_rod(l,  r);
       if (lb)
        {
-         Rod rod(make_rod (lb, r));
-         a.push (rod);
+         do_rod (lb, r);
        }
       
       if (rb)
        {
-         a.push (make_rod (l, rb));
+         do_rod (l, rb);
        }
       
       if (lb && rb)
        {
-         Rod rod(make_rod (lb, rb));
-         a.push (rod);
+         do_rod (lb, rb);
+
        }
     }
 
   /*
     We've done our job, so we get lost. 
    */
-  for (SCM s = get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
     {
       Item * it =dynamic_cast<Item*>(unsmob_element (gh_car (s)));
       if (it && it->broken_b ())
@@ -92,10 +91,8 @@ Separating_group_spanner::get_rods () const
        }
       it->suicide ();
     }
-  
-  ((Separating_group_spanner *)this)->suicide ();
-  
-  return a;
+  me->suicide ();
+  return SCM_UNDEFINED ;
 }
 
 void
@@ -106,8 +103,8 @@ Separating_group_spanner::add_spacing_unit (Score_element* me ,Item*i)
 }
 
 
-Separating_group_spanner::Separating_group_spanner (SCM s)
-  : Spanner (s)  
+void
+Separating_group_spanner::set_interface (Score_element*me)
 {
-  set_elt_property ("elements", SCM_EOL);
+  me->set_elt_property ("elements", SCM_EOL);
 }
index 7987187335586ec8c050ca8b8301939f5808d101..8cd767edcd94f619e5e3a0e00148aff526a4c0c3 100644 (file)
 #include "note-column.hh"
 #include "translator-group.hh"
 #include "engraver.hh"
+#include "spanner.hh"
 
 class Slur_engraver :public Engraver {
   Link_array<Span_req> requests_arr_;
   Link_array<Span_req> new_slur_req_l_arr_;
-  Link_array<Slur> slur_l_stack_;
-  Link_array<Slur> end_slur_l_arr_;
+  Link_array<Score_element> slur_l_stack_;
+  Link_array<Score_element> end_slur_l_arr_;
 
   void set_melisma (bool);
 protected:
@@ -56,13 +57,13 @@ Slur_engraver::set_melisma (bool m)
 void
 Slur_engraver::acknowledge_element (Score_element_info info)
 {
-  if (dynamic_cast<Note_column *> (info.elem_l_))
+  if (Note_column::has_interface (info.elem_l_))
     {
-      Note_column *col_l =dynamic_cast<Note_column *> (info.elem_l_) ;// ugh
+      Score_element *e =info.elem_l_;
       for (int i = 0; i < slur_l_stack_.size (); i++)
-       slur_l_stack_[i]->add_column (col_l);
+       Slur::add_column (slur_l_stack_[i], e);
       for (int i = 0; i < end_slur_l_arr_.size (); i++)
-       end_slur_l_arr_[i]->add_column (col_l);
+       Slur::add_column (end_slur_l_arr_[i], e);
     }
 }
 
@@ -86,7 +87,7 @@ Slur_engraver::do_removal_processing ()
 void
 Slur_engraver::do_process_music ()
 {
-  Array<Slur*> start_slur_l_arr_;
+  Link_array<Score_element> start_slur_l_arr_;
   for (int i=0; i< new_slur_req_l_arr_.size (); i++)
     {
       Span_req* slur_req_l = new_slur_req_l_arr_[i];
@@ -98,7 +99,7 @@ Slur_engraver::do_process_music ()
            slur_req_l->warning (_f ("can't find both ends of %s", _ ("slur")));
          else
            {
-             Slur* slur = slur_l_stack_.pop ();
+             Score_element* slur = slur_l_stack_.pop ();
              SCM s = get_property ("slurEndAttachment");
              if (gh_symbol_p (s))
                {
@@ -112,7 +113,8 @@ Slur_engraver::do_process_music ()
        {
          // push a new slur onto stack.
          // (use temp. array to wait for all slur STOPs)
-         Slur* slur = new Slur (get_property ("basicSlurProperties"));
+         Score_element* slur = new Spanner (get_property ("basicSlurProperties"));
+         Slur::set_interface (slur);
          SCM s = get_property ("slurBeginAttachment");
          if (gh_symbol_p (s))
            {
index 5b702323bd3e72460db1da68378b5aa0ad4885cf..9b751ab6e87f75268f45b611d30e9ce2ad31cd23 100644 (file)
 #include "main.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
+#include "spanner.hh"
 
-Slur::Slur (SCM s)
-  : Spanner (s)
+
+void
+Slur::set_interface (Score_element*me)
 {
-  set_elt_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
-  set_elt_property ("note-columns", SCM_EOL);
-  set_elt_property ("control-points", SCM_EOL);
+  me-> set_elt_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
+  me->set_elt_property ("note-columns", SCM_EOL);
+  me->set_elt_property ("control-points", SCM_EOL);
+  me->set_interface (ly_symbol2scm ("slur-interface"));
 }
 
 void
-Slur::add_column (Note_column*n)
+Slur::add_column (Score_element*me, Score_element*n)
 {
   if (!gh_pair_p (n->get_elt_property ("note-heads")))
     warning (_ ("Putting slur over rest.  Ignoring."));
   else
     {
-      Pointer_group_interface (this, "note-columns").add_element (n);
-      add_dependency (n);
+      Pointer_group_interface (me, "note-columns").add_element (n);
+      me->add_dependency (n);
     }
 
-  add_bound_item (this, n);
+  add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*>(n));
 }
 
 void
-Slur::de_uglyfy (Slur_bezier_bow* bb, Real default_height)
+Slur::de_uglyfy (Score_element*me, Slur_bezier_bow* bb, Real default_height)
 {
   Real length = bb->curve_.control_[3][X_AXIS] ; 
   Real ff = bb->fit_factor ();
@@ -66,9 +69,9 @@ Slur::de_uglyfy (Slur_bezier_bow* bb, Real default_height)
       Real h = bb->curve_.control_[i][Y_AXIS] * ff / length;
 
       Real f = default_height / length;
-      Real c1 = paper_l ()->get_var ("bezier_control1");
-      Real c2 = paper_l ()->get_var ("bezier_control2");
-      Real c3 = paper_l ()->get_var ("bezier_control3");
+      Real c1 = me->paper_l ()->get_var ("bezier_control1");
+      Real c2 = me->paper_l ()->get_var ("bezier_control2");
+      Real c3 = me->paper_l ()->get_var ("bezier_control3");
       if (h > c1 * f)
        {
          h = c1 * f; 
@@ -85,15 +88,15 @@ Slur::de_uglyfy (Slur_bezier_bow* bb, Real default_height)
 }
 
 Direction
-Slur::get_default_dir () const
+Slur::get_default_dir (Score_element*me) 
 {
-  Link_array<Note_column> encompass_arr =
-    Pointer_group_interface__extract_elements (this, (Note_column*)0, "note-columns");
+  Link_array<Score_element> encompass_arr =
+    Pointer_group_interface__extract_elements (me, (Score_element*)0, "note-columns");
   
   Direction d = DOWN;
   for (int i=0; i < encompass_arr.size (); i ++) 
     {
-      if (encompass_arr[i]->dir () < 0) 
+      if (Note_column::dir (encompass_arr[i]) < 0) 
        {
          d = UP;
          break;
@@ -107,13 +110,14 @@ Slur::get_default_dir () const
 
 
 Offset
-Slur::encompass_offset (Score_element* col,
-                       Score_element **common) const
+Slur::encompass_offset (Score_element*me,
+                       Score_element* col,
+                       Score_element **common) 
 {
   Offset o;
   Score_element* stem_l = unsmob_element (col->get_elt_property ("stem"));
   
-  Direction dir = Directional_element_interface (this).get ();
+  Direction dir = Directional_element_interface (me).get ();
   
   if (!stem_l)
     {
@@ -144,7 +148,7 @@ Slur::encompass_offset (Score_element* col,
   /*
    leave a gap: slur mustn't touch head/stem
    */
-  o[Y_AXIS] += dir * paper_l ()->get_var ("slur_y_free");
+  o[Y_AXIS] += dir * me->paper_l ()->get_var ("slur_y_free");
   return o;
 }
 
@@ -154,33 +158,32 @@ SCM
 Slur::after_line_breaking (SCM smob)
 {
   Score_element *me = unsmob_element (smob);
-  Slur * sl = dynamic_cast<Slur*>(me);
-  sl->set_extremities ();
-  sl->set_control_points ();
+  set_extremities (me);
+  set_control_points (me);
   return SCM_UNDEFINED;
 } 
 
 void
-Slur::set_extremities ()
+Slur::set_extremities (Score_element*me)
 {
-  if (!Directional_element_interface (this).get ())
-    Directional_element_interface (this).set (get_default_dir ());
+  if (!Directional_element_interface (me).get ())
+    Directional_element_interface (me).set (get_default_dir (me));
 
   Direction dir = LEFT;
   do 
     {
-      if (!gh_symbol_p (index_cell (get_elt_property ("attachment"), dir)))
+      if (!gh_symbol_p (index_cell (me->get_elt_property ("attachment"), dir)))
        {
          
          // for (SCM s = get_elt_property ("slur-extremity-rules"); s != SCM_EOL; s = gh_cdr (s))
          for (SCM s = scm_eval (ly_symbol2scm ("slur-extremity-rules"));
               s != SCM_EOL; s = gh_cdr (s))
            {
-             SCM r = gh_call2 (gh_caar (s), this->self_scm_,
+             SCM r = gh_call2 (gh_caar (s), me->self_scm_,
                                 gh_int2scm ((int)dir));
              if (r != SCM_BOOL_F)
                {
-                 index_set_cell (get_elt_property ("attachment"), dir,
+                 index_set_cell (me->get_elt_property ("attachment"), dir,
                                  gh_cdar (s));
                  break;
                }
@@ -191,22 +194,24 @@ Slur::set_extremities ()
 }
 
 Offset
-Slur::get_attachment (Direction dir,
-                     Score_element **common) const
+Slur::get_attachment (Score_element*me,Direction dir,
+                     Score_element **common) 
 {
-  SCM s = get_elt_property ("attachment");
+  Spanner*sp = dynamic_cast<Spanner*>(me);
+  SCM s = me->get_elt_property ("attachment");
   SCM a = dir == LEFT ? gh_car (s) : gh_cdr (s);
   String str = ly_symbol2string (a);
-  Real ss = Staff_symbol_referencer::staff_space ((Score_element*)this);
+  Real ss = Staff_symbol_referencer::staff_space ((Score_element*)me);
   Real hs = ss / 2.0;
   Offset o;
 
-  
-  if (Note_column* n = dynamic_cast<Note_column*> (get_bound (dir)))
+
+  if (Note_column::has_interface (sp->get_bound (dir)))
     {
-      if (n->stem_l ())
+      Score_element * n =sp->get_bound (dir);
+      if (Score_element*st = Note_column::stem_l (n))
        {
-         Score_element*st = n->stem_l();
+
          if (str == "head")
            {
              o = Offset (0, Stem::chord_start_f (st ));
@@ -214,7 +219,7 @@ Slur::get_attachment (Direction dir,
                Default position is centered in X, on outer side of head Y
               */
              o += Offset (0.5 * n->extent (X_AXIS).length (),
-                          0.5 * ss * Directional_element_interface (this).get ());
+                          0.5 * ss * Directional_element_interface (me).get ());
            }
          else if (str == "alongside-stem")
            {
@@ -224,7 +229,7 @@ Slur::get_attachment (Direction dir,
               */
              o += Offset (n->extent (X_AXIS).length ()
                           * (1 + Stem::get_direction (st )),
-                          0.5 * ss * Directional_element_interface (this).get ());
+                          0.5 * ss * Directional_element_interface (me).get ());
            }
          else if (str == "stem")
            {
@@ -243,7 +248,7 @@ Slur::get_attachment (Direction dir,
              SCM other_a = dir == LEFT ? gh_cdr (s) : gh_car (s);
              if (ly_symbol2string (other_a) != "loose-end")
                {
-                 o = Offset (0, get_attachment (-dir, common)[Y_AXIS]);
+                 o = Offset (0, get_attachment (me, -dir, common)[Y_AXIS]);
                }
            }
 
@@ -251,7 +256,7 @@ Slur::get_attachment (Direction dir,
          SCM l = scm_assoc
            (scm_listify (a,
                          gh_int2scm (Stem::get_direction (st ) * dir),
-                         gh_int2scm (Directional_element_interface (this).get () * dir),
+                         gh_int2scm (Directional_element_interface (me).get () * dir),
                          SCM_UNDEFINED),
             scm_eval (ly_symbol2scm ("slur-extremity-offset-alist")));
          
@@ -267,24 +272,25 @@ Slur::get_attachment (Direction dir,
     What if get_bound () is not a note-column?
    */
   if (str != "loose-end"
-      && get_bound (dir)->common_refpoint (common[Y_AXIS], Y_AXIS) == common[Y_AXIS])
+      && sp->get_bound (dir)->common_refpoint (common[Y_AXIS], Y_AXIS) == common[Y_AXIS])
     {      
-      o[Y_AXIS] += get_bound (dir)->relative_coordinate (common[Y_AXIS], Y_AXIS) 
-       - relative_coordinate (common[Y_AXIS], Y_AXIS);
+      o[Y_AXIS] += sp->get_bound (dir)->relative_coordinate (common[Y_AXIS], Y_AXIS) 
+       - me->relative_coordinate (common[Y_AXIS], Y_AXIS);
     }
   return o;
 }
 
 Array<Offset>
-Slur::get_encompass_offset_arr () const
+Slur::get_encompass_offset_arr (Score_element*me) 
 {
-  SCM eltlist = get_elt_property ("note-columns");
-  Score_element *common[] = {common_refpoint (eltlist,X_AXIS),
-                            common_refpoint (eltlist,Y_AXIS)};
+    Spanner*sp = dynamic_cast<Spanner*>(me);
+  SCM eltlist = me->get_elt_property ("note-columns");
+  Score_element *common[] = {me->common_refpoint (eltlist,X_AXIS),
+                            me->common_refpoint (eltlist,Y_AXIS)};
 
 
-  common[X_AXIS] = common[X_AXIS]->common_refpoint (get_bound (RIGHT), X_AXIS);
-  common[X_AXIS] = common[X_AXIS]->common_refpoint (get_bound (LEFT), X_AXIS);
+  common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
+  common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (LEFT), X_AXIS);
   
   Link_array<Score_element>  encompass_arr;
   while (gh_pair_p (eltlist))
@@ -297,66 +303,68 @@ Slur::get_encompass_offset_arr () const
   
   Array<Offset> offset_arr;
 
-  Offset origin (relative_coordinate (common[X_AXIS], X_AXIS),
-                relative_coordinate (common[Y_AXIS], Y_AXIS)); 
+  Offset origin (me->relative_coordinate (common[X_AXIS], X_AXIS),
+                me->relative_coordinate (common[Y_AXIS], Y_AXIS)); 
 
   int first = 1;
   int last = encompass_arr.size () - 2;
 
-  offset_arr.push (get_attachment (LEFT, common));
+  offset_arr.push (get_attachment (me, LEFT, common));
 
   /*
     left is broken edge
   */
 
-  if (encompass_arr[0] != get_bound (LEFT))
+  if (encompass_arr[0] != sp->get_bound (LEFT))
     {
       first--;
 
       // ?
       offset_arr[0][Y_AXIS] -=
        encompass_arr[0]->relative_coordinate (common[Y_AXIS], Y_AXIS) 
-       - relative_coordinate (common[Y_AXIS], Y_AXIS); 
+       - me->relative_coordinate (common[Y_AXIS], Y_AXIS); 
     }
 
   /*
     right is broken edge
   */
-  if (encompass_arr.top () != get_bound (RIGHT))
+  if (encompass_arr.top () != sp->get_bound (RIGHT))
     {
       last++;
     }
 
   for (int i = first; i <= last; i++)
     {
-      Offset o (encompass_offset (encompass_arr[i], common));
+      Offset o (encompass_offset (me, encompass_arr[i], common));
       offset_arr.push (o - origin);
     }
 
-  offset_arr.push (Offset (spanner_length (), 0) + get_attachment (RIGHT,common));
+  offset_arr.push (Offset (sp->spanner_length (), 0) + get_attachment (me, RIGHT,common));
 
-  if (encompass_arr[0] != get_bound (LEFT))
+  if (encompass_arr[0] != sp->get_bound (LEFT))
     {
       offset_arr.top ()[Y_AXIS] -= encompass_arr.top ()->relative_coordinate (common[Y_AXIS], Y_AXIS) 
-       - relative_coordinate (common[Y_AXIS], Y_AXIS);
+       - me->relative_coordinate (common[Y_AXIS], Y_AXIS);
     }
 
   return offset_arr;
 }
 
 
-Array<Rod>
-Slur::get_rods () const
+MAKE_SCHEME_CALLBACK(Slur,set_spacing_rods);
+SCM
+Slur::set_spacing_rods (SCM smob)
 {
-  Array<Rod> a;
+  Score_element*me = unsmob_element (smob);
+
   Rod r;
-  
-  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");
+  Spanner*sp = dynamic_cast<Spanner*>(me);
+  r.item_l_drul_[LEFT] = sp->get_bound (LEFT);
+  r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT);
+  r.distance_f_ = me->paper_l ()->get_var ("slur_x_minimum");
 
-  a.push (r);
-  return a;
+  r.add_to_cols ();
+  return SCM_UNDEFINED;
 }
 
 
@@ -367,11 +375,9 @@ MAKE_SCHEME_CALLBACK(Slur,brew_molecule);
 SCM
 Slur::brew_molecule (SCM smob)
 {
-  Slur * me = dynamic_cast<Slur*> (unsmob_element (smob));
-
-  
+  Score_element * me = unsmob_element (smob);
   Real thick = me->paper_l ()->get_var ("slur_thickness");
-  Bezier one = me->get_curve ();
+  Bezier one = get_curve (me);
 
   Molecule a;
   SCM d =  me->get_elt_property ("dashed");
@@ -384,14 +390,14 @@ Slur::brew_molecule (SCM smob)
 }
 
 void
-Slur::set_control_points ()
+Slur::set_control_points (Score_element*me)
 {
-  Slur_bezier_bow bb (get_encompass_offset_arr (),
-                     Directional_element_interface (this).get ());
+  Slur_bezier_bow bb (get_encompass_offset_arr (me),
+                     Directional_element_interface (me).get ());
 
-  Real staff_space = Staff_symbol_referencer::staff_space (this);
-  Real h_inf = paper_l ()->get_var ("slur_height_limit_factor") * staff_space;
-  Real r_0 = paper_l ()->get_var ("slur_ratio");
+  Real staff_space = Staff_symbol_referencer::staff_space (me);
+  Real h_inf = me->paper_l ()->get_var ("slur_height_limit_factor") * staff_space;
+  Real r_0 = me->paper_l ()->get_var ("slur_ratio");
 
   bb.set_default_bezier (h_inf, r_0);
 
@@ -399,14 +405,14 @@ Slur::set_control_points ()
     {
       Real length = bb.curve_.control_[3][X_AXIS]; 
       Real default_height = bb.get_default_height (h_inf, r_0, length);
-      bb.minimise_enclosed_area (paper_l(), default_height);
+      bb.minimise_enclosed_area (me->paper_l(), default_height);
       
-      Real bff = paper_l ()->get_var ("slur_force_blowfit");
+      Real bff = me->paper_l ()->get_var ("slur_force_blowfit");
       bb.curve_.control_[1][Y_AXIS] *= bff;
       bb.curve_.control_[2][Y_AXIS] *= bff;
       bb.blow_fit ();
 
-      Real sb = paper_l ()->get_var ("slur_beautiful");
+      Real sb = me->paper_l ()->get_var ("slur_beautiful");
       Real beautiful = length * default_height * sb;
       Real area = bb.enclosed_area_f ();
       
@@ -414,7 +420,7 @@ Slur::set_control_points ()
        Slurs that fit beautifully are not ugly
       */
       if (area > beautiful)
-       de_uglyfy (&bb, default_height);
+       de_uglyfy (me, &bb, default_height);
     }
 
   Bezier b = bb.get_bezier ();
@@ -424,32 +430,32 @@ Slur::set_control_points ()
   for (int i= 4; i--;)
     controls = gh_cons ( ly_offset2scm (b.control_[i]), controls);
 
-  set_elt_property ("control-points", controls);
+  me->set_elt_property ("control-points", controls);
 }
   
   
 Bezier
-Slur::get_curve () const
+Slur::get_curve (Score_element*me) 
 {
   Bezier b;
   int i = 0;
 
-  if (!Directional_element_interface (this).get ()
-      || ! gh_symbol_p (index_cell (get_elt_property ("attachment"), LEFT)))
-    ((Slur*)this)->set_extremities ();
+  if (!Directional_element_interface (me).get ()
+      || ! gh_symbol_p (index_cell (me->get_elt_property ("attachment"), LEFT)))
+    set_extremities (me);
   
-  if (!gh_pair_p (get_elt_property ("control-points")))
-    ((Slur*)this)->set_control_points ();
+  if (!gh_pair_p (me->get_elt_property ("control-points")))
+    set_control_points (me);
   
   
-  for (SCM s= get_elt_property ("control-points"); s != SCM_EOL; s = gh_cdr (s))
+  for (SCM s= me->get_elt_property ("control-points"); s != SCM_EOL; s = gh_cdr (s))
     {
       b.control_[i] = ly_scm2offset (gh_car (s));
       i++;
     }
   
-  Array<Offset> enc (get_encompass_offset_arr ());
-  Direction dir = Directional_element_interface (this).get ();
+  Array<Offset> enc (get_encompass_offset_arr (me));
+  Direction dir = Directional_element_interface (me).get ();
   
   Real x1 = enc[0][X_AXIS];
   Real x2 = enc.top ()[X_AXIS];
@@ -468,3 +474,11 @@ Slur::get_curve () const
   return b;
 }
 
+
+bool
+Slur::has_interface (Score_element*me)
+{
+  return me->has_interface ("slur-interface");
+}
+
+
index a61b79a2235a2f94d2388551659b8508655db6c9..df45ee44f690b44807b76ba8b492016a6d3b91b8 100644 (file)
 #include "paper-column.hh"
 #include "spacing-engraver.hh"
 #include "spacing-spanner.hh"
+#include "engraver.hh"
+#include "pqueue.hh"
+
+struct Rhythmic_tuple
+{
+  Score_element_info info_;
+  Moment end_;
+  
+  Rhythmic_tuple ()
+    {
+    }
+  Rhythmic_tuple (Score_element_info i, Moment m )
+    {
+      info_ = i;
+      end_ = m;
+    }
+  static int time_compare (Rhythmic_tuple const &, Rhythmic_tuple const &);  
+};
+
+/**
+   Acknowledge rhythmic elements, for initializing spacing fields in
+   the columns.
+
+   should be the  last one of the toplevel context
+*/
+class Spacing_engraver : public Engraver
+{
+  PQueue<Rhythmic_tuple> playing_durations_;
+  Array<Rhythmic_tuple> now_durations_;
+  Array<Rhythmic_tuple> stopped_durations_;
+
+  Spanner * spacing_p_;
+protected:
+  VIRTUAL_COPY_CONS(Translator);
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_post_move_processing ();
+  virtual void do_pre_move_processing ();
+  virtual void do_creation_processing ();
+  virtual void do_removal_processing ();
+public:
+  Spacing_engraver ();
+};
 
 inline int
 compare (Rhythmic_tuple const &a, Rhythmic_tuple const &b)
@@ -33,7 +75,8 @@ Spacing_engraver::Spacing_engraver()
 void
 Spacing_engraver::do_creation_processing ()
 {
-  spacing_p_  =new Spacing_spanner (SCM_EOL);
+  spacing_p_  =new Spanner (get_property ("basicSpacingSpannerProperties"));
+  Spacing_spanner::set_interface (spacing_p_);
   spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));  
   announce_element (Score_element_info (spacing_p_, 0));
 }
index b272827ba4e22d758828e88ede2b942f89a89890..f9cb12f4c1ae7dbaddf0329cfa4c1fb777aafa0a 100644 (file)
@@ -232,38 +232,6 @@ Spanner::broken_b() const
   return broken_into_l_arr_.size();
 }
 
-Array<Rod>
-Spanner::get_rods () const
-{
-  Array<Rod> r;
-  return r;
-}
-
-Array<Spring>
-Spanner::get_springs () const
-{
-  Array<Spring> s;
-  return s;    
-}
-
-void
-Spanner::do_space_processing ()
-{
-  Array<Rod> rs (get_rods ());
-  for (int i=0; i < rs.size (); i++)
-    {
-      rs[i].add_to_cols ();
-    }
-
-  Array<Spring> ss (get_springs ());
-  for (int i=0; i < ss.size (); i++)
-    {
-      if (isinf (ss[i].distance_f_))
-       programming_error ("weird spring");
-      else
-       ss[i].add_to_cols ();
-    }
-}
 
 /*
   If this is a broken spanner, return the amount the left end is to be
index 259d69feebe6336380f039454b4933fd64e75d7b..2b5367aab276018ca567abbcca6990c22ec63048 100644 (file)
@@ -12,7 +12,7 @@
 #include "musical-request.hh"
 #include "misc.hh"
 #include "stem-tremolo.hh"
-
+#include "item.hh"
 #include "translator-group.hh"
 #include "engraver.hh"
 
@@ -34,7 +34,7 @@ protected:
   
 private:
   int default_tremolo_type_i_;
-  Stem *stem_p_;
+  Score_element  *stem_p_;
   Score_element *tremolo_p_;
   Rhythmic_req *rhythmic_req_l_;
   Tremolo_req* tremolo_req_l_;
@@ -77,7 +77,8 @@ Stem_engraver::acknowledge_element(Score_element_info i)
       int duration_log = r->duration_.durlog_i_;      
       if (!stem_p_) 
        {
-         stem_p_ = new Stem (get_property ("basicStemProperties"));
+         stem_p_ = new Item (get_property ("basicStemProperties"));
+         Stem::set_interface (stem_p_);
          Staff_symbol_referencer::set_interface(stem_p_);
 
          
index a0797cff862b4cc905f3181649b12b05743a76ae..fff6f5c056729e2aadd355b67fd8601ca95728ea 100644 (file)
@@ -13,8 +13,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "stem.hh"
-#include "offset.hh"
-
+#include "item.hh"
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 
@@ -45,7 +44,7 @@ Stem_tremolo::brew_molecule (SCM smob)
 {
   Score_element *me= unsmob_element (smob);
   Score_element * stem = unsmob_element (me->get_elt_property ("stem"));
-  Beam * beam = Stem::beam_l (stem);
+  Score_element * beam = Stem::beam_l (stem);
   
   Real dydx;
   if (beam)
@@ -54,8 +53,8 @@ Stem_tremolo::brew_molecule (SCM smob)
       SCM s = beam->get_elt_property ("height");
       if (gh_number_p (s))
        dy = gh_scm2double (s);
-      Real dx = beam->last_visible_stem ()->relative_coordinate (0, X_AXIS)
-       - beam->first_visible_stem ()->relative_coordinate (0, X_AXIS);
+      Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
+       - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
       dydx = dx ? dy/dx : 0;
     }
   else
@@ -79,7 +78,7 @@ Stem_tremolo::brew_molecule (SCM smob)
     // huh?
     tremolo_flags = 1;
 
-  int mult = beam ? beam->get_multiplicity () : 0;
+  int mult = beam ? Beam::get_multiplicity (beam) : 0;
   Real interbeam_f = me->paper_l ()->interbeam_f (mult);
   Molecule mol; 
   for (int i = 0; i < tremolo_flags; i++)
index 1b7d72042af9257576eb60527717ee5f0787a04d..a8583c450a91b2bd1d3899cc751e806d498d6d29 100644 (file)
@@ -25,7 +25,7 @@
 #include "group-interface.hh"
 #include "cross-staff.hh"
 #include "staff-symbol-referencer.hh"
-
+#include "spanner.hh"
 
 
 void
@@ -213,16 +213,6 @@ Stem::add_head (Score_element*me, Score_element *n)
     }
 }
 
-Stem::Stem (SCM s)
-  : Item (s)
-{
-  Score_element * me = this;
-  
-  me->set_elt_property ("heads", SCM_EOL);
-  Stem::set_interface (me);
-  me->add_offset_callback ( &Stem::off_callback, X_AXIS);
-}
-
 bool
 Stem::invisible_b (Score_element*me)
 {
@@ -516,11 +506,11 @@ Stem::off_callback (Score_element * me, Axis)
 
 
 
-Beam*
+Score_element*
 Stem::beam_l (Score_element*me)
 {
   SCM b=  me->get_elt_property ("beam");
-  return dynamic_cast<Beam*> (unsmob_element (b));
+  return unsmob_element (b);
 }
 
 
@@ -528,7 +518,7 @@ Stem::beam_l (Score_element*me)
 Stem_info
 Stem::calc_stem_info (Score_element*me) 
 {
-  Beam * beam = beam_l (me);
+  Score_element * beam = beam_l (me);
 
   Direction beam_dir = Directional_element_interface (beam).get ();
   if (!beam_dir)
@@ -540,9 +530,9 @@ Stem::calc_stem_info (Score_element*me)
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real half_space = staff_space / 2;
-  Real interbeam_f = me->paper_l ()->interbeam_f (beam->get_multiplicity ());
+  Real interbeam_f = me->paper_l ()->interbeam_f (Beam::get_multiplicity (beam));
   Real thick = gh_scm2double (beam->get_elt_property ("beam-thickness"));
-  int multiplicity = beam->get_multiplicity ();
+  int multiplicity = Beam::get_multiplicity (beam);
 
   Stem_info info; 
   info.idealy_f_ = chord_start_f (me);
@@ -626,7 +616,7 @@ Stem::calc_stem_info (Score_element*me)
   if (gh_number_p (s))
     info.idealy_f_ -= gh_scm2double (s);
 
-  Real interstaff_f = -beam_dir* calc_interstaff_dist (dynamic_cast<Item*> (me), beam);
+  Real interstaff_f = -beam_dir* calc_interstaff_dist (dynamic_cast<Item*> (me), dynamic_cast<Spanner*> (beam));
 
   info.idealy_f_ += interstaff_f;
   info.miny_f_ += interstaff_f;
@@ -642,7 +632,9 @@ Stem::has_interface (Score_element*m)
 }
 
 void
-Stem::set_interface (Score_element*m)
-{
-  return m->set_interface (ly_symbol2scm ("stem-interface"));
+Stem::set_interface (Score_element*me)
+{    
+  me->set_elt_property ("heads", SCM_EOL);
+  me->add_offset_callback ( &Stem::off_callback, X_AXIS);
+  me->set_interface (ly_symbol2scm ("stem-interface"));
 }
index 323b502845726c005b28a795e6e43b9e002c2813..2f9c36619510abaed27a0ef626bb39b8937d7f58 100644 (file)
@@ -14,6 +14,7 @@
 #include "group-interface.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
+#include "spanner.hh"
 
 class System_start_delimiter_engraver : public Engraver
 {
@@ -41,9 +42,9 @@ System_start_delimiter_engraver::acknowledge_element (Score_element_info inf)
          
       Pointer_group_interface (delim_).add_element (inf.elem_l_);
     }
-  else if (System_start_delimiter * b = dynamic_cast<System_start_delimiter *> (inf.elem_l_))
+  else if (System_start_delimiter::has_interface (inf.elem_l_))
     {
-      SCM gl = b->get_elt_property ("glyph");
+      SCM gl = inf.elem_l_->get_elt_property ("glyph");
       SCM my_gl = delim_->get_elt_property ("glyph");
 
       /*
@@ -51,7 +52,7 @@ System_start_delimiter_engraver::acknowledge_element (Score_element_info inf)
        */
       if (gh_symbol_p (gl) && gl  == ly_symbol2scm ("brace")
          && gh_symbol_p (my_gl) && my_gl == ly_symbol2scm ("bracket"))
-       b->translate_axis ( -paper_l ()->get_var ("interline"), X_AXIS); // ugh
+       inf.elem_l_->translate_axis ( -paper_l ()->get_var ("interline"), X_AXIS); // ugh
     }
 
 }
@@ -64,7 +65,8 @@ System_start_delimiter_engraver::System_start_delimiter_engraver()
 void
 System_start_delimiter_engraver::do_creation_processing()
 {
-  delim_ = new System_start_delimiter (get_property ("basicSystemStartDelimiterProperties"));
+  delim_ = new Spanner (get_property ("basicSystemStartDelimiterProperties"));
+  System_start_delimiter::set_interface (delim_);
   delim_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
 
   /*
index 20bb3fc306d8f14261508cd345b343c885595ea7..23bf7e7facd6a6c17ad572e9c8d5e1f646336930 100644 (file)
@@ -8,29 +8,30 @@
  */
 #include <math.h>
 
+#include "axis-group-interface.hh"
 #include "system-start-delimiter.hh"
 #include "paper-def.hh"
 #include "molecule.hh"
-#include "axis-group-interface.hh"
 #include "lookup.hh"
 #include "all-font-metrics.hh"
+#include "spanner.hh"
 
 Molecule
-System_start_delimiter::staff_bracket (Real height) const 
+System_start_delimiter::staff_bracket (Score_element*me,Real height)  
 {
-  Paper_def* p= paper_l ();
+  Paper_def* p= me->paper_l ();
   SCM scmss = p->get_scmvar ("staffspace");
   Real ss = gh_scm2double (scmss);
-  Real arc_height = gh_scm2double (get_elt_property("arch-height")) * ss ;
+  Real arc_height = gh_scm2double (me->get_elt_property("arch-height")) * ss ;
   
   SCM at = gh_list (ly_symbol2scm ("bracket"),
-                   scm_product (get_elt_property ("arch-angle"), scmss),
-                   scm_product (get_elt_property ("arch-width"), scmss),
+                   scm_product (me->get_elt_property ("arch-angle"), scmss),
+                   scm_product (me->get_elt_property ("arch-width"), scmss),
                    gh_double2scm (arc_height),
-                   scm_product (get_elt_property ("bracket-width"),scmss),
+                   scm_product (me->get_elt_property ("bracket-width"),scmss),
                    gh_double2scm (height),
-                   scm_product (get_elt_property ("arch-thick"),scmss),
-                   scm_product (get_elt_property ("bracket-thick"),scmss),
+                   scm_product (me->get_elt_property ("arch-thick"),scmss),
+                   scm_product (me->get_elt_property ("bracket-thick"),scmss),
                    SCM_UNDEFINED);
 
   Real h = height + 2 * arc_height;
@@ -40,19 +41,26 @@ System_start_delimiter::staff_bracket (Real height) const
   return mol;
 }
 
-System_start_delimiter::System_start_delimiter (SCM s)
-  : Spanner (s)
+void
+System_start_delimiter::set_interface (Score_element*me)
+{
+  me->set_extent_callback (0, Y_AXIS);
+  Pointer_group_interface (me).set_interface();
+  me->set_interface (ly_symbol2scm ("system-start-delimiter-interface"));
+}
+
+bool
+System_start_delimiter::has_interface (Score_element*me)
 {
-  set_extent_callback (0, Y_AXIS);
-  Pointer_group_interface (this).set_interface();
+  return  me->has_interface (ly_symbol2scm ("system-start-delimiter-interface"));
 }
 
 Molecule
-System_start_delimiter::simple_bar (Real h) const
+System_start_delimiter::simple_bar (Score_element*me,Real h) 
 {
-  Real w = paper_l ()->get_var ("stafflinethickness") *
-    gh_scm2double (get_elt_property ("thickness"));
-  return lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
+  Real w = me->paper_l ()->get_var ("stafflinethickness") *
+    gh_scm2double (me->get_elt_property ("thickness"));
+  return me->lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
 }
 
 MAKE_SCHEME_CALLBACK(System_start_delimiter,after_line_breaking);
@@ -82,31 +90,28 @@ MAKE_SCHEME_CALLBACK(System_start_delimiter,brew_molecule);
 SCM
 System_start_delimiter::brew_molecule (SCM smob)
 {
-  Score_element * sc = unsmob_element (smob);
-
-  System_start_delimiter * ssd= dynamic_cast<System_start_delimiter*> (sc);
-  
-  Interval ext = Axis_group_interface::group_extent_callback (sc, Y_AXIS);
+  Score_element * me = unsmob_element (smob);
+  Interval ext = Axis_group_interface::group_extent_callback (me, Y_AXIS);
   Real l = ext.length (); 
   Molecule m;
 
-  SCM s = sc->get_elt_property ("collapse-height");
+  SCM s = me->get_elt_property ("collapse-height");
   if (gh_number_p (s) && l < gh_scm2double (s))
     {
-      sc->suicide();
+      me->suicide();
       return SCM_EOL;
     }
 
-  s = sc->get_elt_property ("glyph");
+  s = me->get_elt_property ("glyph");
   if (!gh_symbol_p(s))
     return SCM_EOL;
   
   if (s == ly_symbol2scm ("bracket"))
-    m = ssd->staff_bracket (l);
+    m = staff_bracket (me,l);
   else if (s == ly_symbol2scm ("brace"))
-    m = ssd-> staff_brace (l);
+    m =  staff_brace (me,l);
   else if (s == ly_symbol2scm ("bar-line"))
-    m = ssd->simple_bar (l);
+    m = simple_bar (me,l);
   
   
   m.translate_axis (ext.center (), Y_AXIS);
@@ -117,9 +122,9 @@ System_start_delimiter::brew_molecule (SCM smob)
   Ugh. Suck me plenty.
  */
 Molecule
-System_start_delimiter::staff_brace (Real y)  const
+System_start_delimiter::staff_brace (Score_element*me,Real y)  
 {
-  Real staffht  = paper_l ()->get_var ("staffheight");
+  Real staffht  = me->paper_l ()->get_var ("staffheight");
   int staff_size  = int (rint (staffht ));
 
   // URG
index 10008dc2fae6ab37688dedb72067cbdf3e1adbce..cd3badc526d83dd2cae796d88b3a89d40e500a27 100644 (file)
 #include "directional-element-interface.hh"
 #include "rhythmic-head.hh"
 
-Tie_column::Tie_column (SCM s)
-  : Spanner (s)
-{
 
-}
+
 void
 Tie_column::set_interface (Score_element*me)
 {
- me-> set_elt_property ("ties", SCM_EOL);
+  me-> set_elt_property ("ties", SCM_EOL);
+  me->set_interface (ly_symbol2scm ("tie-column"));
   me->set_extent_callback (0, X_AXIS);
   me->set_extent_callback (0, Y_AXIS);  
 }
 
+bool
+Tie_column::has_interface (Score_element*me)
+{
+  return  me->has_interface (ly_symbol2scm ("tie-column"));
+}
+
 void
 Tie_column::add_tie (Score_element*me,Tie *s)
 {
index 4f619e27ae2d5738fd68a631f9b9b2e20be3db9e..09c4d47c6015084fa9eba1be843d9a7c043e24c1 100644 (file)
@@ -49,7 +49,7 @@ class Tie_engraver : public Engraver
   Array<CHead_melodic_tuple> stopped_heads_;
   Link_array<Tie> tie_p_arr_;
 
-  Tie_column * tie_column_p_;
+  Spanner * tie_column_p_;
   
   void set_melisma (bool);
   
@@ -199,7 +199,7 @@ Tie_engraver::process_acknowledged ()
        }
       else if (tie_p_arr_.size () > 1 && !tie_column_p_)
        {
-         tie_column_p_ = new Tie_column (get_property ("basicTieColumnProperties"));
+         tie_column_p_ = new Spanner (get_property ("basicTieColumnProperties"));
          Tie_column::set_interface (tie_column_p_);
          for (int i = tie_p_arr_.size (); i--; )
            Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
index 9b655230a036bf1cca72a88761a8a6c03d639a18..13acee6ea7957b41a617583393b1a6b675f19576 100644 (file)
@@ -168,23 +168,28 @@ Tie::after_line_breaking (SCM smob)
 }
 
 
-
-Array<Rod>
-Tie::get_rods () const
+MAKE_SCHEME_CALLBACK(Tie,set_spacing_rods);
+SCM
+Tie::set_spacing_rods (SCM smob)  
 {
-  Array<Rod> a;
+  Score_element*me = unsmob_element (smob);
+  Spanner*sp = dynamic_cast<Spanner*> (me);
   Rod r;
 
-  r.item_l_drul_ [LEFT]=get_bound (LEFT);
-  r.item_l_drul_ [RIGHT]=get_bound (RIGHT);  
+  r.item_l_drul_ [LEFT]=sp->get_bound (LEFT);
+  r.item_l_drul_ [RIGHT]=sp->get_bound (RIGHT);  
   
-  r.distance_f_ = paper_l ()->get_var ("tie_x_minimum");
-  a.push (r);
-  return a;
+  r.distance_f_ = me->paper_l ()->get_var ("tie_x_minimum");
+  r.add_to_cols ();
+  return SCM_UNDEFINED;
 }
 
-MAKE_SCHEME_CALLBACK(Tie,brew_molecule);
 
+
+
+
+
+MAKE_SCHEME_CALLBACK(Tie,brew_molecule);
 SCM
 Tie::brew_molecule (SCM smob) 
 {
index 071e55e03bf5e49f5b87f5acf719581eb1cdeac1..6fcdba950e6b37657129a10c303980ec763b02ed 100644 (file)
@@ -15,6 +15,7 @@
 #include "beam.hh"
 #include "music-list.hh"
 #include "engraver.hh"
+#include "spanner.hh"
 
 class Tuplet_engraver : public Engraver
 {
@@ -96,17 +97,17 @@ Tuplet_engraver::acknowledge_element (Score_element_info i)
   if (grace != wgb)
     return;
   
-  if (Note_column *nc = dynamic_cast<Note_column *> (i.elem_l_))
+  if (Note_column::has_interface(i.elem_l_))
     {
       for (int j =0; j  <started_span_p_arr_.size (); j++)
        if (started_span_p_arr_[j]) 
-         Tuplet_spanner::add_column (started_span_p_arr_[j],nc);
+         Tuplet_spanner::add_column (started_span_p_arr_[j], dynamic_cast<Item*>(i.elem_l_));
     }
-  else if (Beam *b = dynamic_cast<Beam *> (i.elem_l_))
+  else if (Beam::has_interface (i.elem_l_))
     {
       for (int j = 0; j < started_span_p_arr_.size (); j++)
        if (started_span_p_arr_[j]) 
-         Tuplet_spanner::add_beam (started_span_p_arr_[j],b);
+         Tuplet_spanner::add_beam (started_span_p_arr_[j],i.elem_l_);
     }
 }
 
index 87a528f12b8424cc432530f92f86a4f5c85b1d96..10ddf988768e54c2b3fb197c59789bd22f357b7d 100644 (file)
@@ -20,6 +20,7 @@
 #include "dimensions.hh"
 #include "group-interface.hh"
 #include "directional-element-interface.hh"
+#include "spanner.hh"
 
 
 
@@ -65,8 +66,8 @@ Tuplet_spanner::brew_molecule (SCM smob)
   
   if (gh_pair_p (me->get_elt_property ("columns")))
     {
-      Link_array<Note_column> column_arr=
-       Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
+      Link_array<Score_element> column_arr=
+       Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
        
       Real ncw = column_arr.top ()->extent(X_AXIS).length ();
       Real w = dynamic_cast<Spanner*>(me)->spanner_length () + ncw;
@@ -123,8 +124,8 @@ Tuplet_spanner::brew_molecule (SCM smob)
 void
 Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real * dy) 
 {
-  Link_array<Note_column> column_arr=
-    Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
+  Link_array<Score_element> column_arr=
+    Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
 
 
   Score_element * common = me->common_refpoint (me->get_elt_property ("columns"), Y_AXIS);
@@ -135,11 +136,11 @@ Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real *
     Use outer non-rest columns to determine slope
    */
   int l = 0;
-  while (l <column_arr.size() && column_arr[l]->rest_b())
+  while (l <column_arr.size() && Note_column::rest_b(column_arr[l]))
     l ++;
 
   int r = column_arr.size ()- 1;
-  while (r >= l && column_arr[r]->rest_b())
+  while (r >= l && Note_column::rest_b(column_arr[r]))
     r--;
   
   if (l < r)
@@ -180,9 +181,8 @@ Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real *
 void
 Tuplet_spanner::calc_dy (Score_element*me,Real * dy)
 {
-  Link_array<Note_column> column_arr=
-    Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
-
+  Link_array<Score_element> column_arr=
+    Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
  
   Direction d = Directional_element_interface (me).get ();
   *dy = column_arr.top ()->extent (Y_AXIS) [d]
@@ -224,7 +224,7 @@ Tuplet_spanner::after_line_breaking (SCM smob)
     {
       SCM bs = me->get_elt_property ("beams");
       Score_element *b = unsmob_element (gh_car (bs));
-      Beam * beam_l = dynamic_cast<Beam*> (b);
+      Spanner * beam_l = dynamic_cast<Spanner *> (b);
       if (!sp->broken_b () 
          && sp->get_bound (LEFT)->column_l () == beam_l->get_bound (LEFT)->column_l ()
          && sp->get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
@@ -249,9 +249,8 @@ Tuplet_spanner::get_default_dir (Score_element*me)
   d = UP ;
   for (SCM s = me->get_elt_property ("columns"); gh_pair_p (s); s = gh_cdr (s))
     {
-      Score_element * sc = unsmob_element (gh_car (s));
-      Note_column * nc = dynamic_cast<Note_column*> (sc);
-      if (nc->dir () < 0) 
+      Score_element * nc = unsmob_element (gh_car (s));
+      if (Note_column::dir (nc) < 0) 
        {
          d = DOWN;
          break;
@@ -264,7 +263,7 @@ Tuplet_spanner::get_default_dir (Score_element*me)
 void
 Tuplet_spanner::add_beam (Score_element*me, Score_element *b)
 {
-me->add_dependency (b);
+  me->add_dependency (b);
   Pointer_group_interface gi (me, "beams");
   gi.add_element (b);
 }
index a5412bf776d8cf40f330e21f69d2ce6122b3dcde..da81fa71ef47c2062146e0e8f325e8225bc89d09 100644 (file)
@@ -482,7 +482,7 @@ ScoreContext = \translator {
                (interfaces . (dot-interface))
        )
        basicDynamicLineSpannerProperties = #`(
-               (interfaces (dynamic-interface))
+               (interfaces (dynamic-interface axis-group-interface))
                (axes . ( 1))
        )
        basicDynamicTextProperties       = # `(
@@ -498,6 +498,7 @@ ScoreContext = \translator {
        )
        basicGraceAlignItemProperties = #`(
                (axes . (0))
+               (interfaces . (axis-group-interface align-interface))
                (before-line-breaking-callback . ,Grace_align_item::before_line_breaking)
        )
        basicHaraKiriVerticalGroupspannerProperties = #`(
@@ -523,11 +524,10 @@ ScoreContext = \translator {
                (right-padding . 0.4)
                (interfaces . (accidentals-interface ))
        )
-       basicLineOfScoreProperties = #`( )
-%{;            (axes . (0 1))
-;              (interfaces . (axis-group))
-       ;       (rank . -1)
-       ; )%}
+       basicLineOfScoreProperties = #`(
+               (axes . (0 1))
+               (interfaces . (axis-group-interface))
+       )
        basicLyricExtenderProperties = #`(
                (molecule-callback . ,Lyric_extender::brew_molecule)
        )
@@ -544,12 +544,13 @@ ScoreContext = \translator {
          (visibility-lambda . ,end-of-line-invisible)
        )
        basicMultiMeasureRestProperties = #`(
+               (spacing-procedure . ,Multi_measure_rest::set_spacing_rods)             
                (molecule-callback . ,Multi_measure_rest::brew_molecule)
                (staff-position . 0)
        )
        basicNoteColumnProperties = #`(
                (axes 0 1)
-               (interfaces . (note-column-interface))
+               (interfaces . (axis-group-interface note-column-interface))
        )
        basicNoteHeadProperties = #`(
                (interfaces . (note-head-interface rhythmic-head-interface))
@@ -566,7 +567,7 @@ ScoreContext = \translator {
                (style . "italic")
        )
        basicPaperColumnProperties = #`(
-               (interfaces . (paper-column-interface))
+               (interfaces . (paper-column-interface axis-group-interface))
                (axes 0)
                (rank . -1)
        )
@@ -597,8 +598,12 @@ ScoreContext = \translator {
        )
        basicSlurProperties = #`(
                (molecule-callback . ,Slur::brew_molecule)
+               (spacing-procedure . ,Slur::set_spacing_rods)           
                (after-line-breaking-callback . ,Slur::after_line_breaking) 
        )
+       basicSpacingSpannerProperties =#`(
+               (spacing-procedure . ,Spacing_spanner::set_springs)
+       )
        basicSpanBarProperties = #`(
                (break-align-symbol . Staff_bar)
                (barsize-procedure . ,Span_bar::get_bar_size) 
@@ -658,6 +663,7 @@ ScoreContext = \translator {
        basicTieProperties = #`(
                (molecule-callback . ,Tie::brew_molecule)
                (after-line-breaking-callback . ,Tie::after_line_breaking)
+               (spacing-procedure . ,Tie::set_spacing_rods)                            
                (interfaces . (tie-interface))
        )
        basicTieColumnProperties = #`(
@@ -689,7 +695,8 @@ ScoreContext = \translator {
                (interfaces . (separation-item-interface))
        )
        basicSeparatingGroupSpannerProperties = #`(
-               (interfaces . (separation-spanner-interface))   
+               (interfaces . (separation-spanner-interface))
+               (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
        )
        basicInstrumentNameProperties = #`(
                (breakable . #t)
@@ -699,6 +706,7 @@ ScoreContext = \translator {
        )
        basicVerticalAxisGroupProperties = #`(
                (axes 1)
+               (interfaces . (axis-group-interface))
        )
        basicVoltaSpannerProperties = #`(
                (molecule-callback . ,Volta_spanner::brew_molecule)