]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/score.hh
release: 0.0.46.jcn1
[lilypond.git] / lily / include / score.hh
1 /*
2   score.hh -- declare Score
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef SCORE_HH
11 #define SCORE_HH
12
13 #include "varray.hh"
14 #include "proto.hh"
15 #include "plist.hh"
16 #include "moment.hh"
17 #include "assoc.hh"
18 #include "string.hh"
19 #include "input.hh"
20
21 /// the total music def of one movement
22 struct Score {
23     /// paper_, staffs_ and commands_ form the problem definition.
24     Paper_def *paper_p_;
25     Midi_def *midi_p_;
26     IPointerList<Staff*> staffs_;
27     
28     /// "runtime" fields for setting up spacing    
29     IPointerList<Score_column*> cols_;
30     PScore *pscore_p_;
31
32     Input input_;
33     int errorlevel_i_;
34     
35     /* *************************************************************** */
36
37     /// construction
38     Score();
39     ~Score();    
40     void add(Staff*);
41
42     /// do everything except outputting to file
43     void process();
44     
45     /// output to file
46     void output(String fn);
47
48     
49     ///
50     void set(Midi_def* midi_p);
51     ///
52     void set(Paper_def* midi_p);
53
54     // standard
55     void OK() const;
56     void print() const;
57
58     /// find a column.
59     PCursor<Score_column *> find_col(Moment,bool);
60     
61     /// when does the last *musical* element finish?
62     Moment last() const;
63
64 private:
65     void paper_output();
66     void setup_music();
67     void process_music();
68     /// do midi stuff
69     void midi();
70
71     /// do paper stuff
72     void paper();
73
74     // utils:
75     PCursor<Score_column*> create_cols(Moment, PCursor<Score_column*> &last);
76
77     Score(Score const&){}
78
79     /**
80       make the pcol_l_ fields of each Score_column point to the correct PCol,
81       remove any unnecessary Score_column's
82      */
83     void do_cols();
84
85     /// remove unused cols
86     void clean_cols();
87     
88     /// add #Idealspacings# to #pscore_#
89     void calc_idealspacing();
90 };
91 #endif