]> git.donarmstrong.com Git - lilypond.git/blob - lily/abbreviation-beam.cc
release: 1.1.1
[lilypond.git] / lily / abbreviation-beam.cc
1 /*
2   abbreviation-beam.cc -- implement Abbreviation_beam
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7            Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #include "p-col.hh"
11 #include "array.hh"
12 #include "proto.hh"
13 #include "abbreviation-beam.hh"
14 #include "misc.hh"
15 #include "debug.hh"
16 #include "atom.hh"
17 #include "molecule.hh"
18 #include "leastsquares.hh"
19 #include "stem.hh"
20 #include "paper-def.hh"
21 #include "lookup.hh"
22 #include "stem-info.hh"
23
24
25 IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
26
27 Abbreviation_beam::Abbreviation_beam ()
28   : Beam ()
29 {
30 }
31
32 Molecule*
33 Abbreviation_beam::brew_molecule_p () const 
34 {
35   /* 
36    todo
37    */
38   return Beam::brew_molecule_p ();
39 #if 0
40   Molecule *mol_p = new Molecule;
41   // huh? inter-what
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++) 
46     {
47       Stem *i = stems[j];
48       Stem * prev = (j > 0)? stems[j-1] : 0;
49       Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
50
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));
54       mol_p->add (sb);
55     }
56   mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
57   return mol_p;
58 #endif
59 }
60
61 void
62 Abbreviation_beam::do_print () const
63 {
64 #ifndef NPRINT
65   Beam::do_print ();
66   Spanner::do_print ();
67 #endif
68 }
69
70 /*
71   beams to go with one stem.
72   */
73 Molecule
74 Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
75 {
76   /* 
77    todo
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"
81    */
82   return Beam::stem_beams (here, next, prev);
83 }