]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem-tremolo.cc
* lily/font-select.cc: new file handle font selection routines.
[lilypond.git] / lily / stem-tremolo.cc
index 5af470bae5402bf3a8201ba3447c81d6556ed513..cac78d7e8a87fece3f20a600f7218b9d1e61a3b8 100644 (file)
@@ -3,12 +3,12 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "stem-tremolo.hh"
-#include "debug.hh"
+#include "warn.hh"
 #include "beam.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -61,7 +61,7 @@ Stem_tremolo::brew_molecule (SCM smob)
 {
   Grob *me= unsmob_grob (smob);
   Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
-  Grob * beam = Stem::beam_l (stem);
+  Grob * beam = Stem::get_beam (stem);
   
   Real dydx;
   if (beam)
@@ -107,23 +107,26 @@ Stem_tremolo::brew_molecule (SCM smob)
 
     --hwn.
    */
-  Real interbeam = beam ? Beam::get_interbeam (beam) : 0.81;
+  Real beam_translation = beam ? Beam::get_beam_translation (beam) : 0.81;
 
   Molecule mol; 
   for (int i = 0; i < tremolo_flags; i++)
     {
       Molecule b (a);
-      b.translate_axis (interbeam * i, Y_AXIS);
+      b.translate_axis (beam_translation * i, Y_AXIS);
       mol.add_molecule (b);
     }
   Direction stemdir = Stem::get_direction (stem);
   Interval mol_ext = mol.extent (Y_AXIS);
 
   // ugh, rather calc from Stem_tremolo_req
-  int beams_i = (beam)
-    ? (Stem::beam_count (stem, RIGHT) >? Stem::beam_count (stem, LEFT))
-    : 0;
-  
+  int beams_i = (beam) ? (Stem::beam_multiplicity (stem).length ()+ 1): 0;
+
+  /*
+    TODO.
+   */
+
+
   Real beamthickness = 0.0;
   SCM sbt = (beam) ? beam->get_grob_property ("thickness") : SCM_EOL ;
   if (gh_number_p (sbt))
@@ -134,7 +137,7 @@ Stem_tremolo::brew_molecule (SCM smob)
   Real end_y
     = Stem::stem_end_position (stem) *ss/2 
     - stemdir * (beams_i * beamthickness
-                + ((beams_i -1) >? 0) * interbeam);
+                + ((beams_i -1) >? 0) * beam_translation);
 
   /*
     the 0.33 ss is to compensate for the size of the note head
@@ -142,7 +145,7 @@ Stem_tremolo::brew_molecule (SCM smob)
   Real chord_start_y = Stem::chord_start_y (stem) +
     0.33 * ss * stemdir;
 
-  Real padding = interbeam;
+  Real padding = beam_translation;
 
   /*
     if there is not enough space, center on remaining space,
@@ -154,7 +157,7 @@ Stem_tremolo::brew_molecule (SCM smob)
     }
   else
     {
-      mol.translate_axis (end_y - stemdir * interbeam
+      mol.translate_axis (end_y - stemdir * beam_translation
                          -mol_ext [stemdir]
                          , Y_AXIS);
     }