lilypond-0.1.37
[lilypond.git] / src / midistaff.cc
blobc63ac9688b024eb86beccaae8ac556322ac87752
1 #include "musicalrequest.hh"
2 #include "voice.hh"
3 #include "staffwalker.hh"
4 #include "debug.hh"
5 #include "staff.hh"
6 #include "midistaff.hh"
7 #include "midicolumn.hh"
8 #include "midiwalker.hh"
9 #include "midiitem.hh"
10 #include "midistream.hh"
12 Midi_staff::Midi_staff()
16 Staff_column*
17 Midi_staff::create_col()
19 return new Midi_column(this);
22 Staff_walker*
23 Midi_staff::get_walker_p()
25 return new Midi_walker(this);
28 void
29 Midi_staff::midi( Midi_stream* midi_stream_l, int track_i )
31 Midi_track midi_track( track_i );
32 Midi_column* last_mcol_l = 0;
33 for ( Midi_walker w( this ); w.ok(); w++ ) {
34 Midi_column* mcol_l = (Midi_column*)*w;
35 if ( last_mcol_l )
36 last_mcol_l->note_off( &midi_track, w->when() );
37 mcol_l->note_on( &midi_track );
38 last_mcol_l = mcol_l;
40 if ( last_mcol_l )
41 last_mcol_l->note_off( &midi_track, last() );
42 *midi_stream_l << midi_track;
45 void
46 Midi_staff::set_output(PScore*pscore_l)
48 //i don-t want no pscore!