]> git.donarmstrong.com Git - lilypond.git/blob - staff.hh
release: 0.0.5
[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     /****************************************************************/
23     
24     void add_voice(Voice *v);
25     void add_staff_column(Staff_column *sp);
26
27          
28     /// interpret all requests and add items to #destination#.
29     void process();
30     /**
31     This routines calls virtual functions from Staff, to delegate the
32     interpretation of requests to a derived class of Staff */
33     void setup_staffcols();
34
35     void OK() const;
36     void print() const;
37     Real last() const;
38     void clean_cols() ;
39     Staff_column * get_col(Real,bool);
40
41     void add_commands(PointerList<Command* >const & sv);
42     /**
43     add all commands from sv.
44
45     PRE
46     sv is time-ordered.
47     */
48
49     Staff();
50     /**
51       Should construct with Score as arg, but this isn't known during parsing.      
52       */
53     /****************************************************************
54       VIRTUALS
55     ****************************************************************/
56     
57     virtual void set_output(PScore * destination)=0;
58     virtual void grant_requests()=0;    
59     virtual Staff_column * create_col(Score_column * )=0;
60     virtual ~Staff() { }
61
62 };
63 #endif
64
65