]> git.donarmstrong.com Git - lilypond.git/blob - pscore.hh
release: 0.0.5
[lilypond.git] / pscore.hh
1 // the breaking problem for a score.
2
3 #ifndef PSCORE_HH
4 #define PSCORE_HH
5
6
7 #include "vray.hh"
8 #include "pcol.hh"
9 #include "pstaff.hh"
10
11 /// all stuff which goes onto paper
12 struct PScore {
13     /// width of paper
14     Real linewidth;
15     
16     /// the columns, ordered left to right
17     PointerList<PCol *> cols;
18
19     /// the idealspacings, no particular order
20     PointerList<Idealspacing*> suz;
21
22     /// the staffs ordered top to bottom
23     PointerList<PStaff*> staffs;
24
25     /// all symbols in score. No particular order.
26     PointerList<Item*> its;
27
28     /// if broken, the different lines
29     PointerList<Line_of_score*> lines;
30
31     /// crescs etc; no particular order
32     PointerList<Spanner *> spanners;
33
34     /****************************************************************/
35
36     svec<Item*> select_items(PStaff*, PCol*);
37     
38     void calc_breaking();
39     /**
40       calculate where the lines are to be broken.
41
42       POST
43     
44       lines contain the broken lines.
45      */
46
47     /// search all pcols which are breakable.
48     svec<const PCol *> find_breaks() const;
49
50     /// add a line to the broken stuff. Positions given in #config#
51     void add_line(svec<const PCol *> curline, svec<Real> config);
52
53     /// helper: solve for the columns in #curline#.
54     svec<Real> solve_line(svec<const PCol *> curline) const;
55
56     void add(PStaff *);
57     /// add item
58     void typeset_item(Item *,  PCol *,PStaff*,int=1);
59     ///    add to bottom of pcols
60     void add(PCol*);
61     /**
62
63     */
64     void output(Tex_stream &ts);
65
66     Idealspacing* get_spacing(PCol *, PCol *);
67     /*
68     get the spacing between c1 and c2, create one if necessary.
69     */
70
71
72     PCursor<PCol *> find_col(PCol *);
73     void clean_cols();
74     void problem_OK()const ;
75     void OK()const ;
76     PScore();
77     void print() const;
78 };
79 /** notes, signs, symbols in a score can be grouped in two ways:
80     horizontally (staffwise), and vertically (columns). #PScore#
81     contains the items, the columns and the staffs.
82  */
83 #endif