]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/midi-walker.hh
release: 0.0.71pre
[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
11 #include "lily-proto.hh"
12
13 #if 0
14
15 // sketch. . .
16 class Midi_register {
17 };
18
19 class Midi_group_reg : public Midi_register, public Acceptor {
20     
21 };
22
23 class Midi_staff_reg : public Midi_group_reg {
24 };
25
26
27 class Midi_note_reg : public Midi_register {
28     
29 };
30
31 class Midi_voice_reg : public Midi_group_reg, public Interpreter {
32     
33 };
34
35 class Midi_score_reg: public Midi_group_reg, public Global_acceptor {
36 };
37
38
39 #include "grouping.hh"
40 #include "staff-walker.hh"
41 #include "pcursor.hh"
42 #include "pqueue.hh"
43
44
45 struct Note_event : PQueue_ent<Moment,Melodic_req*>
46 {
47     bool ignore_b_;
48     Note_event() { 
49         ignore_b_ = false;
50     }
51 };
52
53 int compare(Note_event const&, Note_event const&);
54
55 /**
56   a simple walker which collects midi stuff, and then outputs.
57
58   Should derive from Staff_walker
59   */
60 class Midi_walker : public PCursor<Staff_column*> 
61 {
62     Midi_track *track_l_;
63     
64     PQueue< Note_event > stop_notes;
65
66     Moment last_moment_;
67
68     /* *************** */
69     void do_stop_notes(Moment);
70     void do_start_note(Note_req *note_l);
71     void output_event(Midi_item&, Moment);
72 public:
73     
74     Midi_walker(Staff*, Midi_track*);
75     void do_process_requests();
76     ~Midi_walker();
77 };
78 #endif
79
80 #endif // MIDIWALKER_HH
81
82