lilypond-0.1.14
[lilypond.git] / src / midicolumn.cc
blob13abbd03d5940a8b7cea0bdcee58eb9d6e695f89
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 "midiitem.hh"
9 #include "sccol.hh"
10 #include "pscore.hh"
11 #include "main.hh"
13 Midi_column::Midi_column(Midi_staff* mstaff_l)
15 mstaff_l_ = mstaff_l;
18 void
19 Midi_column::setup_one_request(Request*req_l)
21 if ( req_l->melodic() )
22 melreq_l_array_.push( req_l->melodic() );
25 void
26 Midi_column::note_off( Midi_track* midi_track_l, Moment next )
28 Moment delta_t = next - when();
29 for ( int i = 0; i < melreq_l_array_.size(); i++ ) {
30 Midi_note midi_note( melreq_l_array_[ i ], midi_track_l->number_i_, false );
31 midi_track_l->add( delta_t, &midi_note );
32 delta_t = 0.0;
36 void
37 Midi_column::note_on( Midi_track* midi_track_l )
39 Moment delta_t = 0.0;
40 for ( int i = 0; i < melreq_l_array_.size(); i++ ) {
41 Midi_note midi_note( melreq_l_array_[ i ], midi_track_l->number_i_, true );
42 midi_track_l->add( delta_t, &midi_note );