]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/midi-walker.hh
release: 0.0.65
[lilypond.git] / lily / include / midi-walker.hh
1 /*
2   midi-walker.hh -- declare Midi_walker
3
4   (c) 1996,97 Han-Wen Nienhuys, Jan Nieuwenhuizen <jan@digicash.com>
5   */
6
7 #ifndef MIDIWALKER_HH
8 #define MIDIWALKER_HH
9
10 #include "lily-proto.hh"
11 #include "grouping.hh"
12 #include "staff-walker.hh"
13 #include "pcursor.hh"
14 #include "pqueue.hh"
15 struct Note_event : PQueue_ent<Moment,Melodic_req*>
16 {
17     bool ignore_b_;
18     Note_event() { 
19         ignore_b_ = false;
20     }
21 };
22
23 int compare(Note_event const&, Note_event const&);
24
25 /**
26   a simple walker which collects midi stuff, and then outputs.
27
28   Should derive from Staff_walker
29   */
30 class Midi_walker : public PCursor<Staff_column*> 
31 {
32     Midi_track *track_l_;
33     
34     PQueue< Note_event > stop_notes;
35
36     Moment last_moment_;
37
38     /* *************** */
39     void do_stop_notes(Moment);
40     void do_start_note(Note_req *note_l);
41     void output_event(Midi_item&, Moment);
42 public:
43     
44     Midi_walker(Staff*, Midi_track*);
45     void process_requests();
46     ~Midi_walker();
47 };
48
49
50 #endif // MIDIWALKER_HH
51
52