]> git.donarmstrong.com Git - lilypond.git/blob - hdr/spanner.hh
release: 0.0.21
[lilypond.git] / hdr / spanner.hh
1 /*
2   spanner.hh -- part of LilyPond
3
4   (c) 1996 Han-Wen Nienhuys
5 */
6
7 #ifndef SPANNER_HH
8 #define SPANNER_HH
9
10 #include "proto.hh"
11 #include "staffelem.hh"
12
13 /// a symbol which is attached between two columns.
14 struct Spanner:Staff_elem {
15     PCol *left, *right;
16
17     
18     /****************/
19     
20     Spanner();
21     virtual Interval width()const;
22     void print()const;
23
24     Spanner *broken_at(PCol *c1,  PCol *c2) const;
25 protected:
26     /// clone a piece of  this spanner.
27     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0; 
28     /**
29  
30     PRE
31     c1 >= start, c2  <= stop
32     */
33 };
34 /**
35   A spanner is a symbol whose final appearance can only be calculated
36   after the breaking problem is solved.
37
38   Examples
39
40   - (de)crescendo
41   - slur
42   - beam
43   - bracket
44   
45
46   Spanner should know about the items which it should consider:
47     e.g. slurs should be steep enough to "enclose" all those items. This
48     is absolutely necessary for beams, since they have to adjust the
49     length of stems of notes they encompass.
50
51     */
52 #endif