]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-score.hh
7fad9b8b3295d2ad7a732e057891c57dbc8b5308
[lilypond.git] / lily / include / paper-score.hh
1 /*
2   paper-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 "column-x-positions.hh"
14 #include "parray.hh"
15 #include "lily-proto.hh"
16 #include "music-output.hh"
17 #include "lily-guile.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 {
26   SCM element_smob_list_;
27 public:
28   Paper_def *paper_l_;
29
30   /// the columns, ordered left to right
31   Link_array<Paper_column> col_l_arr_;
32
33   Paper_outputter *outputter_l_;  
34   Line_of_score * line_l_;
35   
36   Paper_score ();
37
38
39   /// add to bottom of pcols
40   void add_column (Paper_column*);
41
42   /**
43     @return index of argument.
44     */
45   int find_col_idx (Paper_column const *) const;
46
47   Link_array<Item> broken_col_range (Item const*,Item const*) const;
48     
49     
50   /* STANDARD ROUTINES */
51   void print() const;
52   
53   void typeset_element (Score_element*);
54   void typeset_broken_spanner (Spanner*);
55   /// add a Spanner
56   void typeset_unbroken_spanner (Spanner*);
57   
58     
59   virtual ~Paper_score();
60 protected:
61     /* MAIN ROUTINES */
62   virtual void process();
63
64 private:
65   /// before calc_breaking
66   void preprocess();
67
68   void calc_idealspacing();
69   /// calculate where the lines are to be broken, and use results
70   Array<Column_x_positions> calc_breaking();
71
72   /// after calc_breaking
73   void postprocess();
74   Paper_score (Paper_score const &);
75 };
76
77 #endif