]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 1.3.38
[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 /** A symbol which is attached between two columns. A spanner is a
16   symbol which spans across several columns, so its final appearance
17   can only be calculated after the breaking problem is solved.
18
19   Examples
20
21   * (de)crescendo
22   * slur
23   * beam
24   * bracket
25
26   Spanner should know about the items which it should consider:
27   e.g. slurs should be steep enough to "enclose" all those items. This
28   is absolutely necessary for beams, since they have to adjust the
29   length of stems of notes they encompass.
30
31   */
32 class Spanner : public  Score_element {
33   Drul_array<Item*> spanned_drul_;
34
35 public:
36   Link_array<Spanner> broken_into_l_arr_;
37
38   // TODO: make virtual and do this for Items as well.
39   Interval_t<int> spanned_rank_iv ();
40   void set_bound (Direction d, Item*);
41   Item *get_bound (Direction d) const;
42   
43   Spanner ();
44   Spanner (Spanner const &);
45   bool broken_b () const;
46   void do_break ();
47
48   static int compare (Spanner * const &,Spanner * const &);
49   virtual Array<Rod> get_rods () const;
50   virtual Array<Spring> get_springs () const;  
51   virtual Score_element* find_broken_piece (Line_of_score*) const;
52 protected:
53   void set_my_columns ();
54   VIRTUAL_COPY_CONS(Score_element);
55   Real get_broken_left_end_align () const;
56
57   virtual void do_space_processing ();
58   virtual void do_break_processing ();
59   Real spanner_length () const;
60   virtual Line_of_score*line_l () const;
61 };
62 #endif