]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spanner.hh
release: 1.1.32
[lilypond.git] / lily / include / spanner.hh
1 /*
2   spanner.hh -- part of GNU LilyPond
3
4   (c) 1996--1999 Han-Wen Nienhuys
5 */
6
7 #ifndef SPANNER_HH
8 #define SPANNER_HH
9
10 #include "lily-proto.hh"
11 #include "score-element.hh"
12 #include "drul-array.hh"
13 #include "rod.hh"
14
15 struct Breaking_information
16 {
17   Line_of_score *line_l_;
18   Spanner * broken_spanner_l_;
19   Drul_array<Item*> bounds_;
20   Breaking_information ()
21     {
22       line_l_ =0;
23       broken_spanner_l_ =0;
24       bounds_[LEFT] = bounds_[RIGHT] =0;
25     }
26 };
27
28 class Axis_group_spanner;
29 /** A symbol which is attached between two columns. A spanner is a
30   symbol which spans across several columns, so its final appearance
31   can only be calculated after the breaking problem is solved.
32
33   Examples
34
35   \begin{itemize}
36   \item (de)crescendo
37   \item slur
38   \item beam
39   \item bracket
40   \end{itemize}
41   
42
43   Spanner should know about the items which it should consider:
44   e.g. slurs should be steep enough to "enclose" all those items. This
45   is absolutely necessary for beams, since they have to adjust the
46   length of stems of notes they encompass.
47
48   */
49 class Spanner : public virtual Score_element {
50 public:
51   Drul_array<Item*> spanned_drul_;
52   void set_bounds (Direction d, Item*);
53
54   
55   Spanner ();
56   Spanner (Spanner const &);
57   bool broken_b () const;
58   virtual Array<Rod> get_rods () const;
59   virtual Spanner* find_broken_piece (Line_of_score*) const;
60 protected:
61   void set_my_columns ();
62   VIRTUAL_COPY_CONS(Score_element);
63
64   /**
65     this is virtual; for instance, Line_of_score overrides it.
66     */
67   virtual void break_into_pieces ();
68
69   Array<Breaking_information> broken_info_;
70   friend Axis_group_spanner; // UGH
71
72   Spanner * unbroken_original_l_;
73
74   virtual void do_unlink ();
75   virtual void do_junk_links ();
76   virtual void output_processing ();
77   virtual void do_space_processing ();
78   virtual void do_break_processing ();
79   virtual Interval do_width () const;
80   virtual void do_print () const;
81   virtual Line_of_score*line_l () const;
82 };
83 #endif