]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 1.3.37
[lilypond.git] / lily / include / spanner.hh
1 /*
2   spanner.hh -- part of GNU LilyPond
3
4   (c) 1996--2000 Han-Wen Nienhuys
5 */
6
7 #ifndef SPANNER_HH
8 #define SPANNER_HH
9
10 #include "lily-proto.hh"
11 #include "score-element.hh"
12 #include "drul-array.hh"
13 #include "rod.hh"
14
15
16 class Axis_group_spanner;
17 /** A symbol which is attached between two columns. A spanner is a
18   symbol which spans across several columns, so its final appearance
19   can only be calculated after the breaking problem is solved.
20
21   Examples
22
23   * (de)crescendo
24   * slur
25   * beam
26   * bracket
27
28   Spanner should know about the items which it should consider:
29   e.g. slurs should be steep enough to "enclose" all those items. This
30   is absolutely necessary for beams, since they have to adjust the
31   length of stems of notes they encompass.
32
33   */
34 class Spanner : public  Score_element {
35   Drul_array<Item*> spanned_drul_;
36
37 public:
38   Link_array<Spanner> broken_into_l_arr_;
39   void set_bound (Direction d, Item*);
40   Item *get_bound (Direction d) const;
41   
42   Spanner ();
43   Spanner (Spanner const &);
44   bool broken_b () const;
45   void do_break ();
46
47   static int compare (Spanner * const &,Spanner * const &);
48   virtual Array<Rod> get_rods () const;
49   virtual Array<Spring> get_springs () const;  
50   virtual Score_element* find_broken_piece (Line_of_score*) const;
51 protected:
52   void set_my_columns ();
53   VIRTUAL_COPY_CONS(Score_element);
54   Real get_broken_left_end_align () const;
55
56   virtual void do_space_processing ();
57   virtual void do_break_processing ();
58   Real spanner_length () const;
59   virtual Line_of_score*line_l () const;
60 };
61 #endif