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