2 abbreviation-beam.cc -- implement Abbreviation_beam
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
13 #include "abbreviation-beam.hh"
17 #include "molecule.hh"
18 #include "leastsquares.hh"
20 #include "paper-def.hh"
22 #include "stem-info.hh"
25 IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
27 Abbreviation_beam::Abbreviation_beam ()
33 Abbreviation_beam::brew_molecule_p () const
38 return Beam::brew_molecule_p ();
40 Molecule *mol_p = new Molecule;
42 // Real inter_f = paper ()->interbeam_f ();
43 Real inter_f = paper ()->internote_f ();
44 Real x0 = stems[0]->hpos_f ();
45 for (int j=0; j <stems.size (); j++)
48 Stem * prev = (j > 0)? stems[j-1] : 0;
49 Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
51 Molecule sb = stem_beams (i, next, prev);
52 Real x = i->hpos_f ()-x0;
53 sb.translate (Offset (x, (x * slope_f + left_y)* inter_f));
56 mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
62 Abbreviation_beam::do_print () const
71 beams to go with one stem.
74 Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
78 - shorter beams (not reaching outer "stems")
79 for [:16 c4 c4] and [:16 c1 c1]
80 - centered beam on [:16 c1 c1] heads, rather than "stems"
82 return Beam::stem_beams (here, next, prev);