]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 1.2.9
[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
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
56   /**
57     this is virtual; for instance, Line_of_score overrides it.
58     */
59   virtual void break_into_pieces ();
60   Real get_broken_left_end_align () const;
61
62   friend Axis_group_spanner; // UGH
63
64   virtual void do_space_processing ();
65   void handle_broken_dependents ();
66   virtual void do_break_processing ();
67   virtual Interval do_width () const;
68   virtual void do_print () const;
69   virtual Line_of_score*line_l () const;
70 };
71 #endif