lilypond-0.1.59
[lilypond.git] / lily / abbreviation-beam.cc
blobd9a4e5bac8b2bc6c252a32575bfd0eacb9545b73
1 /*
2 abbreviation-beam.cc -- implement Abbreviation_beam
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 Jan Nieuwenhuizen <jan@digicash.com>
8 */
10 #include "p-col.hh"
11 #include "varray.hh"
12 #include "proto.hh"
13 #include "dimen.hh"
14 #include "abbreviation-beam.hh"
15 #include "misc.hh"
16 #include "debug.hh"
17 #include "atom.hh"
18 #include "molecule.hh"
19 #include "leastsquares.hh"
20 #include "stem.hh"
21 #include "paper-def.hh"
22 #include "lookup.hh"
23 #include "stem-info.hh"
26 IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
28 Abbreviation_beam::Abbreviation_beam ()
29 : Beam ()
33 Molecule*
34 Abbreviation_beam::brew_molecule_p () const
36 /*
37 todo
39 return Beam::brew_molecule_p ();
40 #if 0
41 Molecule *mol_p = new Molecule;
42 // huh? inter-what
43 // Real inter_f = paper ()->interbeam_f ();
44 Real inter_f = paper ()->internote_f ();
45 Real x0 = stems[0]->hpos_f ();
46 for (int j=0; j <stems.size (); j++)
48 Stem *i = stems[j];
49 Stem * prev = (j > 0)? stems[j-1] : 0;
50 Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
52 Molecule sb = stem_beams (i, next, prev);
53 Real x = i->hpos_f ()-x0;
54 sb.translate (Offset (x, (x * slope_f + left_y)* inter_f));
55 mol_p->add (sb);
57 mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
58 return mol_p;
59 #endif
62 void
63 Abbreviation_beam::do_print () const
65 #ifndef NPRINT
66 Beam::do_print ();
67 Spanner::do_print ();
68 #endif
72 beams to go with one stem.
74 Molecule
75 Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
77 /*
78 todo
79 - shorter beams (not reaching outer "stems")
80 for [:16 c4 c4] and [:16 c1 c1]
81 - centered beam on [:16 c1 c1] heads, rather than "stems"
83 return Beam::stem_beams (here, next, prev);