lilypond-0.0.4
[lilypond.git] / score.hh
blob5ec7f33b5a413ba5c1ac68dbb57e7022d0f86542
1 #ifndef SCORE_HH
2 #define SCORE_HH
4 #include "vray.hh"
5 #include "cols.hh"
6 #include "mtime.hh"
7 #include "command.hh"
9 struct Score_column {
10 PCol * pcol;
11 svec<Mtime> durations;
12 Mtime when;
14 ///
15 bool musical;
18 Score_column(Mtime when);
20 static int compare(Score_column & c1, Score_column &c2) {
21 return sgn(c1.when - c2.when);
23 void set_breakable() {
24 pcol->set_breakable();
26 bool used();
27 void print() const;
29 /**
31 When typesetting hasn't started on PScore yet, the columns which
32 contain data have a rhythmical position. Score_column is the type
33 with a rhythmical time attached to it. The calculation of
34 idealspacing is done with data in these columns. (notably: the
35 #durations# field)
39 instantiate_compare(Score_column&, Score_column::compare);
42 /// the total music def of one movement
43 struct Score {
44 String outfile;
45 /// staffs_ and commands_ form the problem definition.
46 PointerList<Staff *> staffs_;
47 PointerList<Command*> commands_;
49 /// "runtime" fields for setting up spacing
50 PointerList<Score_column*> cols_;
51 PScore *pscore_;
53 /****************************************************************/
55 Score();
57 /// add #Idealspacings# to #pscore_#
58 void calc_idealspacing();
59 void process();
61 /// construction
62 void add_staff(Staff *st);
64 void distribute_commands();
65 /** add the score wide commands (bars, breaks) to each staff so
66 they can process (typeset) them if needed */
67 void OK() const;
68 Score_column *find_col(Mtime,bool);
69 void do_pcols();
70 void add(Command *);
71 void add(Staff*);
72 void add_command_seq(svec<Command*> );
73 void output(String fn);
74 PCursor<Score_column*> create_cols(Mtime);
75 void print() const;
76 void do_miscs() ;
77 Mtime last() const;
78 void clean_cols();
79 void clean_commands();
81 void do_connect(PCol *c1, PCol *c2, Real d);
82 void connect_nonmus(PCol* c1, PCol *c2, Real d);
84 /**
87 #endif