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