lilypond-0.0.4
[lilypond.git] / staff.hh
blob49439f373bfafc8c1419a0c2c6126b29e6614254
1 #ifndef STAFF_HH
2 #define STAFF_HH
4 #include "score.hh"
5 #include "voice.hh"
6 #include "command.hh"
8 struct Staff_column {
9 Score_column *score_column;
11 /// fields to collect data vertically.
12 svec<Voice_element *> v_elts;
13 svec<Command *> s_commands;
15 Staff_column(Score_column*s);
16 bool mus() const ;
17 Mtime when() const;
18 void add(Voice_element*ve);
19 /****************************************************************
20 VIRTUAL
21 ****************************************************************/
22 virtual void process_requests()=0;
23 virtual void process_commands()=0;
24 virtual ~Staff_column() { }
28 /// base class for a collection of voices.
29 struct Staff {
30 /// synchronous horizontal stuff
31 PointerList<Voice*> voices;
33 /// commands in chronological order
34 PointerList<Command *> commands;
35 PointerList<Staff_column*> cols;
37 /// indirections to the Score and PScore
38 Score *score_;
39 PScore *pscore_;
41 void add_voice(Voice *v);
42 void add_staff_column(Staff_column *sp);
45 /// interpret all requests and add items to #destination#.
46 void process();
47 /**
48 This routines calls virtual functions from Staff, to delegate the
49 interpretation of requests to a derived class of Staff */
52 /****************************************************************
53 VIRTUALS
54 ****************************************************************/
56 void setup_staffcols();
58 virtual void set_output(PScore * destination)=0;
59 virtual void grant_requests()=0;
61 Staff_column * get_col(Mtime,bool);
63 void add_commands(PointerList<Command* >const & sv);
64 /**
65 add all commands from sv.
67 PRE
68 sv is time-ordered.
70 virtual Staff_column * create_col(Score_column * )=0;
72 void OK() const;
73 void print() const;
74 Mtime last() const;
75 void clean_cols() ;
76 virtual ~Staff() { }
78 #endif