]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
release: 1.3.71
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   (c) 1996--2000 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
13
14 /** a beam connects multiple stems.
15
16   Beam adjusts the stems its owns to make sure that they reach the
17   beam and that point in the correct direction (urg?)
18
19    elt_properties:
20    
21    y-position -- real  (position of left edge)
22
23    height -- real  (dy)
24
25    damping -- amount of beam slope damping. (int)
26    should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
27 */
28 class Beam
29 {
30 public:
31   static int visible_stem_count (Score_element*);
32   static  Item* first_visible_stem (Score_element*);
33   static  Item* last_visible_stem (Score_element*);
34   static bool has_interface (Score_element*);
35   static void set_interface (Score_element*);  
36   static Real rest_collision_callback (Score_element *,Axis);
37   Beam (SCM);
38   static void add_stem (Score_element*,Score_element*);
39   static void set_beaming (Score_element*,Beaming_info_list *);
40   static void set_stemlens (Score_element*);
41   static int get_multiplicity (Score_element*me);
42   static SCM brew_molecule (SCM);
43   static SCM before_line_breaking (SCM);
44   static SCM after_line_breaking (SCM);
45   static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
46
47 private:
48   static Direction get_default_dir (Score_element*);
49   static  void set_stem_directions (Score_element*);
50   static  void auto_knees (Score_element*);
51   static  bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
52   static void set_stem_shorten (Score_element*);
53   static  void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
54   static  bool suspect_slope_b (Score_element*, Real y, Real dy);
55   static  Real calc_slope_damping_f (Score_element*, Real dy);
56   static  Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
57   static  Real check_stem_length_f (Score_element*, Real y, Real dy);
58   static  void set_stem_length (Score_element*, Real y, Real dy);
59   static   Real quantise_dy_f (Score_element*, Real dy);
60   static  Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
61   static int forced_stem_count (Score_element*);
62 };
63
64 #endif // BEAM_HH
65