]> git.donarmstrong.com Git - lilypond.git/blob - score.hh
release: 0.0.3
[lilypond.git] / score.hh
1 #ifndef SCORE_HH
2 #define SCORE_HH
3
4 #include "vray.hh"
5 #include "cols.hh"
6 #include "mtime.hh"
7 #include "command.hh"
8
9 struct Score_column {
10     PCol * pcol;
11     svec<Mtime> durations;
12     Mtime when;
13
14     /// 
15     bool musical;
16     
17
18     Score_column(Mtime when);
19
20     static int compare(Score_column & c1, Score_column &c2) {
21         return sgn(c1.when - c2.when);
22     }
23     void set_breakable() {
24          pcol->set_breakable();
25     }
26     bool used();
27     void print() const;
28 };
29 /**
30
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)
36
37     */
38
39 instantiate_compare(Score_column&, Score_column::compare);
40
41
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_;
48     
49     /// "runtime" fields for setting up spacing    
50     PointerList<Score_column*> cols_;
51     PScore *pscore_;
52
53     /****************************************************************/
54
55     Score();
56     
57     /// add #Idealspacings# to #pscore_#
58     void calc_idealspacing();
59     void process();
60
61     /// construction
62     void add_staff(Staff *st);
63
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();
80
81     void do_connect(PCol *c1, PCol *c2, Real d);
82     void connect_nonmus(PCol* c1, PCol *c2, Real d);
83 };
84 /**
85         
86     */
87 #endif