]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/cluster.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / cluster.cc
index 8391e7899b01179ac514fcbbeb384b7cc84bd3b3..d370a65030dfe489a4996e00ae7782314b3d0e7b 100644 (file)
@@ -3,14 +3,15 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
+  (c) 2002--2006 Juergen Reuter <reuter@ipd.uka.de>
 
-  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "cluster.hh"
 
 #include <cstdio>
+using namespace std;
 
 #include "spanner.hh"
 #include "item.hh"
@@ -39,9 +40,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   String shape;
 
   if (scm_is_symbol (shape_scm))
-    {
-      shape = ly_symbol2string (shape_scm);
-    }
+    shape = ly_symbol2string (shape_scm);
   else
     {
       programming_error ("#'style should be symbol.");
@@ -102,22 +101,16 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
     {
       points.push (bottom_points[0] - vpadding + hpadding);
       for (int i = 1; i < size - 1; i++)
-       {
-         points.push (bottom_points[i] - vpadding);
-       }
+       points.push (bottom_points[i] - vpadding);
       points.push (bottom_points[size - 1] - vpadding - hpadding);
       points.push (top_points[size - 1] + vpadding - hpadding);
       for (int i = size - 2; i > 0; i--)
-       {
-         points.push (top_points[i] + vpadding);
-       }
+       points.push (top_points[i] + vpadding);
       points.push (top_points[0] + vpadding + hpadding);
       out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter));
     }
   else
-    {
-      me->warning (_f ("unknown cluster style `%s'", shape.to_str0 ()));
-    }
+    me->warning (_f ("unknown cluster style `%s'", shape.to_str0 ()));
   return out;
 }
 
@@ -160,10 +153,10 @@ Cluster::print (SCM smob)
     line with the center of the note heads?
 
   */
-  for (int i = 0; i < cols.size ();  i++) 
+  for (int i = 0; i < cols.size (); i++)
     {
       Grob *col = cols[i];
-      
+
       Interval yext = col->extent (commony, Y_AXIS);
 
       Real x = col->relative_coordinate (commonx, X_AXIS) - left_coord;
@@ -174,15 +167,15 @@ Cluster::print (SCM smob)
   /*
     Across a line break we anticipate on the next pitches.
   */
-  if (spanner->original_)
+  if (spanner->original ())
     {
-      Spanner *orig = dynamic_cast<Spanner *> (spanner->original_);
+      Spanner *orig = dynamic_cast<Spanner *> (spanner->original ());
 
       if (spanner->get_break_index () < orig->broken_intos_.size () - 1)
        {
          Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1];
          Link_array<Grob> const &next_cols = extract_grob_array (next, "columns");
-         if (next_cols.size() > 0)
+         if (next_cols.size () > 0)
            {
              Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS);
              Grob *col = next_cols[0];
@@ -217,13 +210,13 @@ ADD_INTERFACE (Cluster, "cluster-interface",
 struct Cluster_beacon
 {
 public:
-  DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (height, (SCM));
   static bool has_interface (Grob *);
 };
 
-MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 2);
+MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
 SCM
-Cluster_beacon::height (SCM g, SCM)
+Cluster_beacon::height (SCM g)
 {
   Grob *me = unsmob_grob (g);
   Interval v = robust_scm2interval (me->get_property ("positions"),
@@ -235,4 +228,6 @@ ADD_INTERFACE (Cluster_beacon,
               "cluster-beacon-interface",
               "A place holder for the cluster spanner to determine the vertical "
               "extents of a cluster spanner at this X position.",
-              "positions");
+
+              /* properties */
+              "positions ");