]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-score.hh
release: 0.1.11
[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 Han-Wen Nienhuys <hanwen@stack.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 "plist.hh"
17 #include "music-output.hh"
18
19 /** all stuff which goes onto paper. notes, signs, symbols in a score
20      #Paper_score# contains the items, the columns.
21     
22     */
23
24 class Paper_score : public Music_output {
25 public:
26   Paper_def *paper_l_;
27
28   /// the columns, ordered left to right
29   Link_list<Paper_column *> col_p_list_;
30
31   /// crescs etc; no particular order
32   Pointer_list<Spanner *> span_p_list_;
33
34   /// other elements
35   Pointer_list<Score_elem*> elem_p_list_;
36     
37   Super_elem *super_elem_l_;
38     
39   Paper_score ();
40   /// add a line to the broken stuff. Positions given in #config#
41   void set_breaking (Array<Col_hpositions> const &);
42
43
44   /// add to bottom of pcols
45   void add_column (Paper_column*);
46
47   /**
48     @return argument as a cursor of the list
49     */
50   PCursor<Paper_column *> find_col (Paper_column const *) const;
51
52   Link_array<Paper_column> col_range (Paper_column *left_l, Paper_column *right_l) const;
53   Link_array<Paper_column> breakable_col_range (Paper_column*,Paper_column*) const;
54   Link_array<Item> broken_col_range (Item const*,Item const*) const;
55     
56     
57   /* STANDARD ROUTINES */
58   void OK() const;
59   void print() const;
60   
61   void typeset_element (Score_elem*);
62   void typeset_broken_spanner (Spanner*);
63   /// add a Spanner
64   void typeset_unbroken_spanner (Spanner*);
65  
66     
67 protected:
68     /* MAIN ROUTINES */
69   virtual void process();
70   virtual ~Paper_score();
71
72 private:
73   /// before calc_breaking
74   void preprocess();
75
76   void calc_idealspacing();
77   /// calculate where the lines are to be broken, and use results
78   void calc_breaking();
79
80   /// after calc_breaking
81   void postprocess();
82     
83   /// delete unused columns
84   void clean_cols();
85 };
86
87 #endif