]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 0.1.11
[lilypond.git] / lily / include / spanner.hh
1 /*
2   spanner.hh -- part of GNU LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef SPANNER_HH
8 #define SPANNER_HH
9
10 #include "lily-proto.hh"
11 #include "score-elem.hh"
12 #include "drul-array.hh"
13
14 /** A symbol which is attached between two columns. A spanner is a
15   symbol which spans across several columns, so its final appearance
16   can only be calculated after the breaking problem is solved.
17
18   Examples
19
20   \begin{itemize}
21   \item (de)crescendo
22   \item slur
23   \item beam
24   \item bracket
25   \end{itemize}
26   
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 virtual Score_elem {
35 public:
36   
37   Drul_array<Item*> spanned_drul_;
38   void set_bounds(Direction d, Item*);
39
40   DECLARE_MY_RUNTIME_TYPEINFO;
41   virtual Spanner* spanner() { return this; }    
42   Spanner();
43   bool broken_b() const;
44
45   Spanner* find_broken_piece (Line_of_score*) const;
46 protected:
47   void set_my_columns();
48   SCORE_ELEM_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
57   virtual void do_unlink();
58   virtual void do_junk_links();
59   virtual String do_TeX_output_str () const;
60   virtual void do_break_processing();
61   virtual Interval do_width() const;
62   virtual void do_print() const;
63   virtual Line_of_score*line_l() const;
64 };
65 #endif