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