]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/crescendo.cc
release: 1.1.28
[lilypond.git] / lily / crescendo.cc
index 47eff97b90bc308bab4722999612d962772f390e..024a697c1799f1cf038581e0cb2ac077b2a9b918 100644 (file)
@@ -14,7 +14,7 @@
 #include "debug.hh"
 #include "score-column.hh"
 
-Crescendo::Crescendo()
+Crescendo::Crescendo ()
 {
   grow_dir_ =0;
   dir_ = DOWN;
@@ -22,17 +22,17 @@ Crescendo::Crescendo()
 }
 
 Interval
-Crescendo::symbol_height() const
+Crescendo::symbol_height () const
 {
-  return get_symbol().dim_[Y_AXIS];
+  return get_symbol ().dim_[Y_AXIS];
 }
 
 static Real absdyn_dim = 10 PT;        // ugh
 
-Atom
-Crescendo::get_symbol() const
+Molecule
+Crescendo::get_symbol () const
 {
-  Real w_dim = extent(X_AXIS).length ();
+  Real w_dim = extent (X_AXIS).length ();
   if (dyn_b_drul_[LEFT])
     {
       w_dim -= absdyn_dim;
@@ -44,24 +44,24 @@ Crescendo::get_symbol() const
 
   if (w_dim < 0)
     {
-      warning (_ ("crescendo") + " " + _("too small"));
+      warning (_ ("crescendo") + " " + _ ("too small"));
       w_dim = 0;
     }
 
   Drul_array<bool> broken;
   Direction d = LEFT;
   do {
-    Score_column* s = (Score_column* )spanned_drul_[d] ; // UGH
-    broken[d] = (!s->musical_b());
-  } while (flip(&d) != LEFT);
+    Score_column* s = dynamic_cast<Score_column*>(spanned_drul_[d]); // UGH
+    broken[d] = (!s->musical_b ());
+  } while (flip (&d) != LEFT);
   
 
-  bool continued = broken[(Direction)-grow_dir_];
-  return Atom (lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued));
+  bool continued = broken[Direction (-grow_dir_)];
+  return Molecule (lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued));
 }
 
 Molecule*
-Crescendo::do_brew_molecule_p() const
+Crescendo::do_brew_molecule_p () const
 {
   Molecule* m_p =0;
   Real x_off_dim=0.0;
@@ -69,8 +69,8 @@ Crescendo::do_brew_molecule_p() const
     x_off_dim += absdyn_dim;
 
   m_p = new Molecule;
-  Atom s (get_symbol());
-  m_p->add_atom  (s);
+  Molecule s (get_symbol ());
+  m_p->add_molecule (s);
   m_p->translate (Offset (x_off_dim, coordinate_offset_f_));
   return m_p;
 }