]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
Imported sources
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   source file of the LilyPond music typesetter
5
6   (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #ifndef BEAM_HH
11 #define BEAM_HH
12
13 #include "lily-proto.hh"
14 #include "lily-guile.hh"
15 #include "stem-info.hh"
16
17
18 class Beam
19 {
20 public:
21   static int visible_stem_count (Grob*);
22   static Grob* first_visible_stem (Grob*);
23   static Grob* last_visible_stem (Grob*);
24   static bool has_interface (Grob*);
25   DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
26   Beam (SCM);
27   static void add_stem (Grob*,Grob*);
28   static bool knee_b (Grob*);
29   static void set_beaming (Grob*,Beaming_info_list *);
30   static void set_stemlens (Grob*);
31   static int get_beam_count (Grob*me);
32   static void position_beam (Grob* me);
33   static Real get_beam_translation (Grob*me);
34   static Real get_thickness (Grob*me);
35
36   static void connect_beams (Grob*me);
37   DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
38   DECLARE_SCHEME_CALLBACK (print, (SCM));
39   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
40   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
41   
42   /* position callbacks */
43   DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
44   DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
45   DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
46   DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));  
47   DECLARE_SCHEME_CALLBACK (quanting, (SCM));
48   static Real score_slopes_dy (Real, Real, Real, Real, Real, bool);
49
50   static Real score_stem_lengths (Link_array<Grob> const &stems,
51                                   Array<Stem_info> const &stem_infos,
52                                   Array<Real> const &base_stem_ys,
53                                   Array<Real> const &stem_xs,
54                                   Real xl, Real xr, 
55                                   bool knee, 
56                                   Real yl, Real yr);
57   static Real score_forbidden_quants (Real, Real,
58                                       Real, Real, Real, Real,
59                                       int, Direction, Direction);
60   
61
62   static int get_direction_beam_count (Grob *me, Direction d);
63 private:
64   static Direction get_default_dir (Grob*);
65   static void set_stem_directions (Grob*, Direction );
66   static void consider_auto_knees (Grob*);
67   static void set_stem_shorten (Grob*);
68   static Real calc_stem_y (Grob*, Grob* s, Grob**c,
69                            Real, Real,
70                            Drul_array<Real> pos, bool french);
71   static void set_stem_lengths (Grob*);
72   static int forced_stem_count (Grob*);
73 };
74
75 const int REGION_SIZE = 2;
76
77 #define DEBUG_QUANTING 1
78
79 #endif /* BEAM_HH */
80