]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.16 release/1.3.16
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 22 Dec 1999 11:52:30 +0000 (12:52 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 22 Dec 1999 11:52:30 +0000 (12:52 +0100)
82 files changed:
CHANGES
TODO
VERSION
input/test/tie-sparse.sly [new file with mode: 0644]
lily/align-note-column-engraver.cc
lily/auto-beam-engraver.cc
lily/bar-engraver.cc
lily/bar-script-engraver.cc
lily/beam-engraver.cc
lily/beam.cc
lily/bow.cc
lily/break-align-engraver.cc
lily/breathing-sign.cc
lily/collision.cc
lily/directional-element.cc
lily/directional-spanner.cc [deleted file]
lily/dot-column.cc
lily/dots.cc
lily/extender-spanner.cc
lily/hyphen-spanner.cc
lily/include/beam.hh
lily/include/bow.hh
lily/include/breathing-sign.hh
lily/include/clef-item.hh
lily/include/col-info.hh [deleted file]
lily/include/collision.hh
lily/include/crescendo.hh
lily/include/directional-element-interface.hh [new file with mode: 0644]
lily/include/directional-element.hh
lily/include/directional-spanner.hh
lily/include/dots.hh
lily/include/extender-spanner.hh
lily/include/hyphen-spanner.hh
lily/include/lily-guile.hh
lily/include/lily-proto.hh
lily/include/note-head-side.hh
lily/include/side-position-interface.hh
lily/include/staff-symbol-referencer.hh
lily/include/staff-symbol.hh
lily/include/stem-info.hh
lily/include/stem-tremolo.hh
lily/include/stem.hh
lily/include/text-item.hh
lily/include/tie.hh
lily/include/tuplet-spanner.hh
lily/key-engraver.cc
lily/lily-guile.cc
lily/local-key-engraver.cc
lily/lookup.cc
lily/melisma-engraver.cc
lily/moment.cc
lily/multi-measure-rest.cc
lily/note-column.cc
lily/note-head-side.cc
lily/note-head.cc
lily/rest-collision.cc
lily/rest.cc
lily/rhythmic-column-engraver.cc
lily/score-element.cc
lily/script-engraver.cc
lily/slur-engraver.cc
lily/slur.cc
lily/staff-bar.cc
lily/staff-symbol-engraver.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/text-engraver.cc
lily/tie-engraver.cc
lily/tie.cc
lily/timing-engraver.cc
lily/timing-translator.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/params.ly
make/out/lilypond.lsm
make/out/lilypond.spec
scm/generic-property.scm
scm/paper.scm

diff --git a/CHANGES b/CHANGES
index 2821f437c013970447002bb53e420b667eb22c18..f0d171221dc1cad39a0636d40e0c784d1213b050 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,19 @@
+1.3.15.hwn1
+===========
+
+       * Fixed bug in stem code.  Stem in chords works again.  Small
+stem cleanups.
+
+       * Use element properties for Staff_symbol.
+
+       * \property sparseTies (boolean).  Only make one tie in the
+middle for tied chords.
+
+       * Junked Directional_spanner, Column_info.
+Directional_element now is element interface `Directional_element_interface'
+
+       * cleanup: use to_boolean () iso. gh_boolean_p && gh_bool2scm
+
 pl 15.jcn4
        - removed old notename2scm conversion
        - beam-dir-algorithm through scm
@@ -14,6 +30,7 @@ pl 14.hwn1jcn1
        - chord-name uses scm members
        - bfs: knee with different mults, interstaff knee, auto-knee
 
+**********
 pl 14.hwn1
        - specialize duration.cc for lily, move out of lib/
        - stem cleanup
@@ -35,7 +52,7 @@ pl 13.jcn2
 pl 13.jcn1
        - bezier-bow fix
 
-***********
+**********
 pl 12.hwn1
        - polynomial.hh
        - bf: generic properties
@@ -45,8 +62,7 @@ pl 12.hwn1
        - use smobs for font metric tables/hashes.
        - nl.po bf
 
-************
-
+**********
 pl 11.jcn3
        - small beam fixes (interstaff knees still broken)
 
@@ -61,7 +77,7 @@ pl 11.jcn2
        - bf's: if (Foo b = bar != 1)
        - beam cleanup
 
-************
+*********
 pl 10.uu1
        - various small bfs
        - bf: alignment reversed
@@ -77,7 +93,7 @@ pl 10.jcn1
        - steminfo to properties
        - dropped internote dim for stem-beams
 
-**********
+*********
 pl 9.hwn1
        - abstracting Staff_symbol_referencer to an interface.
        - quantised_position for staccato dots.
@@ -85,7 +101,7 @@ pl 9.hwn1
        - junk Score_element::do_{width,height}: set callbacks directly.
        - merge Score_element, Graphical_element
        - merge Axis_group_element, Graphical_axis_group
-       - junk pointer fields fromScore_element derived classes
+       - junk pointer fields from Score_element derived classes
        - junk obsolete do_substitute_dependency code.
 
 **********
diff --git a/TODO b/TODO
index 7a30b25a86bd19c929840e46e897ccc9345c33f2..7863d6cfc25049bc983f79e78fb736ff8a1980ca 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,6 @@
 -*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*-
 
+
 * GNU LilyPond TODO
 Features you cannot find in the documentation as working, should be
 mentioned here.  This is an assorted collection of stuff that will be
@@ -10,8 +11,20 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 
 .* TODO
 . * use hash tabs iso. alist_ for elt property?
-. * TODO: junk dstream output.
+. * alignment within @itemize
+. * make a trip test
+.  * base on praeludium
+.  * cross staff beam
+.  * remain very short
+.  * broken slurs, ties
+.  * chords on stem
+.  * grace notes.
+.  * dynamics.
+
+. * junk dstream output.
 . * agressive type-checking for SCM stuff.
+. * Must stop before this music ends:
+verse=\lyrics {
 . * use  "staff-space" and "half-space" iso interline,
     staff_line_leading () etc.
 . * why does Voice.beamQuantisation = #'none not work?
@@ -22,11 +35,6 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 .  * make this file understandable for 3rd parties.
 . * \accepts -> \acceptedby 
 . * context in embedded SCM errors.
-. * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation,
-    eg.
-
-       ctor_dict["Score_element"]->clone_func (orig);
-       ctor_dict["Score_element"]->create_func ();
 . * acc at tied note after linebreak.
 . * fix font-naming and selecting
 . * sparse ties.
diff --git a/VERSION b/VERSION
index d1c8ac5e5e20d6759434fdaca92abc19211d19a2..9bba35ee8b4f6ea1ab5234e3a6c0b43a797c3582 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=15
-MY_PATCH_LEVEL=jcn4
+PATCH_LEVEL=16
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/tie-sparse.sly b/input/test/tie-sparse.sly
new file mode 100644 (file)
index 0000000..cbfc70d
--- /dev/null
@@ -0,0 +1,4 @@
+
+\context Voice {
+\property Voice.sparseTies = ##t
+c''  <c e g> ~ <c e g>  }
index 11bcefe65238f1f66281ca731bf50795a124ea3a..f83c2747ac15d7600afeb5b6b1b08774424b9bba 100644 (file)
@@ -12,6 +12,7 @@
 #include "note-column.hh"
 #include "local-key-item.hh"
 #include "warn.hh"
+#include "directional-element-interface.hh"
 
 /**
    catch notes, and put them in a row.
@@ -53,7 +54,7 @@ Align_note_column_engraver::do_removal_processing ()
   SCM al = get_property ("graceAlignPosition", 0);
   if (isdir_b (al))
     {
-      align_item_p_->set_direction (to_dir (al));
+      directional_element (align_item_p_).set (to_dir (al));
     }
   
   typeset_element (align_item_p_);
index 81e7cf94b8694763477d4a2aa20e083d965d0f29..74761145cd158cfb594690d364364be549fdae25 100644 (file)
@@ -176,7 +176,7 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
     Allow already started autobeam to end
    */
   SCM on = get_property ("noAutoBeaming", 0);
-  if (gh_boolean_p (on) && gh_scm2bool (on))
+  if (to_boolean (on))
     return;
 
   if (begin_mom)
@@ -290,7 +290,7 @@ Auto_beam_engraver::same_grace_state_b (Score_element* e)
 {
   bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
   SCM wg =get_property ("weAreGraceContext",0);
-  return (gh_boolean_p (wg) && gh_scm2bool (wg)) == gr;
+  return (to_boolean (wg)) == gr;
 }
 
 void
@@ -327,7 +327,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info)
       /*
        Don't (start) auto-beam over empty stems; skips or rests
        */
-      if (!stem_l->first_head ())
+      if (!stem_l->heads_i ())
        {
          if (stem_l_arr_p_)
            end_beam ();
index e8b29882f86e45bb3d667a1941c8292adaa1c4d7..a364995d4c0d6524e4ce216fc2f31bd332f2b1b8 100644 (file)
@@ -45,7 +45,7 @@ Bar_engraver::create_bar ()
        urg.  Why did I implement this?
        */
       SCM prop = get_property ("barAtLineStart", 0);
-      if (gh_boolean_p (prop) && gh_scm2bool (prop))
+      if (to_boolean (prop))
        {
          bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T);
        }
@@ -64,7 +64,7 @@ Bar_engraver::request_bar (String requested_type)
   if (!now_mom ())
     {
       SCM prop = get_property ("barAtLineStart", 0);
-      if (!gh_boolean_p (prop) && gh_scm2bool (prop))
+      if (!to_boolean (prop))
        return;
     }
   bool  bar_existed = bar_p_;
index f4fa06452c4f8cfc33c7148f8e94af75cebba814..c51d6611753c929ab97aba58d4223080adeb8a4e 100644 (file)
@@ -31,7 +31,7 @@ void
 Bar_script_engraver::do_creation_processing ()
 {
   SCM prop = get_property (type_ + "HangOnClef", 0);
-  if (gh_boolean_p (prop) && gh_scm2bool (prop))
+  if (to_boolean (prop))
     {
       hang_on_clef_b_ = true;
     }
index 1fa729cc51a0e8a6d41c22d9866ed7a2268e4f42..9ca86078852e6f3e022f78f30cf55b4edd11c18f 100644 (file)
@@ -159,7 +159,7 @@ Beam_engraver::acknowledge_element (Score_element_info info)
       bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
 
       SCM wg =get_property ("weAreGraceContext",0);
-      bool wgb= gh_boolean_p (wg) && gh_scm2bool (wg);
+      bool wgb= to_boolean (wg);
 
       if (wgb!= stem_grace)
        return;
index b0a7deffc5429d2470eb35781c13e2b991f2885e..84104ae96a9505eea273c81f138366f65adaa932 100644 (file)
@@ -14,7 +14,7 @@
     * move paper vars to scm
 
 */
-
+#include "directional-element-interface.hh"
 #include "beaming.hh"
 #include "dimensions.hh"
 #include "beam.hh"
@@ -84,8 +84,8 @@ Beam::do_pre_processing ()
       set_elt_property ("transparent", SCM_BOOL_T);
     }
 
-  if (!get_direction ())
-    set_direction (get_default_dir ());
+  if (!directional_element (this).get ())
+    directional_element (this).set (get_default_dir ());
 
   auto_knees ();
   set_stem_directions ();
@@ -108,8 +108,8 @@ Beam::get_default_dir () const
   for (int i=0; i <stem_count (); i++)
     do { // HUH -- waar slaat dit op?
       Stem *s = stem (i);
-      int current = s->get_direction () 
-       ? (1 + d * s->get_direction ())/2
+      Direction sd = directional_element (s).get ();
+      int current = sd ? (1 + d * sd)/2
        : s->get_center_distance ((Direction)-d);
 
       if (current)
@@ -146,13 +146,13 @@ Beam::get_default_dir () const
 void
 Beam::set_stem_directions ()
 {
-  Direction d = get_direction ();
+  Direction d = directional_element (this).get ();
   for (int i=0; i <stem_count (); i++)
     {
       Stem *s = stem (i);
       SCM force = s->remove_elt_property ("dir-forced");
       if (!gh_boolean_p (force) || !gh_scm2bool (force))
-       s->set_direction (d);
+       directional_element (s).set (d);
     }
 } 
 
@@ -176,6 +176,8 @@ Beam::auto_knee (String gap_str, bool interstaff_b)
   bool knee_b = false;
   int knee_y = 0;
   SCM gap = get_elt_property (gap_str);
+  Direction d = directional_element (this).get ();
+  
   if (gh_number_p (gap))
     {
       int auto_gap_i = gh_scm2int (gap);
@@ -183,9 +185,9 @@ Beam::auto_knee (String gap_str, bool interstaff_b)
         {
          bool is_b = (bool)(calc_interstaff_dist (stem (i), this) 
            - calc_interstaff_dist (stem (i-1), this));
-         int l_y = (int)(stem (i-1)->head_positions()[get_direction ()])
+         int l_y = (int)(stem (i-1)->head_positions()[d])
            + (int)calc_interstaff_dist (stem (i-1), this);
-         int r_y = (int)(stem (i)->head_positions()[get_direction ()])
+         int r_y = (int)(stem (i)->head_positions()[d])
            + (int)calc_interstaff_dist (stem (i), this);
          int gap_i = r_y - l_y;
 
@@ -201,9 +203,9 @@ Beam::auto_knee (String gap_str, bool interstaff_b)
     {
       for (int i=0; i < stem_count (); i++)
         {
-         int y = (int)(stem (i)->head_positions()[get_direction ()])
+         int y = (int)(stem (i)->head_positions()[d])
            + (int)calc_interstaff_dist (stem (i), this);
-         stem (i)->set_direction (y < knee_y ? UP : DOWN);
+         directional_element (stem (i)).set (y < knee_y ? UP : DOWN);
          stem (i)->set_elt_property ("dir-forced", SCM_BOOL_T);
        }
     }
@@ -275,8 +277,8 @@ Beam::do_post_processing ()
   /*
     until here, we used only stem_info, which acts as if dir=up
    */
-  y *= get_direction ();
-  dy *= get_direction ();
+  y *= directional_element (this).get ();
+  dy *= directional_element (this).get ();
 
   /* set or read dy as necessary */
   SCM s = get_elt_property ("height");
@@ -313,7 +315,7 @@ Beam::do_post_processing ()
          */
          int quant_dir = 0;
          if (abs (y_shift) > half_space / 2)
-           quant_dir = sign (y_shift) * get_direction ();
+           quant_dir = sign (y_shift) * directional_element (this).get ();
          y = quantise_y_f (y, dy, quant_dir);
          set_stem_length (y, dy);
        }
@@ -416,9 +418,13 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
   Real stem_y = (s->hpos_f () - x0) / dx * dy + y;
 
   /* knee */
-  if (get_direction () != s->get_direction ())
-    {
-      stem_y -= get_direction ()
+   Direction dir  = directional_element(this).get ();
+   Direction sdir = directional_element (s).get ();
+   
+    /* knee */
+   if (dir!= sdir)
+      {
+       stem_y -= dir 
        * (thick / 2 + (beam_multiplicity - 1) * interbeam_f);
 
       Staff_symbol_referencer_interface me (s);
@@ -427,7 +433,7 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
       // huh, why not for first visible?
       if (//(s != first_visible_stem ()) &&
          me.staff_symbol_l () != last.staff_symbol_l ())
-       stem_y += get_direction ()
+       stem_y += directional_element (this).get ()
          * (beam_multiplicity - stem_multiplicity) * interbeam_f;
     }
   return stem_y;
@@ -438,6 +444,8 @@ Beam::check_stem_length_f (Real y, Real dy) const
 {
   Real shorten = 0;
   Real lengthen = 0;
+  Direction dir = directional_element (this).get ();
+  
   for (int i=0; i < stem_count (); i++)
     {
       Stem* s = stem (i);
@@ -446,24 +454,20 @@ Beam::check_stem_length_f (Real y, Real dy) const
 
       Real stem_y = calc_stem_y_f (s, y, dy);
        
-      stem_y *= get_direction ();
+      stem_y *= dir;
       Stem_info info = s->calc_stem_info ();
 
-      if (stem_y > info.maxy_f_)
-       shorten = shorten <? info.maxy_f_ - stem_y;
-
-      if (stem_y < info.miny_f_)
-        lengthen = lengthen >? info.miny_f_ - stem_y; 
+      // if (0 > info.maxy_f_ - stem_y)
+      shorten = shorten <? info.maxy_f_ - stem_y;
+      // if (0 < info.miny_f_ - stem_y)
+      lengthen = lengthen >? info.miny_f_ - stem_y; 
     }
 
   if (lengthen && shorten)
     warning (_ ("weird beam vertical offset"));
 
   /* when all stems are too short, normal stems win */
-  if (shorten)
-    return shorten * get_direction ();
-  else
-    return lengthen * get_direction ();
+  return dir * ((shorten) ?  shorten : lengthen);
 }
 
 /*
@@ -541,7 +545,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir)
   if (a.size () <= 1)
     return y;
 
-  Real up_y = get_direction () * y;
+  Real up_y = directional_element (this).get () * y;
   Interval iv = quantise_iv (a, up_y/staff_space) * staff_space;
 
   Real q = up_y - iv[SMALLER] <= iv[BIGGER] - up_y 
@@ -549,7 +553,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir)
   if (quant_dir)
     q = iv[(Direction)quant_dir];
 
-  return q * get_direction ();
+  return q * directional_element (this).get ();
 }
 
 void
@@ -609,6 +613,9 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
   else
     nw_f = paper_l ()->get_var ("quartwidth");
 
+
+  Direction dir = directional_element (this).get ();
+  
   /* half beams extending to the left. */
   if (prev)
     {
@@ -627,7 +634,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
       for (int j = 0; j  < lhalfs; j++)
        {
          Molecule b (a);
-         b.translate_axis (-get_direction () * dy * (lwholebeams+j), Y_AXIS);
+         b.translate_axis (-dir * dy * (lwholebeams+j), Y_AXIS);
          leftbeams.add_molecule (b);
        }
     }
@@ -652,7 +659,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
          for (; j  < nogap; j++)
            {
              Molecule b (a);
-             b.translate_axis (-get_direction () * dy * j, Y_AXIS);
+             b.translate_axis (-dir  * dy * j, Y_AXIS);
              rightbeams.add_molecule (b);
            }
          // TODO: notehead widths differ for different types
@@ -664,10 +671,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
       for (; j  < rwholebeams; j++)
        {
          Molecule b (a);
-         if (!here->invisible_b ())
-           b.translate (Offset (gap_f, -get_direction () * dy * j));
-         else
-           b.translate (Offset (0, -get_direction () * dy * j));
+         b.translate (Offset (here->invisible_b () ? 0 : gap_f, -dir * dy * j));
          rightbeams.add_molecule (b);
        }
 
@@ -678,7 +682,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
       for (; j  < rwholebeams + rhalfs; j++)
        {
          Molecule b (a);
-         b.translate_axis (-get_direction () * dy * j, Y_AXIS);
+         b.translate_axis (- dir * dy * j, Y_AXIS);
          rightbeams.add_molecule (b);
        }
 
index a87329fe785c42712a6b7f1b4b7f9cbaac2fe986..ac43af288ec2aabf604775758585fe316ce986ef 100644 (file)
@@ -15,6 +15,7 @@
 #include "lookup.hh"
 #include "bezier-bow.hh"
 #include "main.hh"
+#include "directional-element-interface.hh"
 
 Bow::Bow ()
 {
@@ -33,7 +34,7 @@ Bow::do_brew_molecule_p () const
   if (gh_number_p (d))
     a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
   else
-    a = lookup_l ()->slur (one, get_direction () * thick, thick);
+    a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
   
   return new Molecule (a); 
 }
@@ -58,7 +59,7 @@ Bezier
 Bow::get_curve () const
 {
   Bezier_bow b (paper_l (),
-               get_encompass_offset_arr (), get_direction ());
+               get_encompass_offset_arr (), directional_element (this).get ());
   
   return b.get_curve ();
 }
index f735fe9e8c65eb52eb3151e646040c086002e06f..44d94270a6028544137528c2e1774f5fe6ca33e6 100644 (file)
@@ -83,7 +83,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf)
        return;
 
       SCM bp=item_l->remove_elt_property ("breakable");
-      bool breakable = (gh_boolean_p  (bp) && gh_scm2bool (bp));
+      bool breakable = (to_boolean (bp));
       if (!breakable)
        return ;
 
index 9861ac19c557004e0df2574a1c1a112785c3314b..97460a490afff8826b707e29ffff6e4db2b4769a 100644 (file)
@@ -9,6 +9,7 @@ TODO: --> see breathing-sign-engraver.cc
 
 */
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 #include "breathing-sign.hh"
 #include "string.hh"
@@ -22,12 +23,9 @@ TODO: --> see breathing-sign-engraver.cc
 
 Breathing_sign::Breathing_sign ()
 {
-  set_direction (UP);
   set_elt_property ("breakable", SCM_BOOL_T);
 }
 
-
-
 Molecule*
 Breathing_sign::do_brew_molecule_p () const
 {
@@ -47,6 +45,6 @@ Breathing_sign::do_post_processing()
 {
   Real dl = Staff_symbol_referencer_interface (this).staff_space();
 
-  translate_axis(2.0 * dl * get_direction (), Y_AXIS);
+  translate_axis(2.0 * dl * directional_element(this).get (), Y_AXIS);
 }
 
index 91301c6ca698dc2f9ca1fe552bd19283b08a76d2..a6bf46e56cc85da7374356e3564d00697da529ff 100644 (file)
@@ -145,10 +145,8 @@ Collision::automatic_shift ()
       /*
        TODO.
        */
-      Note_head * nu_l= cu_l->first_head();  // cu_l->head_l_arr_[0];
-      Note_head * nd_l = cd_l->first_head(); // cd_l->head_l_arr_.top();
-
-
+      Note_head * nu_l= cu_l->first_head();
+      Note_head * nd_l = cd_l->first_head();
       
       int downpos =    cd_l->head_positions_interval ()[BIGGER];
       int uppos =      cu_l->head_positions_interval ()[SMALLER];      
@@ -172,7 +170,6 @@ Collision::automatic_shift ()
          while ((flip (&d))!= UP);
     }
 
-
   do
     {
       for (int i=0; i < clash_groups[d].size (); i++)
index 83a4aaecb5d0b9a1e8e261b310c8a8ddf8d9e40e..dac91951bd0fd7a78f39ffbc9134f53208274824 100644 (file)
@@ -7,18 +7,28 @@
   
  */
 
-#include "directional-element.hh"
+#include "directional-element-interface.hh"
 
 
-Directional_element::Directional_element ()
+Directional_element_interface::Directional_element_interface (Score_element const *s)
 {
+  elt_l_ =  (Score_element*)s;
 }
 
+bool
+Directional_element_interface::has_interface_b () const
+{
+  return isdir_b (elt_l_->get_elt_property ("direction"));
+}
+
+
+  
+
 Direction
-Directional_element::get_direction () const
+Directional_element_interface::get () const
 {
   // return dir_;
-  SCM d= get_elt_property ("direction");
+  SCM d= elt_l_->get_elt_property ("direction");
   if (!isdir_b(d))
     return CENTER;
       
@@ -26,7 +36,13 @@ Directional_element::get_direction () const
 }
 
 void
-Directional_element::set_direction (Direction d) 
+Directional_element_interface::set (Direction d) 
+{
+  elt_l_->set_elt_property ("direction", gh_int2scm (d));
+}
+
+Directional_element_interface
+directional_element (Score_element const*s)
 {
-  set_elt_property ("direction", gh_int2scm (d));
+  return s;
 }
diff --git a/lily/directional-spanner.cc b/lily/directional-spanner.cc
deleted file mode 100644 (file)
index 41751d7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "directional-spanner.hh"
-#include "offset.hh"
-
-Direction
-Directional_spanner::get_default_dir() const
-{
-  return DOWN;
-}
-
-void
-Directional_spanner::do_pre_processing()
-{
-  if (!get_direction ())
-    set_direction (get_default_dir());
-}
-
-
index d085bf401116a6b8dbbdab1086e4eb6452c93b9a..b9868a29b88a27079881664c8ad58942da6d3143 100644 (file)
@@ -11,6 +11,7 @@
 #include "rhythmic-head.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 void
 Dot_column::add_dots (Dots *d)
@@ -49,7 +50,7 @@ Dot_column::Dot_column ()
   Group_interface gi (this, "dots");
   gi.set_interface ();
   
-  set_direction (RIGHT);
+  directional_element (this).set (RIGHT);
   set_axes(X_AXIS,X_AXIS);
 }
 
index fc3c57e0dd0c93c5575e30cbfdbd664c39912f80..ad62ecceda10a471d346987165a71261d73deac7 100644 (file)
@@ -11,6 +11,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 Dots::Dots ()
 {
@@ -28,13 +29,13 @@ Dots::do_post_processing ()
     }
   else
     {
-      if (!get_direction ())
-       set_direction (UP);
+      if (!directional_element (this).get ())
+       directional_element (this).set (UP);
 
       Staff_symbol_referencer_interface si (this);
       int p = int (si.position_f ());
       if (!(p % 2))
-       si.set_position (p  + get_direction ());
+       si.set_position (p  + directional_element (this).get ());
     }
 }
 Molecule* 
index a9eb6640c59dd66286073bd1adc46401b6123d9b..e70e848035afa923f404c0a22cc7ad35a5dd1781 100644 (file)
@@ -21,7 +21,7 @@
 #include "extender-spanner.hh"
 
 Extender_spanner::Extender_spanner ()
-  : Directional_spanner ()
+  : Spanner ()
 {
   dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
   dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback);
index ebb02d18d471c8925277c8bb043461246c837505..be36b99bf61ccbf8bc7d749d581a55c42ca43673 100644 (file)
@@ -23,7 +23,7 @@
 #include "dimension-cache.hh"
 
 Hyphen_spanner::Hyphen_spanner ()
-  : Directional_spanner ()
+  : Spanner ()
 {
   dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
 
index cf101fd89534073d55f92a3eeece5c5a6b9db750..e2908fe5c38e5376f3bff5fda64bd9c65490cdca 100644 (file)
@@ -8,7 +8,7 @@
 #define BEAM_HH
 
 #include "lily-proto.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 
 /** a beam connects multiple stems.
@@ -23,7 +23,7 @@
    damping: amount of beam slope damping. (int)
    should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
 */
-class Beam : public Directional_spanner
+class Beam : public Spanner
 {
 public:
 
index 6b788f154c92242b35f029da90f6542eb4cdf40c..16b9741486a4d2cf53c1f901c2dc338dce2335f3 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef BOW_HH
 #define BOW_HH
 
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 /**
   Base class for anything that looks like a slur.
@@ -21,7 +21,7 @@
     dy_f_drul_ , dx_f_drul_
   
   */
-class Bow : public Directional_spanner
+class Bow : public Spanner
 {
 public:
   Bow ();
index ffc2f3d7eb8c3d5b2740c2b8faa9eb62d7e5ed9e..aff6f393b438b95162991b5605cfda03a9e4a12a 100644 (file)
 
 #include "item.hh"
 #include "parray.hh"
-#include "directional-element.hh"
 
-class Breathing_sign : public Item,
-                      public Directional_element
+class Breathing_sign : public Item
 {
 public:
   VIRTUAL_COPY_CONS(Score_element);
index 68ed2dc5e274c54fe60c8ff6430b3eefcd247b6c..652441278dd8f03f2120417ddaab6b26416d94ae 100644 (file)
@@ -9,7 +9,7 @@
 #include "item.hh"
 
 #include "direction.hh"
-#include "pointer.hh"
+
 
 /**
   Set a clef in a staff.
diff --git a/lily/include/col-info.hh b/lily/include/col-info.hh
deleted file mode 100644 (file)
index e5d93f4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  col-info.hh -- declare Column_info
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef COL_INFO_HH
-#define COL_INFO_HH
-
-#include "lily-proto.hh"
-#include "pointer.hh"
-#include "interval.hh"
-#include "drul-array.hh"
-
-struct Spacer_rod {
-  Real distance_f_;
-  int other_idx_;
-  void print () const;
-};
-
-/// helper struct for #Spacing_problem#
-struct Column_info {
-  Paper_column *pcol_l_;
-  P<Real> fixpos_p_;
-
-  Interval width_;
-  int rank_i_;
-  /// did some tricks to make this column come out.
-  bool ugh_b_;         
-
-  Drul_array< Array<Spacer_rod> > rods_;
-
-  Column_info();
-  Column_info (Paper_column *,Real const *);
-
-  int rank_i () const;
-  void print() const;
-  bool fixed_b() const ;
-  Real fixed_position() const ;
-};
-
-#endif // COL_INFO_HH
index a1ee164ff0f007d8f93450bcde79ae9991233fbe..f17e4378342cbfdc0d4039ec0380d7c99ea54ee4 100644 (file)
@@ -13,7 +13,7 @@
 #include "axis-group-item.hh"
 #include "tuple.hh"
 
-
+//junkme, use SCM conses.
 typedef Tuple<Score_element*, Real> Shift_tup;
 
 /**
index 237cc49984375aee53b7e3d7663d1a3e997b1ae3..48834a4718bae47e94ea5804b1446aca916b21f9 100644 (file)
 #ifndef CRESCENDO_HH
 #define CRESCENDO_HH
 
-#include "directional-spanner.hh"
+#include "spanner.hh"
 /**
   The hairpin symbol. (cresc)
 
   (normal spanner?)
  */
-class Crescendo : public Directional_spanner {
+class Crescendo : public Spanner {
 public:
   int grow_dir_;
     
diff --git a/lily/include/directional-element-interface.hh b/lily/include/directional-element-interface.hh
new file mode 100644 (file)
index 0000000..c21a89d
--- /dev/null
@@ -0,0 +1,31 @@
+/*   
+  directional-element.hh -- declare Directional_element
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef DIRECTIONAL_ELEMENT_HH
+#define DIRECTIONAL_ELEMENT_HH
+
+#include "score-element.hh"
+
+struct Directional_element_interface 
+{
+  
+public:
+  Score_element *elt_l_;
+  
+  Directional_element_interface (Score_element const *);
+  void set  (Direction d);
+  Direction get () const;
+  bool has_interface_b () const;
+  // bool set_interface ();
+};
+
+Directional_element_interface directional_element (Score_element const*);
+
+#endif /* DIRECTIONAL_ELEMENT_HH */
+
index a94bfced9dca15bb08025bade179525e34b56962..139597f9cb07c5d48bed18984ec4747f4b4f3438 100644 (file)
@@ -1,25 +1,2 @@
-/*   
-  directional-element.hh -- declare Directional_element
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
 
-#ifndef DIRECTIONAL_ELEMENT_HH
-#define DIRECTIONAL_ELEMENT_HH
-
-#include "score-element.hh"
-
-struct Directional_element : public virtual Score_element
-{
-  void set_direction (Direction d);
-  Direction get_direction () const;
-
-  VIRTUAL_COPY_CONS(Score_element);
-  Directional_element ();
-};
-
-#endif /* DIRECTIONAL_ELEMENT_HH */
 
index 779a5ed9f4eee8572bef6988aaf7405193372379..65296f81060baccd891380179b283fc7515acef0 100644 (file)
@@ -1,28 +1,2 @@
-/*
-  directional-spanner.hh -- part of GNU LilyPond
-
-  (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef DIRECTIONALSPANNER_HH
-#define DIRECTIONALSPANNER_HH
-
-#include "spanner.hh"
-#include "directional-element.hh"
-
-/** a spanner which can be pointing "up" or "down".
-
-    JUNKME
- */
-class Directional_spanner : public Spanner, public Directional_element {
-public:
-  /// offset of "center" relative to left-column/0-pos of staff
-  //  virtual Offset center() const;
-  virtual Direction get_default_dir() const;
-  VIRTUAL_COPY_CONS(Score_element);
-protected:
-  virtual void do_pre_processing();
-};
-
-#endif // DIRECTIONALSPANNER_HH
 
+#error
index 8225860aa9ca1af4180e5e57b9377bb699308dd3..4cb5843b9df8b891703d97207ac68d4b1706495e 100644 (file)
 
 #include "item.hh"
 
-#include "directional-element.hh"
 
 /**
   The dots to go with a notehead/rest.  A separate class, since they
   are a party in collision resolution.
   */
 class Dots :
-  public Item,
-  public Directional_element
+  public Item
 {
 protected:
   virtual Molecule * do_brew_molecule_p () const;
   virtual void do_post_processing ();
 public:
+  // junkme.
   int dots_i_;
   
   Dots ();
index e0268198e8c6c49b3da2b8e3b6f72cc16efce28f..cb24e42ded4344e5aedc57ad8111dd4c9c787a81 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef EXTENDER_SPANNER_HH
 #define EXTENDER_SPANNER_HH
 
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 /** 
   simple extender line 
@@ -27,7 +27,7 @@
   extend beond, lasting the whole duration of the melissima
   (as in MUP, urg).
   */
-class Extender_spanner : public Directional_spanner
+class Extender_spanner : public Spanner
 {
 public:
   Extender_spanner ();
index d7a15b6c00c11f5795c57a5e8c482d032cb7da7c..3086facc32154c0fff6b4f2705c67e5a44034c42 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef HYPHEN_SPANNER_HH
 #define HYPHEN_SPANNER_HH
 
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 /** 
   centred hyphen 
@@ -18,7 +18,7 @@
   The length of the hyphen line should stretch based on the
   size of the gap between syllables.
   */
-class Hyphen_spanner : public Directional_spanner
+class Hyphen_spanner : public Spanner
 {
 public:
 Hyphen_spanner ();
index 53dc8fdc03c5db9495fc882ae97941fadce6ba0f..c9c4e6a997344594c9b8882f2a444805ae317e84 100644 (file)
@@ -39,6 +39,7 @@ void init_lily_guile ();
 bool isdir_b (SCM s);
 Direction to_dir (SCM s);
 
+bool to_boolean (SCM s);
 
 void init_ly_protection ();
 unsigned int ly_scm_hash (SCM s);
index 0c5b18ef7fdf5d5f618433493227bfe7ca95f4d9..c7d99235b463e62ab77866b726bfa08b9d30d29e 100644 (file)
@@ -81,7 +81,7 @@ struct Command_script_req;
 struct Command_tie_engraver;
 struct Crescendo ;
 struct Dimension_cache;
-struct Directional_spanner;
+struct Spanner;
 struct Dot_column;
 struct Dots;
 struct Durational_req;
index b30271855f7728651b958901a97b0f800df99eeb..3e94b475d2a3dadd05a5216e8a7812563ceea71c 100644 (file)
 #define NOTE_HEAD_SIDE_HH
 
 #include "item.hh"
-#include "directional-element.hh"
 
 /**
    be next to noteheads.
    */
-class Note_head_side: public virtual Item, public virtual Directional_element
+class Note_head_side: public virtual Item
 {
 public:
-
   Note_head_side ();
   bool supported_b () const;
   void add_support (Item*);
index 55a15f308adfabc121b2cbe71de431245d6eb06f..cfa65ffec02be2071bda9e39ec77f05227aabc3d 100644 (file)
@@ -13,8 +13,6 @@
 #include "spanner.hh"
 #include "item.hh"
 
-#include "directional-element.hh"
-
 struct Side_position_interface
 {
   Score_element * elt_l_;
index 589f73e0b49ee833f65d8f41194d09bbc5f58f15..d9d05da0184c4c742672863f355dd0647f3a6a7e 100644 (file)
@@ -35,7 +35,7 @@ public:
   
   Real staff_space () const;
   Staff_symbol * staff_symbol_l () const;
-  int lines_i () const;
+  int line_count () const;
   Real position_f () const;
 };
 
index c052e6220dfbf6c955208b92b259771bf6502389..8fde55f94ddc2eaf0ef023eb773c97275e6e6206 100644 (file)
 class Staff_symbol : public Spanner
 {
 public:
-  /// this many lines.
-  int no_lines_i_;
-  Real staff_space_;
-  Real staff_space ();
-  
-  
-  Staff_symbol ();
+  Real staff_space () const;
   int steps_i() const;
+  int line_count () const;
 protected:
   VIRTUAL_COPY_CONS(Score_element);
   virtual Molecule* do_brew_molecule_p() const;
-  virtual void do_print() const;
 };
 #endif // STAFFSYM_HH
index 096671a6d5faacaeba3aa88ab9e8f772c90bf16b..a9fd826e0526a04a58c49ac6a4b89a5051d352d7 100644 (file)
@@ -15,6 +15,8 @@
 struct Stem_info 
 {
   Real idealy_f_;
+
+  // fixme: we're an Interval!
   Real miny_f_;
   Real maxy_f_;
 };
index ef23aadfde82ec64d910386afabae784676d0471..d17936fbec870481426c9defbb8335eec62b7972 100644 (file)
 class Stem_tremolo : public Item {
 protected:
   Stem * stem_l () const;
-  virtual void do_print () const;
   virtual Molecule *do_brew_molecule_p () const;
 
   static Interval dim_callback (Dimension_cache const*);
 public:
-  int abbrev_flags_i_;
   Stem_tremolo ();
   void set_stem (Stem *);
 };
index b496614ebeb08b00d8c244836a55af073f7869d9..e1b330e200d87ff7faeecff3db8146b3739404a4 100644 (file)
@@ -11,7 +11,6 @@
 #include "array.hh"
 #include "moment.hh"
 #include "molecule.hh"
-#include "directional-element.hh"
 #include "stem-info.hh"
 
 /**the rule attached to the ball.
@@ -41,8 +40,7 @@
 
   
   */
-class Stem : public Item,
-            public Directional_element
+class Stem : public Item
 {
 public:
   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
@@ -56,6 +54,8 @@ public:
    */
   Beam* beam_l () const;
   Note_head * first_head () const;
+  Drul_array<Note_head*> extremal_heads () const;
+
   Score_element * support_head () const;
   Stem ();
 
@@ -66,25 +66,28 @@ public:
   Stem_info calc_stem_info () const;
 
   Real chord_start_f () const;
-  
+  Direction get_direction () const;
   int type_i () const;
   void set_stemend (Real);
   Direction get_default_dir() const;
+
   int get_center_distance(Direction) const;
-  Real  get_default_stemlen() const;
+  int heads_i () const;
+
+  bool invisible_b() const;
+    
+  /// heads that the stem encompasses (positions)
+  Interval head_positions() const;
 
+protected:
+  friend class Stem_tremolo;   // ugh.
+  Real  get_default_stem_end_position () const;
   void position_noteheads();
 
-  Real stem_end_position () const;
 
+  Real stem_end_position () const;
   // todo: cleanup, naming
   Real note_delta_f () const;
-
-  bool invisible_b() const;
-    
-  /// heads that the stem encompasses (positions)
-  Interval_t<int> head_positions() const;
-
 protected:
   Molecule flag () const;
 
index 4e628f27870ab4a1333f33c52a2a9e20848cfd1d..4e6f14764edb074a8e995c5751c70f651f3f1661 100644 (file)
@@ -18,6 +18,7 @@
 class Text_item : public Item
 {
 public:
+  // junkme.
   String text_str_;
 
   VIRTUAL_COPY_CONS (Score_element);
index a89088ab8a451edfc90105e4d6d909d80e1ebe16..7fe61a3850e2057c5fb7dd96384e2fc480e95fe6 100644 (file)
@@ -20,7 +20,7 @@ class Tie : public Bow
 {
 public:
   Tie ();
-  void set_head (Direction, Note_head*head_l);
+  void set_head (Direction, Item*head_l);
   VIRTUAL_COPY_CONS(Score_element);
 
   Note_head* head (Direction) const;
index 2fd0a5ff16efd2660d1edd9acfc81ab673682179..662ded9f98f19b68c60aeb2256331082ae047efe 100644 (file)
@@ -8,7 +8,7 @@
 #define Tuplet_spanner_HH
 
 #include "pointer.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 /** supportable plet: triplets, eentweetjes, ottava, etc.
 
@@ -17,7 +17,7 @@
 
   todo: handle breaking elegantly.
 */
-class Tuplet_spanner : public Directional_spanner
+class Tuplet_spanner : public Spanner
 {
 public:
   Tuplet_spanner ();
@@ -25,7 +25,9 @@ public:
   void add_column (Note_column*);
   void add_beam (Beam*);
   
-
+  /*
+    JUNKME.
+   */
   String  number_str_;
 
   bool parallel_beam_b_;
index 6758de42079032733a64e80588faaa409cb24d69..299c6d49edd6f2f0f049b68858226d26e599e2e6 100644 (file)
@@ -86,7 +86,7 @@ Key_engraver::acknowledge_element (Score_element_info info)
   if (dynamic_cast <Clef_change_req *> (info.req_l_)) 
     {
       SCM c =  get_property ("createKeyOnClefChange", 0);
-      if (gh_boolean_p (c) && gh_scm2bool (c))
+      if (to_boolean (c))
        create_key ();
     }
   else if (dynamic_cast<Bar *> (info.elem_l_)
@@ -133,7 +133,7 @@ Key_engraver::read_req (Key_change_req const * r)
   key_.clear ();
   SCM prop = get_property ("keyOctaviation", 0);
 
-  key_.multi_octave_b_ = gh_boolean_p (prop) && gh_scm2bool (prop);
+  key_.multi_octave_b_ = to_boolean (prop);
   
   accidental_idx_arr_.clear ();
 
index 73043deb0118616e41316030c955c42490576848..ac577bd101ae046b82e2f16adaf8869b9fe9ea46 100644 (file)
@@ -296,3 +296,10 @@ scm_to (SCM s, Real* r)
   // urg
   *r = gh_number_p (s) ? gh_scm2double (s) : 0;
 }
+
+  
+bool
+to_boolean (SCM s)
+{
+  return gh_boolean_p (s) && gh_scm2bool (s);
+}
index 100bac981ddbb9207d55544697f88a6c2ede35b9..9029ea1eb40a0a04e7dda8ddb136da76c2112588 100644 (file)
@@ -60,7 +60,7 @@ Local_key_engraver::process_acknowledged ()
     if (!key_item_p_ && mel_l_arr_.size()) 
     {
         SCM f = get_property ("forgetAccidentals",0);
-        bool forget = gh_boolean_p (f) && gh_scm2bool(f);
+        bool forget = to_boolean (f);
         for (int i=0; i  < mel_l_arr_.size(); i++) 
            {
                Item * support_l = support_l_arr_[i];
@@ -183,7 +183,7 @@ Local_key_engraver::do_process_requests()
   if (time_C_ && !time_C_->measure_position ())
     {
       SCM n =  get_property ("noResetKey",0);
-      bool no_res = gh_boolean_p (n) && gh_scm2bool (n);
+      bool no_res = to_boolean (n);
       if (!no_res && key_grav_l_)
        local_key_= key_grav_l_->key_;
     }
index be3cabead6121f1dad766d5ee25b375caf5f73a1..812460e0fc10f062cf0ec98e7cfb46b0f2fd9d5d 100644 (file)
@@ -565,7 +565,7 @@ Lookup::volta (Real h, Real w, Real thick, bool vert_start, bool vert_end) const
 }
 
 Molecule
-Lookup::accordion (SCM s, Real interline_f) const
+Lookup::accordion (SCM s, Real staff_space) const
 {
   Molecule m;
   String sym = ly_scm2string(gh_car (s));
@@ -578,7 +578,7 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (reg.left_str(1) == "F")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
@@ -606,37 +606,37 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (eflag & 0x02)
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
          m.add_molecule(d);
        }
       if (eflag & 0x04)
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
-         d.translate_axis(0.8 * interline_f PT, X_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         d.translate_axis(0.8 * staff_space PT, X_AXIS);
          m.add_molecule(d);
        }
       if (eflag & 0x01)
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
-         d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
          m.add_molecule(d);
        }
       if (reg.left_str(2) == "SS")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(0.5 * interline_f PT, Y_AXIS);
-         d.translate_axis(0.4 * interline_f PT, X_AXIS);
+         d.translate_axis(0.5 * staff_space PT, Y_AXIS);
+         d.translate_axis(0.4 * staff_space PT, X_AXIS);
          m.add_molecule(d);
-         d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-2);
        }
       if (reg.left_str(1) == "S")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(0.5 * interline_f PT, Y_AXIS);
+         d.translate_axis(0.5 * staff_space PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
@@ -648,14 +648,14 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (reg.left_str(1) == "F")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg == "E")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
          m.add_molecule(d);
        }
     }
@@ -666,7 +666,7 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (reg.left_str(1) == "T")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
@@ -674,24 +674,24 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (reg.left_str(1) == "F")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg.left_str(2) == "EE")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
-         d.translate_axis(0.4 * interline_f PT, X_AXIS);
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
+         d.translate_axis(0.4 * staff_space PT, X_AXIS);
          m.add_molecule(d);
-         d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-2);
        }
       if (reg.left_str(1) == "E")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
@@ -703,36 +703,36 @@ Lookup::accordion (SCM s, Real interline_f) const
       if (reg.left_str(1) == "T")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 3.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 3.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg.left_str(1) == "F")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg.left_str(1) == "M")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 2 PT, Y_AXIS);
-         d.translate_axis(interline_f PT, X_AXIS);
+         d.translate_axis(staff_space * 2 PT, Y_AXIS);
+         d.translate_axis(staff_space PT, X_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg.left_str(1) == "E")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
       if (reg.left_str(1) == "S")
        {
          Molecule d = afm_find("scripts-accDot");
-         d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
          m.add_molecule(d);
          reg = reg.right_str(reg.length_i()-1);
        }
index 2bc76c99309ceba781493053c755ce85c37cee9d..3a89ad968fbc62b65cd4b0ae4789155e3a404229 100644 (file)
@@ -30,9 +30,9 @@ Melisma_engraver::do_try_music (Music *m )
       SCM plain (get_property ("melismaBusy", 0));
       SCM slur (get_property ("slurMelismaBusy", 0));
       SCM tie (get_property ("tieMelismaBusy", 0));
-      return (gh_boolean_p (plain) && gh_scm2bool (plain))
-       || (gh_boolean_p (slur) && gh_scm2bool (slur))
-       || (gh_boolean_p (tie) && gh_scm2bool (tie));
+      return (to_boolean (plain))
+       || (to_boolean (slur))
+       || (to_boolean (tie));
     }
   return false;
 }
index 0e11977686cc0c144341dcfedb3c1c0a3aa94927..ebe3b0b190b3d3e1584bd257b59d58eba8c8549c 100644 (file)
@@ -13,7 +13,7 @@
 #include "warn.hh"
 
 SCM
-Moment::mark_smob (SCM s)
+Moment::mark_smob (SCM)
 {
   return SCM_EOL;
 }
index 0ab27b60f59763b90f93e7101449d09285282cd1..72a23f5b589c7bdf08569d59834ee713527592c3 100644 (file)
@@ -89,17 +89,17 @@ Multi_measure_rest::do_brew_molecule_p () const
     }
   
   mol_p->add_molecule (s);
-  Real interline_f
+  Real staff_space
     = staff_symbol_referencer_interface (this).staff_space ();
   if (measures_i_ == 1 && rest_symbol)
     {
-      mol_p->translate_axis (interline_f, Y_AXIS);
+      mol_p->translate_axis (staff_space, Y_AXIS);
     }
   else if (measures_i_ > 1)
     {
       Molecule s (lookup_l ()->text ("number", to_str (measures_i_), paper_l ()));
       s.align_to (X_AXIS, CENTER);
-      s.translate_axis (3.0 * interline_f, Y_AXIS);
+      s.translate_axis (3.0 * staff_space, Y_AXIS);
       mol_p->add_molecule (s);
     }
   mol_p->translate_axis (x_off, X_AXIS);
index 44020d62869f6e092825165806c2c0b3f63ff25f..62fae0d80725cc4351be42aa12bec8441670f550 100644 (file)
@@ -187,7 +187,7 @@ Note_column::do_post_processing ()
   Real dist =
     minimum_dist +  -d  * (beamy - rest_dim) >? 0;
 
-  int stafflines = si.lines_i ();
+  int stafflines = si.line_count ();
 
   // move discretely by half spaces.
   int discrete_dist = int (ceil (dist ));
index b84b8953347e5e6cd6c0a2f0a76b279b7510647a..273744c03290e5300a3bd5454620fdf72e3e7621 100644 (file)
@@ -7,6 +7,8 @@
   
  */
 
+#include "directional-element-interface.hh"
+
 #include "side-position-interface.hh"
 #include "note-head-side.hh"
 void
index 6124b5a1fa6400805263c73a7db6e22819b81b51..fa911e7ca4b19cea11dc752cdf16ad240ad28cde 100644 (file)
@@ -52,7 +52,7 @@ Note_head::do_brew_molecule_p() const
   Staff_symbol_referencer_interface si (this);
   
   Real inter_f = si.staff_space ()/2;
-  int sz = si.lines_i ()-1;
+  int sz = si.line_count ()-1;
   Real p = si.position_f ();
   int streepjes_i = abs (p) < sz 
     ? 0
index 18abd7604c07a09ac8277e4105b7d7fee1d5779c..1f1c8748068ab97ae29edf8f7dff659e8677f52a 100644 (file)
@@ -92,9 +92,9 @@ Rest_collision::do_pre_processing()
        /* FIXME
          staff_space =  rcol->rest_l_arr[0]->staff_space ();
        */
-      Real internote_f = staff_space/2;
+      Real half_staff_space_f = staff_space/2;
       Real minimum_dist = paper_l ()->get_var ("restcollision_minimum_dist")
-       * internote_f;
+       * half_staff_space_f;
       
       /*
        assumption: ref points are the same. 
@@ -113,7 +113,7 @@ Rest_collision::do_pre_processing()
 
 
       // FIXME
-      int stafflines = 5; // rcol->rest_l_arr[0]->lines_i ();
+      int stafflines = 5; // rcol->rest_l_arr[0]->line_count;
 
       
       // move discretely by half spaces.
index 8999559d5f7ef5bf1d69cae171c417099e9ae071..57c5816892073562d2c16b80ccf5d433d786755e 100644 (file)
@@ -46,7 +46,7 @@ Rest::do_brew_molecule_p () const
     {
       Staff_symbol_referencer_interface si(this);
       ledger_b = abs(si.position_f ()  - (2* balltype_i () - 1))
-       > si.lines_i (); 
+       > si.line_count (); 
     }
   
   String style; 
index 6c31e63337d062d2e1d182226f5e0ac6ac63e71e..2709b60a82568c89481782773b4994b45759896c 100644 (file)
@@ -59,7 +59,7 @@ Rhythmic_column_engraver::process_acknowledged ()
        }
 
       SCM wg = get_property ("weAreGraceContext",0);
-      bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg);
+      bool wegrace = to_boolean (wg);
 
       if (!wegrace)
        for (int i=0; i < grace_slur_endings_.size(); i++)
@@ -72,7 +72,7 @@ void
 Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
 {
   SCM wg = get_property ("weAreGraceContext",0);
-  bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg);
+  bool wegrace = to_boolean (wg);
   if ((wegrace !=
       (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED))
     && !dynamic_cast<Slur*> (i.elem_l_))
index 6d3be5981c996fcc980d5185b1cc793823e18abd..870c2803986e303801bf0bcddd236671a7816e5d 100644 (file)
@@ -265,7 +265,7 @@ Score_element::calculate_dependencies (int final, int busy,
 void
 Score_element::output_processing () 
 {
-  if (get_elt_property ("transparent") != SCM_UNDEFINED)
+  if (to_boolean  (get_elt_property ("transparent")))
     return;
 
   // we're being silly here. 
index 65317776bbc7e51782b05f665d18a531618e12ee..af4be4f176af0e0441c9084eb5fc3554ccf27be1 100644 (file)
@@ -76,7 +76,7 @@ Script_engraver::do_process_requests()
        stafy.set_direction (l->get_direction ());
 
       SCM axisprop = get_property ("scriptHorizontal",0);
-      bool xaxis = gh_boolean_p (axisprop) && gh_scm2bool (axisprop);
+      bool xaxis = to_boolean (axisprop);
       if (xaxis)
        stafy.set_axis (X_AXIS);
       else
index ae15cd1d65071241b4358b90ddfb020a684fd734..4bf349656d8354ddcec864ca74faea104fbefc6e 100644 (file)
@@ -59,7 +59,7 @@ Slur_engraver::do_removal_processing ()
     }
   slur_l_stack_.clear ();
   SCM wg = get_property ("weAreGraceContext",0);
-  bool wgb = gh_boolean_p (wg) && gh_scm2bool (wgb);
+  bool wgb = to_boolean (wg);
   if (!wgb)
     for (int i=0; i < requests_arr_.size(); i++)
       {
@@ -116,7 +116,7 @@ Slur_engraver::do_post_move_processing()
 {
   new_slur_req_l_arr_.clear();
   SCM m = get_property ("automaticMelismata",0);
-  if (gh_boolean_p (m) && gh_scm2bool (m))
+  if (to_boolean (m))
     {
       set_melisma (slur_l_stack_.size ());
     }
index f13ba1dd5324fbad11dee39242797cbee6192bd0..6f4d1c279ceb6c1027995acecd23201b3afbb5c5 100644 (file)
@@ -13,6 +13,7 @@
     * broken slur should have uniform trend
  */
 
+#include "directional-element-interface.hh"
 #include "group-interface.hh"
 #include "slur.hh"
 #include "lookup.hh"
@@ -86,36 +87,38 @@ Slur::encompass_offset (Note_column const* col) const
 {
   Offset o;
   Stem* stem_l = col->stem_l ();
+  Direction dir = directional_element (this).get ();
+  
   if (!stem_l)
     {
       warning (_ ("Slur over rest?"));
       o[X_AXIS] = col->hpos_f ();
-      o[Y_AXIS] = col->extent (Y_AXIS)[get_direction ()];
+      o[Y_AXIS] = col->extent (Y_AXIS)[dir];
       return o;  
     }
-  
+  Direction stem_dir = directional_element (stem_l).get ();
   o[X_AXIS] = stem_l->hpos_f ();
 
   /*
     Simply set x to middle of notehead
    */
 
-  o[X_AXIS] -= 0.5 * stem_l->get_direction () * col->extent (X_AXIS).length ();
+  o[X_AXIS] -= 0.5 * stem_dir * col->extent (X_AXIS).length ();
 
-  if ((stem_l->get_direction () == get_direction ())
+  if ((stem_dir == dir)
       && !stem_l->extent (Y_AXIS).empty_b ())
     {
-      o[Y_AXIS] = stem_l->extent (Y_AXIS)[get_direction ()];
+      o[Y_AXIS] = stem_l->extent (Y_AXIS)[dir];
     }
   else
     {
-      o[Y_AXIS] = col->extent (Y_AXIS)[get_direction ()];
+      o[Y_AXIS] = col->extent (Y_AXIS)[dir];
     }
 
   /*
    leave a gap: slur mustn't touch head/stem
    */
-  o[Y_AXIS] += get_direction () * paper_l ()->get_var ("slur_y_free");
+  o[Y_AXIS] += dir * paper_l ()->get_var ("slur_y_free");
   o[Y_AXIS] += calc_interstaff_dist (stem_l, this);
   return o;
 }
@@ -132,8 +135,8 @@ Slur::do_post_processing ()
     Group_interface__extract_elements (this, (Note_column*)0, "note-columns");
 
 
-  if (!get_direction ())
-    set_direction (get_default_dir ());
+  if (!directional_element (this).get ())
+    directional_element (this).set (get_default_dir ());
 
   /* 
    Slur and tie placement [OSU]
@@ -146,8 +149,8 @@ Slur::do_post_processing ()
      y = length >= 5ss : y next interline - d * 0.25 ss
    */
 
-  Real interline_f = paper_l ()->get_var ("interline");
-  Real internote_f = interline_f / 2;
+  Real staff_space = paper_l ()->get_var ("interline");
+  Real half_staff_space = staff_space / 2;
 
   Real x_gap_f = paper_l ()->get_var ("slur_x_gap");
   Real y_gap_f = paper_l ()->get_var ("slur_y_gap");
@@ -157,6 +160,9 @@ Slur::do_post_processing ()
   note_column_drul[RIGHT] = encompass_arr.top ();
 
   bool fix_broken_b = false;
+
+  Direction my_dir = directional_element (this).get ();
+  
   Direction d = LEFT;
   do 
     {
@@ -173,23 +179,23 @@ Slur::do_post_processing ()
            no beam getting in the way
          */
          if ((stem_l->extent (Y_AXIS).empty_b ()
-              || !((stem_l->get_direction () == get_direction ()) && (get_direction () != d)))
-             && !((get_direction () == stem_l->get_direction ())
+              || !((stem_l->get_direction () == my_dir) && (my_dir != d)))
+             && !((my_dir == stem_l->get_direction ())
                   && stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
            {
              dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
              dx_f_drul_[d] -= d * x_gap_f;
 
-             if (stem_l->get_direction () != get_direction ())
+             if (stem_l->get_direction () != my_dir)
                {
-                 dy_f_drul_[d] = note_column_drul[d]->extent (Y_AXIS)[get_direction ()];
+                 dy_f_drul_[d] = note_column_drul[d]->extent (Y_AXIS)[my_dir];
                }
              else
                {
                  dy_f_drul_[d] = stem_l->chord_start_f ()
-                   + get_direction () * internote_f;
+                   + my_dir * half_staff_space;
                }
-             dy_f_drul_[d] += get_direction () * y_gap_f;
+             dy_f_drul_[d] += my_dir * y_gap_f;
            }
          /*
            side attached to (visible) stem
@@ -203,8 +209,8 @@ Slur::do_post_processing ()
               */
              if (stem_l->beam_l () && (stem_l->beam_count (-d) >= 1))
                {
-                 dy_f_drul_[d] = stem_l->extent (Y_AXIS)[get_direction ()];
-                 dy_f_drul_[d] += get_direction () * 2 * y_gap_f;
+                 dy_f_drul_[d] = stem_l->extent (Y_AXIS)[my_dir];
+                 dy_f_drul_[d] += my_dir * 2 * y_gap_f;
                }
              /*
                side attached to notehead, with stem getting in the way
@@ -214,8 +220,8 @@ Slur::do_post_processing ()
                  dx_f_drul_[d] -= d * x_gap_f;
                  
                  dy_f_drul_[d] = stem_l->chord_start_f ()
-                   + get_direction () * internote_f;
-                 dy_f_drul_[d] += get_direction () * y_gap_f;
+                   + my_dir * half_staff_space;
+                 dy_f_drul_[d] += my_dir * y_gap_f;
                }
            }
        }
@@ -294,7 +300,7 @@ Slur::do_post_processing ()
   Real slope_ratio_f = abs (dy_f / dx_f);
   if (slope_ratio_f > slope_damp_f)
     {
-      Direction d = (Direction)(- get_direction () * (sign (dy_f)));
+      Direction d = (Direction)(- my_dir * (sign (dy_f)));
       if (!d)
        d = LEFT;
       Real damp_f = (slope_ratio_f - slope_damp_f) * dx_f;
@@ -302,7 +308,7 @@ Slur::do_post_processing ()
        must never change sign of dy
        */
       damp_f = damp_f <? abs (dy_f);
-      dy_f_drul_[d] += get_direction () * damp_f;
+      dy_f_drul_[d] += my_dir * damp_f;
     }
 
   /*
@@ -324,7 +330,7 @@ Slur::do_post_processing ()
       Real height_ratio_f = abs (height_f / width_f);
       if (height_ratio_f > height_damp_f)
        {
-         Direction d = (Direction)(- get_direction () * (sign (dy_f)));
+         Direction d = (Direction)(- my_dir * (sign (dy_f)));
          if (!d)
            d = LEFT;
          /* take third step */
@@ -334,8 +340,8 @@ Slur::do_post_processing ()
          */
          if (abs (dy_f / dx_f ) < slope_damp_f)
            {
-             dy_f_drul_[-d] += get_direction () * damp_f;
-             dy_f_drul_[d] += get_direction () * damp_f;
+             dy_f_drul_[-d] += my_dir * damp_f;
+             dy_f_drul_[d] += my_dir * damp_f;
            }
          /*
            don't change slope too much, would have been catched by slope damping
@@ -343,7 +349,7 @@ Slur::do_post_processing ()
          else
            {
              damp_f = damp_f <? abs (dy_f/2);
-             dy_f_drul_[d] += get_direction () * damp_f;
+             dy_f_drul_[d] += my_dir * damp_f;
            }
        }
     }
@@ -362,8 +368,8 @@ Slur::do_post_processing ()
       Note_column * nc = note_column_drul[d];
       if (nc == spanned_drul_[d]
          && nc->stem_l ()
-         && nc->stem_l ()->get_direction () == get_direction ()
-         && abs (nc->stem_l ()->extent (Y_AXIS)[get_direction ()]
+         && nc->stem_l ()->get_direction () == my_dir
+         && abs (nc->stem_l ()->extent (Y_AXIS)[my_dir]
                  - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f))
              <= snap_f)
        {
@@ -373,9 +379,9 @@ Slur::do_post_processing ()
          snapx_f_drul[d] = nc->stem_l ()->hpos_f ()
            - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
 
-         snapy_f_drul[d] = nc->stem_l ()->extent (Y_AXIS)[get_direction ()]
+         snapy_f_drul[d] = nc->stem_l ()->extent (Y_AXIS)[my_dir]
            + interstaff_interval[d]
-           + get_direction () * 2 * y_gap_f;
+           + my_dir * 2 * y_gap_f;
          
          snapped_b_drul[d] = true;
        }
index e47791433241b28d949a77d7c6014577db4f5ed3..0f37c1cf0c8f289fb38928c3cd0a0e6bcd3486a5 100644 (file)
@@ -19,7 +19,7 @@ Staff_bar::get_bar_size () const
   else
     {
       Staff_symbol_referencer_interface si (this);
-      return (si.lines_i () -1) * si.staff_space ();
+      return (si.line_count () -1) * si.staff_space ();
     }
 }
 
index 3bb94567713d49c31e43369cad1445768e60d999..6c8787c29928be8a29c4fa43c8984673b38094f2 100644 (file)
@@ -54,21 +54,6 @@ Staff_symbol_engraver::do_creation_processing()
 void
 Staff_symbol_engraver::do_removal_processing()
 {
-  SCM l (get_property ("numberOfStaffLines", 0));
-  if (gh_number_p(l))
-    {
-      span_p_->no_lines_i_ = gh_scm2int (l);
-    }
-
-  SCM sz (get_property ("staffLineLeading", 0));
-  if (gh_number_p(sz))
-    {
-      span_p_->staff_space_ = gh_scm2double (sz);
-    }
-  else
-    {
-      span_p_->staff_space_ = paper_l ()->get_var ("interline");
-    }
   span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (span_p_);
   span_p_ =0;
@@ -81,7 +66,7 @@ Staff_symbol_engraver::acknowledge_element (Score_element_info s)
   s.elem_l_->add_dependency (span_p_); // UGH. UGH. UGH 
 
   SCM ss =s.elem_l_->remove_elt_property ("staff-support");
-  if (gh_boolean_p (ss) && gh_scm2bool (ss))
+  if (to_boolean (ss))
     {
       Side_position_interface si (s.elem_l_);
       if (si.has_interface_b ())
index 5b1f6bba8c8d8f5b62a939ed818126cc0f30b585..d7d639fcd95a7995f6ba082fee318e8dc7c42581 100644 (file)
@@ -35,10 +35,10 @@ Staff_symbol_referencer_interface::has_interface_b ()
 
 
 int
-Staff_symbol_referencer_interface::lines_i () const
+Staff_symbol_referencer_interface::line_count () const
 {
   Staff_symbol *st = staff_symbol_l ();
-  return st  ?  st->no_lines_i_ : 5;
+  return st  ?  st->line_count () : 0;
 }
 
 Staff_symbol*
@@ -53,7 +53,7 @@ Staff_symbol_referencer_interface::staff_space () const
 {
   Staff_symbol * st = staff_symbol_l ();
   if (st)
-    return st->staff_space_;
+    return st->staff_space ();
   else if (elt_l_->pscore_l_ && elt_l_->paper_l ())
     elt_l_->paper_l ()->get_var ("interline");
  
index 7ba3c9e235f6503aa9f12d0034afefde93e87dd7..75a3f5a2a54dc41387b302d5b6b713ad29d3d4bc 100644 (file)
 #include "item.hh"
 
 
-Staff_symbol::Staff_symbol ()
-{
-  no_lines_i_ = 5;
-  staff_space_ = 5.0 PT;
-}
-
-void
-Staff_symbol::do_print() const
-{
-#ifndef NPRINT
-  Spanner::do_print();
-  DEBUG_OUT << "lines: " << no_lines_i_;
-#endif
-}
-
 
 Molecule*
 Staff_symbol::do_brew_molecule_p() const
 {
   Score_element * common
     = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
-
-#if 0
-  Interval r =  spanned_drul_[RIGHT]->extent (X_AXIS);
-  Interval l =  spanned_drul_[LEFT]->extent (X_AXIS);
   
-  Real left_shift =l.empty_b () ? 0.0: l[LEFT];
-  Real right_shift =r.empty_b () ? 0.0: r[RIGHT];  
-#endif
   Real width =
     // right_shift     - left_shift
     + spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS)
@@ -53,27 +31,34 @@ Staff_symbol::do_brew_molecule_p() const
   Molecule rule  = lookup_l ()->filledbox (Box (Interval (0,width),
                                                Interval (-t/2, t/2)));
 
-  Real height = (no_lines_i_-1) * staff_space_ /2;
+  int l = line_count ();
+  
+  Real height = (l-1) * staff_space () /2;
   Molecule * m = new Molecule;
-  for (int i=0; i < no_lines_i_; i++)
+  for (int i=0; i < l; i++)
     {
       Molecule a (rule);
-      a.translate_axis (height - i * staff_space_, Y_AXIS);
+      a.translate_axis (height - i * staff_space (), Y_AXIS);
       m->add_molecule (a);
     }
 
-  //  m->translate_axis (left_shift, X_AXIS);
   return m;
 }
 
-
 int
 Staff_symbol::steps_i() const
 {
-  return no_lines_i_*2;
+  return line_count () * 2;
 }
+
+int
+Staff_symbol::line_count () const
+{
+  return gh_scm2int (get_elt_property ("line-count"));
+}
+
 Real
-Staff_symbol::staff_space ()
+Staff_symbol::staff_space ()const
 {
-  return staff_space_;
+  return gh_scm2double (get_elt_property ("staff-space"));
 }
index 3fa1d0ee0a4afa9acb11ba72cec2e8b8af998400..c5e84f734df68bb797a908a11ac92662baf16f52 100644 (file)
@@ -70,7 +70,7 @@ Stem_engraver::acknowledge_element(Score_element_info i)
                {
                  abbrev_p_ = new Stem_tremolo;
                  announce_element (Score_element_info (abbrev_p_, abbrev_req_l_));
-                 abbrev_p_->abbrev_flags_i_ =intlog2 (t) - (duration_log>? 2);
+                 abbrev_p_->set_elt_property ("tremolo-flags", gh_int2scm (intlog2 (t) - (duration_log>? 2)));
                }
            }
 
index e244c568acf8eeca533b1e822bb62b371143c821..db15d09e4be192f6e2182147d9bc281ab612ee6d 100644 (file)
 #include "offset.hh"
 #include "dimension-cache.hh"
 #include "staff-symbol-referencer.hh"
-
+#include "directional-element-interface.hh"
 
 Stem_tremolo::Stem_tremolo ()
 {
   set_elt_property ("stem", SCM_EOL);
-  abbrev_flags_i_ = 1;
 }
 
-void
-Stem_tremolo::do_print () const
-{
-  DEBUG_OUT << "abbrev_flags_i_ " << abbrev_flags_i_;
-}
 
 Stem *
 Stem_tremolo::stem_l ()const
@@ -61,7 +55,7 @@ Stem_tremolo::do_brew_molecule_p () const
   Real interbeam_f = paper_l ()->interbeam_f (mult);
   Real w  = gh_scm2double (get_elt_property ("beam-width"));
   Real space = Staff_symbol_referencer_interface (st).staff_space ();
-  Real internote_f = space / 2;
+  Real half_staff_space = space / 2;
   Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));
 
   int beams_i = 0;
@@ -84,9 +78,15 @@ Stem_tremolo::do_brew_molecule_p () const
   Molecule a (lookup_l ()->beam (dydx, w, beam_f));
   a.translate (Offset (-w/2, w / 2 * dydx));
   
+  int abbrev_flags = 1;
+  {
+    SCM a = get_elt_property ("abbrev-flags");
+    if (gh_number_p (a))
+      abbrev_flags = gh_scm2int (a);
+  }
 
   Molecule *beams= new Molecule; 
-  for (int i = 0; i < abbrev_flags_i_; i++)
+  for (int i = 0; i < abbrev_flags; i++)
     {
       Molecule b (a);
       b.translate_axis (interbeam_f * i, Y_AXIS);
@@ -99,8 +99,8 @@ Stem_tremolo::do_brew_molecule_p () const
       if (st->beam_l ())
         {
          beams->translate (Offset(st->hpos_f () - hpos_f (),
-           st->stem_end_position () * internote_f - 
-           st->beam_l ()->get_direction () * beams_i * interbeam_f));
+           st->stem_end_position () * half_staff_space - 
+           directional_element (st->beam_l ()).get () * beams_i * interbeam_f));
        }
       else
        {  
index d4bea2a5eccefa026d4128dd3b085e42f4123359..9b315ca6d7c1aae5dbbfeb44f8c46d7f5e03eb07 100644 (file)
@@ -8,7 +8,7 @@
 
   TODO: This is way too hairy
 */
-
+#include "directional-element-interface.hh"
 #include "dimension-cache.hh"
 #include "stem.hh"
 #include "debug.hh"
@@ -49,31 +49,20 @@ Stem::beam_count (Direction d) const
     return 0;
 }
 
-Interval_t<int>
+Interval
 Stem::head_positions () const
 {
-  /* 
-    Mysterious FreeBSD fix by John Galbraith.  Somehow, the empty intervals 
-    trigger FP exceptions on FreeBSD.  Fix: do not return infinity 
-
-   */
-  if (!first_head ())
+  if (!heads_i ())
     {
-      return Interval_t<int> (100,-100);       
+      Interval iv;
+      return iv;
     }
 
-  Link_array<Note_head> head_l_arr =
-    Group_interface__extract_elements (this, (Note_head*)0, "heads");
   
-  Interval_t<int> r;
-  for (int i =0; i < head_l_arr.size (); i++)
-    {
-      Staff_symbol_referencer_interface si (head_l_arr[i]);
-      int p = (int)si.position_f ();
-      r[BIGGER] = r[BIGGER] >? p;
-      r[SMALLER] = r[SMALLER] <? p;
-    }
-  return r;
+  Drul_array<Note_head*> e (extremal_heads ());
+
+  return Interval (staff_symbol_referencer_interface (e[DOWN]).position_f (),
+                  staff_symbol_referencer_interface( e[UP]).position_f ()); 
 }
 
 
@@ -88,21 +77,34 @@ Real
 Stem::stem_end_position () const
 {
   SCM p =get_elt_property ("stem-end-position");
-  Real len;
+  Real pos;
   if (!gh_number_p (p))
     {
       Stem * me = (Stem*) this;
-      len = get_default_stemlen ();
-
-      // FIXME: len != position
-      me->set_elt_property ("stem-end-position", gh_double2scm (len));
+      pos = get_default_stem_end_position ();
+      me->set_elt_property ("stem-end-position", gh_double2scm (pos));
     }
   else
-    len = gh_scm2double (p);
+    pos = gh_scm2double (p);
+
+  return pos;
+}
+
+Direction
+Stem::get_direction () const
+{
+  Direction d = directional_element (this).get ();
 
-  return len;
+  if (!d)
+    {
+       Stem * me = (Stem*) this;
+       d = get_default_dir ();
+       directional_element (me).set (d);
+    }
+  return d ;
 }
 
+
 void
 Stem::set_stemend (Real se)
 {
@@ -121,8 +123,6 @@ Stem::type_i () const
   return first_head () ?  first_head ()->balltype_i () : 2;
 }
 
-
-
 /*
   Note head that determines hshift for upstems
  */ 
@@ -133,43 +133,74 @@ Stem::support_head ()const
   Score_element * nh = unsmob_element (h);
   if (nh)
     return nh;
+  else if (heads_i () == 1)
+    {
+      /*
+       UGH.
+       */
+      
+      return unsmob_element (gh_car (get_elt_property ("heads")));
+    }
   else
     return first_head ();
 }
 
 
+int
+Stem::heads_i ()const
+{
+  Group_interface gi (this, "heads");
+  return gi.count ();
+}
+
 /*
   The note head which forms one end of the stem.  
  */
 Note_head*
 Stem::first_head () const
 {
-  const int inf = 1000000;
-  int pos = -inf;              
-  Direction dir = get_direction ();
+  return extremal_heads ()[-get_direction ()];
+}
 
-  Note_head *nh =0;
+/*
+  START is part where stem reaches `last' head. 
+ */
+Drul_array<Note_head*>
+Stem::extremal_heads () const
+{
+  const int inf = 1000000;
+  Drul_array<int> extpos;
+  extpos[DOWN] = inf;
+  extpos[UP] = -inf;  
+  
+  Drul_array<Note_head *> exthead;
+  exthead[LEFT] = exthead[RIGHT] =0;
+  
   for (SCM s = get_elt_property ("heads"); gh_pair_p (s); s = gh_cdr (s))
     {
       Note_head * n = dynamic_cast<Note_head*> (unsmob_element (gh_car (s)));
       Staff_symbol_referencer_interface si (n);
-      int p = dir * int(si.position_f ());
-      if (p > pos)
+      
+      int p = int(si.position_f ());
+
+      Direction d = LEFT;
+      do {
+      if (d* p > d* extpos[d])
        {
-         nh = n;
-         pos = p;
+         exthead[d] = n;
+         extpos[d] = p;
        }
+      } while (flip (&d) != DOWN);
     }
 
-  return nh;
+  return exthead;
 }
 
 void
 Stem::add_head (Rhythmic_head *n)
 {
   n->set_elt_property ("stem", this->self_scm_);
-  n->add_dependency (this);    // ?
-  
+  n->add_dependency (this);
 
   Group_interface gi (this);
   if (Note_head *nh = dynamic_cast<Note_head *> (n))
@@ -189,14 +220,18 @@ Stem::Stem ()
 bool
 Stem::invisible_b () const
 {
-  return !(first_head () && first_head()->balltype_i () >= 1);
+  /*
+    UGH. Who determines balltype for stem?
+   */
+  Note_head * nh = dynamic_cast<Note_head*> (support_head ());
+  return !(heads_i () && nh->balltype_i () >= 1);
 }
 
 int
 Stem::get_center_distance (Direction d) const
 {
   int staff_center = 0;
-  int distance = d*(head_positions()[d] - staff_center);
+  int distance = (int) (d*(head_positions()[d] - staff_center));
   return distance >? 0;
 }
 
@@ -213,7 +248,7 @@ Stem::get_default_dir () const
 }
 
 Real
-Stem::get_default_stemlen () const
+Stem::get_default_stem_end_position () const
 {
   bool grace_b = get_elt_property ("grace") != SCM_UNDEFINED;
   String type_str = grace_b ? "grace-" : "";
@@ -247,9 +282,8 @@ Stem::get_default_stemlen () const
   Direction dir = get_direction ();
   if (!dir)
     {
-      Stem * me = (Stem*) this;
       dir = get_default_dir ();
-      me->set_direction (dir);
+      directional_element (this).set (dir);
     }
   
   /* 
@@ -260,13 +294,14 @@ Stem::get_default_stemlen () const
       && (get_direction () != get_default_dir ()))
     length_f -= shorten_f;
 
-  Real st_f = head_positions()[-dir] + dir * length_f;
 
-  bool no_extend_b = get_elt_property ("no-stem-extend") != SCM_UNDEFINED;
-  if (!grace_b && !no_extend_b && dir * st_f < 0)
-    st_f = 0.0;
+   Real st = head_positions()[dir] + dir * length_f;
+  
+   bool no_extend_b = to_boolean (get_elt_property ("no-stem-extend"));
+    if (!grace_b && !no_extend_b && dir * st < 0)
+      st = 0.0;
 
-  return st_f;
+  return st;
 }
 
 /*
@@ -282,7 +317,7 @@ Stem::flag_i () const
 void
 Stem::position_noteheads ()
 {
-  if (!first_head ())
+  if (!heads_i ())
     return;
   
   Link_array<Score_element> heads =
@@ -327,7 +362,7 @@ Stem::position_noteheads ()
 void
 Stem::do_pre_processing ()
 {
-  get_default_stemlen ();      // ugh. Trigger direction calc.
+  stem_end_position ();        // ugh. Trigger direction calc.
   position_noteheads ();
 
   if (invisible_b ())
@@ -486,7 +521,7 @@ Stem::calc_stem_info () const
 {
   assert (beam_l ());
 
-  Direction beam_dir = beam_l ()->get_direction ();
+  Direction beam_dir = directional_element (beam_l ()).get ();
   if (!beam_dir)
     {
       programming_error ("Beam dir not set.");
@@ -507,7 +542,7 @@ Stem::calc_stem_info () const
   info.idealy_f_ *= beam_dir;
   SCM grace_prop = get_elt_property ("grace");
 
-  bool grace_b = gh_boolean_p (grace_prop) && gh_scm2bool (grace_prop);
+  bool grace_b = to_boolean (grace_prop);
   
   Array<Real> a;
   SCM s;
@@ -521,7 +556,7 @@ Stem::calc_stem_info () const
   scm_to_array (s, &a);
   Real stem_length =  a[multiplicity <? (a.size () - 1)] * staff_space;
 
-  if (!beam_dir || (beam_dir == get_direction ()))
+  if (!beam_dir || (beam_dir == directional_element (this).get ()))
     /* normal beamed stem */
     {
       if (multiplicity)
@@ -544,9 +579,7 @@ Stem::calc_stem_info () const
        than middle staffline, just as normal stems.
        
       */
-      SCM extend_prop = get_elt_property ("no-stem-extend");
-      bool no_extend_b = gh_boolean_p (extend_prop)
-       && gh_scm2bool (extend_prop);
+      bool no_extend_b = to_boolean (get_elt_property ("no-stem-extend"));
       if (!grace_b && !no_extend_b)
        {
          /* highest beam of (UP) beam must never be lower than middle
index 56f7b3eae1bcd2267509af96d42efd29cf4ad8a1..989332320e8184fff491f9548187b0cc0dc95d4d 100644 (file)
@@ -82,7 +82,7 @@ Text_engraver::do_process_requests ()
       Side_position_interface stafy (text);
 
       SCM axisprop = get_property ("scriptHorizontal",0);
-      if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
+      if (to_boolean (axisprop))
        {
          stafy.set_axis (X_AXIS);
          //      text->set_parent (ss, Y_AXIS);
@@ -102,7 +102,7 @@ Text_engraver::do_process_requests ()
        text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
       
       SCM empty = get_property ("textEmptyDimension", 0);
-      if (gh_boolean_p (empty) && gh_scm2bool (empty))
+      if (to_boolean (empty))
        {
          text->set_empty (X_AXIS);
        }
index 876ca6070fcac5541743bfda711b1dc602fa539c..0948237b0e152886cb2bc16c6ed77e7d9d7215c5 100644 (file)
@@ -82,10 +82,13 @@ Tie_engraver::process_acknowledged ()
     {
       now_heads_.sort (CHead_melodic_tuple::pitch_compare);
       stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
-      int i=0;
-      int j=0;
-      int tie_count=0;
-      while  ( i < now_heads_.size () && j < stopped_heads_.size ())
+
+      SCM head_list = SCM_EOL;
+      
+      int j = stopped_heads_.size ()-1;
+      int i = now_heads_.size ()-1;
+
+      while  (i >= 0 && j >=0)
        {
          int comp
            = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
@@ -93,31 +96,51 @@ Tie_engraver::process_acknowledged ()
 
          if (comp)
            {
-             (comp < 0) ? i ++ : j++;
+             (comp < 0) ? j -- : i--;
              continue;
            }
          else
            {
-             tie_count ++;
-
-             /* don't go around recreating ties that were already
-                made. Not infallible. Due to reordering in sort (),
-                we will make the wrong ties when noteheads are
-                added.  */
-             if (tie_count > tie_p_arr_.size ())
-               {
-                 Tie * p = new Tie;
-                 p->set_head (LEFT, stopped_heads_[j].head_l_);
-                 p->set_head (RIGHT, now_heads_[i].head_l_);
-                 tie_p_arr_.push (p);
-                 announce_element (Score_element_info (p, req_l_));
-               }
-             i++;
-             j++;
-
+             head_list  = gh_cons (gh_cons (stopped_heads_[j].head_l_->self_scm_,
+                                            now_heads_[i].head_l_->self_scm_),
+                                   head_list);
+
+             past_notes_pq_. insert (now_heads_[i]);
+             now_heads_.del (i);
+             stopped_heads_.del (j);
+             i--;
+             j--;
            }
        }
 
+
+      SCM sparse = get_property ("sparseTies", 0);
+      if (to_boolean (sparse))
+       {
+         int i = scm_ilength (head_list);
+
+         if (!i)
+           return;
+         
+         SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
+         
+         Tie * p = new Tie;
+         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_p_arr_.push (p);
+         announce_element (Score_element_info (p, req_l_));
+       }
+      else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
+       {
+         Tie * p = new Tie;
+         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_p_arr_.push (p);
+         announce_element (Score_element_info (p, req_l_));
+       }
+
       if (!tie_p_arr_.size ())
        {
          req_l_->warning (_ ("No ties were created!"));
@@ -147,7 +170,7 @@ void
 Tie_engraver::do_post_move_processing ()
 {
   SCM m = get_property ("automaticMelismata",0);
-  if (gh_boolean_p (m) && gh_scm2bool (m))
+  if (to_boolean (m))
     {
       set_melisma (false);
     }
index c891d0bb685a14cfede797791b592203173c6ddc..15597313e3ff72388af43a42389520222cd98bbb 100644 (file)
 #include "paper-column.hh"
 #include "debug.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 void
-Tie::set_head (Direction d, Note_head * head_l)
+Tie::set_head (Direction d, Item * head_l)
 {
   assert (!head (d));
   index_set_cell (get_elt_property ("heads"), d, head_l->self_scm_);
@@ -89,8 +90,8 @@ Tie::do_post_processing()
       return;
     }
 
-  Real interline_f = paper_l ()->get_var ("interline");
-  Real internote_f = interline_f / 2;
+  Real staff_space = paper_l ()->get_var ("interline");
+  Real half_staff_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");
 
@@ -175,22 +176,23 @@ Tie::do_post_processing()
     ? Staff_symbol_referencer_interface (head (LEFT)).position_f ()
     : Staff_symbol_referencer_interface (head (RIGHT)).position_f () ;  
 
-  Real y_f = internote_f * ypos; 
+  Real y_f = half_staff_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 (this).get();
   if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
     {
       if (abs (ypos_i) % 2)
-       y_f += get_direction () * internote_f;
-      y_f += get_direction () * y_gap_f;
+       y_f += dir * half_staff_space;
+      y_f += dir * y_gap_f;
     }
   else
     {
       if (! (abs (ypos_i) % 2))
-       y_f += get_direction () * internote_f;
-      y_f += get_direction () * internote_f;
-      y_f -= get_direction () * y_gap_f;
+       y_f += dir * half_staff_space;
+      y_f += dir * half_staff_space;
+      y_f -= dir * y_gap_f;
     }
   
   dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = y_f;
index ac2373da6a0c39d8a0d23cb41bae1185e15d022b..e576f036c9c5fbe742a0e167dbf76e34bd8e270d 100644 (file)
@@ -49,11 +49,11 @@ Timing_engraver::which_bar ()
        return "|";
 
       SCM nonauto = get_property ("barNonAuto", 0);
-      if (!gh_boolean_p (nonauto) && gh_scm2bool (nonauto))
+      if (!to_boolean (nonauto))
        {
          SCM always = get_property ("barAlways", 0);
          if (!measure_position ()
-             || (gh_boolean_p (always) && gh_scm2bool (always)))
+             || (to_boolean (always)))
            {
              SCM def=get_property ("defaultBarType" ,0);
              return (gh_string_p (def))? ly_scm2string (def) : "";
index d1e68dcb336bffee8e69d811cdd94eca5691bd56..d54a1903f9b919f6a377e4147a15df09df1f73d8 100644 (file)
@@ -97,7 +97,7 @@ Timing_translator::do_pre_move_processing()
 
   // urg: multi bar rests: should always process whole of first bar?
   SCM tim = get_property ("timing", 0);
-  bool timb = gh_boolean_p (tim) && gh_scm2bool (tim);
+  bool timb = to_boolean (tim);
   if (timb && allbars)
     {
       Moment barleft = (measure_length () - measure_position ());
@@ -227,7 +227,7 @@ Timing_translator::do_post_move_processing()
     }
 
   SCM cad = get_property ("timing", 0);
-  bool c= gh_boolean_p (cad ) && gh_scm2bool (cad);
+  bool c= to_boolean (cad );
 
   Moment len = measure_length ();
   while (c && *measposp >= len)
index e1e0f54c8542b6e2ed70663bed33152470b5b791..b8f85eb870dfef0668728e58597190d19fbea66b 100644 (file)
@@ -62,7 +62,7 @@ Tuplet_engraver::acknowledge_element (Score_element_info i)
 {
   bool grace= (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED);
   SCM wg = get_property ("weAreGraceContext",0);
-  bool wgb = gh_boolean_p (wg) && gh_scm2bool (wg);
+  bool wgb = to_boolean (wg);
   if (grace != wgb)
     return;
   
index 26cdb6948b8d98a772dfce0cf529f3fe7004b8b9..355a036fef500ee23f8af715ee992bb6cd625c5f 100644 (file)
@@ -18,6 +18,7 @@
 #include "note-column.hh"
 #include "dimensions.hh"
 #include "group-interface.hh"
+#include "directional-element-interface.hh"
 
 
 
@@ -74,10 +75,12 @@ Tuplet_spanner::do_brew_molecule_p () const
       num.align_to (X_AXIS, CENTER);
       num.translate_axis (w/2, X_AXIS);
       Real interline = paper_l ()->get_var ("interline");
-      Real dy = column_arr.top ()->extent (Y_AXIS) [get_direction ()]
-       - column_arr[0]->extent (Y_AXIS) [get_direction ()];
+
+      Direction dir = directional_element (this).get ();
+      Real dy = column_arr.top ()->extent (Y_AXIS) [dir]
+       - column_arr[0]->extent (Y_AXIS) [dir];
       num.align_to (Y_AXIS, CENTER);
-      num.translate_axis (get_direction () * interline, Y_AXIS);
+      num.translate_axis (dir * interline, Y_AXIS);
        
       num.translate_axis (dy/2, Y_AXIS);
     
@@ -86,14 +89,14 @@ Tuplet_spanner::do_brew_molecule_p () const
        {
          Real gap = paper_l () -> get_var ("tuplet_spanner_gap");
        
-         mol_p->add_molecule (lookup_l ()->tuplet_bracket (dy, w, thick, gap, interline, get_direction ()));
+         mol_p->add_molecule (lookup_l ()->tuplet_bracket (dy, w, thick, gap, interline, dir));
        }
 
       if (number_visibility)
        {
          mol_p->add_molecule (num);
        }
-      mol_p->translate_axis (get_direction () * interline, Y_AXIS);
+      mol_p->translate_axis (dir * interline, Y_AXIS);
     }
   return mol_p;
 }
@@ -118,8 +121,15 @@ Tuplet_spanner::do_post_processing ()
     Group_interface__extract_elements (this, (Note_column*)0, "columns");
       
 
+  Direction d =   directional_element (this).get ();
+  if (!d)
+    {
+      d = UP;
+      directional_element (this).set (d);
+    }
+  
   if (column_arr.size())
-    translate_axis (column_arr[0]->extent (Y_AXIS)[get_direction ()], Y_AXIS);
+    translate_axis (column_arr[0]->extent (Y_AXIS)[d], Y_AXIS);
 
   
   if (scm_ilength (get_elt_property ("beams")) == 1)
index ac0973f9e5954f210780934254de57346042b2fd..2aed1b957084f055be189de04d3108f8192e9727 100644 (file)
@@ -53,11 +53,11 @@ Volta_spanner::do_brew_molecule_p () const
   if (bar_arr.top ()->type_str_.length_i () > 1)
     no_vertical_end = false;
 
-  Real interline_f = paper_l ()->get_var ("interline");
-  Real internote_f = interline_f/2;
+  Real staff_space = paper_l ()->get_var ("interline");
+  Real half_staff_space = staff_space/2;
   Real t = paper_l ()->get_var ("volta_thick");
 
-  Real dx = internote_f;
+  Real dx = half_staff_space;
   Real w = spanner_length() - dx - get_broken_left_end_align ();
   Real h = paper_l()->get_var ("volta_spanner_height");
   Molecule volta (lookup_l ()->volta (h, w, t, no_vertical_start, no_vertical_end));
@@ -75,7 +75,7 @@ Volta_spanner::do_brew_molecule_p () const
   Molecule two (lookup_l ()->text ("number", "2", paper_l ()));
   Real gap = two.dim_.x ().length () / 2;
   Offset off (num.dim_.x ().length () + gap, 
-             h / internote_f - gap);
+             h / half_staff_space - gap);
   num.translate (off);
   mol_p->add_molecule (volta);
   mol_p->add_molecule (num);
index 4a8de0dbaacfa45dbca5c24241b2783995807698..dd2e7f1fcc00e995f93c73a8d114593a7cbe50ea 100644 (file)
@@ -235,3 +235,6 @@ Wordwrap =0.0;
 % 
 #'Local_key_item::left-padding = #'0.2
 #'Local_key_item::right-padding = #'0.4
+
+#'Staff_symbol::staff-space = \interline ;
+#'Staff_symbol::line-count = #5
index 73fdd902a0af78cf96c2f258177d21c712cb5d9b..d1d72eb40c0149be0ef4d7a0599edb65ba485c7c 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.15
-Entered-date: 20DEC99
+Version: 1.3.16
+Entered-date: 22DEC99
 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.15.tar.gz 
+       1000k lilypond-1.3.16.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.15.tar.gz 
+       1000k lilypond-1.3.16.tar.gz 
 Copying-policy: GPL
 End
index 056d2d1cb3a3acf9b3fccc8d33d544ed16620543..b8a952b8fb975e1cd0d9e1588553688430cba5a6 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.15
+Version: 1.3.16
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.15.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.16.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # get Packager from (undocumented?) ~/.rpmmacros!
index e622e9d0dcfbad1c5acfb5e466c456b5005b489a..decc1ad6df249fe2e34f8707065e4ff4b9d3081b 100644 (file)
                     (list 'barSize number? 'bar-size))
        )
   )    
+
+(define staff-symbol-properties
+  (cons "Staff_symbol" (list
+                       (list 'numberOfStaffLines number? 'line-count)
+                       (list 'staffLineLeading number? 'staff-space)
+                       )
+       )
+  )
+
 (define generic-breathing-sign-properties
   (cons "Breathing_sign"
        (list
index 3c291a4f09044b33daf6d022d0805b0eb3060c30..eed1093b7f075a3acf97577fa50a35b91784e44e 100644 (file)
 ;; beamed stems
 (define beamed-stem-shorten '(0.5))
 (define beamed-stem-length '(0.0 2.5 2.0 1.5))
+(define grace-beamed-stem-length '(0.0 2.5 2.0 1.5))
 (define beamed-stem-minimum-length '(0.0 1.5 1.25 1.0))
 (define grace-beamed-stem-minimum-length
   (map (lambda (x) (* grace-length-factor x)) beamed-stem-minimum-length))