]> git.donarmstrong.com Git - lilypond.git/blob - staff.hh
release: 0.0.4
[lilypond.git] / staff.hh
1 #ifndef STAFF_HH
2 #define STAFF_HH
3
4 #include "score.hh"
5 #include "voice.hh"
6 #include "command.hh"
7
8
9 /// base class for a collection of voices.
10 struct Staff {
11     /// synchronous horizontal stuff
12     PointerList<Voice*> voices;
13
14     /// commands in chronological order
15     PointerList<Command *> commands;
16     PointerList<Staff_column*> cols;
17
18     /// indirections to the Score and PScore
19     Score *score_;
20     PScore *pscore_;
21
22     void add_voice(Voice *v);
23     void add_staff_column(Staff_column *sp);
24
25          
26     /// interpret all requests and add items to #destination#.
27     void process();
28     /**
29     This routines calls virtual functions from Staff, to delegate the
30     interpretation of requests to a derived class of Staff */
31
32     
33     /****************************************************************
34       VIRTUALS
35     ****************************************************************/
36     
37     void setup_staffcols();
38
39     virtual void set_output(PScore * destination)=0;
40     virtual void grant_requests()=0;
41     
42     Staff_column * get_col(Mtime,bool);
43
44     void add_commands(PointerList<Command* >const & sv);
45     /**
46     add all commands from sv.
47
48     PRE
49     sv is time-ordered.
50     */
51     virtual Staff_column * create_col(Score_column * )=0;
52
53     void OK() const;
54     void print() const;
55     Mtime last() const;
56     void clean_cols() ;
57     virtual ~Staff() { } 
58 };
59 #endif