]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 1.3.11
[lilypond.git] / lily / include / spanner.hh
1 /*
2   spanner.hh -- part of GNU LilyPond
3
4   (c) 1996--1999 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   \begin{itemize}
24   \item (de)crescendo
25   \item slur
26   \item beam
27   \item bracket
28   \end{itemize}
29   
30
31   Spanner should know about the items which it should consider:
32   e.g. slurs should be steep enough to "enclose" all those items. This
33   is absolutely necessary for beams, since they have to adjust the
34   length of stems of notes they encompass.
35
36   */
37 class Spanner : public virtual Score_element {
38 public:
39   Drul_array<Item*> spanned_drul_;
40   Link_array<Spanner> broken_into_l_arr_;
41   void set_bounds (Direction d, Item*);
42
43   
44   Spanner ();
45   Spanner (Spanner const &);
46   bool broken_b () const;
47   void do_break ();
48
49   static int compare (Spanner * const &,Spanner * const &);
50   virtual Array<Rod> get_rods () const;
51   virtual Array<Spring> get_springs () const;  
52   virtual Score_element* find_broken_piece (Line_of_score*) const;
53 protected:
54   void set_my_columns ();
55   VIRTUAL_COPY_CONS(Score_element);
56
57   /**
58     this is virtual; for instance, Line_of_score overrides it.
59     */
60   virtual void break_into_pieces ();
61   Real get_broken_left_end_align () const;
62
63   friend Axis_group_spanner; // UGH
64
65   virtual void do_space_processing ();
66   virtual void do_break_processing ();
67   Real spanner_length () const;
68   virtual Line_of_score*line_l () const;
69 };
70 #endif