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