source file of the GNU LilyPond music typesetter
- (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
return 0;
}
-Midi_walker::Midi_walker (Audio_staff *audio_staff, Midi_track *track)
+Midi_walker::Midi_walker (Audio_staff *audio_staff, Midi_track *track,
+ int channel)
{
+ channel_ = channel;
track_ = track;
index_ = 0;
items_ = &audio_staff->audio_items_;
Moment stop_mom = note->get_length () + ptr->audio_column_->at_mom ();
bool play_start = true;
- for (int i = 0; i < stop_note_queue.size (); i++)
+ for (vsize i = 0; i < stop_note_queue.size (); i++)
{
/* if this pith already in queue */
if (stop_note_queue[i].val->get_pitch () == note->get_pitch ())
start with graces
*/
if (delta_t < Moment (0))
- {
- delta_t = Moment (0);
- }
+ delta_t = Moment (0);
track_->add (delta_t, l);
}
if (Midi_item *midi = Midi_item::get_midi (audio))
{
- midi->channel_ = track_->channel_;
+ if (Midi_channel_item *mci = dynamic_cast<Midi_channel_item*> (midi))
+ mci->channel_ = channel_;
+
//midi->channel_ = track_->number_;
if (Midi_note *note = dynamic_cast<Midi_note *> (midi))
{
bool
Midi_walker::ok () const
{
- return index_ <items_->size ();
+ return index_ < items_->size ();
}
void
-Midi_walker::operator++ (int)
+Midi_walker::operator ++ (int)
{
assert (ok ());
index_++;