2 midi-walker.hh -- declare Midi_walker
4 (c) 1996,97 Han-Wen Nienhuys, Jan Nieuwenhuizen <jan@digicash.com>
11 #include "lily-proto.hh"
18 It would be totally cool to share code with the Engraver hierarchy,
19 but this is very tough i think.
23 Performer_group_performer * daddy_perf_l_;
25 virtual bool try_request(Request*r)
27 return daddy_perf_l_->try_request(r);
29 virtual void play_event( Midi_item i ) { daddy_perf_l_->play_event (i ); }
32 class Performer_group_performer : public Performer, public Translator {
33 Pointer_list<Performer*> perf_p_list_;
35 Link_array<Performer_group_performer> group_l_arr_;
36 Link_array<Performer> nongroup_l_arr_;
38 bool try_request(Request*r)
41 for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
42 hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
44 hebbes_b = daddy_grav_l_->try_request(req_l);
50 class Staff_performer : public Performer_group_performer
53 String instrument_str() {
54 return Translator::id_str_;
56 virtual void play_event ( Midi_item i)
58 i.track_i_ = midi_track_i_;
59 Performer::play_event(i);
63 class Voice_performer_group_performer : public Performer_group_performer {
67 class Note_performer : public Performer {
68 Melodic_req * current_l_;
69 Moment switch_off_at_,switch_on_at_;
72 virtual void process_request() {
73 if (when() == switch_off_at_ )
74 play_event( Note_event(current_l_->pitch() ))
77 class Voice_performer :
78 public Performer_group_performer, public Interpreter
83 class Score_performer:
84 public Performer_group_performer, public Global_translator
88 virtual void play_event(Midi_item i)
92 virtual void prepare(Moment m){
93 file_p_->move ( m -prev_ );
99 #endif // MIDIWALKER_HH