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