From: fred <fred> Date: Tue, 26 Mar 2002 21:47:58 +0000 (+0000) Subject: lilypond-1.1.35 X-Git-Tag: release/1.5.59~2541 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=02a91a78534a3caa2ac33a10eaab6a509cbfeeae;p=lilypond.git lilypond-1.1.35 --- diff --git a/lily/performance.cc b/lily/performance.cc index e10a51c229..130cd4a2ec 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -29,12 +29,6 @@ Performance::Performance () audio_elem_p_list_ = 0; } -void -Performance::add_column (Audio_column* p) -{ - p->performance_l_ = this; - add_element (p); -} Performance::~Performance() { @@ -51,18 +45,19 @@ Performance::output (Midi_stream& midi_stream) midi_stream << Midi_header (1, tracks_i, clocks_per_4_i); output_header_track (midi_stream); - int n = 1; + int channel = 1; for (int i =0; i < audio_staff_l_arr_.size (); i++) { Audio_staff *s = audio_staff_l_arr_[i]; + /* Aargh, let's hear it for the MIDI standard. MIDI players tend to ignore instrument settings on channel 10, the percussion channel by default. */ - if (n == 10) - n++; - s->output (midi_stream, n++); + if (channel == 10) + channel++; + s->output (midi_stream, channel++); } } @@ -110,15 +105,17 @@ Performance::output_header_track (Midi_stream& midi_stream) midi_stream << midi_track; } -void -Performance::add_staff (Audio_staff* l) -{ - audio_staff_l_arr_.push (l); -} - void Performance::add_element (Audio_element *p) { + if (Audio_staff*s=dynamic_cast<Audio_staff *> (p)) + { + audio_staff_l_arr_.push (s); + } + else if (Audio_column *c = dynamic_cast<Audio_column*>(p)) + { + c->performance_l_ = this; + } audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_); }