]> git.donarmstrong.com Git - lilypond.git/blob - lily/abbreviation-beam.cc
patch::: 0.1.12.jcn2: kliener pats
[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 Han-Wen Nienhuys <hanwen@stack.nl>
7            Jan Nieuwenhuizen <jan@digicash.com>
8 */
9
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 "symbol.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"
24
25
26 IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
27
28 Abbreviation_beam::Abbreviation_beam ()
29   : Beam ()
30 {
31 }
32
33 Molecule*
34 Abbreviation_beam::brew_molecule_p () const 
35 {
36   /* 
37    todo
38    */
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++) 
47     {
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;
51
52       Molecule sb = stem_beams (i, next, prev);
53       Real  x = i->hpos_f ()-x0;
54       sb.translate (Offset (x, (x * slope  + left_pos)* inter_f));
55       mol_p->add (sb);
56     }
57   mol_p->translate (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
58   return mol_p;
59 #endif
60 }
61
62 void
63 Abbreviation_beam::do_print () const
64 {
65 #ifndef NPRINT
66   Beam::do_print ();
67   Spanner::do_print ();
68 #endif
69 }
70
71 /*
72   beams to go with one stem.
73   */
74 Molecule
75 Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
76 {
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"
82    */
83   return Beam::stem_beams (here, next, prev);
84 }