]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 0.0.50
[lilypond.git] / lily / include / spanner.hh
1 /*
2   spanner.hh -- part of LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef SPANNER_HH
8 #define SPANNER_HH
9
10 #include "proto.hh"
11 #include "staff-elem.hh"
12
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 Staff_elem {
35 public:
36     PCol *left_col_l_, *right_col_l_;
37
38     
39     /* *************** */
40     NAME_MEMBERS(Spanner);
41     virtual Spanner* spanner() { return this; }    
42     Spanner();
43     Spanner *broken_at(PCol *c1,  PCol *c2) const;
44 protected:
45
46     virtual Interval do_width()const;
47     void do_print()const;
48
49
50     /**
51       clone a piece of  this spanner.
52       PRE
53       c1 >= start, c2  <= stop
54     */
55     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0;
56 };
57 #endif