lilypond-1.1.44
[lilypond.git] / lily / include / midi-walker.hh
blob20d1f95ff93f756f0b2b8c1b717e2fb06eff0229
1 /*
2 midi-walker.hh -- declare Midi_walker
4 (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
5 Jan Nieuwenhuizen <janneke@gnu.org>
6 */
8 #ifndef MIDI_WALKER_HH
9 #define MIDI_WALKER_HH
11 #include "proto.hh"
12 #include "pqueue.hh"
13 #include "lily-proto.hh"
14 #include "moment.hh"
16 struct Midi_note_event : PQueue_ent<Moment, Midi_note_off*>
18 bool ignore_b_;
19 Midi_note_event();
22 int compare (Midi_note_event const& left, Midi_note_event const& right);
24 /**
25 walk audio and output midi
27 class Midi_walker
29 public:
30 Midi_walker (Audio_staff* audio_staff_l, Midi_track* midi_track_l);
31 ~Midi_walker();
33 void process();
34 void operator ++(int);
35 bool ok () const;
36 private:
37 void do_start_note (Midi_note* note_p);
38 void do_stop_notes (Moment now_mom);
39 void output_event (Moment now_mom, Midi_item* l);
41 Midi_track* track_l_;
42 Audio_staff* staff_l_;
43 int index_;
44 Link_array<Audio_item> * item_l_arr_l_;
45 PQueue<Midi_note_event> stop_note_queue;
46 Moment last_mom_;
50 #endif // MIDI_WALKER_HH