]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.68 release/1.3.68
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 2 Jul 2000 18:59:31 +0000 (20:59 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 2 Jul 2000 18:59:31 +0000 (20:59 +0200)
======

* ly2dvi: changed back to original semantics of latexheaders.

* Stem_tremolo, Crescendo, Hara_kiri_group_spanner, Tuplet_spanner,
Volta_spanner changed into interface.

* Related cleanups for Tie, Tie_column cleanups.

* Made Time_signature, Single_malt_grouping_item, Script_column,
Chord_name, Dot_column, Breathing_sign, Key_item type into interface.

* Removed const declaration from callback arguments.

* Pagebreak support. See input/test/between-systems.ly

* Fixed a problem with accidentals in combination with
non-nil key signatures.

1.3

116 files changed:
CHANGES
Documentation/regression-test.tely
VERSION
input/bugs/prefatory-spacing.ly [new file with mode: 0644]
input/test/accidental.ly
input/test/between-systems.ly [new file with mode: 0644]
input/test/generic-output-property.ly
lily/align-interface.cc
lily/align-note-column-engraver.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface.cc
lily/beam.cc
lily/break-align-item.cc
lily/breathing-sign-engraver.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/chord-name.cc
lily/clef-engraver.cc
lily/collision.cc
lily/crescendo.cc
lily/dot-column-engraver.cc
lily/dot-column.cc
lily/dots.cc
lily/dynamic-engraver.cc
lily/hara-kiri-engraver.cc
lily/hara-kiri-group-spanner.cc
lily/include/align-interface.hh
lily/include/axis-group-interface.hh
lily/include/bar.hh
lily/include/beam.hh
lily/include/breathing-sign.hh
lily/include/chord-name-engraver.hh [deleted file]
lily/include/chord-name.hh
lily/include/collision.hh
lily/include/crescendo.hh
lily/include/dimension-cache-callback.hh
lily/include/dot-column-engraver.hh [deleted file]
lily/include/dot-column.hh
lily/include/dots.hh
lily/include/hara-kiri-group-spanner.hh
lily/include/key-item.hh
lily/include/local-key-item.hh
lily/include/multi-measure-rest.hh
lily/include/paper-column.hh
lily/include/paper-outputter.hh
lily/include/repeat-engraver.hh [deleted file]
lily/include/rest-collision.hh
lily/include/score-element.hh
lily/include/score-priority-engraver.hh [deleted file]
lily/include/script-column.hh
lily/include/script.hh
lily/include/separating-group-spanner.hh
lily/include/separating-line-group-engraver.hh
lily/include/separation-item.hh [new file with mode: 0644]
lily/include/side-position-interface.hh
lily/include/single-malt-grouping-item.hh [deleted file]
lily/include/span-bar.hh
lily/include/spanner.hh
lily/include/staff-symbol-referencer.hh
lily/include/stem-tremolo.hh
lily/include/stem.hh
lily/include/system-start-delimiter.hh
lily/include/text-item.hh [deleted file]
lily/include/tie-column.hh
lily/include/tie.hh
lily/include/time-signature-engraver.hh [deleted file]
lily/include/time-signature.hh
lily/include/tuplet-spanner.hh
lily/include/volta-spanner.hh
lily/key-engraver.cc
lily/key-item.cc
lily/line-of-score.cc
lily/local-key-engraver.cc
lily/lookup.cc
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/paper-column.cc
lily/paper-outputter.cc
lily/repeat-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rhythmic-column-engraver.cc
lily/rod.cc
lily/score-element-info.cc
lily/score-element.cc
lily/score-engraver.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/script.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/separation-item.cc [new file with mode: 0644]
lily/side-position-interface.cc
lily/single-malt-grouping-item.cc [deleted file]
lily/span-bar.cc
lily/staff-symbol-referencer.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/system-start-delimiter.cc
lily/text-item.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie.cc
lily/time-signature-engraver.cc
lily/time-signature.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/engraver.ly
make/out/lilypond.lsm
make/out/lilypond.spec
scm/lily.scm

diff --git a/CHANGES b/CHANGES
index fb39f85323a84307fdff679f2ca60363d2f6821b..31c3968012e24085aec0373798b5d38fbb80b7ea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,10 +1,25 @@
-1.3.67.mb1
-===========
+1.3.68
+======
 
 * ly2dvi: changed back to original semantics of latexheaders.
 
-1.3.66.hwn1
-===========
+* Stem_tremolo, Crescendo, Hara_kiri_group_spanner, Tuplet_spanner,
+Volta_spanner changed into interface.
+
+* Related cleanups for Tie, Tie_column cleanups.
+
+* Made Time_signature, Single_malt_grouping_item, Script_column,
+Chord_name, Dot_column, Breathing_sign, Key_item type into interface.
+
+* Removed const declaration from callback arguments.
+
+* Pagebreak support. See input/test/between-systems.ly
+
+* Fixed a problem with accidentals in combination with
+non-nil key signatures.
+
+1.3.67
+======
 
 * Use callbacks for augmentation dot positioning.
 
index 60e4ba57a85c60fd49dfdbc960bc83479fd63294..e25c9789df10e418572f65947254252ff4c8015d 100644 (file)
@@ -208,6 +208,11 @@ second slur has slurDirection set to down, overriding the stemup  setting.
 
 @mudelafile{generic-property-override.ly}
 
+Paper column supports a special output property that allows you to force
+page breaks (among others).
+
+@mudelafile{between-systems.ly}
+
 @section Repeats
 
 LilyPond has three modes for repeats: folded, unfolded and
diff --git a/VERSION b/VERSION
index 8ffd3296d36600b8535bc2d2c438838f622a90f8..37215af175ffec675f105de890481240801168e7 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=67
-MY_PATCH_LEVEL=mb1
+PATCH_LEVEL=68
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/bugs/prefatory-spacing.ly b/input/bugs/prefatory-spacing.ly
new file mode 100644 (file)
index 0000000..6ffeb87
--- /dev/null
@@ -0,0 +1,10 @@
+% the space after clef/key is stretched too much.
+
+foo = \notes\relative c''   {   \key as \major; dis4 dis dis! dis? }
+
+\score {
+
+  < \foo 
+   \context NoteNames \foo
+  >
+}
index 89aafb10e982752b0dc899bce7de4d0a7b87a73c..23a0c7ca7fe46d502f2cc270d05a96c13acfde97 100644 (file)
@@ -1,8 +1,9 @@
 
-foo = \notes\relative c''   { cis4 cis cis! cis? }
+foo = \notes\relative c''   {   \key as \major; dis4 dis dis! dis? }
+
 \score {
 
-  <\foo 
-       \context NoteNames \foo
->
+  < \foo 
+   \context NoteNames \foo
+  >
 }
diff --git a/input/test/between-systems.ly b/input/test/between-systems.ly
new file mode 100644 (file)
index 0000000..1f72c7a
--- /dev/null
@@ -0,0 +1,11 @@
+
+\score {
+\notes { c1
+
+       \context Score \outputproperty #(make-type-checker 'paper-column-interface)
+               #'between-system-string = #"(pagebreak)\n\n"
+       \break
+
+c1 }
+
+}
index 0e7d2695b701cc32bdc65cd8dc530a887d303d51..5adbba97c8eb437a5ad5cc0ef566284c31381bba 100644 (file)
@@ -1,11 +1,11 @@
 \score{
        \notes\relative c''{
-       \outputproperty #(make-type-checker 'Note_head
+       \outputproperty #(make-type-checker 'note-head-interface
                #'extra-offset = #'(2 . 3)
        c2
        c
        \context Score {
-               \outputproperty #(make-type-checker 'Mark
+               \outputproperty #(make-type-checker 'mark-interface
                #'extra-offset = #'(-1 . 4)
        }
        \mark A;
index c3779358711f53c0ef277fa3182eb0898b500637..fdeefe5d29458a9f892752d5fa889eee05ab6773 100644 (file)
@@ -18,7 +18,7 @@
   not compute anything, but a side effect of a->do_side_processing ()
   is that the elements are placed correctly.  */
 Real
-Align_interface::alignment_callback (Score_element const *sc, Axis ax)
+Align_interface::alignment_callback (Score_element *sc, Axis ax)
 {
   Score_element * par = sc->parent_l (ax);
   if (par && par->get_elt_property ("alignment-done") == SCM_UNDEFINED) 
@@ -30,7 +30,7 @@ Align_interface::alignment_callback (Score_element const *sc, Axis ax)
 
 
 Real
-Align_interface::center_on_element (Score_element const *me, Axis a)
+Align_interface::center_on_element (Score_element *me, Axis a)
 {
   Score_element *cent = unsmob_element (me->get_elt_pointer ("group-center-element"));
 
index f346fb9191a36e914465c550327512e29941c502..2ffb4d178a6ea9a10bf23fa760933512f5b2d58a 100644 (file)
@@ -11,7 +11,6 @@
 #include "grace-align-item.hh"
 #include "align-interface.hh"
 #include "note-column.hh"
-#include "local-key-item.hh"
 #include "warn.hh"
 #include "directional-element-interface.hh"
 #include "side-position-interface.hh"
@@ -23,7 +22,7 @@ class Align_note_column_engraver: public Engraver
 {
   Grace_align_item * align_item_p_;
   Note_column * now_column_l_;
-  Local_key_item * accidental_l_;
+  Score_element * accidental_l_;
 
   virtual void process_acknowledged ();
   virtual void do_post_move_processing ();
@@ -74,9 +73,9 @@ Align_note_column_engraver::acknowledge_element (Score_element_info inf)
     {
       now_column_l_ =n;
     }
-  else if (Local_key_item * it = dynamic_cast<Local_key_item*> (inf.elem_l_))
+  else if (to_boolean (inf.elem_l_->get_elt_property ("accidentals-interface")))
     {
-      accidental_l_ = it;
+      accidental_l_ = inf.elem_l_;
     }
 }
 void
index 1d88248b40a21fe50a316334860607a5612d5f30..433f469f67a50ba2f7d206d7099e57c01659c0dd 100644 (file)
@@ -9,9 +9,7 @@
 #include "beaming.hh"
 #include "auto-beam-engraver.hh"
 #include "musical-request.hh"
-#include "bar.hh"
 #include "beam.hh"
-#include "rest.hh"
 #include "stem.hh"
 #include "debug.hh"
 #include "timing-engraver.hh"
@@ -310,7 +308,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info)
        {
          end_beam ();
        }
-      else if (Bar *b = dynamic_cast<Bar *> (info.elem_l_))
+      else if (to_boolean (info.elem_l_->get_elt_property ("bar-interface")))
        {
          end_beam ();
        }
index 00c4c8d32c02145beb4878160843d6cbeb8371af..f426b856c95ce2a14839e8e0aa64c217c911acad 100644 (file)
@@ -59,7 +59,7 @@ Axis_group_interface::relative_group_extent (Axis a, Score_element *common, SCM
 }
 
 Interval
-Axis_group_interface::group_extent_callback (Score_element const*me, Axis a)
+Axis_group_interface::group_extent_callback (Score_element *me, Axis a)
 {
   Score_element * common =(Score_element*) me;
 
index 5b50831fca15d6a80e39da9839420cd8e0edc6be..c007e311bf3fde8c773d9d4c39be82cb288bf807 100644 (file)
@@ -857,7 +857,7 @@ Beam::last_visible_stem () const
     rest -> stem -> beam -> interpolate_y_position ()
 */
 Real
-Beam::rest_collision_callback (Score_element const *rest, Axis a )
+Beam::rest_collision_callback (Score_element *rest, Axis a )
 {
   assert (a == Y_AXIS);
 
index bbea713e2bb8d1f711fad9d141242db4371b5c9a..2977cde738abb1a4ae339e96601cb795ddcbc41b 100644 (file)
 
 #include "side-position-interface.hh"
 #include "warn.hh"
-#include "dimension-cache.hh"
 #include "lily-guile.hh"
 #include "break-align-item.hh"
 #include "dimensions.hh"
-#include "paper-score.hh"
 #include "paper-def.hh"
 #include "paper-column.hh"
+
 #include "group-interface.hh"
 #include "align-interface.hh"
 
index 151fbbff79a917432a22d905880da57d64aa2797..1088b39d33378f20393b89d8ae62c6d27255761b 100644 (file)
@@ -36,7 +36,7 @@ protected:
 
 private:
   Breathing_sign_req * breathing_sign_req_l_;
-  Breathing_sign * breathing_sign_p_;
+  Score_element * breathing_sign_p_;
 };
 
 Breathing_sign_engraver::Breathing_sign_engraver()
@@ -63,9 +63,9 @@ Breathing_sign_engraver::do_process_music()
   if(breathing_sign_req_l_)
     {
       SCM b = get_property ("basicBreathingSignProperties");
-      breathing_sign_p_ = new Breathing_sign (b);
-      Staff_symbol_referencer_interface st (breathing_sign_p_);
-      st.set_interface ();
+      breathing_sign_p_ = new Item (b);
+
+      Breathing_sign::set_interface (breathing_sign_p_);
 
       announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_));
     }
index cc743c5a28be79faf0d74f243bc12c716c18c650..73580c0f2c5950f11a4b900b63fce37bba72bb3d 100644 (file)
 #include "direction.hh"
 
 
-Breathing_sign::Breathing_sign (SCM  s)
-  : Item (s)
-{
-}
-
-
 
 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Breathing_sign,brew_molecule);
 
@@ -45,20 +39,25 @@ Breathing_sign::brew_molecule (SCM smob)
   return sc->lookup_l()->filledbox(b).create_scheme ();
 }
 
-GLUE_SCORE_ELEMENT(Breathing_sign,after_line_breaking);
-SCM
-Breathing_sign::member_after_line_breaking ()
+Real
+Breathing_sign::offset_callback (Score_element * b, Axis a)
 {
-  Real space = Staff_symbol_referencer_interface (this).staff_space();
-  Direction d = Directional_element_interface (this). get ();
+  Score_element * me = (Score_element*)b;
+  
+  Real space = Staff_symbol_referencer_interface (b).staff_space();
+  Direction d = Directional_element_interface (b). get ();
   if (!d)
     {
       d = UP;
-      Directional_element_interface (this).set (d);
+      Directional_element_interface (me).set (d);
     }
 
-  translate_axis(2.0 * space * d, Y_AXIS);
-
-  return SCM_UNDEFINED;
+  return 2.0 * space * d;
 }
 
+void
+Breathing_sign::set_interface (Score_element *b)
+{
+  Staff_symbol_referencer_interface::set_interface  (b);
+  b->add_offset_callback (Breathing_sign::offset_callback,Y_AXIS); 
+}
index cab0239b3c0921505fd51fcea83300a4eb77e51c..3e82a773508c26e4ab030dd7aa78f0a8b2b82f6e 100644 (file)
@@ -6,8 +6,9 @@
   (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "chord-name-engraver.hh"
+#include "engraver.hh"
 #include "chord-name.hh"
+#include "chord.hh"
 #include "musical-request.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "main.hh"
 #include "dimensions.hh"
 #include "item.hh"
+#include "musical-pitch.hh"
 
+class Chord_name_engraver : public Engraver 
+{
+public:
+  Chord_name_engraver ();
+  VIRTUAL_COPY_CONS (Translator);
+
+protected:
+  virtual void do_pre_move_processing ();
+  virtual void acknowledge_element (Score_element_info i);
+  virtual void do_process_music ();
+  virtual bool do_try_music (Music* m);
+
+private:
+  Array<Musical_pitch> pitch_arr_;
+  Item* chord_name_p_;
+  Tonic_req* tonic_req_;
+  Inversion_req* inversion_req_;
+  Bass_req* bass_req_;
+};
 
 ADD_THIS_TRANSLATOR (Chord_name_engraver);
 
@@ -73,7 +94,7 @@ Chord_name_engraver::do_process_music ()
   if (gh_boolean_p (chord_inversion))
     find_inversion_b = gh_scm2bool (chord_inversion);
 
-  chord_name_p_ = new Chord_name (get_property ("basicChordNameProperties"));
+  chord_name_p_ = new Item (get_property ("basicChordNameProperties"));
   Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
                          find_inversion_b);
 
index 0d4ff138499a7b2fe91603e5b84df0bfaa033951..bcc0abea3daf24f71318669467d4184c9b461e1d 100644 (file)
@@ -7,14 +7,10 @@
 */
 
 #include "chord-name.hh"
-#include "musical-request.hh"
-#include "warn.hh"
-#include "debug.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
-#include "staff-symbol-referencer.hh"
-
+#include "score-element.hh"
 
 /*
   TODO: move text lookup out of Chord_name
@@ -27,7 +23,7 @@
  */
 
 Molecule
-Chord_name::ly_word2molecule (SCM word, Real* x) const
+Chord_name::ly_word2molecule (Score_element * me, SCM word, Real* x) 
 {
   *x = 0;
 
@@ -43,10 +39,10 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
       /*
        UGH. Should read from font metric structure.
       */
-      Real ex = lookup_l ()->text ("", "x",
-                                  paper_l ()).extent (Y_AXIS).length ();
-      Real em = lookup_l ()->text ("", "m",
-                                  paper_l ()).extent (X_AXIS).length ();
+      Real ex = me->lookup_l ()->text ("", "x",
+                                  me->paper_l ()).extent (Y_AXIS).length ();
+      Real em = me->lookup_l ()->text ("", "m",
+                                  me->paper_l ()).extent (X_AXIS).length ();
 
       String w = ly_scm2string (word);
 
@@ -90,9 +86,9 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
       Molecule mol;
       s = scm_assoc (ly_symbol2scm ("font"), options_alist);
       if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "feta")
-        mol = paper_l ()->lookup_l (size)->afm_find (w);
+        mol = me->paper_l ()->lookup_l (size)->afm_find (w);
       else
-       mol = paper_l ()->lookup_l (size)->text (style, w, paper_l ());
+       mol = me->paper_l ()->lookup_l (size)->text (style, w, me->paper_l ());
 
       mol.translate (offset);
       return mol;
@@ -106,7 +102,7 @@ Chord_name::ly_word2molecule (SCM word, Real* x) const
   ;; property: align, kern, font (?), size
  */
 Molecule
-Chord_name::ly_text2molecule (SCM text) const
+Chord_name::ly_text2molecule (Score_element * me, SCM text) 
 {
   Molecule mol;
   if (gh_list_p (text))
@@ -114,7 +110,7 @@ Chord_name::ly_text2molecule (SCM text) const
       while (gh_cdr (text) != SCM_EOL)
         {
          Real x;
-         Molecule m = ly_word2molecule (gh_car (text), &x);
+         Molecule m = ly_word2molecule (me, gh_car (text), &x);
          if (!m.empty_b ())
            mol.add_at_edge (X_AXIS, RIGHT, m, x);
          text = gh_cdr (text);
@@ -122,7 +118,7 @@ Chord_name::ly_text2molecule (SCM text) const
       text = gh_car (text);
     }  
   Real x;
-  Molecule m = ly_word2molecule (text, &x);
+  Molecule m = ly_word2molecule (me,text, &x);
   if (!m.empty_b ())
     mol.add_at_edge (X_AXIS, RIGHT, m, x);
   return mol;
@@ -154,11 +150,5 @@ Chord_name::brew_molecule (SCM smob)
                                ly_quote_scm (gh_cons (inversion, bass)),
                                SCM_UNDEFINED));
 
-  return dynamic_cast<Chord_name*> (sc)->
-    ly_text2molecule (text).create_scheme ();
-}
-
-Chord_name::Chord_name (SCM s)
-  : Item (s)
-{
+  return ly_text2molecule (sc, text).create_scheme ();
 }
index def1a6262200431376c7c954fb1d1ea41d993712..4267a357795079486472535bd0bb1248433d26cb 100644 (file)
 #include <ctype.h>
 
 #include "staff-symbol-referencer.hh"
-#include "bar.hh"
-
 #include "debug.hh"
 #include "command-request.hh"
-#include "timing-translator.hh"
-#include "rhythmic-head.hh"
-#include "key-item.hh"
-#include "local-key-item.hh"
 #include "array.hh"
 #include "engraver.hh"
 #include "direction.hh"
@@ -126,22 +120,23 @@ Clef_engraver::set_type (String s)
 void
 Clef_engraver::acknowledge_element (Score_element_info info)
 {
-  if (dynamic_cast<Bar*>(info.elem_l_)
-      && gh_string_p (clef_glyph_))
-    create_clef();
-
-  Item * it_l =dynamic_cast <Item *> (info.elem_l_);
-  if (it_l)
+  Item * item =dynamic_cast <Item *> (info.elem_l_);
+  if (item)
     {
-      if (to_boolean (it_l->get_elt_property("note-head-interface"))
-         || dynamic_cast<Local_key_item*> (it_l))
+      if (to_boolean (info.elem_l_->get_elt_property ("bar-interface"))
+         && gh_string_p (clef_glyph_))
+       create_clef();
+      
+
+      if (to_boolean (item->get_elt_property("note-head-interface"))
+         || to_boolean (item->get_elt_property ("accidentals-interface")))
        {
-         Staff_symbol_referencer_interface si (it_l);
+         Staff_symbol_referencer_interface si (item);
          si.set_position (int (si.position_f ()) + c0_position_i_);
        }
-      else if (Key_item *k = dynamic_cast<Key_item*>(it_l))
+      else if (to_boolean (item->get_elt_property ("key-item-interface")))
        {
-         k->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
+         item->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
        }
     } 
 }
@@ -180,8 +175,7 @@ Clef_engraver::create_clef()
       Item *c= new Item ( current_settings_);
       announce_element (Score_element_info (c, clef_req_l_));
 
-      Staff_symbol_referencer_interface si(c);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (c);
       
       clef_p_ = c;
     }
index 9cedc344799fd404ccfa8c23f0ec0c5ecb910677..9316fcd2f3a7af2371cc8e62707443eaf7429e36 100644 (file)
@@ -22,7 +22,7 @@ Collision::add_column (Note_column* ncol_l)
 }
 
 Real
-Collision::force_shift_callback (Score_element const * c, Axis a)
+Collision::force_shift_callback (Score_element * c, Axis a)
 {
   assert (a == X_AXIS);
   
index 7890d5cf0057c631b37ed5e8eaaa951be0650064..8ba2b7ef9e6e309a87d74ec2981bc3a53ae79718 100644 (file)
@@ -8,51 +8,48 @@
 
 #include "molecule.hh"
 #include "crescendo.hh"
+#include "spanner.hh"
 #include "lookup.hh"
 #include "dimensions.hh"
 #include "paper-def.hh"
 #include "debug.hh"
 #include "paper-column.hh"
 
-
-Crescendo::Crescendo (SCM s)
-  : Spanner (s)
+void
+Crescendo::set_interface (Score_element*s)
 {
-  set_elt_property ("dynamic-drul", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
+  s->set_elt_pointer ("dynamic-drul", gh_cons (SCM_UNDEFINED, SCM_UNDEFINED));
 }
 
 
 
-
-GLUE_SCORE_ELEMENT(Crescendo,brew_molecule);
-
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Crescendo,brew_molecule);
 SCM
-Crescendo::member_brew_molecule () const
+Crescendo::brew_molecule (SCM smob) 
 {
-  Real absdyn_dim = paper_l ()-> get_var ("crescendo_shorten");
-  Real extra_left =  get_broken_left_end_align ();
+  Score_element *me= unsmob_element (smob);
+  Spanner * sp = dynamic_cast<Spanner*>(me);
+  Real absdyn_dim = me->paper_l ()-> get_var ("crescendo_shorten");
+  Real extra_left =  sp->get_broken_left_end_align ();
 
-  SCM dir = get_elt_property("grow-direction");
-  SCM dyns = get_elt_property ("dynamic-drul");
+  SCM dir = me->get_elt_property("grow-direction");
+  SCM dyns = me->get_elt_property ("dynamic-drul");
 
   if (!isdir_b (dir) || !gh_pair_p (dyns))
     {
-      Crescendo * me = (Crescendo*)this;
       me->suicide ();
       return SCM_EOL;
     }
   
   Direction gd = to_dir (dir);
 
-  bool dynleft= to_boolean (gh_car (dyns));
-  bool dynright = to_boolean (gh_cdr (dyns));
+  bool dynleft= unsmob_element (gh_car (dyns));
+  bool dynright = unsmob_element (gh_cdr (dyns));
   
   if (dynleft)
     extra_left += absdyn_dim;
 
-  
-
-  Real width = spanner_length()- get_broken_left_end_align ();
+  Real width = sp->spanner_length()- sp->get_broken_left_end_align ();
 
   if (dynleft)
     {
@@ -73,7 +70,7 @@ Crescendo::member_brew_molecule () const
   Direction d = LEFT;
   do
     {
-      Paper_column* s = dynamic_cast<Paper_column*>(get_bound (d)); // UGH
+      Paper_column* s = dynamic_cast<Paper_column*>(sp->get_bound (d)); // UGH
       broken[d] = (!s->musical_b ());
     }
   while (flip (&d) != LEFT);
@@ -82,15 +79,15 @@ Crescendo::member_brew_molecule () const
   Molecule m;
   
   Real pad = 0;
-  SCM s = get_elt_property ("start-text");
+  SCM s = me->get_elt_property ("start-text");
   if (gh_string_p (s))
     {
-      Molecule start_text (lookup_l ()->text ("italic",
+      Molecule start_text (me->lookup_l ()->text ("italic",
                                              ly_scm2string (s),
-                                             paper_l ()));
+                                                 me->paper_l ()));
       m.add_molecule (start_text);
 
-      pad = paper_l ()->get_var ("interline") / 2;
+      pad = me->paper_l ()->get_var ("interline") / 2;
 
       width -= start_text.extent (X_AXIS).length ();
       width -= pad;
@@ -98,12 +95,12 @@ Crescendo::member_brew_molecule () const
     }
 
   SCM at;
-  s = get_elt_property ("spanner");
+  s =me->get_elt_property ("spanner");
   Real height;
   if (gh_string_p (s) && ly_scm2string (s) == "dashed-line")
     {
-      Real thick = paper_l ()->get_var ("crescendo_dash_thickness");
-      Real dash = paper_l ()->get_var ("crescendo_dash");
+      Real thick = me->paper_l ()->get_var ("crescendo_dash_thickness");
+      Real dash = me->paper_l ()->get_var ("crescendo_dash");
       height = thick;
       at = gh_list (ly_symbol2scm (ly_scm2string (s).ch_C ()),
                    gh_double2scm (thick),
@@ -114,8 +111,8 @@ Crescendo::member_brew_molecule () const
   else
     {
       bool continued = broken[Direction (-gd)];
-      height = paper_l()->get_var ("crescendo_height");
-      Real thick = paper_l ()->get_var ("crescendo_thickness");
+      height = me->paper_l()->get_var ("crescendo_height");
+      Real thick = me->paper_l ()->get_var ("crescendo_thickness");
       
       const char* hairpin = (gd < 0)? "decrescendo" :  "crescendo";
 
index d555327c8ef1318bb9132eb1797115271499265d..908851d168da4ae0934c741c08103aae377cfbbf 100644 (file)
@@ -7,10 +7,25 @@
   
  */
 
-#include "dot-column-engraver.hh"
+
 #include "rhythmic-head.hh"
 #include "dot-column.hh"
 #include "side-position-interface.hh"
+#include "engraver.hh"
+
+class Dot_column_engraver : public Engraver
+{
+  Score_element *dotcol_p_ ;
+  Link_array<Rhythmic_head> head_l_arr_;
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Dot_column_engraver();
+  
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_pre_move_processing ();  
+};
+
 
 Dot_column_engraver::Dot_column_engraver ()
 {
@@ -31,22 +46,21 @@ Dot_column_engraver::do_pre_move_processing ()
 void
 Dot_column_engraver::acknowledge_element (Score_element_info info)
 {
-  Rhythmic_head * h = dynamic_cast<Rhythmic_head*>(info.elem_l_);
-  if (!h)
-      return;
+  Score_element *d = unsmob_element (info.elem_l_->get_elt_pointer ("dot"));
+  if (d)
+    {
+      if (!dotcol_p_)
+       {
+         dotcol_p_ = new Item(get_property ("basicDotColumnProperties"));
 
-  if (!h->dots_l ())
-    return;
+         Dot_column::set_interface (dotcol_p_);
+         Side_position_interface (dotcol_p_).set_axis (X_AXIS);
+         Side_position_interface (dotcol_p_).set_direction (RIGHT);      
+         announce_element (Score_element_info (dotcol_p_, 0));
+       }
 
-  if (!dotcol_p_)
-    {
-      dotcol_p_ = new Dot_column(get_property ("basicDotColumnProperties"));
-      Side_position_interface (dotcol_p_).set_axis (X_AXIS);
-      Side_position_interface (dotcol_p_).set_direction (RIGHT);      
-      announce_element (Score_element_info (dotcol_p_, 0));
+      Dot_column::add_head (dotcol_p_, info.elem_l_);
     }
-
-  dotcol_p_->add_head (h);
 }
 
 
index a725998bcfc69462404eeaef29d9addd9a95bf88..f3ce19ad83713299b1da8145c5e567a6301a0308 100644 (file)
 
 
 void
-Dot_column::add_head (Rhythmic_head *r)
+Dot_column::add_head (Score_element * dc, Score_element *rh)
 {
-  if (!r->dots_l ())
-    return ;
-
-  Side_position_interface (this).add_support (r);
-  Item * d = r->dots_l ();
+  Score_element * d = unsmob_element (rh->get_elt_pointer ("dot"));
   if (d)
     {
-      Pointer_group_interface gi (this, "dots");
+      Side_position_interface (dc).add_support (rh);
+
+      Pointer_group_interface gi (dc, "dots");
       gi.add_element (d);
       
       d->add_offset_callback (force_shift_callback , Y_AXIS);
-      Axis_group_interface (this).add_element (d);
+      Axis_group_interface (dc).add_element (d);
     }
 }
 
@@ -46,14 +44,14 @@ Dot_column::compare (Score_element * const &d1, Score_element * const &d2)
 }
 
 
-Dot_column::Dot_column (SCM s)
-  : Item (s)
+void
+Dot_column::set_interface (Score_element* dc)
 {
-  this->set_elt_pointer  ("dots", SCM_EOL);
-  Directional_element_interface (this).set (RIGHT);
+  dc->set_elt_pointer  ("dots", SCM_EOL);
+  Directional_element_interface (dc).set (RIGHT);
   
-  Axis_group_interface (this).set_interface ();
-  Axis_group_interface (this).set_axes(X_AXIS,X_AXIS);
+  Axis_group_interface (dc).set_interface ();
+  Axis_group_interface (dc).set_axes(X_AXIS,X_AXIS);
 }
 
 /*
@@ -74,7 +72,7 @@ Dot_column::Dot_column (SCM s)
 
 
 Real
-Dot_column::force_shift_callback (Score_element const * dot, Axis a)
+Dot_column::force_shift_callback (Score_element * dot, Axis a)
 {
   assert (a == Y_AXIS);
   Score_element * me = dot->parent_l (X_AXIS);
index 6a037d9f803d83504700db58d2871e042e0a14f8..929aabf96f5b11a9e548ce118b5d2d6b912f554a 100644 (file)
@@ -16,7 +16,7 @@
 
 
 Real
-Dots::quantised_position_callback (Score_element const* me, Axis a)
+Dots::quantised_position_callback (Score_element * me, Axis a)
 {
   assert (a == Y_AXIS);
     
index 8224b1f6f6939f39d2691f2c9764fd4b213ea6d9..1e329f4f7342c7134e1251835fc71c51bb0493f7 100644 (file)
@@ -7,22 +7,15 @@
 */
 #include "debug.hh"
 #include "dimensions.hh"
-#include "dimension-cache.hh"
 #include "crescendo.hh"
 #include "musical-request.hh"
-#include "lookup.hh"
-#include "paper-def.hh"
 #include "paper-column.hh"
-#include "staff-symbol.hh"
 #include "note-column.hh"
 #include "item.hh"
 #include "side-position-interface.hh"
 #include "engraver.hh"
-#include "stem.hh"
-#include "rhythmic-head.hh"
 #include "group-interface.hh"
 #include "directional-element-interface.hh"
-#include "staff-symbol-referencer.hh"
 #include "translator-group.hh"
 #include "axis-group-interface.hh"
 
@@ -40,8 +33,8 @@
 class Dynamic_engraver : public Engraver
 {
   Item * text_p_;
-  Crescendo * finished_cresc_p_;
-  Crescendo * cresc_p_;
+  Spanner * finished_cresc_p_;
+  Spanner * cresc_p_;
 
   Text_script_req* text_req_l_;
   
@@ -214,7 +207,8 @@ Dynamic_engraver::do_process_music ()
       else
        {
          current_cresc_req_ = accepted_spanreqs_drul_[START];
-         cresc_p_  = new Crescendo (get_property ("basicCrescendoProperties"));
+         cresc_p_  = new Spanner (get_property ("basicCrescendoProperties"));
+         Crescendo::set_interface (cresc_p_);
          cresc_p_->set_elt_property
            ("grow-direction",
             gh_int2scm ((accepted_spanreqs_drul_[START]->span_type_str_ == "crescendo")
@@ -262,11 +256,11 @@ Dynamic_engraver::do_process_music ()
          
          if (text_p_)
            {
-             index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
-                             LEFT, SCM_BOOL_T);
+             index_set_cell (cresc_p_->get_elt_pointer ("dynamic-drul"),
+                             LEFT, text_p_->self_scm_);
              if (finished_cresc_p_)
-               index_set_cell (finished_cresc_p_->get_elt_property ("dynamic-drul"),
-                               RIGHT, SCM_BOOL_T);
+               index_set_cell (finished_cresc_p_->get_elt_pointer ("dynamic-drul"),
+                               RIGHT, text_p_->self_scm_);
            }
 
          Axis_group_interface (line_spanner_).add_element (cresc_p_);
index 10eca4fe1d181149ce7e4a2bfe090d67811b7e17..1ef2d1ac3c8c2c7a32a69911f0182f7334595d4c 100644 (file)
@@ -9,11 +9,14 @@
 #include "hara-kiri-group-spanner.hh"
 #include "hara-kiri-engraver.hh"
 #include "rhythmic-head.hh"
+#include "spanner.hh"
 
 Spanner*
 Hara_kiri_engraver::get_spanner_p () const
 {
-  return new Hara_kiri_group_spanner (get_property ("basicHaraKiriVerticalGroupspannerProperties"));
+  Spanner * sp = new Spanner (get_property ("basicHaraKiriVerticalGroupspannerProperties"));
+  Hara_kiri_group_spanner::set_interface (sp);
+  return sp;
 }
 
 void
@@ -25,9 +28,7 @@ Hara_kiri_engraver::acknowledge_element (Score_element_info i)
   
   if (Rhythmic_head *h = dynamic_cast<Rhythmic_head *> (i.elem_l_))
     {
-      dynamic_cast<Hara_kiri_group_spanner*> (staffline_p_)
-       ->add_interesting_item (h);
+      Hara_kiri_group_spanner::add_interesting_item (staffline_p_, h);
     }
-  
 }
 ADD_THIS_TRANSLATOR(Hara_kiri_engraver);
index 3161032716697aba99f4b6980d71030a37b47919..125b686f370ab9b6dd5009a38b80c69922c94056 100644 (file)
@@ -8,49 +8,41 @@
 */
 
 #include "axis-group-interface.hh"
+#include "spanner.hh"
 #include "hara-kiri-group-spanner.hh"
 #include "debug.hh"
 #include "item.hh"
 
-/*
- */
-Hara_kiri_group_spanner::Hara_kiri_group_spanner(SCM s)
-  : Spanner (s)
+void
+Hara_kiri_group_spanner::set_interface (Score_element*me)
 {
-  set_elt_pointer ("items-worth-living", SCM_EOL);
+  me->set_elt_pointer ("items-worth-living", SCM_EOL);
 }
 
 void 
-Hara_kiri_group_spanner::add_interesting_item (Item* n)
+Hara_kiri_group_spanner::add_interesting_item (Score_element* me,Item* n)
 {
-  add_dependency (n);
-  Pointer_group_interface (this, "items-worth-living").add_element (n);
+  me->add_dependency (n);
+  Pointer_group_interface (me, "items-worth-living").add_element (n);
 
 }
 
-GLUE_SCORE_ELEMENT(Hara_kiri_group_spanner,after_line_breaking);
-SCM 
-Hara_kiri_group_spanner::member_after_line_breaking ()
+void
+Hara_kiri_group_spanner::consider_suicide(Score_element*me)
 {
-  SCM worth = get_elt_pointer ("items-worth-living");
+  SCM worth = me->get_elt_pointer ("items-worth-living");
   if (gh_pair_p (worth))
-    return SCM_UNDEFINED;
+    return ;
 
-  Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
+  Link_array<Score_element> childs = Axis_group_interface (me).get_children ();
   for (int i = 0; i < childs.size (); i++)
-    {
-      Score_element* s = childs[i];
+    childs[i]->suicide ();
 
-      if ( line_l () != s->line_l ())
-       programming_error ("Killing other children too");
-      s->suicide ();
-    }
 
   /*
     very appropriate name here :-)
    */
-  suicide ();
-  return SCM_UNDEFINED;
+  me->suicide ();
 }
 
 
@@ -60,18 +52,16 @@ Hara_kiri_group_spanner::member_after_line_breaking ()
   group. Use a callback to make sure that hara-kiri has been done
   before asking for offsets.  */
 Real
-Hara_kiri_group_spanner::force_hara_kiri_callback (Score_element const  *elt, Axis a)
+Hara_kiri_group_spanner::force_hara_kiri_callback (Score_element *elt, Axis a)
 {
-  while (elt && !dynamic_cast<Hara_kiri_group_spanner const*> (elt))
+  while (elt
+        && to_boolean (elt->get_elt_property ("hara-kiri-interface")))
     elt = elt->parent_l(a);
 
   if (elt)
     {
-      Hara_kiri_group_spanner const  * seppuku = dynamic_cast<Hara_kiri_group_spanner const*> (elt);
-
-      ((Hara_kiri_group_spanner*)seppuku)->member_after_line_breaking ();
+      Hara_kiri_group_spanner::consider_suicide (elt);
     }
-  
 
   return 0.0;
 }
index c9e42d7be1dba7d4cfe71db58a625bec18c7de6e..04b2cca234d3d1ccdabf7ba5326767e86fcd963f 100644 (file)
@@ -38,7 +38,7 @@ struct Align_interface  {
   Score_element * elt_l_;
   
   Align_interface (Score_element const*);
-  static Real alignment_callback (Score_element const*,Axis);
+  static Real alignment_callback (Score_element *,Axis);
   void do_side_processing (Axis a);
   void set_axis (Axis);
   Axis axis () const;
@@ -46,7 +46,7 @@ struct Align_interface  {
   int get_count (Score_element*)const;
   void set_interface ();
   bool has_interface_b ();
-  static Real center_on_element (Score_element const *c, Axis);
+  static Real center_on_element (Score_element *c, Axis);
 };
 
 #endif /* ALIGN_INTERFACE_HH */
index 3d72a99494eae311437be103feaa96d5103f5862..f99d23213350932ec20b21b899c2f619fa64e855 100644 (file)
@@ -31,7 +31,7 @@ struct Axis_group_interface
   Score_element *elt_l_;
   Axis_group_interface (Score_element*);
 
-  static Interval group_extent_callback (Score_element const*,Axis);
+  static Interval group_extent_callback (Score_element *,Axis);
   static Interval relative_group_extent (Axis, Score_element * common, SCM list);
 
   void add_element (Score_element*);
index 92c03f20d87315213a08479af22c0ae6ddb230d5..1e6bf095f8e6cd9dbcb0f0a439475094fe2352a4 100644 (file)
@@ -11,7 +11,8 @@
 /**
   A vertical bar.
  */
-class Bar:public Item {
+class Bar:public Item
+{
 public:
   VIRTUAL_COPY_CONS(Score_element);
   Bar(SCM);
index 9a85134d641b1f1795c17888365f0536f5ca24f2..3efb7c2827377a13963b2bd2e507511ab5943580 100644 (file)
@@ -35,7 +35,7 @@ public:
   int visible_stem_count () const;
   Stem* first_visible_stem () const;
   Stem* last_visible_stem () const;
-  static Real rest_collision_callback (Score_element const*,Axis);
+  static Real rest_collision_callback (Score_element *,Axis);
   Beam (SCM);
   void add_stem (Stem*);
   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
index dd495b1db866198b6b1ebb6d31033dce867b3b84..a3c3bb9be0e4d2fac12097da911e3d9e7f5c2801 100644 (file)
 #ifndef BREATHING_SIGN_HH
 #define BREATHING_SIGN_HH
 
-#include "item.hh"
-#include "parray.hh"
+#include "lily-guile.hh"
 
 /*
   breathing sign (apostrophe within staff, not the comma above staff
   type)
 */
-class Breathing_sign : public Item
+class Breathing_sign
 {
 public:
   static SCM brew_molecule (SCM);
-  
-  VIRTUAL_COPY_CONS(Score_element);
-  Breathing_sign (SCM s);
-public:
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
-  SCM member_brew_molecule () const;
+  static Real offset_callback (Score_element *, Axis);
+  static void set_interface (Score_element*);
 };
 
 #endif // BREATHING_SIGN_HH
diff --git a/lily/include/chord-name-engraver.hh b/lily/include/chord-name-engraver.hh
deleted file mode 100644 (file)
index e8b780d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  chord-name-engraver.hh -- declare Chord_name_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef CHORD_NAME_ENGRAVER_HH
-#define CHORD_NAME_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "array.hh"
-#include "musical-pitch.hh"
-#include "lily-proto.hh"
-
-class Chord_name_engraver : public Engraver 
-{
-public:
-  Chord_name_engraver ();
-  VIRTUAL_COPY_CONS (Translator);
-
-protected:
-  virtual void do_pre_move_processing ();
-  virtual void acknowledge_element (Score_element_info i);
-  virtual void do_process_music ();
-  virtual bool do_try_music (Music* m);
-
-private:
-  Array<Musical_pitch> pitch_arr_;
-  Chord_name* chord_name_p_;
-  Tonic_req* tonic_req_;
-  Inversion_req* inversion_req_;
-  Bass_req* bass_req_;
-};
-
-#endif // CHORD_NAME_ENGRAVER_HH
index fae9d217b0a8c67cb07e7b37b7b3779e3ca56f14..b4b55b318ba2012ce633495d55d102f085040ba2 100644 (file)
@@ -9,8 +9,7 @@
 #ifndef CHORD_NAME_HH
 #define CHORD_NAME_HH
 
-#include "chord.hh"
-#include "item.hh"
+#include "lily-guile.hh"
 #include "molecule.hh"
 
 /**
    inversion(optional): musical-pitch
    bass(optional): musical-pitch
  */
-class Chord_name : public Item
+class Chord_name
 {
 public:
   static SCM brew_molecule (SCM);
-  
-  VIRTUAL_COPY_CONS (Score_element);
-  Molecule ly_word2molecule (SCM scm, Real* x) const;
-  Molecule ly_text2molecule (SCM scm) const;
-  Chord_name(SCM s);
-public:
-  SCM member_brew_molecule () const;
-
+  static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
+  static Molecule ly_text2molecule (Score_element*, SCM scm) ;
 };
 
 #endif // CHORD_NAME_HH
index 6f7ffbb4711be42f89158d5d09d9dcc988f3061a..3e88c982b2cdfbdfd28502e38cae09f40aa65993 100644 (file)
@@ -42,7 +42,7 @@ public:
   Score_element*  elt_l_;
   static SCM automatic_shift (Score_element*);
   static SCM forced_shift (Score_element*);
-  static Real force_shift_callback (Score_element const*, Axis);
+  static Real force_shift_callback (Score_element *, Axis);
   static void do_shifts (Score_element*);
 
   void add_column (Note_column*ncol_l);
index e45ef61ffdb6b3914e92339e2c8910aeeef93d71..36639f85869c1a4dd1d712abf2533e12b4185675 100644 (file)
 #ifndef CRESCENDO_HH
 #define CRESCENDO_HH
 
-#include "spanner.hh"
+#include "lily-guile.hh"
 /**
   The hairpin symbol. (cresc)
 
   (normal spanner?)
  */
-class Crescendo : public Spanner {
+struct Crescendo
+{
 public:
-   static SCM brew_molecule (SCM);
-  
-  Crescendo(SCM);
-
-  VIRTUAL_COPY_CONS(Score_element);
-  SCM member_brew_molecule() const;
-    
-private:
-  Molecule get_symbol() const;
+  static SCM brew_molecule (SCM);
+  static void set_interface(Score_element*);
 };
 
 #endif // CRESCENDO_HH
index 6c58b1d2e95ee06f4479ce2ec0881e72b86d83cd..b14b0b16aacec62aa987e527d87aa757545a9980 100644 (file)
@@ -11,8 +11,8 @@
 #define DIMENSION_CACHE_CALLBACK_HH
 
 
-typedef Interval (*Dim_cache_callback)(Score_element const *,Axis);
-typedef Real (*Offset_callback)(Score_element const *,Axis);
+typedef Interval (*Dim_cache_callback)(Score_element *,Axis);
+typedef Real (*Offset_callback)(Score_element *,Axis);
 
 #endif /* DIMENSION_CACHE_CALLBACK_HH */
 
diff --git a/lily/include/dot-column-engraver.hh b/lily/include/dot-column-engraver.hh
deleted file mode 100644 (file)
index deec318..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  dot-column-engraver.hh -- declare Dot_column_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef DOT_COLUMN_GRAV_HH
-#define DOT_COLUMN_GRAV_HH
-
-#include "engraver.hh"
-
-class Dot_column_engraver : public Engraver
-{
-  Dot_column *dotcol_p_ ;
-  Link_array<Rhythmic_head> head_l_arr_;
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  Dot_column_engraver();
-  
-protected:
-  virtual void acknowledge_element (Score_element_info);
-  virtual void do_pre_move_processing ();  
-};
-
-#endif // DOT_COLUMN_GRAV_HH
index e812875e99da32328b45a0b9064f39c88e173fd6..db18bf572dc8577b71dded790a2364034dbf884c 100644 (file)
 #ifndef DOT_COLUMN_HH
 #define DOT_COLUMN_HH
 
-#include "item.hh"
-
+#include "lily-guile.hh"
 
 /**
   Group dots.  This is needed because, the dots have to be aligned per voice
  */
-class Dot_column : public Item
+class Dot_column               // interface
 {
-  static int compare (Score_element * const&,Score_element * const&);
 public:
-  VIRTUAL_COPY_CONS (Score_element);
-  void add_head (Rhythmic_head*);
-  Dot_column (SCM);
-  
-  static Real force_shift_callback (Score_element const* , Axis);
+  static int compare (Score_element * const&,Score_element * const&);
+  static void add_head (Score_element * dotcol, Score_element* rh );
+  static void set_interface (Score_element*);
+  static Real force_shift_callback (Score_element * , Axis);
   static SCM do_shifts (SCM dotlist);
 };
 #endif // DOT_COLUMN_HH
index 21be4f774761090e2192a6c3018d7eee061edd8b..76189d65f67522b83196e664cc276fa99d74c546 100644 (file)
@@ -27,7 +27,7 @@
 class Dots                     // interface
 {
 public:
-  static Real quantised_position_callback(Score_element const*, Axis);
+  static Real quantised_position_callback(Score_element*, Axis);
   static SCM brew_molecule (SCM);
 };
 
index 476a18a915db3fa0d2a33289eba48b4d68082e11..912a6f4ffcf226956c0c366e8e9f954def389972 100644 (file)
@@ -10,7 +10,8 @@
 #ifndef HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
 #define HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
 
-#include "spanner.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /** 
   As Vertical_group_spanner, but keep track of interesting items.  If
     clear this line
 
 */
-class Hara_kiri_group_spanner : public Spanner
+class Hara_kiri_group_spanner 
 {
 public:
-  static Real force_hara_kiri_callback (Score_element const* , Axis);
-  Hara_kiri_group_spanner (SCM);
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
-  
-  void add_interesting_item (Item* n);
-
-  VIRTUAL_COPY_CONS(Score_element);
+  static Real force_hara_kiri_callback (Score_element * , Axis);
+  static void set_interface (Score_element*me);
+  static void consider_suicide (Score_element*me);
+  static void add_interesting_item (Score_element * me , Item* n);
 };
 
 
index 756a2b013988a96ebfd95a408ead2dce78511e54..e77703b9a31e33045a1500628e7e1c8baad72e05 100644 (file)
@@ -7,9 +7,8 @@
 #ifndef KEYITEM_HH
 #define KEYITEM_HH
 
-#include "item.hh"
-#include "array.hh"
-
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /**
   A group of  accidentals.
 
   new-accidentals -- list of (pitch, accidental) pairs
  */
-class Key_item :public  Item
+struct Key_item
 {
-  int calculate_position(SCM pair) const;
-
-public:
-  VIRTUAL_COPY_CONS(Score_element);
-  Key_item (SCM);
+  static int calculate_position(Score_element*,SCM pair) ;
+  void set_interface (Score_element*);
   static SCM brew_molecule (SCM);
-  
-
-
-  SCM member_brew_molecule() const;
 };
 
 #endif // KEYITEM_HH
index 0006c857bc16c47e2b0b82bcd59e1b71781ae9ba..01eba650076951905370ba8f72e436415f078b09 100644 (file)
@@ -6,6 +6,8 @@
 
 #ifndef LOCALKEYITEM_HH
 #define LOCALKEYITEM_HH
+
+
 #include "item.hh"
 #include "array.hh"
 #include "musical-pitch.hh"
index 6a9b31be68849afe5153751286d24f122d61d21f..f163bf48166dbb3653300f09acb5babacfa9e37c 100644 (file)
@@ -17,17 +17,11 @@ class Multi_measure_rest : public Spanner
 {
 public:
   Multi_measure_rest (SCM);
- static SCM brew_molecule (SCM);
   
-
-  void add_column (Item*);
-  Molecule compound_rest (int)const;
-
-  SCM member_brew_molecule () const;
+  static void set_interface (Score_element*);
+  static SCM brew_molecule (SCM);
+  static  void add_column (Score_element*,Item*);
   VIRTUAL_COPY_CONS (Score_element);
-
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
   virtual Array<Rod> get_rods () const;
 };
 
index 5ef166a3bac27d386c7ed6a34e3c1c422c24ae08..fe5dc7c68b5160ab4dcbb6decc76a6ec99cf3fff 100644 (file)
@@ -49,7 +49,7 @@ public:
   void add_rod (Paper_column * to, Real distance);
   void add_spring (Paper_column * to, Real dist, Real strength);
 
-  virtual Paper_column * column_l () const;
+  virtual Paper_column *column_l () const;
   virtual Line_of_score *line_l () const;
 
   /// if lines are broken then this column is in #line#
@@ -58,7 +58,7 @@ public:
   /// which  one (left =0)
   int rank_i() const;
 
-  Paper_column (Moment when);
+  Paper_column (SCM);
   Moment when_mom ()const;
 
   bool musical_b () const;
index 8758535ea8c8fce05ecc676f27d35c249e4bcc15..ff9846cfbf543b277086dcfd479523cc2b2ea9fc 100644 (file)
@@ -46,6 +46,7 @@ public:
   void output_font_switch (int i);
   void output_header ();
   void output_comment (String s);
+  void output_string (SCM s);
   void output_scheme (SCM scm);
 };
 
diff --git a/lily/include/repeat-engraver.hh b/lily/include/repeat-engraver.hh
deleted file mode 100644 (file)
index bd8bbd9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-  repeat-engraver.hh -- declare Repeat_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef REPEAT_ENGRAVER_HH
-#define REPEAT_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "cons.hh"
-
-struct Bar_create_event
-{
-  Moment when_;
-  bool bar_b_;
-  bool last_b_;
-  String type_;
-  Bar_create_event();
-  Bar_create_event (Moment w, String s);
-  Bar_create_event (Moment w, int i, int j);
-};
-
-int compare (Bar_create_event const & c1, Bar_create_event const &c2)
-{
-  return (c1.when_ - c2.when_).sign();
-}
-
-/**
-  Generate repeat-bars |: :| for repeated-music
-  */
-class Repeat_engraver : public Engraver 
-{
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  Repeat_engraver ();
-protected:
-  virtual void acknowledge_element (Score_element_info i);
-  virtual void do_removal_processing ();
-  virtual bool do_try_music (Music *req_l);
-  virtual void do_process_music();
-  virtual void do_pre_move_processing();
-  virtual void do_post_move_processing ();
-  void queue_events ();
-
-private:
-  Repeated_music *repeated_music_l_;
-  bool done_this_one_b_;
-
-  /*
-    Royal_brackla_create_queue is only two Whiskies away. :-)
-   */
-  Cons<Bar_create_event> *create_barmoments_queue_;
-
-  Volta_spanner * volta_span_p_;
-  Volta_spanner* end_volta_span_p_;
-};
-
-#endif // REPEAT_ENGRAVER_HH
-
index 4eaddd45d73e1a52b23a112f79983b63c5b9b535..baf03668b40b2de755b717376991de9e99a5f4c3 100644 (file)
@@ -22,7 +22,7 @@ public:
   Rest_collision(Score_element*);
   void set_interface ();
 
-  static Real force_shift_callback (Score_element const*, Axis);
+  static Real force_shift_callback (Score_element *, Axis);
   static SCM do_shift (Score_element*,SCM);
 };
 #endif // REST_COLLISION_HH
index 32398bb089d909ab9fb9d321f03ce60b109698d5..9ae036d0d56803faa8f1e79291967d1115733c1d 100644 (file)
@@ -14,8 +14,8 @@
 #include "smobs.hh"
 #include "dimension-cache.hh"
 
-typedef Interval (*Extent_callback)(Score_element const *,Axis);
-typedef Real (*Offset_callback)(Score_element const *,Axis);
+typedef Interval (*Extent_callback)(Score_element *,Axis);
+typedef Real (*Offset_callback)(Score_element *,Axis);
 
 #define READONLY_PROPS         // FIXME.
 
@@ -167,9 +167,9 @@ public:
   Molecule get_molecule () const;
   void suicide ();
   
-  static Interval preset_extent (Score_element const*,Axis);
-  static Interval point_dimension_callback (Score_element const*,Axis );
-  static Interval molecule_extent (Score_element const*,Axis);
+  static Interval preset_extent (Score_element *,Axis);
+  static Interval point_dimension_callback (Score_element *,Axis );
+  static Interval molecule_extent (Score_element *,Axis);
 
 protected:
   /**
diff --git a/lily/include/score-priority-engraver.hh b/lily/include/score-priority-engraver.hh
deleted file mode 100644 (file)
index 3ec4360..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  score-align-engraver.hh -- declare Type_align_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef SCOREF_ALIGN_GRAV_HH
-#define SCOREF_ALIGN_GRAV_HH
-
-#include "engraver.hh"
-
-/**
-  Group a number of items across staffs:
-
-  Acknowledge items, put each priority in a separate column.  Put all
-  columns in a horizontal align engraver.  We manufacture two types of
-  elements: the alignment element and the columns.  This is probably
-  more convenient, and I question the use having one without the
-  other.
-*/
-class Score_priority_engraver : public Engraver
-{
-  Break_align_item * halign_p_;
-  Link_array<Item> column_p_arr_;
-
-  void add_horizontal_group (Item* , int p);
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  Score_priority_engraver ();
-  
-protected:
-  virtual void acknowledge_element (Score_element_info);
-  virtual void do_pre_move_processing();
-};
-
-#endif // SCORE_ALIGN_GRAV_HH
index 9c580c50833b3699d43b068c5363e73a81e3022c..1e41d86583ce46cfbd2895ff4d3f2658e30d50aa 100644 (file)
 #ifndef Script_COLUMN_HH
 #define Script_COLUMN_HH
 
-#include "item.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
 
-class Script_column : public Item
+class Script_column
 {
 public:
-  Script_column(SCM);
-  void add_staff_sided (Item*);
-
-  SCM member_before_line_breaking ();
+  static void add_staff_sided (Score_element*, Item*);
   static SCM before_line_breaking (SCM);
 };
 
index 4d7bc39cfd0e30b9d85a7fa08631ebe4b80fb715..df31d40d15e094b84bdc41535d92484f417ed0c1 100644 (file)
 */
 class Script : public Item
 {
-  Molecule get_molecule (Direction d) const;
 public:
+  static  Molecule get_molecule (Score_element*,Direction d);
   Script (SCM);
-   static SCM brew_molecule (SCM);
-  
-
-
-  SCM member_before_line_breaking ();
-  static SCM before_line_breaking (SCM);
+  static SCM brew_molecule (SCM);
   SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
-  SCM member_brew_molecule () const;
 };
 
 #endif /* Stem_SCRIPT_HH */
index bfbe26506224c4fd7ecbb9da67a14010ebf029f3..f947eb57ba93554ebb8ac806442fc83fbaf04390 100644 (file)
@@ -15,7 +15,7 @@
 class Separating_group_spanner : public Spanner
 {
 public:
-  void add_spacing_unit (Single_malt_grouping_item*);
+  void add_spacing_unit (Item*);
   Separating_group_spanner(SCM);
 protected:
   VIRTUAL_COPY_CONS(Score_element);
index eccb4b0ee4dce690d552322bce7e2d2aaf10b9a1..6a26cd3194ce78e49a5e42cb8b15017df291a96f 100644 (file)
@@ -9,26 +9,5 @@
 
 #ifndef SEPARATING_LINE_GROUP_GRAV_HH
 #define SEPARATING_LINE_GROUP_GRAV_HH
-
-#include "engraver.hh"
-
-class Separating_line_group_engraver : public Engraver
-{
-protected:
-  Single_malt_grouping_item * break_malt_p_;
-  Single_malt_grouping_item* nobreak_malt_p_;
-  Separating_group_spanner * sep_span_p_;
-  
-  virtual void acknowledge_element (Score_element_info);
-  virtual void do_creation_processing ();
-  virtual void do_removal_processing ();
-  virtual void do_pre_move_processing ();
-public:
-  Separating_line_group_engraver ();
-  VIRTUAL_COPY_CONS (Translator);
-  
-};
-
-
 #endif /* SEPARATING_LINE_GROUP_GRAV_HH */
 
diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh
new file mode 100644 (file)
index 0000000..a7bfa6e
--- /dev/null
@@ -0,0 +1,36 @@
+/*   
+  single-malt-grouping-item.hh -- declare Separation_item
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef SINGLE_MALT_GROUPING_ITEM_HH
+#define SINGLE_MALT_GROUPING_ITEM_HH
+
+#include "lily-proto.hh"
+
+/** Calc dimensions for the Separating_group_spanner; this has to be
+   an item to get dependencies correct.  It can't be an element_group
+   since these usually are in a different X_group
+
+   Properties:
+
+
+   elements -- list of items.
+   
+   no-spacing-rods -- read from elements: boolean that makes Separation_item ignore
+     this item
+   
+*/
+struct Separation_item
+{
+  static void set_interface (Score_element*);
+  static Interval my_width (Score_element*) ;
+  static void add_item (Score_element*,Item*);
+};
+
+#endif /* SINGLE_MALT_GROUPING_ITEM_HH */
+
index 8ace8fcad84bcedda5a7899cbf85546d75d2ee52..117fd8caed604b45fb806c36bc8dd87b7d90517a 100644 (file)
@@ -39,11 +39,11 @@ struct Side_position_interface
   Score_element * elt_l_;
 public:
   Side_position_interface (Score_element const*);
-  static Real side_position (Score_element const *, Axis);
-  static Real aligned_on_self (Score_element const *, Axis);
-  static Real aligned_side (Score_element const *, Axis);  
-  static Real quantised_position (Score_element const*, Axis);
-  static Real centered_on_parent (Score_element const*, Axis);
+  static Real side_position (Score_element *, Axis);
+  static Real aligned_on_self (Score_element *, Axis);
+  static Real aligned_side (Score_element *, Axis);  
+  static Real quantised_position (Score_element *, Axis);
+  static Real centered_on_parent (Score_element *, Axis);
   void set_axis (Axis);
   void set_minimum_space (Real);
   void set_padding (Real);
diff --git a/lily/include/single-malt-grouping-item.hh b/lily/include/single-malt-grouping-item.hh
deleted file mode 100644 (file)
index 082a37b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*   
-  single-malt-grouping-item.hh -- declare Single_malt_grouping_item
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef SINGLE_MALT_GROUPING_ITEM_HH
-#define SINGLE_MALT_GROUPING_ITEM_HH
-
-#include "item.hh"
-
-/** Calc dimensions for the Separating_group_spanner; this has to be
-   an item to get dependencies correct.  It can't be an element_group
-   since these usually are in a different X_group
-
-   It's 1:30 am.  Naming suggestions appreciated.
-
-   Properties:
-
-
-   elements -- list of items.
-   
-   no-spacing-rods -- read from elements: boolean that makes Single_malt_grouping_item ignore
-     this item
-   
-*/
-class Single_malt_grouping_item : public Item
-{
-  VIRTUAL_COPY_CONS(Score_element);
-public:
-  Single_malt_grouping_item (SCM);
-  Interval my_width () const;
-  void add_item (Item*);
-};
-
-#endif /* SINGLE_MALT_GROUPING_ITEM_HH */
-
index 9ccb4d65b37e571d17cce28aee606001240e1f89..52079f0a5ac93c4cc61ed1b1bff6f160ca48bf7a 100644 (file)
@@ -31,7 +31,7 @@ public:
   void add_bar (Score_element*);
   void evaluate_empty ();
 
-  static Interval width_callback(Score_element const*, Axis) ;
+  static Interval width_callback(Score_element *, Axis) ;
   
   virtual Real get_bar_size () const;
   SCM member_before_line_breaking ();
index 3241e2790858df5840580535db41f4fcc6a9a56e..4ce355dd4c26add27d83492a1bd06d88c5fafad5 100644 (file)
@@ -34,7 +34,7 @@ class Spanner : public  Score_element {
 
 public:
   Link_array<Spanner> broken_into_l_arr_;
-
+  Real get_broken_left_end_align () const;
   // TODO: make virtual and do this for Items as well.
   Interval_t<int> spanned_rank_iv ();
   void set_bound (Direction d, Score_element*);
@@ -54,7 +54,7 @@ public:
 protected:
   void set_my_columns ();
   VIRTUAL_COPY_CONS(Score_element);
-  Real get_broken_left_end_align () const;
+
 
   virtual void do_space_processing ();
   virtual void do_break_processing ();
index 9734cf17afb7d77378ee67837b99745e85eae328..202f27f0ded4214fe476b2e74e6c122b10c920b3 100644 (file)
 class Staff_symbol_referencer_interface 
 {
 public:
-  Score_element * elt_l_;
+  Score_element * elt_l_;      // junkme.
   Staff_symbol_referencer_interface (Score_element const*);
-  void set_interface ();
-  bool has_interface_b ();
+  static void set_interface (Score_element*);
+  static bool has_interface_b (Score_element*);
   void set_position (Real);
-  static Real callback (Score_element const*, Axis a);
+  static Real callback (Score_element *, Axis a);
 
   /**
      Leading are the lead strips between the sticks (lines) of
index 2cd904a6320dfd04866d74ba279c8d6224a8d794..344d1f5568b81cd83b39b7171ea208b617b83213 100644 (file)
 #ifndef ABBREV_HH
 #define ABBREV_HH
 
-#include "item.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
 
-
-class Stem_tremolo : public Item {
+class Stem_tremolo
+{
 public:
-  Stem * stem_l () const;
-  SCM member_brew_molecule () const;
-
+  static void set_interface (Score_element*);
   static Interval dim_callback (Score_element*, Axis);
   static SCM brew_molecule (SCM);
-  Stem_tremolo (SCM);
-  void set_stem (Stem *);
+  static void set_stem (Score_element*me, Score_element *st);
 };
 
 #endif /* ABBREV_HH */
index ed0f619d0fdf5d4b77b5e2af18171a07717d6fe1..2897b07d538d090b27bdc3a721cc7984de916576 100644 (file)
@@ -88,12 +88,12 @@ public:
   void position_noteheads();
 
   Real stem_end_position () const;
-  static Real off_callback (Score_element const*, Axis);
+  static Real off_callback (Score_element *, Axis);
   Molecule flag () const;
 
   SCM member_before_line_breaking ();
   static SCM before_line_breaking (SCM);
-  static Interval dim_callback (Score_element const*,Axis);
+  static Interval dim_callback (Score_element *,Axis);
   SCM member_brew_molecule() const;
 
   void set_spacing_hints () ;
index 659b166514e3723c1fc2c45aaff646e1b32d7c49..b5c500c6f70ef809cea94fdda28cd0e883a4a0e2 100644 (file)
@@ -23,8 +23,8 @@ public:
   
   VIRTUAL_COPY_CONS (Score_element);
 
-  virtual SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
+  static void try_collapse (Score_element*);
   
   Molecule staff_bracket (Real) const;
   Molecule staff_brace (Real) const;
diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
index d4ff9f41e7d41986c7f8dc4a4edefe7011301944..c8a7b8bca3d0a1d544e5b147516a5d70ad8b527e 100644 (file)
 class Tie_column : public Spanner
 {
 public:
-  VIRTUAL_COPY_CONS (Score_element);
-  void add_tie (Tie*);
   Tie_column (SCM s);
+  VIRTUAL_COPY_CONS (Score_element);
+  static void set_interface (Score_element*me);
+  static void add_tie (Score_element*me,Tie*);
 
-  SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
-  void set_directions ();
+  static void set_directions (Score_element*me);
 };
 
 #endif /* TIE_COLUMN_HH */
index 92a2b24719eb6b4efe76ae54b1895aff79150de8..347c0be237a9f484fef722f3fb053eb69ef6c759 100644 (file)
@@ -20,29 +20,24 @@ class Tie : public Spanner
 {
 public:
   Tie (SCM);
-  void set_head (Direction, Item*head_l);
+  static void set_head (Score_element*,Direction, Item*head_l);
+  static void set_interface (Score_element*);
   VIRTUAL_COPY_CONS(Score_element);
-
-  Rhythmic_head* head (Direction) const;
-  Real position_f () const;
+  static Rhythmic_head* head (Score_element*,Direction) ;
+  static Real position_f (Score_element*) ;
   static SCM brew_molecule (SCM);
-  Direction get_default_dir() const;
-  SCM member_brew_molecule () const;
-  Array<Offset> get_encompass_offset_arr () const;
-  Bezier get_curve () const;
+  static Direction get_default_dir(Score_element*) ;
+  static SCM after_line_breaking (SCM);
+
 
   /*
     JUNKME
    */
+  Array<Offset> get_encompass_offset_arr () const;
+  Bezier get_curve () const;
   Drul_array<Real> dy_f_drul_;
   Drul_array<Real> dx_f_drul_;
-
-  virtual void do_add_processing ();
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
-
   virtual Array<Rod> get_rods () const;
-
   Array<Offset> get_controls () const;
 };
 
diff --git a/lily/include/time-signature-engraver.hh b/lily/include/time-signature-engraver.hh
deleted file mode 100644 (file)
index 11959f8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  time_signature-engraver.hh -- declare  Time_signature_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef TIME_SIG_ENGRAVER_HH
-#define TIME_SIG_ENGRAVER_HH
-
-#include "engraver.hh"
-
-/**
-  generate time_signatures. 
-  */
-class Time_signature_engraver : public Engraver {
-protected:
-  virtual void do_process_music();
-  virtual void do_pre_move_processing();
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  Time_signature * time_signature_p_;
-
-  Time_signature_engraver();
-};
-#endif // TIME_SIG_ENGRAVER_HH
index 80a08ac7a61bba9c8b36caf7e1b1dd90b53c9019..f25d12c866863b7cffc7fa5c959500bfbea994f1 100644 (file)
@@ -8,34 +8,20 @@
 #define METER_HH
 
 #include "item.hh"
-#include "array.hh"
-#include "real.hh"
 
 /**
    Print a time_signature sign.
-  TODO:
 
-  C style time_signatures, 2+3+2/8 time_signatures, alla breve.
+   TODO:
+
+   2+3+2/8 time_signatures
   
  */
-class Time_signature: public Item
+struct Time_signature
 {
-  Molecule special_time_signature (String,int,int) const;
-  Molecule time_signature (int, int)const;
-  
-public:
-  SCM member_brew_molecule() const;
-
-  Time_signature (SCM);
- static SCM brew_molecule (SCM);
-  
-
-  /*
-    TODO: make this SCM!
-   */
-  Array<int> args_;
-  
-  VIRTUAL_COPY_CONS(Score_element);
+  static Molecule special_time_signature (Score_element*,String,int,int) ;
+  static Molecule time_signature (Score_element*,int, int);
+  static SCM brew_molecule (SCM);
 };
 #endif // METER_HH
 
index 90496b424e674df3809c895fa417941db9fc32f3..73370baea38b97407835514d8f2124c4228d1a60 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef Tuplet_spanner_HH
 #define Tuplet_spanner_HH
 
-#include "spanner.hh"
+#include "lily-guile.hh"
 
 /** supportable plet: triplets, eentweetjes, ottava, etc.
 
 
   todo: handle breaking elegantly.
 */
-class Tuplet_spanner : public Spanner
+class Tuplet_spanner
 {
 public:
-  Tuplet_spanner (SCM);
   static SCM brew_molecule (SCM);
-  
+  static void set_interface (Score_element*);  
 
-  void add_column (Note_column*);
-  void add_beam (Beam*);
+  static void add_column (Score_element*me,Item*);
+  static void add_beam (Score_element*me,Score_element*);
 
-  void calc_dy (Real *) const;
-  void calc_position_and_height (Real*,Real *dy)const;
+  static void calc_dy (Score_element*,Real *) ;
+  static void calc_position_and_height (Score_element*,Real*,Real *dy);
   
-  SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
-  SCM member_brew_molecule () const;
-  VIRTUAL_COPY_CONS(Score_element);
-
 
-  Direction get_default_dir () const;
+  static Direction get_default_dir (Score_element*);
 };
 
 #endif // Tuplet_spanner_HH
index ba28f37e6a10d54b37989db30dd80bc7755190af..c95961909b95977404063238dc4bf7f93fe44bf0 100644 (file)
 
 /** Volta bracket with number */
 
-class Volta_spanner : public Spanner
+class Volta_spanner
 {
 public:
-  Volta_spanner (SCM);
+  static void set_interface (Score_element*);
   static SCM brew_molecule (SCM);
-  void add_column (Note_column*);
-  void add_bar (Bar*);
-  SCM member_brew_molecule () const;
-  VIRTUAL_COPY_CONS (Score_element);
+  static void add_column (Score_element*, Score_element*col);
+  static void add_bar (Score_element*me, Item*bar);
 
-
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
 };
 
 #endif // VOLTA_SPANNER_HH
index 524d32cffaa013748f05682c0f42d6cc3701b3c1..3d5f48e83ac8dbd564f53f01b4a1d29a3ff704de 100644 (file)
@@ -32,8 +32,8 @@ public:
   VIRTUAL_COPY_CONS(Translator);
 
   Key_change_req * keyreq_l_;
-  Key_item * item_p_;
-  Protected_scm old_accs_;
+  Item * item_p_;
+  Protected_scm old_accs_;     // ugh. -> property
     
 protected:
   virtual void do_creation_processing();
@@ -56,16 +56,15 @@ Key_engraver::create_key (bool def)
 {
   if (!item_p_) 
     {
-      item_p_ = new Key_item ( get_property ("basicKeyProperties"));
-      
+      item_p_ = new Item ( get_property ("basicKeyProperties"));
+
       item_p_->set_elt_property ("c0-position", gh_int2scm (0));
 
       // todo: put this in basic props.
       item_p_->set_elt_property ("old-accidentals", old_accs_);
       item_p_->set_elt_property ("new-accidentals", get_property ("keySignature"));
 
-      Staff_symbol_referencer_interface st (item_p_);
-      st.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (item_p_);
 
       SCM prop = get_property ("keyOctaviation");
       bool multi = to_boolean (prop);
index 77a9e104188d80a4a0fe205d451429205e527693..871abd31ceefa68a39d6e584e238a6530397644c 100644 (file)
@@ -8,20 +8,13 @@
   keyplacement by Mats Bengtsson
 */
 
-#include "group-interface.hh" 
+#include "item.hh"
 #include "key-item.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 
-Key_item::Key_item (SCM s)
-  : Item (s)
-{
-  set_elt_property ("c0-position", gh_int2scm (0));
-}
-
-
 /*
   FIXME: too much hardcoding here.
  */
@@ -34,18 +27,18 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
   the thinking to other parties.
  */
 int
-Key_item::calculate_position(SCM pair) const
+Key_item::calculate_position(Score_element *ki, SCM pair) 
 {
   int p = gh_scm2int (gh_car (pair));
   int a = gh_scm2int (gh_cdr (pair));  
-  
-  if (to_boolean (get_elt_property ("multi-octave")))
+  int c0p = gh_scm2int (ki->get_elt_property ("c0-position"));
+  if (to_boolean (ki->get_elt_property ("multi-octave")))
     {
-      return p + gh_scm2int (get_elt_property ("c0-position"));
+      return p + c0p;
     }
   else {
     // Find the c in the range -4 through 2
-    int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
+    int from_bottom_pos = c0p + 4;
     from_bottom_pos = from_bottom_pos%7;
     from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
     int c0 = from_bottom_pos - 4;
@@ -78,17 +71,18 @@ Key_item::calculate_position(SCM pair) const
   TODO
   - space the `natural' signs wider
  */
-GLUE_SCORE_ELEMENT(Key_item,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Key_item,brew_molecule);
 SCM
-Key_item::member_brew_molecule () const
+Key_item::brew_molecule (SCM smob)
 {
-  Molecule mol;
+  Score_element*me =unsmob_element (smob);
 
-  Staff_symbol_referencer_interface si (this);
+
+  Staff_symbol_referencer_interface si (me);
   Real inter = si.staff_space ()/2.0;
   
-  SCM newas = get_elt_property ("new-accidentals");  
-
+  SCM newas = me->get_elt_property ("new-accidentals");  
+  Molecule mol;
   /*
     SCM lists are stacks, so we work from right to left, ending with
     the cancellation signature.
@@ -96,14 +90,15 @@ Key_item::member_brew_molecule () const
   for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
     {
       int a = gh_scm2int (gh_cdar (s));
-      Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (a));
-      m.translate_axis (calculate_position(gh_car (s)) * inter, Y_AXIS);
+      Molecule m = me->lookup_l ()->afm_find ("accidentals-" + to_str (a));
+      m.translate_axis (calculate_position(me, gh_car (s)) * inter, Y_AXIS);
       mol.add_at_edge (X_AXIS, LEFT, m, 0);
     }
-  
-  if (break_status_dir () != RIGHT)
+
+  Item *it = dynamic_cast<Item*> (me) ;
+  if (it->break_status_dir () != RIGHT)
     {
-      SCM old = get_elt_property ("old-accidentals");
+      SCM old = me->get_elt_property ("old-accidentals");
       /*
        Add half a space between  cancellation and key sig.
 
@@ -112,7 +107,7 @@ Key_item::member_brew_molecule () const
       Interval x(0, inter);
       Interval y(0,0);
 
-      mol.add_at_edge (X_AXIS, LEFT, lookup_l()->blank (Box(x,y)),0);
+      mol.add_at_edge (X_AXIS, LEFT, me->lookup_l()->blank (Box(x,y)),0);
       
       for (; gh_pair_p (old); old = gh_cdr (old))
         {
@@ -127,9 +122,9 @@ Key_item::member_brew_molecule () const
                
          if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old))
            {
-              Molecule m =lookup_l ()->afm_find ("accidentals-0");
+              Molecule m =me->lookup_l ()->afm_find ("accidentals-0");
 
-              m.translate_axis (calculate_position(gh_car(old)) * inter, Y_AXIS);
+              m.translate_axis (calculate_position (me, gh_car (old)) * inter, Y_AXIS);
               mol.add_at_edge (X_AXIS, LEFT, m,0);     
             }
         }
index 62bd6a153d0b2ac5acc8711f8c0bb1f6a5b39441..274a558a07e261a3fb0e3e8d4bf4e13d25dc0f8c 100644 (file)
@@ -101,6 +101,17 @@ Line_of_score::output_lines ()
          progress_indication (to_str (i));
          progress_indication ("]");
        }
+
+      if (i < broken_into_l_arr_.size () - 1)
+       {
+         SCM lastcol =  gh_car (line_l->get_elt_pointer ("columns"));
+         Score_element*  e = unsmob_element (lastcol);
+         SCM inter = e->get_elt_property ("between-system-string");
+         if (gh_string_p (inter))
+           {
+             pscore_l_->outputter_l_->output_string (inter);         
+           }
+       }
     }
 }
 
@@ -179,7 +190,6 @@ Line_of_score::add_column (Paper_column*p)
   set_elt_pointer ("columns",  gh_cons (p->self_scm_, cs));
 
   Axis_group_interface (this).add_element (p);
-  typeset_element (p);
 }
 
 
index 9fcde99872787e0bb7492586bd5f083da5222c9e..96e4cec5dff519e75e3faf0860d11b704254b7db 100644 (file)
@@ -65,10 +65,10 @@ Local_key_engraver::do_creation_processing ()
 void
 Local_key_engraver::process_acknowledged ()
 {
-  SCM localsig = get_property ("localKeySignature");
-  
   if (!key_item_p_ && mel_l_arr_.size()) 
     {
+      SCM localsig = get_property ("localKeySignature");
+  
       SCM f = get_property ("forgetAccidentals");
       bool forget = to_boolean (f);
       for (int i=0; i  < mel_l_arr_.size(); i++) 
@@ -100,7 +100,7 @@ Local_key_engraver::process_acknowledged ()
                  key_item_p_ = new Local_key_item (get_property ("basicLocalKeyProperties"));
                  Side_position_interface (key_item_p_).set_axis (X_AXIS);
                  Side_position_interface (key_item_p_).set_direction (LEFT);
-                 Staff_symbol_referencer_interface (key_item_p_).set_interface ();
+                 Staff_symbol_referencer_interface::set_interface (key_item_p_);
                         
                  announce_element (Score_element_info (key_item_p_, 0));
                }
@@ -137,13 +137,13 @@ Local_key_engraver::process_acknowledged ()
 #endif
            }
         }
-    }
+
 
   
   
   daddy_trans_l_->set_property ("localKeySignature",  localsig);
+    }
   /*
-    UGH ! 
    */
   
   if (key_item_p_ && grace_align_l_)
@@ -192,12 +192,12 @@ Local_key_engraver::acknowledge_element (Score_element_info info)
     {
       grace_align_l_ = gai;
     }
-  Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
-  Rhythmic_head * note_head = dynamic_cast<Rhythmic_head *> (info.elem_l_);
-
   if (he_gr != selfgr)
     return;
   
+  Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
+  Rhythmic_head * note_head = dynamic_cast<Rhythmic_head *> (info.elem_l_);
+
   if (note_l && note_head)
     {
       mel_l_arr_.push (note_l);
@@ -205,12 +205,12 @@ Local_key_engraver::acknowledge_element (Score_element_info info)
     }
   else if (Tie * tie_l = dynamic_cast<Tie *> (info.elem_l_))
     {
-      tied_l_arr_.push (tie_l->head (RIGHT));
+      tied_l_arr_.push (Tie::head (tie_l, RIGHT));
     }
 }
 
 /*
-  ugh. deep_copy uses lots of space.
+  ugh. repeated deep_copy generates lots of garbage.
  */
 void
 Local_key_engraver::do_process_music()
@@ -227,6 +227,7 @@ Local_key_engraver::do_process_music()
   else if (last_keysig_ != sig) 
     {
       daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
+      last_keysig_ = sig;
     }
 }
 
index 61326091ea5dceaf7ce15a701a1b23d4d7fb3880..a139f21ca5941188312067c90e1d797db7dc2a82 100644 (file)
@@ -220,7 +220,7 @@ sanitise_PS_string (String t)
 }
 
 /**
-TODO: move into Text_item
+TODO: move into Text_item. UGH: paper_l argument shoudl be junked.
 */
 Molecule
 Lookup::text (String style, String text, Paper_def *paper_l) 
index 943092d400093c1152ea9c7661775b07e77d10aa..762deb8825bed43931a00b89639ea57684cfd57f 100644 (file)
@@ -57,9 +57,9 @@ Multi_measure_rest_engraver::acknowledge_element (Score_element_info i)
   if (Bar *c = dynamic_cast<Bar*> (i.elem_l_))
     {
       if (mmrest_p_)
-       mmrest_p_->add_column (c);
+       Multi_measure_rest::add_column (mmrest_p_,c);
       if (lastrest_p_)
-       lastrest_p_->add_column (c);
+       Multi_measure_rest::add_column (mmrest_p_,c);
     }
 }
 
@@ -110,8 +110,8 @@ Multi_measure_rest_engraver::do_process_music ()
   if (busy_span_req_l_ && !mmrest_p_)
     {
       mmrest_p_ = new Multi_measure_rest (get_property ("basicMultiMeasureRestProperties"));
-      Staff_symbol_referencer_interface si (mmrest_p_);
-      si.set_interface ();
+      Multi_measure_rest::set_interface (mmrest_p_);
+      Staff_symbol_referencer_interface::set_interface (mmrest_p_);
 
       announce_element (Score_element_info (mmrest_p_, busy_span_req_l_));
       start_measure_i_
index 97d1401c17ae56e16e61396e7f8f8f4a1dde88a5..72b54689930201938d8d199a4ef3b6c501f86aa7 100644 (file)
 #include "group-interface.hh"
 #include "stem.hh"
 #include "staff-symbol-referencer.hh"
-
-Multi_measure_rest::Multi_measure_rest (SCM s)
-  : Spanner (s)
+void
+Multi_measure_rest::set_interface (Score_element*me)
 {
-  set_elt_pointer ("columns", SCM_EOL);
+  me->set_elt_pointer ("columns", SCM_EOL);
 }
 
+Multi_measure_rest::Multi_measure_rest (SCM s)
+  : Spanner(s)
+{}
 
 /*
    [TODO]                                      17
  * variable-sized multi-measure rest symbol: |====| ??
 */
-
-GLUE_SCORE_ELEMENT(Multi_measure_rest,brew_molecule);
-
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Multi_measure_rest,brew_molecule);
 SCM
-Multi_measure_rest::member_brew_molecule () const
+Multi_measure_rest::brew_molecule (SCM smob) 
 {
+  Score_element *me = unsmob_element (smob);
+  Spanner * sp = dynamic_cast<Spanner*> (me);
   Real staff_space
-    = Staff_symbol_referencer_interface (this).staff_space ();
+    = Staff_symbol_referencer_interface (me).staff_space ();
 
   Interval sp_iv;
   Direction d = LEFT;
   do
     {
-      Item * col = get_bound (d)->column_l ();
+      Item * col = sp->get_bound (d)->column_l ();
 
       Interval coldim = col->extent (X_AXIS)
        + col->relative_coordinate (0, X_AXIS);
@@ -55,7 +57,7 @@ Multi_measure_rest::member_brew_molecule () const
   Molecule mol;
   Real x_off = 0.0;
 
-  Real rx  = get_bound (LEFT)->relative_coordinate (0, X_AXIS);
+  Real rx  = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
   /*
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
@@ -71,14 +73,14 @@ Multi_measure_rest::member_brew_molecule () const
   Molecule s;
 
   int measures = 1;
-  SCM m (get_elt_property ("measure-count"));
+  SCM m (me->get_elt_property ("measure-count"));
   if (gh_number_p (m))
     {
       measures = gh_scm2int (m);
     }
   
 
-  if (measures <= paper_l() ->get_var ("multi_measure_rest_expand_limit"))
+  if (measures <= me->paper_l() ->get_var ("multi_measure_rest_expand_limit"))
     {
       /*
        Build a rest from smaller parts. Distances inbetween are
@@ -105,9 +107,9 @@ Multi_measure_rest::member_brew_molecule () const
            }
 
          Real pad = s.empty_b ()
-           ? 0.0 : paper_l ()->get_var ("multi_measure_rest_padding");
+           ? 0.0 : me->paper_l ()->get_var ("multi_measure_rest_padding");
       
-         Molecule r (lookup_l ()->afm_find ("rests-" + to_str (k)));
+         Molecule r (me->lookup_l ()->afm_find ("rests-" + to_str (k)));
          if (k == 0)
            r.translate_axis (staff_space, Y_AXIS);
          
@@ -120,14 +122,14 @@ Multi_measure_rest::member_brew_molecule () const
   else 
     {
       String idx =  ("rests-") + to_str (-4);
-      s = lookup_l ()->afm_find (idx);
+      s = me->lookup_l ()->afm_find (idx);
     }
   
   mol.add_molecule (s);
 
   if (measures > 1)
     {
-      Molecule s (lookup_l ()->text ("number", to_str (measures), paper_l ()));
+      Molecule s (me->lookup_l ()->text ("number", to_str (measures), me->paper_l ()));
       s.align_to (X_AXIS, CENTER);
       s.translate_axis (3.0 * staff_space, Y_AXIS);
       mol.add_molecule (s);
@@ -139,19 +141,13 @@ Multi_measure_rest::member_brew_molecule () const
 /*
   UGH. JUNKME elt prop "columns" isn't really needed. 
  */
-
-
-
 void
-Multi_measure_rest::add_column (Item* c)
+Multi_measure_rest::add_column (Score_element*me,Item* c)
 {
-  Pointer_group_interface gi (this, "columns");
+  Pointer_group_interface gi (me, "columns");
   gi.add_element (c);
 
-  add_bound_item (this, c);
-  
-  add_dependency (c);
+  add_bound_item (dynamic_cast<Spanner*> (me),c);
 }
 
 
index c072d2f461b505c0e3a9c03bd761efa85d8f38e5..035b18a3786e74db55a7b46d2c604ded7a16167c 100644 (file)
@@ -16,8 +16,6 @@
 #include "dimension-cache.hh"
 #include "staff-symbol-referencer.hh"
 
-
-
 /*
   build a ledger line for small pieces.
  */
index fa72a59e2f55a6779d4b9f3382854987d849fed5..49524aea218df88ae88af231d0ae1a7415b395e8 100644 (file)
@@ -87,8 +87,8 @@ Note_heads_engraver::do_process_music()
     {
       Rhythmic_head *note_p  = new Rhythmic_head (get_property ("basicNoteHeadProperties"));
       
-      Staff_symbol_referencer_interface si (note_p);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (note_p);
+
 
       
       Note_req * note_req_l = note_req_l_arr_[i];
@@ -100,8 +100,7 @@ Note_heads_engraver::do_process_music()
        {
          Item * d = new Item (get_property ("basicDotsProperties"));
 
-         Staff_symbol_referencer_interface sd (d);
-         sd.set_interface ();
+         Staff_symbol_referencer_interface::set_interface (d);
          
          note_p->set_dots (d);
          
@@ -114,7 +113,8 @@ Note_heads_engraver::do_process_music()
          announce_element (Score_element_info (d,0));
          dot_p_arr_.push (d);
        }
-      si.set_position(note_req_l->pitch_.steps ());
+
+      note_p->set_elt_property("staff-position",  gh_int2scm (note_req_l->pitch_.steps ()));
 
       Score_element_info itinf (note_p,note_req_l);
       announce_element (itinf);
index 5ab553257f9e028413abaab825d2769ec8bfc6b5..b7e18f9aa4f9d93b33a00be9c434da892ea525c1 100644 (file)
@@ -94,12 +94,9 @@ Paper_column::column_l () const
   return (Paper_column*)(this);
 }
 
-Paper_column::Paper_column (Moment w)
-  : Item (SCM_EOL)             // guh.?
+Paper_column::Paper_column (SCM l)
+  : Item (l)           // guh.?
 {
-  SCM when = smobify (new Moment (w));
-  set_elt_property ("when", when);
-
   Axis_group_interface (this).set_interface ();
   Axis_group_interface (this).set_axes (X_AXIS, X_AXIS);
   set_elt_pointer ("bounded-by-me", SCM_EOL);
index 832905198153213e79695361adfd1da07473e6e8..0277f753a7ff070975412832c39495cb0ea4e5b4 100644 (file)
@@ -231,5 +231,8 @@ Paper_outputter::output_int_def (String k, int v)
 
 
 
-
-
+void
+Paper_outputter::output_string (SCM str)
+{
+  *stream_p_ <<  ly_scm2string (str);
+}
index 72572c389133c552b97745f263ba1bb717edde79..6ed4bf9bb7d157505c87f57180336efad9b58ec7 100644 (file)
@@ -6,7 +6,8 @@
   (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "repeat-engraver.hh"
+#include "engraver.hh"
+#include "cons.hh"
 #include "bar.hh"
 #include "bar-engraver.hh"
 #include "musical-request.hh"
 #include "note-column.hh"
 #include "paper-def.hh"
 #include "music-list.hh"
+#include "side-position-interface.hh"
+
+struct Bar_create_event
+{
+  Moment when_;
+  bool bar_b_;
+  bool last_b_;
+  String type_;
+  Bar_create_event();
+  Bar_create_event (Moment w, String s);
+  Bar_create_event (Moment w, int i, int j);
+};
+
+int compare (Bar_create_event const & c1, Bar_create_event const &c2)
+{
+  return (c1.when_ - c2.when_).sign();
+}
+
+/**
+  Generate repeat-bars |: :| for repeated-music
+  */
+class Repeat_engraver : public Engraver 
+{
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Repeat_engraver ();
+protected:
+  virtual void acknowledge_element (Score_element_info i);
+  virtual void do_removal_processing ();
+  virtual bool do_try_music (Music *req_l);
+  virtual void do_process_music();
+  virtual void do_pre_move_processing();
+  virtual void do_post_move_processing ();
+  void queue_events ();
+
+private:
+  Repeated_music *repeated_music_l_;
+  bool done_this_one_b_;
+
+  /*
+    Royal_brackla_create_queue is only two Whiskies away. :-)
+   */
+  Cons<Bar_create_event> *create_barmoments_queue_;
+
+  Spanner * volta_span_p_;
+  Spanner* end_volta_span_p_;
+};
+
+
+
 
 ADD_THIS_TRANSLATOR (Repeat_engraver);
 
@@ -180,7 +231,8 @@ Repeat_engraver::do_process_music ()
          else
            {
              assert (!volta_span_p_);
-             volta_span_p_ = new Volta_spanner (get_property ("basicVoltaSpannerProperties"));
+             volta_span_p_ = new Spanner (get_property ("basicVoltaSpannerProperties"));
+             Volta_spanner::set_interface (volta_span_p_);
              announce_element (Score_element_info (volta_span_p_,0));
              volta_span_p_->set_elt_property ("text",
                                               ly_str02scm (t.ch_C()));
@@ -212,16 +264,16 @@ Repeat_engraver::acknowledge_element (Score_element_info i)
   if (Note_column *c = dynamic_cast<Note_column *> (i.elem_l_))
     {
       if (volta_span_p_)
-       volta_span_p_->add_column (c);
+       Volta_spanner::add_column (volta_span_p_,c);
       if (end_volta_span_p_)
-       end_volta_span_p_->add_column (c);      
+       Volta_spanner::add_column (end_volta_span_p_,c);      
     }
   if (Bar *c = dynamic_cast<Bar*> (i.elem_l_))
     {
       if (volta_span_p_)
-       volta_span_p_->add_bar (c);
+       Volta_spanner::add_bar (volta_span_p_,c);
       if (end_volta_span_p_)
-       end_volta_span_p_ ->add_bar(c);
+       Volta_spanner::add_bar(end_volta_span_p_ , c);
     }
 }
 
@@ -257,6 +309,8 @@ Repeat_engraver::do_pre_move_processing ()
 {
   if (end_volta_span_p_)
     {
+      Side_position_interface (end_volta_span_p_).add_staff_support ();
+      
       typeset_element (end_volta_span_p_ );
       end_volta_span_p_ =0;
     }
index 2a38b27d2ba391b1bf294eb6ba68d5f0609bcfc9..969741809b67e05cbd271fb744fb2709edbc2672 100644 (file)
@@ -20,7 +20,7 @@
 #include "duration.hh"
 
 Real
-Rest_collision::force_shift_callback (Score_element const*them, Axis a)
+Rest_collision::force_shift_callback (Score_element *them, Axis a)
 {
   assert (a == Y_AXIS);
 
index ccc80a3f82de05f2f6fe3916280e4cb485cf3aae..35df3f18ec8af778f710135f9a80ad76ee10a70f 100644 (file)
@@ -65,8 +65,8 @@ Rest_engraver::do_process_music ()
   if (rest_req_l_ && !rest_p_) 
     {
       rest_p_ = new Rhythmic_head (get_property ("basicRestProperties"));
-      Staff_symbol_referencer_interface si (rest_p_);
-      si.set_interface ();
+      Staff_symbol_referencer_interface::set_interface (rest_p_);
+
       
       rest_p_->set_elt_property ("duration-log",
                                 gh_int2scm (rest_req_l_->duration_.durlog_i_)); 
@@ -75,8 +75,8 @@ Rest_engraver::do_process_music ()
        {
          dot_p_ = new Item (get_property ("basicDotsProperties"));
 
-         Staff_symbol_referencer_interface si (dot_p_);
-         si.set_interface ();
+         Staff_symbol_referencer_interface::set_interface (dot_p_);
+
          
          rest_p_->set_dots (dot_p_);
          dot_p_->set_parent (rest_p_, Y_AXIS);
index dba6143faaac850313e3a107105a8368f78beb85..632beeb3af33216b0e34afe08d65fafabfd14f73 100644 (file)
@@ -21,7 +21,7 @@ class Rhythmic_column_engraver :public Engraver
   Link_array<Slur> grace_slur_endings_;
   Stem * stem_l_;
   Note_column *ncol_p_;
-  Dot_column *dotcol_l_;
+  Score_element *dotcol_l_;
 
 protected:
   VIRTUAL_COPY_CONS(Translator);
@@ -67,7 +67,7 @@ Rhythmic_column_engraver::process_acknowledged ()
   if (ncol_p_)
     {
       if (dotcol_l_
-         && !dotcol_l_->parent_l(X_AXIS))
+         && !dotcol_l_->parent_l (X_AXIS))
        {
          ncol_p_->set_dotcol (dotcol_l_);
        }
@@ -108,9 +108,10 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
     {
       rhead_l_arr_.push (r);
     }
-  else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
+  else if (item
+          && to_boolean (item->get_elt_property ("dot-column-interface")))
     {
-      dotcol_l_ = d;
+      dotcol_l_ = item;
     }
   else if (Slur *s = dynamic_cast<Slur*> (i.elem_l_))
     {
index 90af9edf1b67c577cdbd9ef2f3be5aa970a116d7..7d287f84bad9d942d1734ca85773ba0beb7d33b0 100644 (file)
@@ -10,7 +10,7 @@
 #include "paper-column.hh"
 #include "debug.hh"
 #include "dimensions.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 
 
 Rod::Rod ()
index 92c1abd453ace9ae0afa7a2cf68aa0baa9e73b81..c437a655d5831b4a530f088a482992e291204323 100644 (file)
@@ -35,7 +35,7 @@ Score_element_info::origin_trans_l_arr (Translator* end) const
   do {
     r.push (t);
     t = t->daddy_trans_l_;
-  } while (t != end->daddy_trans_l_);
+  } while (t && t != end->daddy_trans_l_);
   
   return r;
 }
index 5e929206f41e8093d5c256f4f06613bd54de4cf9..c79813468c6559b2050c702a27ad84e788fcb161 100644 (file)
@@ -138,14 +138,14 @@ Score_element::set_elt_pointer (const char* k, SCM v)
 
 
 Interval
-Score_element::molecule_extent (Score_element const *s, Axis a )
+Score_element::molecule_extent (Score_element *s, Axis a)
 {
   Molecule m = s->get_molecule ();
   return m.extent(a);
 }
 
 Interval
-Score_element::preset_extent (Score_element const *s , Axis a )
+Score_element::preset_extent (Score_element  *s , Axis a)
 {
   SCM ext = s->get_elt_property ((a == X_AXIS)
                                 ? "extent-X"
@@ -508,7 +508,7 @@ Score_element::get_offset (Axis a) const
 
 
 Interval
-Score_element::point_dimension_callback (Score_element const* , Axis)
+Score_element::point_dimension_callback (Score_element* , Axis)
 {
   return Interval (0,0);
 }
@@ -529,7 +529,7 @@ Score_element::extent (Axis a) const
     }
   else if (!d->valid_b_)
     {
-      d->dim_= (*d->extent_callback_l_ ) (this, a);
+      d->dim_= (*d->extent_callback_l_ ) ((Score_element*)this, a);
       d->valid_b_ = true;
     }
 
index c8933e03969c4f661bd27af6263f0a9b65529ed7..8c878da7bf574098746a79434ae254bf95c5e68d 100644 (file)
@@ -31,9 +31,22 @@ void
 Score_engraver::prepare (Moment w)
 {
   Global_translator::prepare (w);
-  set_columns (new Paper_column (w),  new Paper_column (w));
 
+  SCM props = get_property (ly_symbol2scm ("basicPaperColumnProperties"));
+  set_columns (new Paper_column (props),  new Paper_column (props));
+  
+  SCM when = smobify (new Moment (w));
+  command_column_l_->set_elt_property ("when", when);
+  musical_column_l_->set_elt_property ("when", when);
   command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
+  
+  Score_element_info i1(command_column_l_, 0), i2 (musical_column_l_,0);
+
+  i1.origin_trans_l_ = this;
+  i2.origin_trans_l_ = this;
+  announce_element (i1);
+  announce_element (i2);
+  
   post_move_processing();
 }
 
@@ -181,19 +194,10 @@ Score_engraver::set_columns (Paper_column *new_command_l,
     {
       if (*current[i])
        {
-             scoreline_l_->add_column ((*current[i]));
+         scoreline_l_->add_column ((*current[i]));
          if (!(*current[i])->used_b())
            {
-             /*
-               We're forgetting about this column. Dump it, and make SCM
-               forget it.
-
-               FIXME: we should have another way of not putting this
-               column into the spacing problem. Maybe we shouldn't
-               even prevent this.
-
-             */
-               (*current[i])->suicide ();
+             (*current[i])->suicide ();
              *current[i]  =0;
            }
        }
index 9fbf4f567d61c8d34da0f808f11e413ed28e16d6..e76d3c41a7ba1dc878b1db9c900a365151c650cf 100644 (file)
@@ -9,15 +9,15 @@
 
 #include "engraver.hh"
 #include "script-column.hh"
+#include "item.hh"
 #include "side-position-interface.hh"
-#include "dimension-cache.hh"
 
 /**
    Find potentially colliding scripts, and put them in a
    Script_column, that will fix the collisions.  */
 class Script_column_engraver : public Engraver
 {
-  Script_column *scol_p_;
+  Score_element *scol_p_;
   Link_array<Item> script_l_arr_;
 
 public:
@@ -73,14 +73,16 @@ Script_column_engraver::process_acknowledged ()
 {
   if (!scol_p_ && script_l_arr_.size () > 1)
     {
-      scol_p_ = new Script_column (SCM_EOL);
+      scol_p_ = new Item (get_property ("basicScriptColumnProperties"));
+      scol_p_->set_elt_pointer ("scripts", SCM_EOL);  
+
       announce_element (Score_element_info (scol_p_, 0));
     }
 
   if (scol_p_)
     {
       for (int i=0; i < script_l_arr_.size (); i++)
-       scol_p_->add_staff_sided (script_l_arr_[i]);
+       Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
       script_l_arr_.clear ();
     }
 }
index cc8cfcacb0b5d0d22ce005a1e644ef83c96322ee..7d047b97f5772a8cd3adb61882d885da63fa4e39 100644 (file)
 #include "group-interface.hh"
 
 void
-Script_column::add_staff_sided (Item *i)
+Script_column::add_staff_sided (Score_element *me, Item *i)
 {
   SCM p = i->get_elt_property ("script-priority");
   if (!gh_number_p (p))
     return;
-  
 
-  Pointer_group_interface gi (this, "scripts");
+  Pointer_group_interface gi (me, "scripts");
   gi.add_element (i);
   
-  add_dependency (i);
-}
-
-Script_column::Script_column (SCM s)
-  : Item (s)
-{
-  set_elt_pointer ("scripts", SCM_EOL);  
+  me->add_dependency (i);
 }
 
 static int
-staff_side_compare (Item * const &i1,
-                   Item * const &i2)
+staff_side_compare (Score_element * const &i1,
+                   Score_element * const &i2)
 {
   SCM p1 = i1->get_elt_property ("script-priority");
   SCM p2 = i2->get_elt_property ("script-priority");
@@ -41,13 +34,15 @@ staff_side_compare (Item * const &i1,
   return gh_scm2int (p1) - gh_scm2int (p2);
 }
 
-GLUE_SCORE_ELEMENT(Script_column,before_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Script_column,before_line_breaking);
+
 SCM
-Script_column::member_before_line_breaking ()
+Script_column::before_line_breaking (SCM smob)
 {
-  Drul_array<Link_array<Item> > arrs;
-  Link_array<Item> staff_sided 
-    = Pointer_group_interface__extract_elements (this, (Item*)0, "scripts");
+  Score_element* me = unsmob_element (smob);
+  Drul_array<Link_array<Score_element> > arrs;
+  Link_array<Score_element> staff_sided 
+    = Pointer_group_interface__extract_elements (me, (Score_element*)0, "scripts");
                                     
                                     
   for (int i=0; i < staff_sided.size (); i++)
@@ -58,11 +53,11 @@ Script_column::member_before_line_breaking ()
 
   Direction d = DOWN;
   do {
-    Link_array<Item> &arr(arrs[d]);
+    Link_array<Score_element> &arr(arrs[d]);
     
     arr.sort (staff_side_compare);
 
-    Item * last = 0;
+    Score_element * last = 0;
     for (int i=0; i < arr.size (); i++)
       {
        Side_position_interface s (arr[i]);
index 04f8bf4f8d334d741298474b14bae86da5665316..a12f671bbd1604f465f1c13d754db61f57da0ad0 100644 (file)
@@ -71,6 +71,8 @@ Script_engraver::do_process_music()
        }
       // todo -> use result of articulation-to-scriptdef directly as basic prop list.
       Script *p =new Script (get_property ("basicScriptProperties"));
+
+      p->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
       Side_position_interface stafy (p);
       
       
index 326667e7b44cc99a6d380d756d3bc11bc1922e8b..5ad45f28ca7c23a1c345e19bec6b804696f069e2 100644 (file)
@@ -20,40 +20,29 @@ Script ::Script (SCM s)
 }
 
 Molecule
-Script::get_molecule(Direction d) const
+Script::get_molecule(Score_element * me, Direction d)
 {
-  SCM s = get_elt_property ("molecule");
+  SCM s = me->get_elt_property ("molecule");
   assert (gh_pair_p (s));
 
   SCM key = gh_car  (s);
   if (key == ly_symbol2scm ("feta"))
     {
-      return lookup_l ()->afm_find ("scripts-" +
+      return me->lookup_l ()->afm_find ("scripts-" +
                                    ly_scm2string (index_cell (gh_cdr (s), d)));
     }
   else if (key == ly_symbol2scm ("accordion"))
     {
-      return lookup_l ()->accordion (gh_cdr (s), paper_l()->get_var("interline"));
+      return me->lookup_l ()->accordion (gh_cdr (s), me->paper_l()->get_var("interline"));
     }
-
-  else assert (false);
+  else
+    assert (false);
 
   return Molecule ();
 }
 
 
-GLUE_SCORE_ELEMENT(Script,before_line_breaking);
-SCM
-Script::member_before_line_breaking ()
-{
-  /*
-    center my self on the note head.
-   */
-  Score_element * e = parent_l(X_AXIS);
-  translate_axis (e->extent (X_AXIS).center (), X_AXIS);
 
-  return SCM_UNDEFINED;
-}
 
 GLUE_SCORE_ELEMENT(Script,after_line_breaking);
 SCM
@@ -67,17 +56,18 @@ Script::member_after_line_breaking ()
 }
 
 
-GLUE_SCORE_ELEMENT(Script,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Script,brew_molecule);
 
 SCM
-Script::member_brew_molecule () const
+Script::brew_molecule (SCM smob)
 {
+  Score_element *me= unsmob_element (smob);
   Direction dir = DOWN;
-  SCM d = get_elt_property ("direction");
+  SCM d = me->get_elt_property ("direction");
   if (isdir_b (d))
     dir = to_dir (d);
   
-  return get_molecule (dir).create_scheme();
+  return get_molecule (me, dir).create_scheme();
 }
 
 
index 9ce1156d171bccdf9b29d9287e68eed29592a568..d627cb6da150c7e1526bb323bc59fae7bf3ba53d 100644 (file)
@@ -8,19 +8,19 @@
  */
 
 #include "separating-group-spanner.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
 #include "dimensions.hh"
 #include "group-interface.hh"
 
 static Rod
-make_rod (Single_malt_grouping_item *l, Single_malt_grouping_item *r)
+make_rod (Item *l, Item *r)
 {
   Rod rod;
 
-  Interval li (l->my_width ());
-  Interval ri (r->my_width ());
+  Interval li (Separation_item::my_width (l));
+  Interval ri (Separation_item::my_width (r));
 
   rod.item_l_drul_[LEFT] =l;
   rod.item_l_drul_[RIGHT]=r;
@@ -48,17 +48,17 @@ Separating_group_spanner::get_rods () const
       SCM elt = gh_cadr (s);
       SCM next_elt = gh_car (s);
 
-      Single_malt_grouping_item *l = dynamic_cast<Single_malt_grouping_item*> (unsmob_element (elt));
-      Single_malt_grouping_item *r = dynamic_cast<Single_malt_grouping_item*> (unsmob_element ( next_elt));
+      Item *l = dynamic_cast<Item*> (unsmob_element (elt));
+      Item *r = dynamic_cast<Item*> (unsmob_element ( next_elt));
 
       if (!r || !l)
        continue;
       
-      Single_malt_grouping_item *lb
-       = dynamic_cast<Single_malt_grouping_item*>(l->find_prebroken_piece (RIGHT));
+      Item *lb
+       = dynamic_cast<Item*>(l->find_prebroken_piece (RIGHT));
 
-      Single_malt_grouping_item *rb
-       = dynamic_cast<Single_malt_grouping_item*>(r->find_prebroken_piece (LEFT));
+      Item *rb
+       = dynamic_cast<Item*>(r->find_prebroken_piece (LEFT));
       
       a.push (make_rod(l,  r));
       if (lb)
@@ -99,7 +99,7 @@ Separating_group_spanner::get_rods () const
 }
 
 void
-Separating_group_spanner::add_spacing_unit (Single_malt_grouping_item*i)
+Separating_group_spanner::add_spacing_unit (Item*i)
 {
   Pointer_group_interface (this, "elements").add_element (i);
   add_dependency (i);
index a46608d0ab18c928013f5706acdde44f98473830..8b5c2f23273b0db50813f74c035d246b1ac5cc8f 100644 (file)
@@ -7,11 +7,27 @@
   
  */
 
-#include "separating-line-group-engraver.hh"
 #include "separating-group-spanner.hh"
-#include "single-malt-grouping-item.hh"
+#include "separation-item.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
+#include "engraver.hh"
+
+class Separating_line_group_engraver : public Engraver
+{
+protected:
+  Item * break_malt_p_;
+  Item * nobreak_malt_p_;
+  Separating_group_spanner * sep_span_p_;
+  
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_creation_processing ();
+  virtual void do_removal_processing ();
+  virtual void do_pre_move_processing ();
+public:
+  Separating_line_group_engraver ();
+  VIRTUAL_COPY_CONS (Translator);
+};
 
 Separating_line_group_engraver::Separating_line_group_engraver ()
 {
@@ -43,20 +59,20 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i)
   if (it && !it->parent_l (X_AXIS))
     {
       bool ib =it->breakable_b ();
-      Single_malt_grouping_item *&p_ref_ (ib ? break_malt_p_
-                                         : nobreak_malt_p_);
+      Item *&p_ref_ (ib ? break_malt_p_
+                             : nobreak_malt_p_);
 
       if (!p_ref_)
        {
          p_ref_
-           = new Single_malt_grouping_item
+           = new Item
            (get_property ("basicSingleMaltGroupingItemProperties"));
          
          if (ib)
            p_ref_->set_elt_property ("breakable", SCM_BOOL_T);
          announce_element (Score_element_info (p_ref_, 0));
        }
-      p_ref_->add_item (it);
+      Separation_item::add_item (p_ref_,it);
     }
 }
 
diff --git a/lily/separation-item.cc b/lily/separation-item.cc
new file mode 100644 (file)
index 0000000..f51345b
--- /dev/null
@@ -0,0 +1,70 @@
+/*   
+  single-malt-grouping-item.cc --  implement Separation_item
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "separation-item.hh"
+#include "paper-column.hh"
+#include "debug.hh"
+#include "group-interface.hh"
+
+void
+Separation_item::set_interface (Score_element*s)
+{
+  s->set_elt_pointer ("elements", SCM_EOL);
+  s->set_extent_callback (0, X_AXIS);
+  s->set_extent_callback (0,  Y_AXIS);
+}
+
+void
+Separation_item::add_item (Score_element*s,Item* i)
+{
+  assert (i);
+  Pointer_group_interface (s).add_element (i);
+  s->add_dependency (i);
+}
+
+Interval
+Separation_item::my_width (Score_element *me)
+{
+  Item *item = dynamic_cast<Item*> (me);
+  Paper_column * pc = item->column_l ();
+  Interval w;
+  
+  for (SCM s =  me->get_elt_pointer ("elements"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      SCM elt = gh_car (s);
+      if (!SMOB_IS_TYPE_B(Score_element, elt))
+       continue;
+      
+      Item *il = dynamic_cast<Item*> (unsmob_element (elt));
+      if (pc != il->column_l ())
+       {
+         /* this shouldn't happen, but let's continue anyway. */
+         programming_error (_("Separation_item:  I've been drinking too much"));
+         continue;             /*UGH UGH*/ 
+       }
+
+      if (to_boolean (il->get_elt_property ("no-spacing-rods")))
+       {
+         continue;
+       }
+
+      Interval iv (il->extent (X_AXIS));
+      if (!iv.empty_b ())
+       {
+         Real off = il->relative_coordinate (pc, X_AXIS);
+         w.unite  (iv + off);
+       }
+    }
+
+  return w;
+ // add this->offset_ ? this-> relative_coordinate ()? 
+}
+
+
+
index 21f8d227dc82a85780690a367e9eb4aefdf00db6..c52646506a7d0da5a91224e79b4dbe9a1fce6c23 100644 (file)
@@ -59,7 +59,7 @@ Side_position_interface::get_direction () const
  */
 
 Real
-Side_position_interface::side_position (Score_element const *cme, Axis axis)
+Side_position_interface::side_position (Score_element *cme, Axis axis)
 {
   Score_element* me = (Score_element*)cme;
   Score_element *common = me->parent_l (axis);
@@ -114,7 +114,7 @@ Side_position_interface::side_position (Score_element const *cme, Axis axis)
   callback that centers the element on itself
  */
 Real
-Side_position_interface::aligned_on_self (Score_element const*elm, Axis ax)
+Side_position_interface::aligned_on_self (Score_element *elm, Axis ax)
 {
   String s ("self-alignment-");
 
@@ -156,14 +156,14 @@ directed_round (Real f, Direction d)
   Callback that quantises in staff-spaces, rounding in the direction
   of the elements "direction" elt property. */
 Real
-Side_position_interface::quantised_position (Score_element const *me, Axis a)
+Side_position_interface::quantised_position (Score_element *me, Axis a)
 {
   Side_position_interface s(me);
   Direction d = s.get_direction ();
-  Staff_symbol_referencer_interface si (me);
 
-  if (si.has_interface_b ())
+  if (Staff_symbol_referencer_interface::has_interface_b (me))
     {
+      Staff_symbol_referencer_interface si (me);
       Real p = si.position_f ();
       Real rp = directed_round (p, d);
 
@@ -183,7 +183,7 @@ Side_position_interface::quantised_position (Score_element const *me, Axis a)
   Position next to support, taking into account my own dimensions and padding.
  */
 Real
-Side_position_interface::aligned_side (Score_element const*me, Axis ax)
+Side_position_interface::aligned_side (Score_element *me, Axis ax)
 {
   Side_position_interface s(me);
   Direction d = s.get_direction ();
@@ -206,7 +206,7 @@ Side_position_interface::aligned_side (Score_element const*me, Axis ax)
   Position centered on parent.
  */
 Real
-Side_position_interface::centered_on_parent (Score_element const* me, Axis a)
+Side_position_interface::centered_on_parent (Score_element * me, Axis a)
 {
   Score_element *him = me->parent_l (a);
 
diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc
deleted file mode 100644 (file)
index 84d10f7..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*   
-  single-malt-grouping-item.cc --  implement Single_malt_grouping_item
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#include "single-malt-grouping-item.hh"
-#include "paper-column.hh"
-#include "debug.hh"
-#include "group-interface.hh"
-
-Single_malt_grouping_item ::Single_malt_grouping_item(SCM s)
-  : Item (s)
-{
-  set_elt_pointer ("elements", SCM_EOL);
-
-  // this is weird! , but needed!
-  set_extent_callback (0, X_AXIS);
-  set_extent_callback (0,  Y_AXIS);
-
-}
-
-void
-Single_malt_grouping_item::add_item (Item* i)
-{
-  assert (i);
-  Pointer_group_interface (this).add_element (i);
-
-  add_dependency (i);
-}
-
-Interval
-Single_malt_grouping_item::my_width () const
-{
-  Paper_column * pc = column_l ();
-  Interval w;
-  
-  for (SCM s = get_elt_pointer ("elements"); gh_pair_p (s); s = gh_cdr (s))
-    {
-      SCM elt = gh_car (s);
-      if (!SMOB_IS_TYPE_B(Score_element, elt))
-       continue;
-      
-      Item *il = dynamic_cast<Item*> (SMOB_TO_TYPE (Score_element, elt));
-      if (pc != il->column_l ())
-       {
-         /* this shouldn't happen, but let's continue anyway. */
-         programming_error (_("Single_malt_grouping_item:  I've been drinking too much"));
-         continue;             /*UGH UGH*/ 
-       }
-
-      if (to_boolean (il->get_elt_property ("no-spacing-rods")))
-       {
-         continue;
-       }
-
-      Interval iv (il->extent (X_AXIS));
-      if (!iv.empty_b ())
-       {
-         Real off = il->relative_coordinate (pc, X_AXIS);
-         w.unite  (iv + off);
-       }
-    }
-
-  return w;
- // add this->offset_ ? this-> relative_coordinate ()? 
-}
-
-
-
index 91ab2a0ab291a43a9a41da542c970af3e5a4f682..0012dab45f7931711ff3a0334a002fa5f52629db 100644 (file)
@@ -26,7 +26,7 @@ Span_bar::add_bar (Score_element*b)
 
 
 Interval
-Span_bar::width_callback (Score_element const *se, Axis )
+Span_bar::width_callback (Score_element *se, Axis )
 {
   Span_bar*  s= dynamic_cast<Span_bar*> ((Score_element*)se);
   String gl = ly_scm2string (s->get_elt_property ("glyph"));
@@ -101,7 +101,7 @@ Span_bar::evaluate_empty ()
 Interval
 Span_bar::get_spanned_interval () const
 {
-  return Axis_group_interface::group_extent_callback (this, Y_AXIS);  
+  return Axis_group_interface::group_extent_callback ((Span_bar*)this, Y_AXIS);  
 }
 
 
index ca3c938ed85733ebf423d246035af23056143841..b2ed112f90d2e4d20d2499f5e8a55937943ca895 100644 (file)
@@ -19,19 +19,19 @@ Staff_symbol_referencer_interface::Staff_symbol_referencer_interface (Score_elem
 }
 
 void
-Staff_symbol_referencer_interface::set_interface ()
+Staff_symbol_referencer_interface::set_interface (Score_element * e)
 {
-  if (!gh_number_p (elt_l_->get_elt_property ("staff-position")))
-      elt_l_->set_elt_property ("staff-position", gh_double2scm (0.0));
+  if (!gh_number_p (e->get_elt_property ("staff-position")))
+      e->set_elt_property ("staff-position", gh_double2scm (0.0));
       
-  elt_l_->add_offset_callback (callback, Y_AXIS);
+  e->add_offset_callback (callback, Y_AXIS);
 }
 
 bool
-Staff_symbol_referencer_interface::has_interface_b ()
+Staff_symbol_referencer_interface::has_interface_b (Score_element*e)
 {
-  return unsmob_element (elt_l_->get_elt_pointer ("staff-symbol"))
-    || gh_number_p (elt_l_->get_elt_property ("staff-position"));
+  return unsmob_element (e->get_elt_pointer ("staff-symbol"))
+    || gh_number_p (e->get_elt_property ("staff-position"));
 }
 
 
@@ -91,7 +91,7 @@ Staff_symbol_referencer_interface::position_f () const
   should use offset callback!
  */
 Real
-Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis )
+Staff_symbol_referencer_interface::callback (Score_element * sc,Axis )
 {
   Score_element* me = (Score_element*)sc; // UGH.
   
index 0deb53ab44b0b2c8a972a4f9cf499dabe584ca84..08b598f1e2c215753903937d7acac5c76715b88d 100644 (file)
@@ -35,7 +35,7 @@ protected:
 private:
   int default_tremolo_type_i_;
   Stem *stem_p_;
-  Stem_tremolo *tremolo_p_;
+  Score_element *tremolo_p_;
   Rhythmic_req *rhythmic_req_l_;
   Tremolo_req* tremolo_req_l_;
 };
@@ -77,8 +77,8 @@ Stem_engraver::acknowledge_element(Score_element_info i)
       if (!stem_p_) 
        {
          stem_p_ = new Stem (get_property ("basicStemProperties"));
-         Staff_symbol_referencer_interface st(stem_p_);
-         st.set_interface ();
+         Staff_symbol_referencer_interface::set_interface(stem_p_);
+
          
          stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log));
 
@@ -101,7 +101,9 @@ Stem_engraver::acknowledge_element(Score_element_info i)
 
              if (requested_type)
                {
-                 tremolo_p_ = new Stem_tremolo (get_property ("basicStemTremoloProperties"));
+                 tremolo_p_ = new Item (get_property ("basicStemTremoloProperties"));
+                 Stem_tremolo::set_interface (tremolo_p_);
+
                  announce_element (Score_element_info (tremolo_p_, tremolo_req_l_));
                  /*
                    The number of tremolo flags is the number of flags of
@@ -133,7 +135,7 @@ Stem_engraver::do_pre_move_processing()
 {
   if (tremolo_p_)
     {
-      tremolo_p_->set_stem (stem_p_);
+      Stem_tremolo::set_stem (tremolo_p_, stem_p_);
       typeset_element (tremolo_p_);
       tremolo_p_ = 0;
     }
index 0d26fcd52a52604f4db37607d9e9b9f21a673b9c..a2e174f69b793efb0a2ace8d5a8496de8da34f5f 100644 (file)
     lengthen stem if necessary
  */
 
-Stem_tremolo::Stem_tremolo (SCM s)
-  : Item (s)
+void
+Stem_tremolo::set_interface (Score_element *me)
 {
-  set_elt_pointer ("stem", SCM_EOL);
+me->set_elt_pointer ("stem", SCM_EOL);
 }
 
 
-Stem *
-Stem_tremolo::stem_l ()const
-{
-  SCM s =   get_elt_pointer ("stem");
-
-  return dynamic_cast<Stem*> (  unsmob_element (s));
-}
-
 Interval
 Stem_tremolo::dim_callback (Score_element * se, Axis )
 {
-  Stem_tremolo * s = dynamic_cast<Stem_tremolo*> (se);
-  Real space = Staff_symbol_referencer_interface (s->stem_l ())
-    .staff_space ();
+  Real space = Staff_symbol_referencer_interface (se).staff_space ();
   return Interval (-space, space);
 }
 
 
 
-GLUE_SCORE_ELEMENT(Stem_tremolo,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Stem_tremolo,brew_molecule);
 SCM
-Stem_tremolo::member_brew_molecule () const
+Stem_tremolo::brew_molecule (SCM smob)
 {
-  Stem * stem = stem_l ();
+  Score_element *me= unsmob_element (smob);
+  Stem * stem = dynamic_cast<Stem*> (unsmob_element (me->get_elt_pointer ("stem")));
   Beam * beam = stem->beam_l ();
   
   Real dydx;
@@ -72,16 +63,16 @@ Stem_tremolo::member_brew_molecule () const
     dydx = 0.25;
 
   Real ss = Staff_symbol_referencer_interface (stem).staff_space ();
-  Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
-  Real width = gh_scm2double (get_elt_property ("beam-width"));
+  Real thick = gh_scm2double (me->get_elt_property ("beam-thickness"));
+  Real width = gh_scm2double (me->get_elt_property ("beam-width"));
   width *= ss;
   thick *= ss;
   
-  Molecule a (lookup_l ()->beam (dydx, width, thick));
+  Molecule a (me->lookup_l ()->beam (dydx, width, thick));
   a.translate (Offset (-width/2, width / 2 * dydx));
   
   int tremolo_flags;
-  SCM s = get_elt_property ("tremolo-flags");
+  SCM s = me->get_elt_property ("tremolo-flags");
   if (gh_number_p (s))
     tremolo_flags = gh_scm2int (s);
   else
@@ -89,7 +80,7 @@ Stem_tremolo::member_brew_molecule () const
     tremolo_flags = 1;
 
   int mult = beam ? beam->get_multiplicity () : 0;
-  Real interbeam_f = paper_l ()->interbeam_f (mult);
+  Real interbeam_f = me->paper_l ()->interbeam_f (mult);
   Molecule mol; 
   for (int i = 0; i < tremolo_flags; i++)
     {
@@ -103,7 +94,7 @@ Stem_tremolo::member_brew_molecule () const
     {
       // ugh, rather calc from Stem_tremolo_req
       int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
-      mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS),
+      mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - me->relative_coordinate (0, X_AXIS),
                            stem->stem_end_position () * ss / 2 - 
                            Directional_element_interface (beam).get () * beams_i * interbeam_f));
     }
@@ -125,7 +116,7 @@ Stem_tremolo::member_brew_molecule () const
       else
        whole_note_correction = 0;
         
-      mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS) +
+      mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - me->relative_coordinate (0, X_AXIS) +
                             whole_note_correction, dy));
     }
   
@@ -134,9 +125,8 @@ Stem_tremolo::member_brew_molecule () const
 
 
 void
-Stem_tremolo::set_stem (Stem *s)
+Stem_tremolo::set_stem (Score_element*me,Score_element *s)
 {
-  set_elt_pointer ("stem", s->self_scm_);
-  add_dependency (s);
+  me->set_elt_pointer ("stem", s->self_scm_);
 }
 
index 694be6fde2e9667b81c4a75e8edcdeec936dc92d..cbbc19ddec87a9416968d91aa124768db4401046 100644 (file)
@@ -440,7 +440,7 @@ Stem::flag () const
 }
 
 Interval
-Stem::dim_callback (Score_element const *se, Axis ) 
+Stem::dim_callback (Score_element *se, Axis ) 
 {
   Stem * s = dynamic_cast<Stem*> ((Score_element*)se);
   
@@ -498,7 +498,7 @@ Stem::member_brew_molecule () const
 }
 
 Real
-Stem::off_callback (Score_element const* se, Axis)
+Stem::off_callback (Score_element * se, Axis)
 {
   Stem *st = dynamic_cast<Stem*> ((Score_element*)se);
 
index 5be06b334ee7315995f45859eade2c84ffcaa918..051e0a844b3463c798555d61155c25ee2be2125b 100644 (file)
@@ -55,19 +55,28 @@ System_start_delimiter::simple_bar (Real h) const
   return lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
 }
 
-GLUE_SCORE_ELEMENT(System_start_delimiter,after_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(System_start_delimiter,after_line_breaking);
+
 SCM
-System_start_delimiter::member_after_line_breaking ()
+System_start_delimiter::after_line_breaking (SCM smob)
+{
+  try_collapse (unsmob_element (smob));
+  return SCM_UNDEFINED;
+}
+
+void
+System_start_delimiter::try_collapse (Score_element*me)
 {
-  SCM   gl = get_elt_property ("glyph");
+  SCM   gl = me->get_elt_property ("glyph");
   
-  if (scm_ilength (get_elt_pointer ("elements")) <=  1 && gl == ly_symbol2scm ("bar-line"))
+  if (scm_ilength (me->get_elt_pointer ("elements")) <=  1 && gl == ly_symbol2scm ("bar-line"))
     {
-      suicide ();
+      me->suicide ();
     }
-  return SCM_UNDEFINED;
+  
 }
 
+
 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(System_start_delimiter,brew_molecule);
 
 SCM
index 84a006243daf7f0a90053dc2a229d6c247f48031..931c5b843d49562570b175791c771bf9e893c340 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  text-item.cc -- implement Item
+  text-item.cc -- implement Text_item
 
   source file of the GNU LilyPond music typesetter
   
index 63e3d2a465e13460b590976671086c9e7daf7aa7..5fccceba2c704865d2acda84d5a60aae32420146 100644 (file)
 Tie_column::Tie_column (SCM s)
   : Spanner (s)
 {
-  set_elt_pointer ("ties", SCM_EOL);
-  set_extent_callback (0, X_AXIS);
-  set_extent_callback (0, Y_AXIS);  
+
+}
+void
+Tie_column::set_interface (Score_element*me)
+{
+ me-> set_elt_pointer ("ties", SCM_EOL);
+  me->set_extent_callback (0, X_AXIS);
+  me->set_extent_callback (0, Y_AXIS);  
 }
 
 void
-Tie_column::add_tie (Tie *s)
+Tie_column::add_tie (Score_element*me,Tie *s)
 {
-  Pointer_group_interface g (this, "ties");
+  Pointer_group_interface g (me, "ties");
   if (!g.count ())
     {
-      set_bound (LEFT, s->head (LEFT));
-      set_bound (RIGHT, s->head (RIGHT));
+      dynamic_cast<Spanner*> (me)->set_bound (LEFT, Tie::head (s,LEFT));
+      dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (s,RIGHT));
     }
   
-  Pointer_group_interface (this, "ties").add_element (s);
-  s->add_dependency (this);
+  Pointer_group_interface (me, "ties").add_element (s);
+  s->add_dependency (me);
 }
 
 
@@ -40,7 +45,7 @@ int
 tie_compare (Tie* const & s1,
             Tie* const & s2)
 {
-  return sign (s1->position_f () - s2->position_f());
+  return sign (Tie::position_f (s1) - Tie::position_f(s2));
 }
 
 /*
@@ -51,15 +56,15 @@ tie_compare (Tie* const & s1,
   direction of the rest is determined by their staff position.
 
   Ross forgets about the tie that is *on* the middle staff line. We
-  assume it goes UP. (TODO: make this settable) */
+  assume it goes UP. (TODO: make me settable) */
 void
-Tie_column::set_directions ()
+Tie_column::set_directions (Score_element*me)
 {
   Link_array<Tie> ties =
-    Pointer_group_interface__extract_elements (this, (Tie*)0, "ties");
+    Pointer_group_interface__extract_elements (me, (Tie*)0, "ties");
 
 
-  Direction d = Directional_element_interface (this).get ();
+  Direction d = Directional_element_interface (me).get ();
 
   if (d)
     {
@@ -74,7 +79,7 @@ Tie_column::set_directions ()
   if (ties.size () == 1)
     {
       Tie * t = ties[0];      
-      Directional_element_interface (t).set (t->get_default_dir ());
+      Directional_element_interface (t).set (Tie::get_default_dir (t));
       return;
     }
   
@@ -89,7 +94,7 @@ Tie_column::set_directions ()
   for (int i=ties.size(); i--; )
     {
       Tie * t = ties[i];
-      Real p = t->position_f ();
+      Real p = Tie::position_f (t);
       Direction d = (Direction) sign (p);
       if (!d)
        d = UP;
@@ -98,10 +103,10 @@ Tie_column::set_directions ()
   
 }
 
-GLUE_SCORE_ELEMENT(Tie_column,after_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Tie_column,after_line_breaking);
 SCM
-Tie_column::member_after_line_breaking ()
+Tie_column::after_line_breaking (SCM smob)
 {
-  set_directions ();
+  set_directions (unsmob_element (smob));
   return SCM_UNDEFINED;
 }
index 020779e4827586206e986ea58c96dcfecd6e7271..59a05f4c507822693eda44699da9a725bbcc2403 100644 (file)
@@ -59,7 +59,7 @@ protected:
   virtual bool do_try_music (Music*);
   virtual void do_process_music ();
   virtual void process_acknowledged ();
-
+  void typeset_tie (Score_element*);
 public:
   VIRTUAL_COPY_CONS(Translator);
   Tie_engraver();
@@ -174,8 +174,8 @@ Tie_engraver::process_acknowledged ()
          SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
          
          Tie * p = new Tie (basic);
-         p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
-         p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
+         Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
+         Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
          
          tie_p_arr_.push (p);
          announce_element (Score_element_info (p, req_l_));
@@ -183,8 +183,10 @@ Tie_engraver::process_acknowledged ()
       else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
        {
          Tie * p = new Tie (basic);
-         p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
-         p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
+         Tie::set_interface (p);
+         
+         Tie::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
+         Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
          
          tie_p_arr_.push (p);
          announce_element (Score_element_info (p, req_l_));
@@ -197,8 +199,9 @@ 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::set_interface (tie_column_p_);
          for (int i = tie_p_arr_.size (); i--; )
-           tie_column_p_->add_tie (tie_p_arr_ [i]);
+           Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
          announce_element (Score_element_info (tie_column_p_, 0));
        }
     }
@@ -216,16 +219,37 @@ Tie_engraver::do_pre_move_processing ()
 
   for (int i=0; i<  tie_p_arr_.size (); i++)
    {
-      typeset_element (tie_p_arr_[i]);
+      typeset_tie (tie_p_arr_[i]);
     }
   tie_p_arr_.clear ();
   if (tie_column_p_)
     {
-      typeset_element (tie_column_p_);
+      typeset_tie (tie_column_p_);
       tie_column_p_ =0;
     }
 }
 
+void
+Tie_engraver::typeset_tie (Score_element *her)
+{
+    if (!(Tie::head (her,LEFT) && Tie::head (her,RIGHT)))
+    warning (_ ("lonely tie"));
+
+  Direction d = LEFT;
+  Drul_array<Item *> new_head_drul;
+  new_head_drul[LEFT] = Tie::head(her,LEFT);
+  new_head_drul[RIGHT] = Tie::head (her,RIGHT);  
+  do {
+    if (!Tie::head (her,d))
+      new_head_drul[d] = Tie::head(her,(Direction)-d);
+  } while (flip(&d) != LEFT);
+
+  index_set_cell (her->get_elt_pointer ("heads"), LEFT, new_head_drul[LEFT]->self_scm_ );
+  index_set_cell (her->get_elt_pointer ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm_ );
+
+  typeset_element (her);
+}
+
 void
 Tie_engraver::do_post_move_processing ()
 {
index e777a74fba696cb586a6b4580f07bba0732ab92c..7a2a81ef87b4b82118515356abf98c2e667d25ca 100644 (file)
 #include "stem.hh"
 
 void
-Tie::set_head (Direction d, Item * head_l)
+Tie::set_head (Score_element*me,Direction d, Item * head_l)
 {
-  assert (!head (d));
-  index_set_cell (get_elt_pointer ("heads"), d, head_l->self_scm_);
+  assert (!head (me,d));
+  index_set_cell (me->get_elt_pointer ("heads"), d, head_l->self_scm_);
   
-  set_bound (d, head_l);
-  add_dependency (head_l);
+  dynamic_cast<Spanner*> (me)->set_bound (d, head_l);
+  me->add_dependency (head_l);
 }
 
 Tie::Tie(SCM s)
   : Spanner (s)
 {
-  set_elt_pointer ("heads", gh_cons (SCM_EOL, SCM_EOL));
   dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
   dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
-
+}
+void
+Tie::set_interface (Score_element*me)
+{
+  me->set_elt_pointer ("heads", gh_cons (SCM_EOL, SCM_EOL));
 }
 
 Rhythmic_head* 
-Tie::head (Direction d) const
+Tie::head (Score_element*me, Direction d) 
 {
-  SCM c = get_elt_pointer ("heads");
+  SCM c = me->get_elt_pointer ("heads");
   c = index_cell (c, d);
 
   return dynamic_cast<Rhythmic_head*> (unsmob_element (c));  
 }
 
 Real
-Tie::position_f () const
+Tie::position_f (Score_element*me) 
 {
-  return head (LEFT)
-    ? Staff_symbol_referencer_interface (head (LEFT)).position_f ()
-    : Staff_symbol_referencer_interface (head (RIGHT)).position_f () ;  
+  return head (me,LEFT)
+    ? Staff_symbol_referencer_interface (head (me,LEFT)).position_f ()
+    : Staff_symbol_referencer_interface (head (me,RIGHT)).position_f () ;  
 }
 
 
@@ -61,10 +64,10 @@ Tie::position_f () const
   ugh: direction of the Tie is more complicated.  See [Ross] p136 and further
  */
 Direction
-Tie::get_default_dir () const
+Tie::get_default_dir (Score_element*me) 
 {
-  Stem * sl =  head(LEFT) ? head (LEFT)->stem_l () :0;
-  Stem * sr =  head(RIGHT) ? head (RIGHT)->stem_l () :0;  
+  Stem * sl =  head(me,LEFT) ? head (me,LEFT)->stem_l () :0;
+  Stem * sr =  head(me,RIGHT) ? head (me,RIGHT)->stem_l () :0;  
 
   if (sl && Directional_element_interface (sl).get () == UP
       && sr && Directional_element_interface (sr).get () == UP)
@@ -73,47 +76,28 @@ Tie::get_default_dir () const
     return UP;
 }
 
-/*
-  fixme  must  use spanned drul from heads elt property
- */
 
-void
-Tie::do_add_processing()
-{
-  if (!(head (LEFT) && head (RIGHT)))
-    warning (_ ("lonely tie"));
-
-  Direction d = LEFT;
-  Drul_array<Rhythmic_head *> new_head_drul;
-  new_head_drul[LEFT] = head(LEFT);
-  new_head_drul[RIGHT] = head(RIGHT);  
-  do {
-    if (!head (d))
-      new_head_drul[d] = head((Direction)-d);
-  } while (flip(&d) != LEFT);
-
-  index_set_cell (get_elt_pointer ("heads"), LEFT, new_head_drul[LEFT]->self_scm_ );
-  index_set_cell (get_elt_pointer ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm_ );
-}
 
-GLUE_SCORE_ELEMENT(Tie,after_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Tie,after_line_breaking);
 SCM
-Tie::member_after_line_breaking ()
+Tie::after_line_breaking (SCM smob)
 {
-  if (!head (LEFT) && !head (RIGHT))
+  Tie*me = dynamic_cast<Tie*> (unsmob_element (smob));
+  
+  if (!head (me,LEFT) && !head (me,RIGHT))
     {
       programming_error ("Tie without heads.");
-      suicide ();
+      me->suicide ();
       return SCM_UNDEFINED;
     }
 
-  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 (Tie::get_default_dir (me));
   
-  Real staff_space = Staff_symbol_referencer_interface (this).staff_space ();
+  Real staff_space = Staff_symbol_referencer_interface (me).staff_space ();
   Real half_space = staff_space / 2;
-  Real x_gap_f = paper_l ()->get_var ("tie_x_gap");
-  Real y_gap_f = paper_l ()->get_var ("tie_y_gap");
+  Real x_gap_f = me->paper_l ()->get_var ("tie_x_gap");
+  Real y_gap_f = me->paper_l ()->get_var ("tie_y_gap");
 
   /* 
    Slur and tie placement [OSU]
@@ -126,18 +110,18 @@ Tie::member_after_line_breaking ()
 
 
   /*
-    OSU: not different for outer notes, so why all this code?
-    ie,  can we drop this, or should it be made switchable.
+    OSU: not different for outer notes, so why all me code?
+    ie,  can we drop me, or should it be made switchable.
    */
-  if (head (LEFT))
-    dx_f_drul_[LEFT] = head (LEFT)->extent (X_AXIS).length ();
+  if (head (me,LEFT))
+    me->dx_f_drul_[LEFT] = Tie::head (me,LEFT)->extent (X_AXIS).length ();
   else
-    dx_f_drul_[LEFT] = get_broken_left_end_align ();
-  dx_f_drul_[LEFT] += x_gap_f;
-  dx_f_drul_[RIGHT] -= x_gap_f;
+    me->dx_f_drul_[LEFT] = dynamic_cast<Spanner*>(me)->get_broken_left_end_align ();
+  me->dx_f_drul_[LEFT] += x_gap_f;
+  me->dx_f_drul_[RIGHT] -= x_gap_f;
 
   /* 
-   Slur and tie placement [OSU]  -- check this
+   Slur and tie placement [OSU]  -- check me
 
    Ties:
 
@@ -152,14 +136,14 @@ Tie::member_after_line_breaking ()
    */
 
 
-  Real ypos = position_f ();
+  Real ypos = Tie::position_f (me);
 
   Real y_f = half_space * ypos; 
   int ypos_i = int (ypos);
  
-  Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
-  Direction dir = Directional_element_interface (this).get();
-  if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
+  Real dx_f = me->extent (X_AXIS).length () + me->dx_f_drul_[RIGHT] - me->dx_f_drul_[LEFT];
+  Direction dir = Directional_element_interface (me).get();
+  if (dx_f < me->paper_l ()->get_var ("tie_staffspace_length"))
     {
       if (abs (ypos_i) % 2)
        y_f += dir * half_space;
@@ -173,7 +157,7 @@ Tie::member_after_line_breaking ()
       y_f -= dir * y_gap_f;
     }
   
-  dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = y_f;
+  me->dy_f_drul_[LEFT] = me->dy_f_drul_[RIGHT] = y_f;
 
   return SCM_UNDEFINED;
 }
@@ -194,20 +178,21 @@ Tie::get_rods () const
   return a;
 }
 
-GLUE_SCORE_ELEMENT(Tie,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Tie,brew_molecule);
 
 SCM
-Tie::member_brew_molecule () const
+Tie::brew_molecule (SCM smob) 
 {
-  Real thick = paper_l ()->get_var ("tie_thickness");
-  Bezier one = get_curve ();
+  Score_element*me = unsmob_element (smob);
+  Real thick = me->paper_l ()->get_var ("tie_thickness");
+  Bezier one = dynamic_cast<Tie*> (me)->get_curve ();
 
   Molecule a;
-  SCM d =  get_elt_property ("dashed");
+  SCM d =  me->get_elt_property ("dashed");
   if (gh_number_p (d))
-    a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
+    a = me->lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
   else
-    a = lookup_l ()->slur (one, Directional_element_interface (this).get () * thick, thick);
+    a = me->lookup_l ()->slur (one, Directional_element_interface (me).get () * thick, thick);
   
   return a.create_scheme(); 
 }
@@ -217,17 +202,18 @@ Tie::member_brew_molecule () const
 Bezier
 Tie::get_curve () const
 {
-  Direction d (Directional_element_interface (this).get ());
+  Score_element*me = (Score_element*)this;
+  Direction d (Directional_element_interface (me).get ());
   Bezier_bow b (get_encompass_offset_arr (), d);
 
-  Real staff_space = Staff_symbol_referencer_interface (this).staff_space ();
+  Real staff_space = Staff_symbol_referencer_interface (me).staff_space ();
   Real h_inf = paper_l ()->get_var ("tie_height_limit_factor") * staff_space;
   Real r_0 = paper_l ()->get_var ("tie_ratio");
 
   b.set_default_bezier (h_inf, r_0);
   Bezier c = b.get_bezier ();
 
-  /* should do this for slurs as well. */
+  /* should do me for slurs as well. */
   Array<Real> horizontal (c.solve_derivative (Offset (1,0)));
 
   if (horizontal.size ())
index 77f1e75e943d6abe7854924f32e809cb31cb7001..9b44c6ded40fe2ff1ad08a5b2671fca0f0ec2d21 100644 (file)
@@ -6,12 +6,29 @@
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "time-signature-engraver.hh"
 #include "time-signature.hh"
 #include "command-request.hh"
+#include "engraver.hh"
+
 #include "timing-engraver.hh"
 #include "engraver-group-engraver.hh"
 
+
+/**
+  generate time_signatures. 
+  */
+class Time_signature_engraver : public Engraver {
+protected:
+  virtual void do_process_music();
+  virtual void do_pre_move_processing();
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Item * time_signature_p_;
+
+  Time_signature_engraver();
+};
+
+
 Time_signature_engraver::Time_signature_engraver()
 { 
   time_signature_p_ =0;
@@ -20,6 +37,10 @@ Time_signature_engraver::Time_signature_engraver()
 void
 Time_signature_engraver::do_process_music()
 {
+  /*
+    UGH.
+    this should use properties.
+   */
   Translator * result =
     daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
 
@@ -35,8 +56,7 @@ Time_signature_engraver::do_process_music()
   Time_signature_change_req *req = timing_grav_l->time_signature_req_l();
   if (req)
     {
-      time_signature_p_ = new Time_signature (get_property ("basicTimeSignatureProperties"));
-
+      time_signature_p_ = new Item (get_property ("basicTimeSignatureProperties"));
       time_signature_p_->set_elt_property ("fraction",
                                           gh_cons (gh_int2scm (req->beats_i_),
                                                    gh_int2scm (req->one_beat_i_))); 
index 50c45abd4c4dc0e812ee73779bd0de4a49bfbd6a..95cc942a599e73345363571fa84926126c616a4f 100644 (file)
 #include "paper-def.hh"
 #include "lookup.hh"
 
-Time_signature::Time_signature (SCM s)
-  :  Item (s)
-{
-
-}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Time_signature,brew_molecule);
 
-// ugh.!
-
-GLUE_SCORE_ELEMENT(Time_signature,brew_molecule);
 SCM
-Time_signature::member_brew_molecule () const
+Time_signature::brew_molecule (SCM smob) 
 {
-  SCM st = get_elt_property ("style");
-
-  SCM frac = get_elt_property ("fraction");
+  Score_element * me = unsmob_element (smob);
+  SCM st = me->get_elt_property ("style");
+  SCM frac = me->get_elt_property ("fraction");
   int n = 4;
   int d = 4;
   if (gh_pair_p (frac))
@@ -42,47 +35,47 @@ Time_signature::member_brew_molecule () const
       String style (ly_scm2string (st));
       if (style[0]=='1')
        {
-         return time_signature (n, 0).create_scheme();
+         return time_signature (me, n, 0).create_scheme();
        }
       else
        {
-         return special_time_signature (style, n, d).create_scheme();
+         return special_time_signature (me, style, n, d).create_scheme();
        }
     }
   else
-    return time_signature (n,d).create_scheme();
+    return time_signature (me, n,d).create_scheme();
 }
 
 Molecule
-Time_signature::special_time_signature (String s, int n, int d) const
+Time_signature::special_time_signature (Score_element*me, String s, int n, int d)
 {
   // First guess: s contains only the signature style
   String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d);
   
-  Molecule m = lookup_l ()->afm_find (symbolname, false);
+  Molecule m = me->lookup_l ()->afm_find (symbolname, false);
   if (!m.empty_b()) 
     return m;
 
   // Second guess: s contains the full signature name
-  m = lookup_l ()->afm_find ("timesig-"+s, false);
+  m = me->lookup_l ()->afm_find ("timesig-"+s, false);
   if (!m.empty_b ()) 
     return m;
 
   // Resort to default layout with numbers
-  return time_signature (n,d);
+  return time_signature (me, n,d);
 }
 
 
 Molecule
-Time_signature::time_signature (int num, int den) const
+Time_signature::time_signature (Score_element*me,int num, int den)
 {
   String sty = "timesig";
 
   /*
     UGH: need to look at fontsize.
    */
-  Molecule n (lookup_l ()->text (sty, to_str (num), paper_l ()));
-  Molecule d (lookup_l ()->text (sty, to_str (den), paper_l ()));
+  Molecule n (me->lookup_l ()->text (sty, to_str (num), me->paper_l ()));
+  Molecule d (me->lookup_l ()->text (sty, to_str (den), me->paper_l ()));
   n.align_to (X_AXIS, CENTER);
   d.align_to (X_AXIS, CENTER);
   Molecule m;
index 355cb64c09bfd8810c8238a4a77e8e9ecef325e0..071e55e03bf5e49f5b87f5acf719581eb1cdeac1 100644 (file)
@@ -29,7 +29,7 @@ protected:
   Array<Moment> span_stop_moments_;
   
   /// The spanners. Array order is synced with time_scaled_music_arr_
-  Link_array<Tuplet_spanner> started_span_p_arr_;
+  Link_array<Spanner> started_span_p_arr_;
 
   virtual void do_removal_processing ();
   virtual void acknowledge_element (Score_element_info);
@@ -73,7 +73,8 @@ Tuplet_engraver::do_process_music ()
       if (i < started_span_p_arr_.size () && started_span_p_arr_[i])
        continue;
 
-      Tuplet_spanner* glep = new Tuplet_spanner (get_property ("basicTupletSpannerProperties"));
+      Spanner* glep = new Spanner (get_property ("basicTupletSpannerProperties"));
+      Tuplet_spanner::set_interface (glep);
       if (i >= started_span_p_arr_.size ())
        started_span_p_arr_.push (glep);
       else
@@ -99,13 +100,13 @@ Tuplet_engraver::acknowledge_element (Score_element_info i)
     {
       for (int j =0; j  <started_span_p_arr_.size (); j++)
        if (started_span_p_arr_[j]) 
-         started_span_p_arr_[j]->add_column (nc);
+         Tuplet_spanner::add_column (started_span_p_arr_[j],nc);
     }
   else if (Beam *b = dynamic_cast<Beam *> (i.elem_l_))
     {
       for (int j = 0; j < started_span_p_arr_.size (); j++)
        if (started_span_p_arr_[j]) 
-         started_span_p_arr_[j]->add_beam (b);
+         Tuplet_spanner::add_beam (started_span_p_arr_[j],b);
     }
 }
 
index 3acb6c68f3432e037cbd3e392e453a5265f98595..00760818d7cfdb8da262fd466dc98ed9a8ecbc48 100644 (file)
 #include "directional-element-interface.hh"
 
 
-Tuplet_spanner::Tuplet_spanner (SCM s)
-  : Spanner (s)
-{
-  set_elt_pointer ("beams", SCM_EOL);
-  set_elt_pointer ("columns", SCM_EOL);
 
-  // ugh.
-  set_elt_property ("delta-y", gh_int2scm (0));
+void
+Tuplet_spanner::set_interface (Score_element*me)
+{
+  me-> set_elt_pointer ("beams", SCM_EOL);
+  me->set_elt_pointer ("columns", SCM_EOL);
 }
 
 /*
   TODO. 
  */
 
-GLUE_SCORE_ELEMENT(Tuplet_spanner,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Tuplet_spanner,brew_molecule);
+
 SCM
-Tuplet_spanner::member_brew_molecule () const
+Tuplet_spanner::brew_molecule (SCM smob) 
 {
+  Score_element *me= unsmob_element (smob);
   Molecule  mol;
 
   // Default behaviour: number always, bracket when no beam!
-  bool par_beam = to_boolean (get_elt_property ("parallel-beam"));
+  bool par_beam = to_boolean (me->get_elt_property ("parallel-beam"));
   bool bracket_visibility = !par_beam;
   bool number_visibility = true;
 
-  SCM bracket = get_elt_property ("tuplet-bracket-visibility");
+  SCM bracket = me->get_elt_property ("tuplet-bracket-visibility");
   if (gh_boolean_p (bracket))
     {
       bracket_visibility = gh_scm2bool (bracket);
@@ -55,7 +55,7 @@ Tuplet_spanner::member_brew_molecule () const
   else if (bracket == ly_symbol2scm ("if-no-beam"))
     bracket_visibility = !par_beam;
 
-  SCM numb = get_elt_property ("tuplet-number-visibility");  
+  SCM numb = me->get_elt_property ("tuplet-number-visibility");  
   if (gh_boolean_p (numb))
     {
       number_visibility = gh_scm2bool (numb);
@@ -63,24 +63,23 @@ Tuplet_spanner::member_brew_molecule () const
   else if (bracket == ly_symbol2scm ("if-no-beam"))
     number_visibility = !par_beam;
   
-  if (gh_pair_p (get_elt_pointer ("columns")))
+  if (gh_pair_p (me->get_elt_pointer ("columns")))
     {
       Link_array<Note_column> column_arr=
-       Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns");
+       Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
        
       Real ncw = column_arr.top ()->extent(X_AXIS).length ();
-      Real w = spanner_length () + ncw;
+      Real w = dynamic_cast<Spanner*>(me)->spanner_length () + ncw;
 
-
-      Real staff_space = paper_l ()->get_var ("interline");
-      Direction dir = Directional_element_interface (this).get ();
-      Real dy = gh_scm2double (get_elt_property ("delta-y"));
-      SCM number = get_elt_property ("text");
+      Real staff_space = me->paper_l ()->get_var ("interline");
+      Direction dir = Directional_element_interface (me).get ();
+      Real dy = gh_scm2double (me->get_elt_property ("delta-y"));
+      SCM number = me->get_elt_property ("text");
       if (gh_string_p (number) && number_visibility)
        {
          Molecule
-           num (lookup_l ()->text ("italic",
-                                   ly_scm2string (number), paper_l ()));
+           num (me->lookup_l ()->text ("italic",
+                                   ly_scm2string (number), me->paper_l ()));
          num.align_to (X_AXIS, CENTER);
          num.translate_axis (w/2, X_AXIS);
          num.align_to (Y_AXIS, CENTER);
@@ -93,11 +92,11 @@ Tuplet_spanner::member_brew_molecule () const
       
       if (bracket_visibility)      
        {
-         SCM ss = paper_l ()->get_scmvar ("staffspace");
-         SCM lt =  paper_l ()->get_scmvar ("stafflinethickness");
+         SCM ss = me->paper_l ()->get_scmvar ("staffspace");
+         SCM lt =  me->paper_l ()->get_scmvar ("stafflinethickness");
          
-         SCM thick = get_elt_property ("thick");
-         SCM gap = get_elt_property ("number-gap");
+         SCM thick = me->get_elt_property ("thick");
+         SCM gap = me->get_elt_property ("number-gap");
          
          SCM at =gh_list(ly_symbol2scm ("tuplet"),
                          ss,
@@ -122,15 +121,15 @@ Tuplet_spanner::member_brew_molecule () const
   use first -> last note for slope, and then correct for disturbing
   notes in between.  */
 void
-Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const
+Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real * dy) 
 {
   Link_array<Note_column> column_arr=
-    Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns");
+    Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
 
 
-  Score_element * common = common_refpoint (get_elt_pointer ("columns"), Y_AXIS);
+  Score_element * common = me->common_refpoint (me->get_elt_pointer ("columns"), Y_AXIS);
   
-  Direction d = Directional_element_interface (this).get ();
+  Direction d = Directional_element_interface (me).get ();
 
   /*
     Use outer non-rest columns to determine slope
@@ -179,64 +178,67 @@ Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const
   use first -> last note for slope,
 */
 void
-Tuplet_spanner::calc_dy (Real * dy) const
+Tuplet_spanner::calc_dy (Score_element*me,Real * dy)
 {
   Link_array<Note_column> column_arr=
-    Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns");
+    Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
 
  
-  Direction d = Directional_element_interface (this).get ();
+  Direction d = Directional_element_interface (me).get ();
   *dy = column_arr.top ()->extent (Y_AXIS) [d]
     - column_arr[0]->extent (Y_AXIS) [d];
 }
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Tuplet_spanner,after_line_breaking);
 
-GLUE_SCORE_ELEMENT(Tuplet_spanner,after_line_breaking);
 SCM
-Tuplet_spanner::member_after_line_breaking ()
+Tuplet_spanner::after_line_breaking (SCM smob)
 {
+  Score_element * me = unsmob_element (smob);
   Link_array<Note_column> column_arr=
-    Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns");
+    Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
+  Spanner *sp = dynamic_cast<Spanner*> (me);
+
 
   if (!column_arr.size ())
     {
-      suicide ();
+      me->suicide ();
       return SCM_UNDEFINED;
     }
 
-  Direction d = Directional_element_interface (this).get ();
+  Direction d = Directional_element_interface (me).get ();
   if (!d)
     {
-      d = get_default_dir ();
-      Directional_element_interface (this).set (d);
+      d = Tuplet_spanner::get_default_dir (me);
+      Directional_element_interface (me).set (d);
 
     }
   Real dy, offset;
 
-  calc_position_and_height  (&offset,&dy);
+  calc_position_and_height (me,&offset,&dy);
   
-  set_elt_property ("delta-y", gh_double2scm (dy));
+  me->set_elt_property ("delta-y", gh_double2scm (dy));
 
-  translate_axis (offset, Y_AXIS);
+  me->translate_axis (offset, Y_AXIS);
   
-  if (scm_ilength (get_elt_pointer ("beams")) == 1)
+  if (scm_ilength (me->get_elt_pointer ("beams")) == 1)
     {
-      SCM bs = get_elt_pointer ("beams");
+      SCM bs = me->get_elt_pointer ("beams");
       Score_element *b = unsmob_element (gh_car (bs));
       Beam * beam_l = dynamic_cast<Beam*> (b);
-      if (!broken_b () 
-         && 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);
+      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 ())
+       me->set_elt_property ("parallel-beam", SCM_BOOL_T);
     }
   return SCM_UNDEFINED;
 }
 
 
 Direction
-Tuplet_spanner::get_default_dir () const
+Tuplet_spanner::get_default_dir (Score_element*me)
 {
   Direction d = UP;
-  SCM dir_sym =get_elt_property ("dir-forced");
+  SCM dir_sym =me->get_elt_property ("dir-forced");
   if (isdir_b (dir_sym))
     {
       d= to_dir (dir_sym);
@@ -245,7 +247,7 @@ Tuplet_spanner::get_default_dir () const
     }
 
   d = UP ;
-  for (SCM s = get_elt_pointer ("columns"); gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = me->get_elt_pointer ("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);
@@ -260,22 +262,21 @@ Tuplet_spanner::get_default_dir () const
 }
 
 void
-Tuplet_spanner::add_beam (Beam *b)
+Tuplet_spanner::add_beam (Score_element*me, Score_element *b)
 {
-  add_dependency (b);
-  Pointer_group_interface gi (this, "beams");
+me->add_dependency (b);
+  Pointer_group_interface gi (me, "beams");
   gi.add_element (b);
 }
 
 void
-Tuplet_spanner::add_column (Note_column*n)
+Tuplet_spanner::add_column (Score_element*me, Item*n)
 {
-  Pointer_group_interface gi (this, "columns");
+  Pointer_group_interface gi (me, "columns");
   gi.add_element (n);
+  me->add_dependency (n);
 
-  add_dependency (n);
-
-  add_bound_item (this, n);
+  add_bound_item (dynamic_cast<Spanner*> (me), n);
 }
 
 
index 6e99afdb84463b06c135632dd5557904b9110326..fa986542eb9c727925b439151af211440d34e2d3 100644 (file)
 #include "debug.hh"
 #include "lookup.hh"
 #include "molecule.hh"
-#include "note-column.hh"
 #include "paper-column.hh"
 #include "bar.hh"
 #include "paper-def.hh"
 #include "volta-spanner.hh"
-#include "stem.hh"
-#include "dimension-cache.hh"
 #include "group-interface.hh"
 #include "side-position-interface.hh"
 #include "directional-element-interface.hh"
 
-Volta_spanner::Volta_spanner (SCM s)
-  : Spanner (s)
+
+void
+Volta_spanner::set_interface (Score_element*me)
 {
-  set_elt_pointer ("bars", SCM_EOL);
-  Side_position_interface (this).set_axis (Y_AXIS);
-  Directional_element_interface (this).set (UP);
+  me->set_elt_pointer ("bars", SCM_EOL);
+  Side_position_interface (me).set_axis (Y_AXIS);
+  Directional_element_interface (me).set (UP);
 }
 
 
 /*
-  this is too complicated. Yet another version of side-positioning,
+  me is too complicated. Yet another version of side-positioning,
   badly implemented.
 
   --
@@ -42,37 +40,37 @@ Volta_spanner::Volta_spanner (SCM s)
   
 */
 
-GLUE_SCORE_ELEMENT(Volta_spanner,brew_molecule);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Volta_spanner,brew_molecule);
 SCM
-Volta_spanner::member_brew_molecule () const
+Volta_spanner::brew_molecule (SCM smob) 
 {
-  
+  Score_element *me = unsmob_element (smob);
   Link_array<Bar> bar_arr
-    = Pointer_group_interface__extract_elements (this, (Bar*)0, "bars");
+    = Pointer_group_interface__extract_elements (me, (Bar*)0, "bars");
 
   if (!bar_arr.size ())
     return SCM_EOL;
 
   bool no_vertical_start = false;
-  bool no_vertical_end = to_boolean (get_elt_property ("last-volta"));
-  Spanner *orig_span =  dynamic_cast<Spanner*> (original_l_);
-  if (orig_span && (orig_span->broken_into_l_arr_[0] != (Spanner*)this))
+  bool no_vertical_end = to_boolean (me->get_elt_property ("last-volta"));
+  Spanner *orig_span =  dynamic_cast<Spanner*> (me->original_l_);
+  if (orig_span && (orig_span->broken_into_l_arr_[0] != (Spanner*)me))
     no_vertical_start = true;
-  if (orig_span && (orig_span->broken_into_l_arr_.top () != (Spanner*)this))
+  if (orig_span && (orig_span->broken_into_l_arr_.top () != (Spanner*)me))
     no_vertical_end = true;
 
 #if 0
   // FIXME
-  if (bar_arr.top ()->get_elt_property (type_str_.length_i () > 1)
+  if (bar_arr.top ()->me->get_elt_property (type_str_.length_i () > 1)
     no_vertical_end = false;
 #endif
 
-  Real staff_space = paper_l ()->get_var ("interline");
+  Real staff_space = me->paper_l ()->get_var ("interline");
   Real half_space = staff_space / 2;
-  Real left = get_broken_left_end_align ();
-  Real w = spanner_length () - left - half_space;
-  Real h = paper_l()->get_var ("volta_spanner_height");
-  Real t = paper_l ()->get_var ("volta_thick");
+  Real left = dynamic_cast<Spanner*>(me)->get_broken_left_end_align ();
+  Real w = dynamic_cast<Spanner*>(me)->spanner_length () - left - half_space;
+  Real h = me->paper_l()->get_var ("volta_spanner_height");
+  Real t = me->paper_l ()->get_var ("volta_thick");
 
   SCM at = (gh_list (ly_symbol2scm ("volta"),
                     gh_double2scm (h),
@@ -84,9 +82,9 @@ Volta_spanner::member_brew_molecule () const
 
   Box b (Interval (0, w), Interval (0, h));
   Molecule  mol (b, at);
-  Molecule num (lookup_l ()->text ("volta",
-                                  ly_scm2string (get_elt_property("text")),
-                                  paper_l ()));
+  Molecule num (me->lookup_l ()->text ("volta",
+                                      ly_scm2string (me->get_elt_property("text")),
+                                      me->paper_l ()));
 
   mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
                   - staff_space);
@@ -95,29 +93,18 @@ Volta_spanner::member_brew_molecule () const
 }
 
 
-GLUE_SCORE_ELEMENT(Volta_spanner,after_line_breaking);
-SCM
-Volta_spanner::member_after_line_breaking ()
-{
-  Side_position_interface (this).add_staff_support ();
-  return SCM_UNDEFINED;
-}
-  
 void
-Volta_spanner::add_bar  (Bar* b)
+Volta_spanner::add_bar  (Score_element *me, Item* b)
 {
-  Pointer_group_interface gi(this, "bars");
+  Pointer_group_interface gi(me, "bars");
   gi.add_element (b);
 
-  Side_position_interface (this).add_support (b);
-  add_dependency (b);
-
-  add_bound_item (this, b); 
+  Side_position_interface (me).add_support (b);
+  add_bound_item (dynamic_cast<Spanner*>(me), b); 
 }
 
 void
-Volta_spanner::add_column (Note_column* c)
+Volta_spanner::add_column (Score_element*me, Score_element* c)
 {
-  Side_position_interface (this).add_support (c);
-  add_dependency (c);
+  Side_position_interface (me).add_support (c);
 }
index cb548ddceda9acc52fdd25df12dfb01dbfae882f..adac158aac5e9f3b4901c368b5cd40b8f8e4e220 100644 (file)
@@ -414,6 +414,7 @@ ScoreContext = \translator {
                (thin-kern . 3.0)
                (hair-thickness . 1.6)
                (thick-thickness . 6.0)
+               (bar-interface . #t)
        )
 
        basicBarNumberProperties = #`(
@@ -437,11 +438,9 @@ ScoreContext = \translator {
        
        basicBreathingSignProperties = #`(
                (break-align-symbol . Breathing_sign)
-               (after-line-breaking-callback . ,Breathing_sign::after_line_breaking)
                (breakable . #t )
                (molecule-callback . ,Breathing_sign::brew_molecule)
                (visibility-lambda . ,begin-of-line-invisible)
-
        )
         basicClefItemProperties = #`(
           (molecule-callback . ,Score_element::brew_molecule)
@@ -488,7 +487,8 @@ ScoreContext = \translator {
                (before-line-breaking-callback . ,Grace_align_item::before_line_breaking)
        )
        basicHaraKiriVerticalGroupspannerProperties = #`(
-               (after-line-breaking-callback . ,Hara_kiri_group_spanner::after_line_breaking)
+               (hara-kiri-interface . #t)
+               (axes 1)
        )
        basicHyphenSpannerProperties = #`(
                (thickness . 1.0)
@@ -498,6 +498,7 @@ ScoreContext = \translator {
        )
        basicKeyProperties = #`(
          (molecule-callback . ,Key_item::brew_molecule)
+         (key-item-interface . #t)
          (break-align-symbol . Key_item)
          (visibility-lambda . ,begin-of-line-visible)
          (breakable . #t)
@@ -506,6 +507,7 @@ ScoreContext = \translator {
                (molecule-callback . ,Local_key_item::brew_molecule)
                (left-padding . 0.2)
                (right-padding . 0.4)
+               (accidentals-interface . #t)
        )
        basicLyricExtenderProperties = #`(
                (molecule-callback . ,Lyric_extender::brew_molecule)
@@ -519,12 +521,12 @@ ScoreContext = \translator {
        basicMarkProperties = #`(
          (molecule-callback . ,Text_item::brew_molecule)       
          (breakable . #t)
+         (mark-interface . #t)
          (visibility-lambda . ,end-of-line-invisible)
        )
        basicMultiMeasureRestProperties = #`(
                (molecule-callback . ,Multi_measure_rest::brew_molecule)
                (staff-position . 0)
-
        )
        basicNoteColumnProperties = #`(
                (axes 0 1)
@@ -543,6 +545,10 @@ ScoreContext = \translator {
                (molecule-callback . ,Text_item::brew_molecule)
                (style . "italic")
        )
+       basicPaperColumnProperties = #`(
+               (paper-column-interface . #t)
+               (axes 0)
+       )
        basicPedalProperties = #`(
                (molecule-callback . ,Text_item::brew_molecule)
                (style . "italic")
@@ -563,7 +569,9 @@ ScoreContext = \translator {
        basicScriptProperties    = #`(
                (molecule-callback . ,Script::brew_molecule)
        )
-               
+       basicScriptColumnProperties = #`(
+               (before-line-breaking-callback . ,Script_column::before_line_breaking)
+       )
        basicSlurProperties = #`(
                (molecule-callback . ,Slur::brew_molecule)
                (after-line-breaking-callback . ,Slur::after_line_breaking) 
@@ -585,7 +593,7 @@ ScoreContext = \translator {
                (thin-kern . 3.0)
                (hair-thickness . 1.6)
                (thick-thickness . 6.0)
-
+               (bar-interface . #t)
        )
        basicSustainPedalProperties = #`(
                (no-spacing-rods . #t)
@@ -633,6 +641,7 @@ ScoreContext = \translator {
        )
        basicTupletSpannerProperties = #`(
                (number-gap . 2.0)   
+               (delta-y . 0)
                (thick . 1.0)
                (after-line-breaking-callback . ,Tuplet_spanner::after_line_breaking)
                (molecule-callback . ,Tuplet_spanner::brew_molecule)
@@ -657,7 +666,6 @@ ScoreContext = \translator {
        )
        basicVoltaSpannerProperties = #`(
                (molecule-callback . ,Volta_spanner::brew_molecule)
-               (after-line-breaking-callback . ,Volta_spanner::after_line_breaking) 
        )
        
        \accepts "Staff";
index 00ee1d42b00ac55509614acd540c004138213106..5c5c756f9e32837ec4a9f730cd9595a3852b2b8e 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.67
-Entered-date: 30JUN00
+Version: 1.3.68
+Entered-date: 02JUL00
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.67.tar.gz 
+       1000k lilypond-1.3.68.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.67.tar.gz 
+       1000k lilypond-1.3.68.tar.gz 
 Copying-policy: GPL
 End
index 0f23a1b61b099309d7d7733f10fb6abbc8e888bb..d54470836e4d798c4cfb57fdd095063d44924036 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.67
+Version: 1.3.68
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.67.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.68.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # Icon: lilypond-icon.gif
index 80e3ffeb6ae74ac8903a06ce9146444c95a2ec4f..7479ba214e8fddda94e1eb7b2e6ef04ed8205617 100644 (file)
 
 
 ; Make a function that checks score element for being of a specific type. 
-(define (make-type-checker name)
+(define (make-type-checker symbol)
   (lambda (elt)
-    (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
+    (display  symbol)
+    (if (eq? #t (ly-get-elt-property elt symbol))
+              #t
+       #f)
+    ))
+
+  
 
        
 ;;;;;;;;;;;;;;;;;;; TeX output
       (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
 
   (define (stop-line) 
-    "}\\vss}\\interscoreline")
+    "}\\vss}\\interscoreline\n")
   (define (stop-last-line)
     "}\\vss}")
   (define (filledbox breapth width depth height)