]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   (c) 1996--2002 Han-Wen Nienhuys
5 */
6
7 #ifndef BEAM_HH
8 #define BEAM_HH
9
10 #include "lily-proto.hh"
11 #include "lily-guile.hh"
12 #include "stem-info.hh"
13
14
15 class Beam
16 {
17 public:
18   static int visible_stem_count (Grob*);
19   static Grob* first_visible_stem (Grob*);
20   static Grob* last_visible_stem (Grob*);
21   static bool has_interface (Grob*);
22   DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
23   Beam (SCM);
24   static void add_stem (Grob*,Grob*);
25   static bool knee_b (Grob*);
26   static void set_beaming (Grob*,Beaming_info_list *);
27   static void set_stemlens (Grob*);
28   static int get_beam_count (Grob*me);
29
30   static Real get_beam_translation (Grob*me);
31   static Real get_thickness (Grob*me);
32
33   static void connect_beams (Grob*me);
34   DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
35   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
36   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
37   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
38   
39   /* position callbacks */
40   DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
41   DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
42   DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
43   DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));  
44   DECLARE_SCHEME_CALLBACK (quanting, (SCM));
45   static Real score_slopes_dy (Real, Real, Real, Real, bool);
46   static Real score_stem_lengths (Link_array<Grob>,
47                                   Array<Stem_info>,
48                                   Array<Real>, Array<Real>,
49                                   Real, Real, bool, Real, Real);
50   static Real score_forbidden_quants (Real, Real,
51                                       Real, Real, Real, Real,
52                                       int, Direction, Direction);
53   
54
55   static int get_direction_beam_count (Grob *me, Direction d);
56 private:
57   static Direction get_default_dir (Grob*);
58   static void set_stem_directions (Grob*, Direction );
59   static void consider_auto_knees (Grob*);
60   static void set_stem_shorten (Grob*);
61   static Real calc_stem_y (Grob*, Grob* s, Grob**c,
62                            Real, Real,
63                            Interval pos, bool french);
64   static void set_stem_lengths (Grob*);
65   static int forced_stem_count (Grob*);
66 };
67
68 const int REGION_SIZE = 2;
69 #define DEBUG_QUANTING 0
70
71
72 #endif /* BEAM_HH */
73