]> git.donarmstrong.com Git - lilypond.git/blob - hdr/score.hh
b9555b20369a9fba995f031d674049d21e7fc243
[lilypond.git] / hdr / 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
20 /// the total music def of one movement
21 struct Score {
22     /// paper_, staffs_ and commands_ form the problem definition.
23     Paperdef *paper_p_;
24     Mididef *midi_p_;
25     IPointerList<Staff*> staffs_;
26     
27     /// "runtime" fields for setting up spacing    
28     IPointerList<Score_column*> cols_;
29     PScore *pscore_p_;
30
31     const char *defined_ch_c_l_;
32     int errorlevel_i_;
33     
34     /* *************************************************************** */
35
36     /// construction
37     Score(Paperdef*);
38     ~Score();    
39     void add(Staff*);
40
41     /// do everything except outputting to file
42     void process();
43     
44     /// output to file
45     void output(String fn);
46
47     /// do midi stuff
48     void midi();
49
50     ///
51     void set(Mididef* midi_p);
52
53     // standard
54     void OK() const;
55     void print() const;
56
57     /// find a column.
58     PCursor<Score_column *> find_col(Moment,bool);
59     
60     /// when does the last *musical* element finish?
61     Moment last() const;
62
63 private:
64     void setup_music();
65     void process_music();
66     // utils:
67     PCursor<Score_column*> create_cols(Moment);
68
69     Score(Score const&){}
70
71     /**
72       make the pcol_l_ fields of each Score_column point to the correct PCol,
73       remove any unnecessary Score_column's
74      */
75     void do_cols();
76
77     /// remove unused cols
78     void clean_cols();
79     
80     /// add #Idealspacings# to #pscore_#
81     void calc_idealspacing();
82 };
83 #endif