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