]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 0.1.7
[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
13 /** A symbol which is attached between two columns. A spanner is a
14   symbol which spans across several columns, so its final appearance
15   can only be calculated after the breaking problem is solved.
16
17   Examples
18
19   \begin{itemize}
20   \item (de)crescendo
21   \item slur
22   \item beam
23   \item bracket
24   \end{itemize}
25   
26
27   Spanner should know about the items which it should consider:
28   e.g. slurs should be steep enough to "enclose" all those items. This
29   is absolutely necessary for beams, since they have to adjust the
30   length of stems of notes they encompass.
31
32   */
33 class Spanner:public virtual Score_elem {
34 public:
35     PCol *left_col_l_, *right_col_l_;
36     
37     /* *************** */
38     DECLARE_MY_RUNTIME_TYPEINFO;
39     virtual Spanner* spanner() { return this; }    
40     Spanner();
41     bool broken_b() const;
42     Spanner* find_broken_piece(Line_of_score*)const;
43 protected:
44     void set_my_columns();
45     SCORE_ELEM_CLONE(Spanner);
46
47     /**
48       this is virtual; for instance, Line_of_score overrides it.
49      */
50     virtual void break_into_pieces(bool);
51
52     Link_array<Spanner> broken_into_l_arr_;
53         
54     virtual void do_break_processing();
55     virtual Interval do_width()const;
56     virtual void do_print()const;
57     virtual Line_of_score*line_l()const;
58 };
59 #endif