2 crescendo.cc -- implement Crescendo
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "crescendo.hh"
12 #include "dimensions.hh"
13 #include "paper-def.hh"
15 #include "score-column.hh"
17 Crescendo::Crescendo ()
21 dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false;
25 Crescendo::symbol_height () const
27 return get_symbol ().dim_[Y_AXIS];
30 static Real absdyn_dim = 10 PT; // ugh
33 Crescendo::get_symbol () const
35 Real w_dim = extent (X_AXIS).length ();
36 if (dyn_b_drul_[LEFT])
40 if (dyn_b_drul_[RIGHT])
47 warning (_ ("crescendo") + " " + _ ("too small"));
51 Drul_array<bool> broken;
54 Score_column* s = dynamic_cast<Score_column*>(spanned_drul_[d]); // UGH
55 broken[d] = (!s->musical_b ());
56 } while (flip (&d) != LEFT);
59 bool continued = broken[Direction (-grow_dir_)];
60 return Molecule (lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued));
64 Crescendo::do_brew_molecule_p () const
68 if (dyn_b_drul_[LEFT])
69 x_off_dim += absdyn_dim;
72 Molecule s (get_symbol ());
73 m_p->add_molecule (s);
74 m_p->translate (Offset (x_off_dim, coordinate_offset_f_));