2 beam.hh -- part of GNU LilyPond
4 (c) 1996--1998 Han-Wen Nienhuys
9 #include "lily-proto.hh"
10 #include "directional-spanner.hh"
13 /** a beam connects multiple stems.
15 Beam adjusts the stems its owns to make sure that they reach the
16 beam and that point in the correct direction */
17 class Beam: public Directional_spanner {
20 The beams should be prevented to conflict with the stafflines,
21 especially at small slopes.
23 enum Quantisation { NONE, NORMAL, TRADITIONAL, TEST };
24 enum Dir_algorithm { /* DOWN=-1, UP=1, */ MAJORITY=2, MEAN, MEDIAN };
26 Link_array<Stem> stems_;
27 /// the slope of the beam in posns / point (dimension)
29 /// the slope as solved; not quantised or damped
32 /// position of leftmost end of beam
34 /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
36 /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
37 Quantisation quantisation_;
38 /// maximum number of beams (for opening-up of beam-spacing)
44 void add_stem (Stem*);
46 void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
48 VIRTUAL_COPY_CONS(Score_element);
51 virtual Interval do_width () const;
52 Offset center () const;
53 void set_default_dir ();
54 virtual void do_pre_processing ();
55 virtual void do_post_processing ();
56 virtual void do_substitute_dependent (Score_element*, Score_element*);
58 virtual void do_print() const;
60 virtual void quantise_left_y (bool extend_b);
61 virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
62 virtual void solve_slope ();
63 virtual void quantise_dy ();
64 virtual Molecule*do_brew_molecule_p () const;