]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-score.hh
release: 1.1.36
[lilypond.git] / lily / include / p-score.hh
1 /*
2   p-score.hh -- declare Paper_score
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef P_SCORE_HH
11 #define P_SCORE_HH
12
13 #include "colhpos.hh"
14 #include "parray.hh"
15 #include "lily-proto.hh"
16 #include "music-output.hh"
17
18 /** all stuff which goes onto paper. notes, signs, symbols in a score
19      #Paper_score# contains the items, the columns.
20     
21     */
22
23 class Paper_score : public Music_output
24 {
25   /// crescs etc; no particular order
26   Link_array<Spanner> span_p_arr_;
27
28   /// other elements
29   Link_array<Score_element> elem_p_arr_;
30
31   Link_array<Score_element> to_delete_arr_;
32   Link_array<Score_element> break_helpers_arr_;
33
34 public:
35   Paper_def *paper_l_;
36
37   /// the columns, ordered left to right
38   Link_array<Paper_column> col_l_arr_;
39
40   Paper_outputter *outputter_l_;  
41   Line_of_score * line_l_;
42   
43   Paper_score ();
44
45
46   /// add to bottom of pcols
47   void add_column (Paper_column*);
48
49   /**
50     @return index of argument.
51     */
52   int find_col_idx (Paper_column const *) const;
53
54   Link_array<Item> broken_col_range (Item const*,Item const*) const;
55     
56     
57   /* STANDARD ROUTINES */
58   void print() const;
59   
60   void typeset_element (Score_element*);
61   void typeset_broken_spanner (Spanner*);
62   /// add a Spanner
63   void typeset_unbroken_spanner (Spanner*);
64   
65   void schedule_for_delete (Score_element*);
66     
67   virtual ~Paper_score();
68 protected:
69
70   
71     /* MAIN ROUTINES */
72   virtual void process();
73
74 private:
75
76   
77   Link_array<Score_element> remove_line (Line_of_score*);
78   Link_array<Score_element> remove_break_helpers ();
79
80   /// before calc_breaking
81   void preprocess();
82
83   void calc_idealspacing();
84   /// calculate where the lines are to be broken, and use results
85   Array<Column_x_positions> calc_breaking();
86
87   /// after calc_breaking
88   void postprocess();
89   Paper_score (Paper_score const &);
90 };
91
92 #endif