]> git.donarmstrong.com Git - lilypond.git/blob - hdr/staff.hh
d02f94437337423bdb9e399d0d48caad7cc1ac93
[lilypond.git] / hdr / staff.hh
1 #ifndef STAFF_HH
2 #define STAFF_HH
3
4 #include "staffcommands.hh"
5
6
7 /// base class for a collection of voices.
8 struct Staff {
9     /// synchronous horizontal stuff
10     IPointerList<Voice*> voices;
11
12     /// runtime field
13     IPointerList<Staff_column*> cols;
14
15     Score *score_l_;
16     PScore *pscore_l_;
17     String define_spot_str_;
18     /****************************************************************/
19     void add(PointerList<Voice*> &s);
20     void do_commands(PointerList<Input_command*> score_wide,
21                      PointerList<Input_command*> staff_wide);
22
23     void get_marks(Array<String>&, Array<Moment>&);
24     
25     /// throw away cols later the #l#
26     void truncate_cols(Moment l);
27
28     Staff(const Staff&src);
29     void add_voice(Voice *v);
30     void add_staff_column(Staff_column *sp);
31
32     Paperdef*paper()const;
33     
34     /// interpret all requests and add items to #destination#.
35     void process();
36     /**
37     This routines calls virtual functions from Staff, to delegate the
38     interpretation of requests to a derived class of Staff */
39
40     
41     void setup_staffcols();
42
43     void OK() const;
44     void print() const;
45
46     /// when does the last *musical* element finish?
47     Moment last() const;
48
49     /// remove unused cols
50     void clean_cols() ;
51     
52     Staff_column * get_col(Moment,bool);
53
54     Staff();
55
56     /****************************************************************
57       VIRTUALS
58     ****************************************************************/
59
60     virtual void set_output(PScore * destination)=0;
61     virtual void walk()=0;    
62     virtual Staff_column * create_col(Score_column * )=0;
63     virtual ~Staff() { }
64 private:
65     void set_time_descriptions();
66 };
67 #endif
68
69