]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 0.0.39-1
[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 symbol which spans across several columns, so its
15   final appearance can only be calculated after the breaking problem
16   is solved.
17
18   Examples
19
20   - (de)crescendo
21   - slur
22   - beam
23   - bracket
24   
25
26   Spanner should know about the items which it should consider:
27     e.g. slurs should be steep enough to "enclose" all those items. This
28     is absolutely necessary for beams, since they have to adjust the
29     length of stems of notes they encompass.
30
31     */
32 struct Spanner:Staff_elem {
33     PCol *left, *right;
34
35     
36     /* *************** */
37     
38     Spanner();
39     virtual Interval width()const;
40     void do_print()const;
41
42     Spanner *broken_at(PCol *c1,  PCol *c2) const;
43     virtual Spanner* spanner() { return this; }
44 protected:
45
46     /**
47   clone a piece of  this spanner.
48     PRE
49     c1 >= start, c2  <= stop
50     */
51     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0;
52     NAME_MEMBERS(Spanner);
53 };
54 #endif