]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-score.hh
patch::: 1.0.12.jcn2: opniewvisite
[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--1998 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 "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   Paper_outputter *open_paper_outputter (Paper_stream*);
26   Paper_outputter *open_ps_outputter (Ps_stream*);
27   Paper_outputter *open_tex_outputter (Tex_stream*);
28   Paper_stream *open_output_stream ();
29   
30 public:
31   Paper_def *paper_l_;
32
33   /// the columns, ordered left to right
34   Link_list<Paper_column *> col_p_list_;
35
36   /// crescs etc; no particular order
37   Pointer_list<Spanner *> span_p_list_;
38
39   /// other elements
40   Pointer_list<Score_element*> elem_p_list_;
41   
42   Paper_outputter *outputter_l_;  
43   Line_of_score * line_l_;
44   
45   Paper_score ();
46
47
48   /// add to bottom of pcols
49   void add_column (Paper_column*);
50
51   /**
52     @return argument as a cursor of the list
53     */
54   PCursor<Paper_column *> find_col (Paper_column const *) const;
55
56   Link_array<Paper_column> col_range (Paper_column *left_l, Paper_column *right_l) const;
57   Link_array<Paper_column> breakable_col_range (Paper_column*,Paper_column*) const;
58   Link_array<Item> broken_col_range (Item const*,Item const*) const;
59     
60     
61   /* STANDARD ROUTINES */
62   void print() const;
63   
64   void typeset_element (Score_element*);
65   void typeset_broken_spanner (Spanner*);
66   /// add a Spanner
67   void typeset_unbroken_spanner (Spanner*);
68  
69     
70   virtual ~Paper_score();
71 protected:
72
73   
74     /* MAIN ROUTINES */
75   virtual void process();
76 // can't instantiate template with cygnus' gcc...
77 //  virtual ~Paper_score();
78
79 private:
80
81   void remove_line (Line_of_score*);
82   /// before calc_breaking
83   void preprocess();
84
85   void calc_idealspacing();
86   /// calculate where the lines are to be broken, and use results
87   Array<Column_x_positions> calc_breaking();
88
89   /// after calc_breaking
90   void postprocess();
91     
92   /// delete unused columns
93   void clean_cols();
94 };
95
96 #endif