Midi_instrument::str () const
{
Byte program_byte = 0;
- for (int i = 0; instrument_name_sz_a_[i]; i++)
+ bool found = false;
+ for (int i = 0; !found && instrument_name_sz_a_[i]; i++)
if (instrument_str_ == String (instrument_name_sz_a_[ i ]))
{
program_byte = (Byte)i;
- break;
+ found = true;
}
+ if (!found)
+ {
+ warning (_f("No such instrument: `%s'", instrument_str_.ch_C ()));
+ }
+
String str = to_str ((char) (0xc0 + channel_i_));
str += to_str ((char)program_byte);
return str;
String str = Midi_chunk::data_str ();
if (check_debug && !monitor->silent_b ("Midistrings"))
str += "\n";
- for (Cons<Midi_event>* i = event_p_list_.head_cons_p_; i; i = i->next_cons_p_)
+ for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_)
{
- str += i->car_p_->str ();
+ str += i->car_->str ();
if (check_debug && !monitor->silent_b ("Midistrings"))
str += "\n";
}