lilypond-0.0.2
[lilypond.git] / score.hh
blob3e65d50d998d7e7146cd20543486d4cc82623c21
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 /// staffs_ and commands_ form the problem definition.
45 PointerList<Staff *> staffs_;
46 PointerList<Command*> commands_;
48 /// "runtime" fields for setting up spacing
49 PointerList<Score_column*> cols_;
50 PScore *pscore_;
52 /****************************************************************/
54 /// add #Idealspacings# to #pscore_#
55 void calc_idealspacing();
56 void process();
58 /// construction
59 void add_staff(Staff *st);
61 void distribute_commands();
62 /** add the score wide commands (bars, breaks) to each staff so
63 they can process (typeset) them if needed */
64 void OK() const;
65 Score_column *find_col(Mtime,bool);
66 void do_pcols();
67 void add(Command *);
68 void add(Staff*);
69 void output(String fn);
70 PCursor<Score_column*> create_cols(Mtime);
71 void print() const;
72 void do_miscs() ;
73 Mtime last() const;
74 void clean_cols();
75 void clean_commands();
77 void do_connect(PCol *c1, PCol *c2, Real d);
78 void connect_nonmus(PCol* c1, PCol *c2, Real d);
80 /**
83 #endif