lilypond-0.1.26
[lilypond.git] / lily / stem-info.cc
blob89cd395c0b66001f3bcff05ea20b8e4fc4012d2c
1 /*
2 stem-info.cc -- implement Stem_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
8 */
10 #include "proto.hh"
11 #include "dimen.hh"
12 #include "misc.hh"
13 #include "debug.hh"
14 #include "atom.hh"
15 #include "stem.hh"
16 #include "paper-def.hh"
17 #include "lookup.hh"
18 #include "stem-info.hh"
20 Stem_info::Stem_info ()
24 Stem_info::Stem_info (Stem const *s)
26 x = s->hpos_f();
27 dir_ = s->dir_;
28 beams_i_ = 0 >? (abs (s->flag_i_) - 2);
31 [todo]
32 * get algorithm
33 * runtime
35 Breitkopf + H\"artel:
36 miny_f_ = interline + #beams * interbeam
37 ideal8 = 2 * interline + interbeam
38 ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
40 * B\"arenreiter:
41 miny_f_ = interline + #beams * interbeam
42 ideal8,16 = 2 interline + #beams * interbeam
43 ideal32,64,128 = 1.5 interline + #beams * interbeam
47 Real notehead_y = s->paper()->interline_f ();
48 // huh? why do i need the / 2
49 // Real interbeam_f = s->paper()->interbeam_f ();
50 Real interbeam_f = s->paper()->interbeam_f () / 2;
52 /* well eh, huh?
53 idealy_f_ = dir_ * s->stem_start_f() + beams_i_ * interbeam_f;
54 if (beams_i_ < 3)
55 idealy_f_ += 2 * interline_f;
56 else
57 idealy_f_ += 1.5 * interline_f;
60 idealy_f_ = dir_ * s->stem_end_f();
62 miny_f_ = dir_ * s->stem_start_f() + notehead_y + beams_i_ * interbeam_f;
64 idealy_f_ = miny_f_ >? idealy_f_;
65 // assert (miny_f_ <= idealy_f_);